谐波畸变bug修复&&区域统计bug修复
This commit is contained in:
@@ -84,7 +84,7 @@ public class TerminalOnlineRateDataServiceImpl implements TerminalOnlineRateData
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TerminalOnlineRateDataVO> getOnlineRateData(TerminalOnlineRateDataParam terminalOnlineRateDataParam) {
|
||||
public List<TerminalOnlineRateDataVO> getOnlineRateData (TerminalOnlineRateDataParam terminalOnlineRateDataParam) {
|
||||
|
||||
// 获取所有数据
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(terminalOnlineRateDataParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
List<String> dicIdsDouble = dicTypeList.stream().filter(item->item.getName().contains("双相接地")).map(DictData::getId).collect(Collectors.toList());
|
||||
Map<String, List<String>> 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<String, List<String>> stringListEntry : stringListMap.entrySet()) {
|
||||
List<String> 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);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
|
||||
//查找畸变率
|
||||
List<PublicDTO> 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<THDistortionVO> treeList = getTreeData(lineIndexes, thDistortionParam);
|
||||
thDistortionVO.setChildren(treeList);
|
||||
@@ -162,7 +162,7 @@ public class THDistortionServiceImpl implements THDistortionService {
|
||||
List<THDistortionVO> children = thDistortionVO.getChildren();
|
||||
List<THDistortionVO> 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)
|
||||
);
|
||||
|
||||
@@ -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=====================");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ xxl:
|
||||
accessToken:
|
||||
executor:
|
||||
#执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
appname: xuyang
|
||||
appname: zxylocaltest
|
||||
#执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
|
||||
address:
|
||||
#执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
|
||||
Reference in New Issue
Block a user