diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalOnlineRateDataServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalOnlineRateDataServiceImpl.java index 67f42b944..33ec90e7a 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalOnlineRateDataServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalOnlineRateDataServiceImpl.java @@ -84,7 +84,7 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData * @return */ @Override - public List getOnlineRateData(TerminalOnlineRateDataParam terminalOnlineRateDataParam) { + public List getOnlineRateData (TerminalOnlineRateDataParam terminalOnlineRateDataParam) { // 获取所有数据 List generalDeviceDTOList = generalDeviceService.getDeviceInfo(terminalOnlineRateDataParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList())); diff --git a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/WaveTypeVO.java b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/WaveTypeVO.java index 114b751d2..02c9fc797 100644 --- a/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/WaveTypeVO.java +++ b/pqs-event/event-api/src/main/java/com/njcn/event/pojo/vo/WaveTypeVO.java @@ -1,5 +1,7 @@ package com.njcn.event.pojo.vo; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.influxdb.annotation.Column; @@ -15,109 +17,68 @@ import java.math.BigDecimal; @Data public class WaveTypeVO{ - - - @ApiModelProperty( - name = "lineName", - value = "监测点名称" - ) + @ApiModelProperty(name = "lineName", value = "监测点名称") private String lineName; - @ApiModelProperty( - name = "subId", - value = "变电站id" - ) + + @ApiModelProperty(name = "subId", value = "变电站id") private String subId; - @ApiModelProperty( - name = "subName", - value = "变电站名称" - ) + + @ApiModelProperty(name = "subName", value = "变电站名称") private String subName; - @ApiModelProperty( - name = "gdId", - value = "供电公司id" - ) + + @ApiModelProperty(name = "gdId", value = "供电公司id") private String gdId; - @ApiModelProperty( - name = "gdName", - value = "供电公司名称" - ) + + @ApiModelProperty(name = "gdName", value = "供电公司名称") private String gdName; - @ApiModelProperty( - name = "voltageId", - value = "母线id" - ) + + @ApiModelProperty(name = "voltageId", value = "母线id") private String voltageId; - @ApiModelProperty( - name = "voltageName", - value = "母线名称" - ) + + @ApiModelProperty(name = "voltageName", value = "母线名称") private String voltageName; - @ApiModelProperty( - name = "voltageScale", - value = "监测点电压等级" - ) + + @ApiModelProperty(name = "voltageScale", value = "监测点电压等级") private String voltageScale; - @ApiModelProperty( - name = "noDealCount", - value = "未处理暂降事件" - ) + + @ApiModelProperty(name = "noDealCount", value = "未处理暂降事件") private Integer noDealCount; - @ApiModelProperty( - name = "ct1", - value = "ct1" - ) + + @ApiModelProperty(name = "ct1", value = "ct1") private Integer ct1; - @ApiModelProperty( - name = "ct2", - value = "ct2" - ) + + @ApiModelProperty(name = "ct2", value = "ct2") private Integer ct2; - @ApiModelProperty( - name = "pt1", - value = "pt1" - ) + + @ApiModelProperty(name = "pt1", value = "pt1") private Integer pt1; - @ApiModelProperty( - name = "pt2", - value = "pt2" - ) + + @ApiModelProperty(name = "pt2", value = "pt2") private Integer pt2; - @ApiModelProperty( - name = "runFlag", - value = "运行状态" - ) + + @ApiModelProperty(name = "runFlag", value = "运行状态") private Integer runFlag; - @ApiModelProperty( - name = "comFlag", - value = "通讯状态" - ) + + @ApiModelProperty(name = "comFlag", value = "通讯状态") private Integer comFlag; - @ApiModelProperty( - name = "ip", - value = "装置ip" - ) + + @ApiModelProperty(name = "ip", value = "装置ip") private String ip; - @ApiModelProperty( - name = "lat", - value = "维度" - ) + + @ApiModelProperty(name = "lat", value = "维度") private BigDecimal lat; - @ApiModelProperty( - name = "lng", - value = "经度" - ) + + @ApiModelProperty(name = "lng", value = "经度") private BigDecimal lng; - @ApiModelProperty( - name = "manufacturer", - value = "供应商名称" - ) + + @ApiModelProperty(name = "manufacturer", value = "供应商名称") private String manufacturer; - @ApiModelProperty( - name = "loadType", - value = "干扰源类型" - ) + + @ApiModelProperty(name = "loadType", value = "干扰源类型") private String loadType; + @ApiModelProperty(value = "暂时事件ID") + private String eventId; @Column(name = "line_id") private String lineId; diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaAnalysisServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaAnalysisServiceImpl.java index ee0d6c10f..98e3dde72 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaAnalysisServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/AreaAnalysisServiceImpl.java @@ -87,7 +87,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService { List dicIdsDouble = dicTypeList.stream().filter(item->item.getName().contains("双相接地")).map(DictData::getId).collect(Collectors.toList()); Map> stringListMap = new HashMap<>(); stringListMap.put("单相接地",dicIdsOne); - stringListMap.put("双相接地",dicIdsDouble); + stringListMap.put("两相接地",dicIdsDouble); stringListMap.put("三相短路",dicIdsThree); stringListMap.put("相间故障",dicIdsXi); stringListMap.put("未知",dicIdsOther); @@ -217,7 +217,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService { Integer allCount = 0; for (Map.Entry> stringListEntry : stringListMap.entrySet()) { List value = stringListEntry.getValue(); - Integer count = Math.toIntExact(reasons.stream().filter(x -> value.contains(x)).count()); + Integer count = Math.toIntExact(reasons.stream().filter(x -> value.contains(x.getAdvanceType())).count()); AreaAnalysisVO.Children allType = new AreaAnalysisVO.Children(); allType.setName(stringListEntry.getKey()); allType.setValue(count); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/THDistortionServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/THDistortionServiceImpl.java index ec3d0dbdd..2d7909e7a 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/THDistortionServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/THDistortionServiceImpl.java @@ -78,7 +78,7 @@ public class THDistortionServiceImpl implements THDistortionService { //查找畸变率 List condition = getCondition(lineIndexes, thDistortionParam.getSearchBeginTime(), thDistortionParam.getSearchEndTime()); - thDistortionVO.setDistortion(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159)); + thDistortionVO.setDistortion(roundHalfUp(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159))); //组装父级数据树 List treeList = getTreeData(lineIndexes, thDistortionParam); thDistortionVO.setChildren(treeList); @@ -162,7 +162,7 @@ public class THDistortionServiceImpl implements THDistortionService { List children = thDistortionVO.getChildren(); List tempList = children.stream().filter(child -> !Objects.equals(child.getDistortion(), 3.14159)).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(tempList)) { - thDistortionVO.setDistortion(tempList.stream().mapToDouble(THDistortionVO::getDistortion).average().orElse(3.14159)); + thDistortionVO.setDistortion(roundHalfUp(tempList.stream().mapToDouble(THDistortionVO::getDistortion).average().orElse(3.14159))); } else { thDistortionVO.setDistortion(3.14159); } @@ -210,7 +210,7 @@ public class THDistortionServiceImpl implements THDistortionService { if (!CollectionUtils.isEmpty(monitorList)) { //根据监测点集合组装谐波畸变率 monitorList.stream().map(list1 -> condition.stream().filter(list2 -> Objects.equals(list1.getId(), list2.getId())).findAny().map(m -> { - list1.setDistortion(m.getData()); + list1.setDistortion(roundHalfUp(m.getData())); return list1; })).collect(Collectors.toList()); @@ -226,6 +226,18 @@ public class THDistortionServiceImpl implements THDistortionService { return powerCompanyList; } + /** + * 四舍五入保留两位小数 + */ + private Double roundHalfUp (double num) { + if (num == 3.14159) { + return num; + } + BigDecimal b = new BigDecimal(num); + //保留2位小数 + return b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + } + /** * influxDB查询畸变率 @@ -246,7 +258,8 @@ public class THDistortionServiceImpl implements THDistortionService { .ge(StrUtil.isNotBlank(startTime), RStatDataVD::getTime, DateUtil.beginOfDay(DateUtil.parse(startTime))) .le(StrUtil.isNotBlank(endTime), RStatDataVD::getTime, DateUtil.endOfDay(DateUtil.parse(endTime))) - .eq(RStatDataVD::getQualityFlag, 1) +// .eq(RStatDataVD::getQualityFlag, 1) + .eq(RStatDataVD::getQualityFlag, 0) .in(RStatDataVD::getPhasicType, phasicType) .eq(RStatDataVD::getValueType, Param.VALUE_TYPEAVG) ); diff --git a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/DistortionRateJob.java b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/DistortionRateJob.java index c8aecee2c..be783996b 100644 --- a/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/DistortionRateJob.java +++ b/pqs-job/job-executor/src/main/java/com/njcn/executor/handler/DistortionRateJob.java @@ -24,6 +24,6 @@ public class DistortionRateJob { lineParam.setDataDate(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); log.info(lineParam.toString()); distortionRateFeignClient.distortionRate(lineParam); - log.info("===================DistortionRateJob End==================="); + log.info("===================DistortionRateJob End====================="); } } diff --git a/pqs-job/job-executor/src/main/resources/bootstrap.yml b/pqs-job/job-executor/src/main/resources/bootstrap.yml index 36c48ef4d..f6ae5ce08 100644 --- a/pqs-job/job-executor/src/main/resources/bootstrap.yml +++ b/pqs-job/job-executor/src/main/resources/bootstrap.yml @@ -52,7 +52,7 @@ xxl: accessToken: executor: #执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册 - appname: xuyang + appname: zxylocaltest #执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。 address: #执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";