From cb340a99fc382ef1206bf6d9fd63accb50e44f8a Mon Sep 17 00:00:00 2001 From: weitang Date: Fri, 6 Jun 2025 18:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AlgorithmArrangeController.java | 13 +++++++++++++ .../AlgorithmArrangeDeviceController.java | 11 +++++++++++ .../controller/SubstationMaindeviceController.java | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java index f5f4b81..f0ada01 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeController.java @@ -59,6 +59,13 @@ public class AlgorithmArrangeController { @PostMapping("/saveAlgorithmArrange") @ApiOperation("新增算法布点") public ResponseResult saveAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) { + + // 判断是否存在相同的方案 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AlgorithmArrange::getArrangeName, algorithmArrange.getArrangeName()); + if (algorithmArrangeService.getOne(queryWrapper) != null) { + return ResponseResult.error("方案名称已存在"); + } algorithmArrange.setLastmodifier("admin"); algorithmArrange.setLastmodifydate(LocalDateTime.now()); algorithmArrange.setDatastatus("1"); @@ -85,6 +92,12 @@ public class AlgorithmArrangeController { @PostMapping("/updateAlgorithmArrange") @ApiOperation("修改算法布点") public ResponseResult updateAlgorithmArrange(AlgorithmArrange algorithmArrange, MultipartFile file) { + // 判断是否存在相同的方案 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ne(AlgorithmArrange::getId, algorithmArrange.getId()).eq(AlgorithmArrange::getArrangeName, algorithmArrange.getArrangeName()); + if (algorithmArrangeService.getOne(queryWrapper) != null) { + return ResponseResult.error("方案名称已存在"); + } algorithmArrange.setLastmodifier(SecurityUtils.getCurrentUsername()); algorithmArrange.setLastmodifydate(LocalDateTime.now()); // 文件上传逻辑 diff --git a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java index d3a9254..5ae5ac6 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/algorithm/controller/AlgorithmArrangeDeviceController.java @@ -1,6 +1,8 @@ package com.yfd.platform.modules.algorithm.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.modules.algorithm.domain.AlgorithmArrangeDevice; import com.yfd.platform.modules.algorithm.service.IAlgorithmArrangeDeviceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -34,4 +36,13 @@ public class AlgorithmArrangeDeviceController { List> maps = algorithmArrangeDeviceService.getArrangeDeviceInfo(arrangeId); return ResponseResult.successData(maps); } + + @GetMapping("/getArrangeDeviceById") + @ApiOperation("根据ID查询当前布点详情") + public ResponseResult getArrangeDeviceById(String arrangeId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(AlgorithmArrangeDevice::getArrangeId, arrangeId); + List> maps = algorithmArrangeDeviceService.listMaps(queryWrapper); + return ResponseResult.successData(maps); + } } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/SubstationMaindeviceController.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/SubstationMaindeviceController.java index 37b6035..3ae1cf0 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/SubstationMaindeviceController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/SubstationMaindeviceController.java @@ -115,7 +115,7 @@ public class SubstationMaindeviceController { } LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(StrUtil.isNotBlank(stationCode), SubstationMaindevice::getStationCode, stationCode); - queryWrapper.eq(StrUtil.isNotBlank(deviceTypeList), SubstationMaindevice::getDeviceType, StrUtil.split(deviceTypeList + queryWrapper.in(StrUtil.isNotBlank(deviceTypeList), SubstationMaindevice::getDeviceType, StrUtil.split(deviceTypeList , ",")); queryWrapper.select(SubstationMaindevice::getMainDeviceId, SubstationMaindevice::getMainDeviceName, SubstationMaindevice::getDeviceType, SubstationMaindevice::getFileUrl);