diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/DeviceMessageFeignClient.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/DeviceMessageFeignClient.java index 1b1641b..97cc1bc 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/DeviceMessageFeignClient.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/DeviceMessageFeignClient.java @@ -1,10 +1,17 @@ package com.njcn.csdevice.api; +import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.constant.ServerInfo; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; import com.njcn.csdevice.api.fallback.DeviceMessageClientFallbackFactory; import com.njcn.csdevice.param.DeviceMessageParam; +import com.njcn.csdevice.pojo.po.CsLinePO; import com.njcn.user.pojo.po.User; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -29,6 +36,6 @@ public interface DeviceMessageFeignClient { @PostMapping("/getLineInfo") @ApiOperation("获取监测点信息") - HttpResult getLineInfo(@RequestParam("id") String id); + HttpResult getLineInfo(@RequestParam("id") String id, @RequestParam("list") List list); } diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/fallback/DeviceMessageClientFallbackFactory.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/fallback/DeviceMessageClientFallbackFactory.java index 5db78bb..59c9c6d 100644 --- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/fallback/DeviceMessageClientFallbackFactory.java +++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/api/fallback/DeviceMessageClientFallbackFactory.java @@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; import com.njcn.csdevice.api.DeviceMessageFeignClient; import com.njcn.csdevice.param.DeviceMessageParam; +import com.njcn.csdevice.pojo.po.CsLinePO; import com.njcn.user.pojo.po.User; import feign.hystrix.FallbackFactory; import lombok.extern.slf4j.Slf4j; @@ -41,7 +42,7 @@ public class DeviceMessageClientFallbackFactory implements FallbackFactory getLineInfo(String id) { + public HttpResult getLineInfo(String id, List list) { log.error("{}异常,降级处理,异常为:{}","获取监测点信息数据异常",cause.toString()); throw new BusinessException(finalExceptionEnum); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/message/DeviceMessageController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/message/DeviceMessageController.java index 0dbe8c1..7dc722f 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/message/DeviceMessageController.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/message/DeviceMessageController.java @@ -7,12 +7,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.csdevice.param.DeviceMessageParam; -import com.njcn.csdevice.pojo.param.DataArrayParam; -import com.njcn.csdevice.pojo.po.CsDataArray; -import com.njcn.csdevice.pojo.vo.DataArrayTreeVO; -import com.njcn.csdevice.pojo.vo.DeviceManagerDetailVO; +import com.njcn.csdevice.pojo.po.CsLinePO; import com.njcn.csdevice.service.DeviceMessageService; -import com.njcn.csdevice.service.ICsDataArrayService; import com.njcn.user.pojo.po.User; import com.njcn.web.controller.BaseController; import io.swagger.annotations.Api; @@ -22,7 +18,6 @@ import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; @@ -47,8 +42,8 @@ public class DeviceMessageController extends BaseController { @PostMapping("/getEventUserByDeviceId") @ApiOperation("根据设备获取需要推送的用户id") @ApiImplicitParams({ - @ApiImplicitParam(name = "devId", value = "设备id", required = true, paramType = "query"), - @ApiImplicitParam(name = "isAdmin", value = "是否需要推送给普通用户", required = true, paramType = "query") + @ApiImplicitParam(name = "devId", value = "设备id", required = true, paramType = "query"), + @ApiImplicitParam(name = "isAdmin", value = "是否需要推送给普通用户", required = true, paramType = "query") }) public HttpResult> getEventUserByDeviceId(@RequestParam("devId") String devId, @RequestParam("isAdmin") Boolean isAdmin){ String methodDescribe = getMethodDescribe("getEventUserByDeviceId"); @@ -70,9 +65,13 @@ public class DeviceMessageController extends BaseController { @PostMapping("/getLineInfo") @ApiOperation("获取监测点信息") @ApiImplicitParam(name = "id", value = "参数", required = true, paramType = "query") - public HttpResult getLineInfo(@RequestParam("id") String id){ + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "参数", paramType = "query"), + @ApiImplicitParam(name = "list", value = "监测点id集合", paramType = "query") + }) + public HttpResult getLineInfo(@RequestParam("id") String id, @RequestParam("list") List list){ String methodDescribe = getMethodDescribe("getLineInfo"); - deviceMessageService.getLineInfo(id); + deviceMessageService.getLineInfo(id,list); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/DeviceMessageService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/DeviceMessageService.java index 77cb886..a642a02 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/DeviceMessageService.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/DeviceMessageService.java @@ -1,6 +1,7 @@ package com.njcn.csdevice.service; import com.njcn.csdevice.param.DeviceMessageParam; +import com.njcn.csdevice.pojo.po.CsLinePO; import com.njcn.user.pojo.po.User; import java.util.List; @@ -14,6 +15,6 @@ public interface DeviceMessageService { List getSendUserByType(DeviceMessageParam param); - void getLineInfo(String id); + void getLineInfo(String id,List list); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDataArrayServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDataArrayServiceImpl.java index 0bf0bef..37a86a6 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDataArrayServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDataArrayServiceImpl.java @@ -57,7 +57,7 @@ public class CsDataArrayServiceImpl extends ServiceImpl> entry : map.entrySet()) { DeviceManagerDetailVO vo = new DeviceManagerDetailVO(); EleEpdPqd eleEpdPqd = entry.getValue().get(0); - if (Objects.equals(eleEpdPqd.getPhase(),"M")){ + if (Objects.equals(eleEpdPqd.getPhase(),"T")){ vo.setPhasic("/"); } else { vo.setPhasic(entry.getValue().stream().map(EleEpdPqd::getPhase).collect(Collectors.joining(","))); @@ -109,7 +109,7 @@ public class CsDataArrayServiceImpl extends ServiceImpl impl if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){ throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)"); } - Double ct = finalCsLinePOList.get(0).getCtRatio(); - Double pt = finalCsLinePOList.get(0).getPtRatio(); + Double ct = finalCsLinePOList.get(0).getCtRatio() / (Objects.isNull(finalCsLinePOList.get(0).getCt2Ratio())?1.0:finalCsLinePOList.get(0).getCt2Ratio()); + Double pt = finalCsLinePOList.get(0).getPtRatio() / (Objects.isNull(finalCsLinePOList.get(0).getPt2Ratio())?1.0:finalCsLinePOList.get(0).getPt2Ratio()); if(CollectionUtil.isNotEmpty(commonStatisticalQueryParam.getList())){ for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){ @@ -347,7 +347,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl String unit; ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType()); + vo.setPhase(Objects.equals("T",temp.getPhaseType())?null:temp.getPhaseType()); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -455,21 +455,6 @@ public class CsGroupServiceImpl extends ServiceImpl impl vo.setAnotherName(epdPqd.getShowName()); return vo; }).collect(Collectors.toList()); - - //长时闪变 - if (Objects.equals(epdPqd.getOtherName(), "plt")) { - List timeInstants = getTimeInstants(commonStatisticalQueryParam.getStartTime(), commonStatisticalQueryParam.getEndTime(), 2, ChronoUnit.HOURS, DEFAULT_ZONE); - collect1 = collect1.stream() - .filter(vo -> timeInstants.contains(vo.getTime())) - .collect(Collectors.toList()); - } - //短时闪变 || 电压波动 - else if (Objects.equals(epdPqd.getOtherName(), "pst") || Objects.equals(epdPqd.getOtherName(), "fluc")) { - List timeInstants = getTimeInstants(commonStatisticalQueryParam.getStartTime(), commonStatisticalQueryParam.getEndTime(), 10, ChronoUnit.MINUTES, DEFAULT_ZONE); - collect1 = collect1.stream() - .filter(vo -> timeInstants.contains(vo.getTime())) - .collect(Collectors.toList()); - } result.addAll(collect1); }); } @@ -512,7 +497,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl List collect1 = deviceRtData.stream().map(temp -> { ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType()); + vo.setPhase(Objects.equals("T",temp.getPhaseType())?null:temp.getPhaseType()); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -667,7 +652,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl List collect1 = deviceRtData.stream().map(temp -> { ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType()); + vo.setPhase(Objects.equals("T",temp.getPhaseType())?null:temp.getPhaseType()); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -767,7 +752,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl List collect1 = deviceRtData.stream().map(temp -> { ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType()); + vo.setPhase(Objects.equals("T",temp.getPhaseType())?null:temp.getPhaseType()); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -846,8 +831,8 @@ public class CsGroupServiceImpl extends ServiceImpl impl if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())) { throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)"); } - Double ct = finalCsLinePO.getCtRatio(); - Double pt = finalCsLinePO.getPtRatio(); + Double ct = finalCsLinePO.getCtRatio() / (Objects.isNull(finalCsLinePO.getCt2Ratio())?1.0:finalCsLinePO.getCt2Ratio()); + Double pt = finalCsLinePO.getPtRatio() / (Objects.isNull(finalCsLinePO.getPt2Ratio())?1.0:finalCsLinePO.getPt2Ratio()); if(CollectionUtil.isNotEmpty(trendDataQueryParam.getList())) { for (TrendDataQueryParam param : trendDataQueryParam.getList()) { List eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData(); @@ -872,7 +857,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl String unit; ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType()); + vo.setPhase(Objects.equals("T", temp.getPhaseType()) ? null : temp.getPhaseType()); String position = finalCsLinePO.getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -980,21 +965,6 @@ public class CsGroupServiceImpl extends ServiceImpl impl vo.setAnotherName(epdPqd.getShowName()); return vo; }).collect(Collectors.toList()); - - //长时闪变 - if (Objects.equals(epdPqd.getOtherName(), "plt")) { - List timeInstants = getTimeInstants(trendDataQueryParam.getSearchBeginTime(), trendDataQueryParam.getSearchEndTime(), 2, ChronoUnit.HOURS, DEFAULT_ZONE); - collect1 = collect1.stream() - .filter(vo -> timeInstants.contains(vo.getTime())) - .collect(Collectors.toList()); - } - //短时闪变 || 电压波动 - else if (Objects.equals(epdPqd.getOtherName(), "pst") || Objects.equals(epdPqd.getOtherName(), "fluc")) { - List timeInstants = getTimeInstants(trendDataQueryParam.getSearchBeginTime(), trendDataQueryParam.getSearchEndTime(), 10, ChronoUnit.MINUTES, DEFAULT_ZONE); - collect1 = collect1.stream() - .filter(vo -> timeInstants.contains(vo.getTime())) - .collect(Collectors.toList()); - } result.addAll(collect1); } } @@ -1010,9 +980,10 @@ public class CsGroupServiceImpl extends ServiceImpl impl if(Objects.isNull(csDataSet) || StrUtil.isBlank(csDataSet.getDataLevel())){ throw new BusinessException("当前测点数据集主要信息缺失,请联系管理员排查(测点表里面数据集id缺失)"); } - Double ct = finalCsLinePO.getCtRatio(); - Double pt = finalCsLinePO.getPtRatio(); - // String position = finalCsLinePO.getPosition(); + Double ct = finalCsLinePO.getCtRatio() / (Objects.isNull(finalCsLinePO.getCt2Ratio())?1.0:finalCsLinePO.getCt2Ratio()); + Double pt = finalCsLinePO.getPtRatio() / (Objects.isNull(finalCsLinePO.getPt2Ratio())?1.0:finalCsLinePO.getPt2Ratio()); + + // String position = finalCsLinePO.getPosition(); Overlimit overlimit = overLimitWlMapper.selectById(finalCsLinePO.getLineId()); if (Objects.isNull(overlimit)) { throw new BusinessException("当前测点限值信息缺失,请联系管理员排查"); @@ -1048,7 +1019,7 @@ public class CsGroupServiceImpl extends ServiceImpl impl ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); // vo.setLineName(finalCsLinePO.getName()); - vo.setPhase(Objects.equals("M", temp.getPhaseType()) ? null : temp.getPhaseType()); + vo.setPhase(Objects.equals("T", temp.getPhaseType()) ? null : temp.getPhaseType()); // vo.setPosition(position); vo.setTime(temp.getTime()); vo.setStatMethod(commonQueryParam.getDataType()); diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/DeviceMessageServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/DeviceMessageServiceImpl.java index 16c825a..dc21b98 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/DeviceMessageServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/DeviceMessageServiceImpl.java @@ -86,9 +86,14 @@ class DeviceMessageServiceImpl implements DeviceMessageService { } @Override - public void getLineInfo(String id) { + public void getLineInfo(String id, List list) { Map map = new HashMap<>(); - List lineList = csLinePOService.findByNdid(id); + List lineList; + if (CollectionUtil.isNotEmpty(list) && list != null) { + lineList = list; + } else { + lineList = csLinePOService.findByNdid(id); + } if (CollectionUtil.isEmpty(lineList)){ throw new BusinessException("监测点为空"); } diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RStatIntegrityDServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RStatIntegrityDServiceImpl.java index a7d7739..005c858 100644 --- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RStatIntegrityDServiceImpl.java +++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/RStatIntegrityDServiceImpl.java @@ -79,16 +79,16 @@ public class RStatIntegrityDServiceImpl extends MppServiceImpl i String unit; ThdDataVO vo = new ThdDataVO(); vo.setLineId(temp.getLineId()); - vo.setPhase(Objects.equals("M",temp.getPhaseType())?null:temp.getPhaseType()); + vo.setPhase(Objects.equals("T",temp.getPhaseType())?null:temp.getPhaseType()); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); vo.setPosition(position); vo.setTime(temp.getTime()); @@ -681,13 +681,13 @@ public class WlRecordServiceImpl extends ServiceImpl i if(Objects.isNull(list.get(i).getEndTime())){ LocalDateTime now = LocalDateTime.now(); String sqlNow = now.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)); - InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("pqd_data",StatisticalDataDTO.class); + InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("data_v",StatisticalDataDTO.class); influxQueryWrapper.select(StatisticalDataDTO::getLineId) .select(StatisticalDataDTO::getPhaseType) .select(StatisticalDataDTO::getValueType) - .last("Pq_Freq") + .last("freq") .eq(InfluxDBTableConstant.LINE_ID,lineId) - .eq(InfluxDBTableConstant.PHASIC_TYPE,"M") + .eq(InfluxDBTableConstant.PHASIC_TYPE,"T") .between(InfluxDBTableConstant.TIME,startSql,sqlNow); System.out.println(influxQueryWrapper.generateSql()); StatisticalDataDTO statisticalDataDTO = commonMapper.getLineRtData(influxQueryWrapper); @@ -708,13 +708,13 @@ public class WlRecordServiceImpl extends ServiceImpl i //如果不存在结束时间,则取后面一条的起始时间作为结束判断标识 if(Objects.isNull(list.get(i).getEndTime())){ String end = list.get(i+1).getStartTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)); - InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("pqd_data",StatisticalDataDTO.class); + InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper("data_v",StatisticalDataDTO.class); influxQueryWrapper.select(StatisticalDataDTO::getLineId) .select(StatisticalDataDTO::getPhaseType) .select(StatisticalDataDTO::getValueType) - .last("Pq_Freq") + .last("freq") .eq(InfluxDBTableConstant.LINE_ID,lineId) - .eq(InfluxDBTableConstant.PHASIC_TYPE,"M") + .eq(InfluxDBTableConstant.PHASIC_TYPE,"T") .between(InfluxDBTableConstant.TIME,startSql,end); System.out.println(influxQueryWrapper.generateSql()); StatisticalDataDTO statisticalDataDTO = commonMapper.getLineRtData(influxQueryWrapper); diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java index a5d0394..b141453 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/handler/MqttMessageHandler.java @@ -249,7 +249,7 @@ public class MqttMessageHandler { }); //过滤M相 - List m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList()); + List m = tempList.stream().filter(temp -> Objects.equals(temp.getPhase(), "T")).collect(Collectors.toList()); m.stream().forEach(temp -> { Stream.of("A", "B", "C").forEach(phase -> { ThdDataVO thdDataVO = new ThdDataVO(); @@ -314,7 +314,7 @@ public class MqttMessageHandler { }); } - List notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "M")).collect(Collectors.toList()); + List notM = tempList.stream().filter(temp -> !Objects.equals(temp.getPhase(), "T")).collect(Collectors.toList()); result.addAll(notM); Gson gson = new Gson(); topoDataJson = gson.toJson(result); diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CustomReportServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CustomReportServiceImpl.java index c910ef3..d3b3b05 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CustomReportServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CustomReportServiceImpl.java @@ -599,7 +599,7 @@ public class CustomReportServiceImpl implements CustomReportService { private void assPhase(List value, ReportTreeVO reportTreeItem, String key) { List phaseTree = new ArrayList<>(); value.forEach(item -> { - if (Objects.nonNull(item.getPhase()) && !"M".equals(item.getPhase())) { + if (Objects.nonNull(item.getPhase()) && !"T".equals(item.getPhase())) { List statTree = new ArrayList<>(); ReportTreeVO reportTreePhase = new ReportTreeVO(); reportTreePhase.setName(item.getPhase()); diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java index cd847a5..18a5c23 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/DataServiceImpl.java @@ -99,8 +99,8 @@ public class DataServiceImpl implements IDataService { //获取监测点使用的数据集 List finalCsLinePOList = csLineFeignClient.queryLineById(Collections.singletonList(param.getLineId())).getData(); CsDataSet csDataSet = csDataSetMapper.selectOne(new LambdaQueryWrapper().eq(CsDataSet::getId,finalCsLinePOList.get(0).getDataSetId())); - Double ct = finalCsLinePOList.get(0).getCtRatio(); - Double pt = finalCsLinePOList.get(0).getPtRatio(); + Double ct = finalCsLinePOList.get(0).getCtRatio() / (Objects.isNull(finalCsLinePOList.get(0).getCt2Ratio())?1.0:finalCsLinePOList.get(0).getCt2Ratio()); + Double pt = finalCsLinePOList.get(0).getPtRatio() / (Objects.isNull(finalCsLinePOList.get(0).getPt2Ratio())?1.0:finalCsLinePOList.get(0).getPt2Ratio()); //根据类型id获取指标分组 List dictTreeVOList = dictTreeFeignClient.query(param.getTargetType()).getData(); if (CollUtil.isNotEmpty(dictTreeVOList)) { @@ -283,7 +283,7 @@ public class DataServiceImpl implements IDataService { vo2.setPhasicType(item.getPhaseType()); vo2.setData(Objects.isNull(item.getAvgValue()) ? 3.14159 : Double.parseDouble(df.format(item.getAvgValue()))); - if (Objects.equals(item.getPhaseType(),"M")) { + if (Objects.equals(item.getPhaseType(),"T")) { EachModuleVO.DataVo vo3 = new EachModuleVO.DataVo(); vo3.setTime(LocalDateTime.ofInstant(item.getTime().minus(8, ChronoUnit.HOURS), ZoneId.systemDefault())); vo3.setPhasicType(item.getPhaseType()); @@ -805,7 +805,7 @@ public class DataServiceImpl implements IDataService { if (Objects.nonNull(phaseC)) { vo.setValueC(Objects.isNull(phaseC.getAvgValue()) ? 3.14159 : phaseC.getAvgValue()); } - RealTimeDataVo phaseM = v.stream().filter(s->Objects.equals(s.getPhase(),"M")).findFirst().orElse(null); + RealTimeDataVo phaseM = v.stream().filter(s->Objects.equals(s.getPhase(),"T")).findFirst().orElse(null); if (Objects.nonNull(phaseM)) { vo.setValueM(Objects.isNull(phaseM.getAvgValue()) ? 3.14159 : phaseM.getAvgValue()); } diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/LineTargetServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/LineTargetServiceImpl.java index f4aadc3..ae1dc2d 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/LineTargetServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/LineTargetServiceImpl.java @@ -165,7 +165,7 @@ public class LineTargetServiceImpl implements ILineTargetService { } String clDid = influxDbParamUtil.getClDidByLineId(item.getLineId()); //基础信息 - CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],targetName,clDid); + CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"T":tempTable[1],tempTable[2],targetName,clDid); //设备状态信息 CsEquipmentDeliveryPO po = equipmentFeignClient.getDevByLineId(item.getLineId()).getData(); vo.setDevStatus(po.getRunStatus()); @@ -214,7 +214,7 @@ public class LineTargetServiceImpl implements ILineTargetService { .collect(Collectors.toList()); String s = tempUid.get(tempUid.size() - 1); String[] tempTable = s.replace("$", "").split("#"); - result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],temp,item.getUnit().get(i))); + result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"T":tempTable[1],tempTable[2],temp,item.getUnit().get(i))); // result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%")); } } diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StatisticsDataDataServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StatisticsDataDataServiceImpl.java index 837a5d8..d9429ab 100644 --- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StatisticsDataDataServiceImpl.java +++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/StatisticsDataDataServiceImpl.java @@ -60,11 +60,11 @@ public class StatisticsDataDataServiceImpl implements IStatisticsDataDataService Integer process = devMap.get(item.getDeviceId()).getProcess(); //治理监测点 if (item.getClDid() == 0) { - statisticalDataDTO = commonService.getCounts(item.getLineId(),"apf_data","Apf_Freq","frequency","M","avg",item.getClDid().toString(),process.toString(),param.getStartTime(),param.getEndTime()); + statisticalDataDTO = commonService.getCounts(item.getLineId(),"apf_data","Apf_Freq","frequency","T","AVG",item.getClDid().toString(),process.toString(),param.getStartTime(),param.getEndTime()); } //电能质量监测点 else { - statisticalDataDTO = commonService.getCounts(item.getLineId(),"pqd_data","Pq_Freq","frequency","M","avg",item.getClDid().toString(),process.toString(),param.getStartTime(),param.getEndTime()); + statisticalDataDTO = commonService.getCounts(item.getLineId(),"data_v","freq","frequency","T","AVG",item.getClDid().toString(),process.toString(),param.getStartTime(),param.getEndTime()); } vo.setDevId(item.getDeviceId()); vo.setDevName(devMap.get(item.getDeviceId()).getName());