根据主设备类型查询主设备

This commit is contained in:
weitang 2025-06-06 09:13:52 +08:00
parent 26a4b19724
commit 7928e671de

View File

@ -36,7 +36,6 @@ import java.util.stream.Collectors;
* 变电站_主设备 前端控制器 * 变电站_主设备 前端控制器
* </p> * </p>
* *
*
* @since 2023-03-28 * @since 2023-03-28
*/ */
@RestController @RestController
@ -64,7 +63,7 @@ public class SubstationMaindeviceController {
return ResponseResult.successData(mainDeviceTree); return ResponseResult.successData(mainDeviceTree);
} }
@Log(module = "主设备及部件", value = "新增主设备",type = "1") @Log(module = "主设备及部件", value = "新增主设备", type = "1")
@PostMapping("/addMainDevice") @PostMapping("/addMainDevice")
@ApiOperation("新增主设备") @ApiOperation("新增主设备")
@PreAuthorize("@el.check('add:maindevice')") @PreAuthorize("@el.check('add:maindevice')")
@ -111,6 +110,20 @@ public class SubstationMaindeviceController {
return ResponseResult.successData(substationMaindevice); return ResponseResult.successData(substationMaindevice);
} }
@GetMapping("/getMainDeviceByType")
@ApiOperation("根据主设备类型获取主设备")
public ResponseResult getMainDeviceByType(String stationCode, String deviceType) {
LambdaQueryWrapper<SubstationMaindevice> 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<Map<String, Object>> maps = substationMaindeviceService.listMaps(queryWrapper);
return ResponseResult.successData(maps);
}
@GetMapping("/getMainDevice") @GetMapping("/getMainDevice")
@ApiOperation("根据条件获取主设备") @ApiOperation("根据条件获取主设备")
public ResponseResult getMainDevice(String stationCode, String areaId, String bayId, String mainDeviceName, public ResponseResult getMainDevice(String stationCode, String areaId, String bayId, String mainDeviceName,
@ -270,8 +283,8 @@ public class SubstationMaindeviceController {
@GetMapping("/getComponent") @GetMapping("/getComponent")
@ApiOperation("获取部件") @ApiOperation("获取部件")
public ResponseResult getComponent(String mainDeviceId,String bayId,String componentName) { public ResponseResult getComponent(String mainDeviceId, String bayId, String componentName) {
List<Map<String, Object>> list = substationMaindeviceService.getComponent(mainDeviceId,bayId,componentName); List<Map<String, Object>> list = substationMaindeviceService.getComponent(mainDeviceId, bayId, componentName);
return ResponseResult.successData(list); return ResponseResult.successData(list);
} }
@ -289,7 +302,7 @@ public class SubstationMaindeviceController {
return ResponseResult.successData(listItems); return ResponseResult.successData(listItems);
} }
@Log(module = "主设备及部件", value = "修改主设备",type = "1") @Log(module = "主设备及部件", value = "修改主设备", type = "1")
@PostMapping("/updateMainDevice") @PostMapping("/updateMainDevice")
@ApiOperation("修改主设备") @ApiOperation("修改主设备")
@PreAuthorize("@el.check('update:maindevice')") @PreAuthorize("@el.check('update:maindevice')")
@ -333,7 +346,7 @@ public class SubstationMaindeviceController {
} }
} }
@Log(module = "主设备及部件", value = "修改主设备状态",type = "1") @Log(module = "主设备及部件", value = "修改主设备状态", type = "1")
@PostMapping("/setMainDeviceStatus") @PostMapping("/setMainDeviceStatus")
@ApiOperation("修改主设备状态") @ApiOperation("修改主设备状态")
public ResponseResult setMainDeviceStatus(String id, String dataStatus) { 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") @PostMapping("/deleteMainDevice")
@ApiOperation("删除主设备") @ApiOperation("删除主设备")
@PreAuthorize("@el.check('del:maindevice')") @PreAuthorize("@el.check('del:maindevice')")
@ -359,7 +372,7 @@ public class SubstationMaindeviceController {
} }
} }
@Log(module = "主设备及部件", value = "新增部件",type = "1") @Log(module = "主设备及部件", value = "新增部件", type = "1")
@PostMapping("/addComponent") @PostMapping("/addComponent")
@ApiOperation("新增部件") @ApiOperation("新增部件")
public ResponseResult addComponent(SubstationComponent substationComponent) { public ResponseResult addComponent(SubstationComponent substationComponent) {
@ -388,7 +401,7 @@ public class SubstationMaindeviceController {
return ResponseResult.successData(substationComponent); return ResponseResult.successData(substationComponent);
} }
@Log(module = "主设备及部件", value = "修改部件",type = "1") @Log(module = "主设备及部件", value = "修改部件", type = "1")
@PostMapping("/updateComponent") @PostMapping("/updateComponent")
@ApiOperation("修改部件") @ApiOperation("修改部件")
public ResponseResult updateComponent(SubstationComponent substationComponent) { public ResponseResult updateComponent(SubstationComponent substationComponent) {
@ -413,7 +426,7 @@ public class SubstationMaindeviceController {
} }
} }
@Log(module = "主设备及部件", value = "修改部件状态",type = "1") @Log(module = "主设备及部件", value = "修改部件状态", type = "1")
@PostMapping("/setComponentStatus") @PostMapping("/setComponentStatus")
@ApiOperation("修改部件状态") @ApiOperation("修改部件状态")
public ResponseResult setComponentStatus(String componentId, String dataStatus) { 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") @PostMapping("/deleteComponent")
@ApiOperation("删除部件") @ApiOperation("删除部件")
public ResponseResult deleteComponent(String componentId) { public ResponseResult deleteComponent(String componentId) {
@ -481,8 +494,9 @@ public class SubstationMaindeviceController {
@ApiOperation("获取主设备导航树") @ApiOperation("获取主设备导航树")
@GetMapping("/getSubstationMainDeviceTree") @GetMapping("/getSubstationMainDeviceTree")
public ResponseResult getSubstationMainDeviceTree(String stationCode,String mainDeviceName) { public ResponseResult getSubstationMainDeviceTree(String stationCode, String mainDeviceName) {
List<Map<String, Object>> mainDeviceTree = substationMaindeviceService.getSubstationMainDeviceTree(stationCode,mainDeviceName); List<Map<String, Object>> mainDeviceTree =
substationMaindeviceService.getSubstationMainDeviceTree(stationCode, mainDeviceName);
return ResponseResult.successData(mainDeviceTree); return ResponseResult.successData(mainDeviceTree);
} }
@ -495,14 +509,15 @@ public class SubstationMaindeviceController {
@GetMapping("/getDeviceSignalTree") @GetMapping("/getDeviceSignalTree")
@ApiOperation("获取信号树(前台)") @ApiOperation("获取信号树(前台)")
public ResponseResult getDeviceSignalTree(String stationCode,String signalName) { public ResponseResult getDeviceSignalTree(String stationCode, String signalName) {
List<TreeNode> treeNodes = substationMaindeviceService.getDeviceSignalTree(stationCode,signalName); List<TreeNode> treeNodes = substationMaindeviceService.getDeviceSignalTree(stationCode, signalName);
return ResponseResult.successData(treeNodes); return ResponseResult.successData(treeNodes);
} }
@GetMapping("/getComponentTree") @GetMapping("/getComponentTree")
@ApiOperation("获取部件树(前台)") @ApiOperation("获取部件树(前台)")
public ResponseResult getComponentTree(String stationCode,String componentName) { public ResponseResult getComponentTree(String stationCode, String componentName) {
List<TreeNode> treeNodes = substationMaindeviceService.getComponentTree(stationCode,componentName); List<TreeNode> treeNodes = substationMaindeviceService.getComponentTree(stationCode, componentName);
return ResponseResult.successData(treeNodes); return ResponseResult.successData(treeNodes);
} }
} }