diff --git a/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850Service.java b/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850Service.java index 4407530..286e6df 100644 --- a/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850Service.java +++ b/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850Service.java @@ -101,9 +101,12 @@ public class IEC61850Service { * type 类型(yk、yt) * value */ - public boolean sendCommand(String systemcode, String signalid, String type, String value) throws IOException, + public boolean sendCommand(String systemcode, String signalid, String type, String deviceType, String value) throws IOException, ServiceError { - +// value = getControlValue(deviceType, value); +// if (StrUtil.isBlank(value)) { +// return false; +// } DeviceSignal deviceSignal = deviceSignalService.getById(signalid); //辅控系统下属网关机状态监控 if (StrUtil.isNotEmpty(systemcode) && "10".equals(systemcode)) { @@ -180,5 +183,26 @@ public class IEC61850Service { return false; } + /** + * 获取控制值 + * + * @param type 类型 + * @param value 值 + * @return + */ + public String getControlValue(String type, String value) { + + if ("7".equals(type)) { + return value.equals("1") ? "false" : "true"; + } + if ("14".equals(type)) { + return value.equals("1") ? "false" : "true"; + } + if ("20".equals(type)) { + return value.equals("1") ? "false" : "true"; + } + return null; + } + } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceSignalController.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceSignalController.java index b3df2e7..78a2732 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceSignalController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceSignalController.java @@ -78,15 +78,15 @@ public class DeviceSignalController { ***********************************/ @GetMapping("/queryYxData") @ApiOperation("查询遥信数据") - public ResponseResult queryYxData(Page> page, String areaId, String type,String stationId) { - Page> mapPage = deviceSignalService.queryYxData(page, areaId, type,stationId); + public ResponseResult queryYxData(Page> page, String areaId, String type, String stationId) { + Page> mapPage = deviceSignalService.queryYxData(page, areaId, type, stationId); return ResponseResult.successData(mapPage); } @GetMapping("/countDeviceTypeStatus") @ApiOperation("查询遥信数据统计") - public ResponseResult countDeviceTypeStatus(String areaId, String type,String stationId) { - List> mapList = deviceSignalService.countDeviceTypeStatus(areaId, type,stationId); + public ResponseResult countDeviceTypeStatus(String areaId, String type, String stationId) { + List> mapList = deviceSignalService.countDeviceTypeStatus(areaId, type, stationId); return ResponseResult.successData(mapList); } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java index 1f2cf3d..1dd84c2 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java @@ -61,17 +61,14 @@ public class IECController { ***********************************/ @GetMapping("/sendCommand") @ApiOperation("发送遥控遥调命令") - public ResponseResult sendCommand(String systemcode, String signalid, String type, String value) throws Exception { - if (StrUtil.isBlank(signalid)) { + public ResponseResult sendCommand(String systemcode, String signalId, String type,String deviceType, String value) throws Exception { + if (StrUtil.isBlank(signalId)) { return ResponseResult.error("信号ID不能为空!"); } - DeviceSignal deviceSignal = deviceSignalService.getById(signalid); + DeviceSignal deviceSignal = deviceSignalService.getById(signalId); if (ObjUtil.isNotEmpty(deviceSignal)) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - //型号对应的监控设备id - queryWrapper.eq(MeterDevice::getDeviceId, deviceSignal.getMeterDeviceId()); //查找信号对应监控设备 - MeterDevice meterDevice = meterDeviceService.getOne(queryWrapper); + MeterDevice meterDevice = meterDeviceService.getById(deviceSignal.getMeterDeviceId()); LambdaQueryWrapper queryWrapper2 = new LambdaQueryWrapper<>(); //IP地址 queryWrapper2.eq(GatewayDevice::getIpAddr, meterDevice.getNetdeviceIp()); @@ -81,9 +78,9 @@ public class IECController { return ResponseResult.error("组件未关联信号!"); } if ("IEC104".equals(netDevice.getProtocol())) { - iec104Service.sendCommand(systemcode, signalid, type, value); + iec104Service.sendCommand(systemcode, signalId, type, value); } else if ("IEC61850".equals(netDevice.getProtocol())) { - iec61850Service.sendCommand(systemcode, signalid, type, value); + iec61850Service.sendCommand(systemcode, signalId, type,deviceType, value); } return ResponseResult.success(); } else { diff --git a/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml b/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml index eddda22..8a8a523 100644 --- a/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml +++ b/riis-system/src/main/resources/mapper/auxcontrol/DeviceSignalMapper.xml @@ -130,7 +130,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +