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 f645891..49fe25e 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 @@ -36,7 +36,6 @@ import java.util.stream.Collectors; * 变电站_主设备 前端控制器 *

* - * * @since 2023-03-28 */ @RestController @@ -64,7 +63,7 @@ public class SubstationMaindeviceController { return ResponseResult.successData(mainDeviceTree); } - @Log(module = "主设备及部件", value = "新增主设备",type = "1") + @Log(module = "主设备及部件", value = "新增主设备", type = "1") @PostMapping("/addMainDevice") @ApiOperation("新增主设备") @PreAuthorize("@el.check('add:maindevice')") @@ -111,6 +110,20 @@ public class SubstationMaindeviceController { return ResponseResult.successData(substationMaindevice); } + @GetMapping("/getMainDeviceByType") + @ApiOperation("根据主设备类型获取主设备") + public ResponseResult getMainDeviceByType(String stationCode, String deviceType) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StrUtil.isNotBlank(stationCode), SubstationMaindevice::getStationCode, stationCode); + queryWrapper.eq(StrUtil.isNotBlank(deviceType), SubstationMaindevice::getDeviceType, StrUtil.split(deviceType + , ",")); + queryWrapper.select(SubstationMaindevice::getMainDeviceId, SubstationMaindevice::getMainDeviceName, + SubstationMaindevice::getDeviceType, SubstationMaindevice::getFileUrl); + queryWrapper.eq(SubstationMaindevice::getDatastatus, "1"); + List> maps = substationMaindeviceService.listMaps(queryWrapper); + return ResponseResult.successData(maps); + } + @GetMapping("/getMainDevice") @ApiOperation("根据条件获取主设备") public ResponseResult getMainDevice(String stationCode, String areaId, String bayId, String mainDeviceName, @@ -270,8 +283,8 @@ public class SubstationMaindeviceController { @GetMapping("/getComponent") @ApiOperation("获取部件") - public ResponseResult getComponent(String mainDeviceId,String bayId,String componentName) { - List> list = substationMaindeviceService.getComponent(mainDeviceId,bayId,componentName); + public ResponseResult getComponent(String mainDeviceId, String bayId, String componentName) { + List> list = substationMaindeviceService.getComponent(mainDeviceId, bayId, componentName); return ResponseResult.successData(list); } @@ -289,7 +302,7 @@ public class SubstationMaindeviceController { return ResponseResult.successData(listItems); } - @Log(module = "主设备及部件", value = "修改主设备",type = "1") + @Log(module = "主设备及部件", value = "修改主设备", type = "1") @PostMapping("/updateMainDevice") @ApiOperation("修改主设备") @PreAuthorize("@el.check('update:maindevice')") @@ -333,7 +346,7 @@ public class SubstationMaindeviceController { } } - @Log(module = "主设备及部件", value = "修改主设备状态",type = "1") + @Log(module = "主设备及部件", value = "修改主设备状态", type = "1") @PostMapping("/setMainDeviceStatus") @ApiOperation("修改主设备状态") public ResponseResult setMainDeviceStatus(String id, String dataStatus) { @@ -346,7 +359,7 @@ public class SubstationMaindeviceController { } - @Log(module = "主设备及部件", value = "删除主设备",type = "1") + @Log(module = "主设备及部件", value = "删除主设备", type = "1") @PostMapping("/deleteMainDevice") @ApiOperation("删除主设备") @PreAuthorize("@el.check('del:maindevice')") @@ -359,7 +372,7 @@ public class SubstationMaindeviceController { } } - @Log(module = "主设备及部件", value = "新增部件",type = "1") + @Log(module = "主设备及部件", value = "新增部件", type = "1") @PostMapping("/addComponent") @ApiOperation("新增部件") public ResponseResult addComponent(SubstationComponent substationComponent) { @@ -388,7 +401,7 @@ public class SubstationMaindeviceController { return ResponseResult.successData(substationComponent); } - @Log(module = "主设备及部件", value = "修改部件",type = "1") + @Log(module = "主设备及部件", value = "修改部件", type = "1") @PostMapping("/updateComponent") @ApiOperation("修改部件") public ResponseResult updateComponent(SubstationComponent substationComponent) { @@ -413,7 +426,7 @@ public class SubstationMaindeviceController { } } - @Log(module = "主设备及部件", value = "修改部件状态",type = "1") + @Log(module = "主设备及部件", value = "修改部件状态", type = "1") @PostMapping("/setComponentStatus") @ApiOperation("修改部件状态") public ResponseResult setComponentStatus(String componentId, String dataStatus) { @@ -425,7 +438,7 @@ public class SubstationMaindeviceController { } } - @Log(module = "主设备及部件", value = "删除部件",type = "1") + @Log(module = "主设备及部件", value = "删除部件", type = "1") @PostMapping("/deleteComponent") @ApiOperation("删除部件") public ResponseResult deleteComponent(String componentId) { @@ -481,8 +494,9 @@ public class SubstationMaindeviceController { @ApiOperation("获取主设备导航树") @GetMapping("/getSubstationMainDeviceTree") - public ResponseResult getSubstationMainDeviceTree(String stationCode,String mainDeviceName) { - List> mainDeviceTree = substationMaindeviceService.getSubstationMainDeviceTree(stationCode,mainDeviceName); + public ResponseResult getSubstationMainDeviceTree(String stationCode, String mainDeviceName) { + List> mainDeviceTree = + substationMaindeviceService.getSubstationMainDeviceTree(stationCode, mainDeviceName); return ResponseResult.successData(mainDeviceTree); } @@ -495,14 +509,15 @@ public class SubstationMaindeviceController { @GetMapping("/getDeviceSignalTree") @ApiOperation("获取信号树(前台)") - public ResponseResult getDeviceSignalTree(String stationCode,String signalName) { - List treeNodes = substationMaindeviceService.getDeviceSignalTree(stationCode,signalName); + public ResponseResult getDeviceSignalTree(String stationCode, String signalName) { + List treeNodes = substationMaindeviceService.getDeviceSignalTree(stationCode, signalName); return ResponseResult.successData(treeNodes); } + @GetMapping("/getComponentTree") @ApiOperation("获取部件树(前台)") - public ResponseResult getComponentTree(String stationCode,String componentName) { - List treeNodes = substationMaindeviceService.getComponentTree(stationCode,componentName); + public ResponseResult getComponentTree(String stationCode, String componentName) { + List treeNodes = substationMaindeviceService.getComponentTree(stationCode, componentName); return ResponseResult.successData(treeNodes); } }