diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/DeptLineFeignClient.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/DeptLineFeignClient.java index a99e17288..c7bcb2a71 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/DeptLineFeignClient.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/api/DeptLineFeignClient.java @@ -21,7 +21,7 @@ public interface DeptLineFeignClient { HttpResult> getLineByDeptId(@RequestParam("id")String id); @PostMapping("/getLineByDeptIdAndNewStation") - HttpResult> getLineByDeptIdAndNewStation(@RequestParam("id")String id); + HttpResult> getLineByDeptIdAndNewStation(@RequestParam(value = "id",required = false)String id); @PostMapping("/selectDeptBindLines") HttpResult selectDeptBindLines(@RequestParam("ids") List ids); diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeptLineController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeptLineController.java index 5e633d2fe..b9aa66e51 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeptLineController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/DeptLineController.java @@ -115,7 +115,7 @@ public class DeptLineController extends BaseController { @OperateInfo(info = LogEnum.SYSTEM_COMMON) @PostMapping("/getLineByDeptIdAndNewStation") @ApiOperation("根据部门id获取绑定的监测点且再根据(监测点详情进行过滤)") - public HttpResult> getLineByDeptIdAndNewStation(@RequestParam("id") String id) { + public HttpResult> getLineByDeptIdAndNewStation(@RequestParam(value = "id",required = false) String id) { String methodDescribe = getMethodDescribe("getLineByDeptIdAndNewStation"); List list = deptLineService.getLineByDeptIdAndNewStation(id); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineDetailMapper.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineDetailMapper.java index 34192a98f..a9372847b 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineDetailMapper.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/LineDetailMapper.java @@ -43,6 +43,8 @@ public interface LineDetailMapper extends BaseMapper { * @return 结果 */ List getLineDetailInfo(@Param("lineIds") List lineIds); + + @Select ("select count(1) from pq_line a where a.Level=4 and SUBSTRING_INDEX(SUBSTRING_INDEX(a.Pids, ',', 4),',',-1)=#{subIndex}") Integer getDeviceCountBySubstation(@Param("subIndex")String subIndex); diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml index c3bee4164..8f37da4f7 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/DeptLineMapper.xml @@ -204,9 +204,10 @@ FROM pq_dept_line pdl INNER JOIN pq_line_detail pld ON pdl.Line_Id = pld.Id - WHERE + + pld.Obj_Id IS NOT NULL and pld.Obj_Id !='' - pdl.Id = #{id} + and pdl.Id = #{id} and pld.Big_Obj_Type in @@ -214,6 +215,6 @@ #{item} - and pld.Obj_Id IS NOT NULL and pld.Obj_Id !='' + diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineDetailMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineDetailMapper.xml index 2e3ebb47b..34fc5d486 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineDetailMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineDetailMapper.xml @@ -42,10 +42,9 @@ c.id lineId, a.name lineName, c.Time_Interval, - e.name scale, + d.Scale AS scale, c.Obj_Id obyId, - c.Big_Obj_Type bigObjType, - d.Scale AS scale + c.Big_Obj_Type bigObjType from pq_line a inner join pq_line b on a.pid = b.id inner join pq_line_detail c on a.id = c.id diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml index 23de4e1a7..3ad273f0d 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml @@ -1466,7 +1466,8 @@ pqd.Run_Flag as runFlag, detail.PT_Type AS ptType, detail.PT_Phase_Type AS ptPhaseType, - detail.Obj_Id AS objId + detail.Obj_Id AS objId, + detail.Big_Obj_Type AS bigObjType FROM pq_line line, pq_line_detail detail, diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java index b5986372d..e11b91f4c 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/LineServiceImpl.java @@ -903,7 +903,6 @@ public class LineServiceImpl extends ServiceImpl implements Li } }); return lineDetailInfo; - } /** diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/event/SpThroughServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/event/SpThroughServiceImpl.java index 209eb0ff1..356fd7649 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/event/SpThroughServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/event/SpThroughServiceImpl.java @@ -54,7 +54,6 @@ public class SpThroughServiceImpl extends MppServiceImpl lineIds = deptLineFeignClient.getLineByDeptIdAndNewStation(null).getData(); if (CollUtil.isNotEmpty(lineIds)) { List lineDetailDataVOS = lineFeignClient.getLineDetailList(lineIds).getData(); - Map lineDetailDataMap = lineDetailDataVOS.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity())); - List objIds = lineDetailDataVOS.stream().map(LineDetailDataVO::getObyId).distinct().collect(Collectors.toList()); - List userReportVOS = userLedgerFeignClient.getUserReportByIds(objIds).getData(); - Map userReportMap = userReportVOS.stream().collect(Collectors.toMap(NewUserReportVO::getId, NewUserReportVO::getRatePower)); - - - EventCountParam param = new EventCountParam(); - param.setIds(lineIds); - param.setStartTime(getLastTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN))); - param.setEndTime(currentTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN))); - List evenStDetailPOS = eventDetailFeignClient.getNewEventDetailByTime(param).getData(); - MonitorTerminalParam monitorTerminalParam = new MonitorTerminalParam(); - monitorTerminalParam.setSystemType(0); - monitorTerminalParam.setType(0); - for (RmpEventDetailPO rmpEventDetailPO : evenStDetailPOS) { - if (lineDetailDataMap.containsKey(rmpEventDetailPO.getMeasurementPointId())) { - LineDetailDataVO line = lineDetailDataMap.get(rmpEventDetailPO.getMeasurementPointId()); - LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); - lambdaQueryWrapper.eq(SpThroughPO::getEventId, rmpEventDetailPO.getEventId()) - .eq(SpThroughPO::getEventType, rmpEventDetailPO.getEventType()) - .eq(SpThroughPO::getStationType, line.getBigObjType()) - .eq(SpThroughPO::getState, 1); - if (this.baseMapper.selectList(lambdaQueryWrapper).isEmpty()) { - //准备高低电压穿越实体bean - SpThroughPO spThroughPO = new SpThroughPO(); - spThroughPO.setId(IdUtil.simpleUUID()); - spThroughPO.setEventId(rmpEventDetailPO.getEventId()); - spThroughPO.setEventType(rmpEventDetailPO.getEventType()); - spThroughPO.setStationType(line.getBigObjType()); - //默认该事件没有穿越 - spThroughPO.setIsOrNot(0); - //设置波形查询的条件:事件ID - monitorTerminalParam.setId(rmpEventDetailPO.getEventId()); - //获取RMS波形数据(由于WaveDataDTO为复杂对象所以转成byte数组在进行反序列化) - byte[] bytes = transientFeignClient.getTransientAnalyseWaveToByteArray(monitorTerminalParam).getData(); - WaveDataDTO waveDataDTO = null; - try { - ByteArrayInputStream bis = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(bis); - //强转成WaveDataDTO - waveDataDTO = (WaveDataDTO) ois.readObject(); - } catch (Exception e) { - e.printStackTrace(); - } - //标称电压 - if (line.getScale() != null) { - Float voltageLevel = Float.parseFloat(line.getScale()); - //格式化数据源 - List> newListRmsData = listRmsDataFormat(waveDataDTO); - //暂升事件 - if (rmpEventDetailPO.getEventType().equals(rise.getId())) { - //风电场 - if (line.getBigObjType().equals(windFarms.getId())) { - if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData) - && isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData) - && isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) { - spThroughPO.setIsOrNot(1); - } - } - //光伏电站 - if (line.getBigObjType().equals(powerStation.getId())) { - if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData) - && isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData) - && isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) { - spThroughPO.setIsOrNot(1); - } - } - } - //暂降事件 - if (rmpEventDetailPO.getEventType().equals(dip.getId())) { - //风电场 - if (line.getBigObjType().equals(windFarms.getId())) { - if (isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData)) { - spThroughPO.setIsOrNot(1); - } - } - //光伏电站 - if (line.getBigObjType().equals(powerStation.getId())) { - if (isThrough(0, -1, 150, voltageLevel.floatValue(), newListRmsData) - && isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData) - && isThrough(20, 90, -1, voltageLevel.floatValue(), newListRmsData)) { - spThroughPO.setIsOrNot(1); - } - } - } - spThroughPO.setCreateTime(currentTime); - this.baseMapper.insert(spThroughPO); - } - - } + if (CollUtil.isNotEmpty(lineDetailDataVOS)) { + Map lineDetailDataMap = lineDetailDataVOS.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity())); + EventCountParam param = new EventCountParam(); + param.setIds(new ArrayList<>(lineDetailDataMap.keySet())); + LocalDateTime lastTime = getLastTime(); + if (ObjectUtil.isNotNull(getLastTime())) { + param.setStartTime(lastTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN))); } + param.setEndTime(currentTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN))); + List evenStDetailPOS = eventDetailFeignClient.getNewEventDetailByTime(param).getData(); + MonitorTerminalParam monitorTerminalParam = new MonitorTerminalParam(); + monitorTerminalParam.setSystemType(0); + monitorTerminalParam.setType(0); + for (RmpEventDetailPO rmpEventDetailPO : evenStDetailPOS) { + if (lineDetailDataMap.containsKey(rmpEventDetailPO.getMeasurementPointId())) { + LineDetailDataVO line = lineDetailDataMap.get(rmpEventDetailPO.getMeasurementPointId()); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); + lambdaQueryWrapper.eq(SpThroughPO::getEventId, rmpEventDetailPO.getEventId()) + .eq(SpThroughPO::getEventType, rmpEventDetailPO.getEventType()) + .eq(SpThroughPO::getStationType, line.getBigObjType()) + .eq(SpThroughPO::getState, 1); + if (this.baseMapper.selectList(lambdaQueryWrapper).isEmpty()) { + //准备高低电压穿越实体bean + SpThroughPO spThroughPO = new SpThroughPO(); + spThroughPO.setId(IdUtil.simpleUUID()); + spThroughPO.setEventId(rmpEventDetailPO.getEventId()); + spThroughPO.setEventType(rmpEventDetailPO.getEventType()); + spThroughPO.setStationType(line.getBigObjType()); + //默认该事件没有穿越 + spThroughPO.setIsOrNot(0); + //设置波形查询的条件:事件ID + monitorTerminalParam.setId(rmpEventDetailPO.getEventId()); + //获取RMS波形数据(由于WaveDataDTO为复杂对象所以转成byte数组在进行反序列化) + byte[] bytes = transientFeignClient.getTransientAnalyseWaveToByteArray(monitorTerminalParam).getData(); + WaveDataDTO waveDataDTO = null; + try { + ByteArrayInputStream bis = new ByteArrayInputStream(bytes); + ObjectInputStream ois = new ObjectInputStream(bis); + //强转成WaveDataDTO + waveDataDTO = (WaveDataDTO) ois.readObject(); + } catch (Exception e) { + e.printStackTrace(); + } + //标称电压 + if (line.getScale() != null) { + Float voltageLevel = Float.parseFloat(line.getScale()); + //格式化数据源 + List> newListRmsData = listRmsDataFormat(waveDataDTO); + //暂升事件 + if (rmpEventDetailPO.getEventType().equals(rise.getId())) { + //风电场 + if (line.getBigObjType().equals(windFarms.getId())) { + if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData) + && isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData) + && isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) { + spThroughPO.setIsOrNot(1); + } + } + //光伏电站 + if (line.getBigObjType().equals(powerStation.getId())) { + if (isThrough(125, 130, 500, voltageLevel.floatValue(), newListRmsData) + && isThrough(120, 125, 1000, voltageLevel.floatValue(), newListRmsData) + && isThrough(110, 120, 10000, voltageLevel.floatValue(), newListRmsData)) { + spThroughPO.setIsOrNot(1); + } + } + } + //暂降事件 + if (rmpEventDetailPO.getEventType().equals(dip.getId())) { + //风电场 + if (line.getBigObjType().equals(windFarms.getId())) { + if (isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData)) { + spThroughPO.setIsOrNot(1); + } + } + //光伏电站 + if (line.getBigObjType().equals(powerStation.getId())) { + if (isThrough(0, -1, 150, voltageLevel.floatValue(), newListRmsData) + && isThrough(20, -1, 625, voltageLevel.floatValue(), newListRmsData) + && isThrough(20, 90, -1, voltageLevel.floatValue(), newListRmsData)) { + spThroughPO.setIsOrNot(1); + } + } + } + spThroughPO.setCreateTime(currentTime); + this.baseMapper.insert(spThroughPO); + } + } + } + + } } } } @@ -233,7 +232,7 @@ public class SpThroughServiceImpl extends MppServiceImpl indexs = new ArrayList<>(); //根据channelNames取出电压对应listRmsData数据中的数据索引 for (int i = 0; i < waveDataDTO.getChannelNames().size(); i++) { - if (waveDataDTO.getChannelNames().get(i).indexOf("电压") != -1) { + if (waveDataDTO.getChannelNames().get(i).indexOf("U") != -1) { indexs.add(i); } } diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/user/NewUserReportVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/user/NewUserReportVO.java index f60b83781..ac07e93a9 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/user/NewUserReportVO.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/user/NewUserReportVO.java @@ -16,12 +16,6 @@ public class NewUserReportVO { @ApiModelProperty(value = "id") private String id; - /** - * 监测点id - */ - @ApiModelProperty(value = "lineId") - private String lineId; - /** * 工程名称 */