From 4f3a98f19143865cdc1de4791e8a95d96bd40c65 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期五, 01 八月 2025 13:27:59 +0800 Subject: [PATCH] yys 密码已重置 --- cnas-require/src/main/java/com/ruoyi/require/controller/FePowerStableController.java | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 99 insertions(+), 0 deletions(-) diff --git a/cnas-require/src/main/java/com/ruoyi/require/controller/FePowerStableController.java b/cnas-require/src/main/java/com/ruoyi/require/controller/FePowerStableController.java new file mode 100644 index 0000000..6b8ee7e --- /dev/null +++ b/cnas-require/src/main/java/com/ruoyi/require/controller/FePowerStableController.java @@ -0,0 +1,99 @@ +package com.ruoyi.require.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.require.dto.FePowerStableAddDto; +import com.ruoyi.require.dto.FePowerStableDto; +import com.ruoyi.require.pojo.FeMeasuredQuantity; +import com.ruoyi.require.pojo.FePowerStable; +import com.ruoyi.require.service.FeMeasuredQuantityService; +import com.ruoyi.require.service.FePowerStableService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; + +/** + * <p> + * 璁炬柦鍜岀幆澧冩潯浠�-璁炬柦鍜岀幆澧冩潯浠惰姹�-鐢垫簮绋冲畾鎬� 鍓嶇鎺у埗鍣� + * </p> + * + * @author + * @since 2024-11-07 04:16:52 + */ +@Api(tags = "璁炬柦鍜岀幆澧冩潯浠�-璁炬柦鍜岀幆澧冩潯浠惰姹�-鐢垫簮绋冲畾鎬�") +@RestController +@RequestMapping("/fePowerStable") +public class FePowerStableController { + + @Autowired + private FeMeasuredQuantityService feMeasuredQuantityService; + + @Autowired + private FePowerStableService fePowerStableService; + + @PostMapping("addLaboratoryFacilityPowerStable") + @ApiOperation("鐢垫簮绋冲畾鎬ф柊澧�/淇敼") + public Result<?> addLaboratoryFacilityPowerStable(@RequestBody FePowerStableAddDto fePowerStableAddDto) { + FePowerStable fePowerStable = new FePowerStable(); + BeanUtils.copyProperties(fePowerStableAddDto, fePowerStable); + fePowerStableService.saveOrUpdate(fePowerStable); + if (CollectionUtils.isNotEmpty(fePowerStableAddDto.getFeMeasuredQuantityList())) { + fePowerStableAddDto.getFeMeasuredQuantityList().forEach(i -> i.setPowerStableId(fePowerStable.getPowerStableId())); + feMeasuredQuantityService.saveOrUpdateBatch(fePowerStableAddDto.getFeMeasuredQuantityList()); + } + return Result.success(); + } + + @DeleteMapping("deleteLaboratoryFacilityPowerStable") + @ApiOperation("鐢垫簮绋冲畾鎬у垹闄�") + public Result<FePowerStable> deleteLaboratoryFacilityPowerStable(@RequestParam("powerStableId") Integer powerStableId) { + fePowerStableService.removeById(powerStableId); + feMeasuredQuantityService.remove(Wrappers.<FeMeasuredQuantity>lambdaQuery() + .eq(FeMeasuredQuantity::getPowerStableId, powerStableId)); + return Result.success(); + } + + @GetMapping("getLaboratoryFacilityPowerStablePage") + @ApiOperation("鐢垫簮绋冲畾鎬ф煡璇�") + public Result<IPage<FePowerStableDto>> getLaboratoryFacilityPowerStablePage( + Page page) { + IPage<FePowerStableDto> page1 = fePowerStableService.getLaboratoryFacilityPowerStablePage(page); + return Result.success(page1); + } + + @ApiOperation("閫夋嫨璁惧鍚庢煡璇㈡渶鏂拌澶囩紪鍙凤紝鏍″噯鏃ユ湡") + @GetMapping("getCalibrationDate") + public Result<?> getCalibrationDate(@RequestParam("deviceId") Integer deviceId) { + return Result.success(fePowerStableService.getCalibrationDate(deviceId)); + } + + @DeleteMapping("deleteFeMeasuredQuantity") + @ApiOperation("鐢垫簮绋冲畾鎬�-娴嬪畾閲� 鍒犻櫎") + public Result<?> deleteFeMeasuredQuantity(@RequestParam("measuredQuantityId") Integer measuredQuantityId) { + return Result.success(feMeasuredQuantityService.removeById(measuredQuantityId)); + } + + @GetMapping("getFeMeasuredQuantityService") + @ApiOperation("鐢垫簮绋冲畾鎬�-娴嬪畾閲� 鏍规嵁鐢垫簮绋冲畾鎬ф煡璇�") + public Result<?> getFeMeasuredQuantityService(@RequestParam("powerStableId") Integer powerStableId) { + return Result.success(feMeasuredQuantityService.list(Wrappers.<FeMeasuredQuantity>lambdaQuery() + .eq(FeMeasuredQuantity::getPowerStableId, powerStableId))); + } + + /** + * 瀵煎嚭鐢垫簮绋冲畾鎬� + * @return + */ + @ApiOperation(value = "瀵煎嚭鐢垫簮绋冲畾鎬�") + @GetMapping("/exportFePowerStable") + public void exportFePowerStable(Integer powerStableId, HttpServletResponse response){ + fePowerStableService.exportFePowerStable(powerStableId, response); + } +} -- Gitblit v1.9.3