zbj//1.算法bug解决
This commit is contained in:
@@ -551,7 +551,7 @@ public class RAlarmCountServiceImpl implements RAlarmCountService {
|
|||||||
zwwtResult.get(0).setHarmonicTypeGrade(0);
|
zwwtResult.get(0).setHarmonicTypeGrade(0);
|
||||||
zwwtResult.get(1).setHarmonicTypeGrade(1);
|
zwwtResult.get(1).setHarmonicTypeGrade(1);
|
||||||
} else {
|
} else {
|
||||||
i = (int) (zwwtResult.size() * 0.3);
|
i = (int) (zwwtResult.size() * 0.3)+1;
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
@@ -581,7 +581,7 @@ public class RAlarmCountServiceImpl implements RAlarmCountService {
|
|||||||
zwztResult.get(0).setEventTypeGrade(0);
|
zwztResult.get(0).setEventTypeGrade(0);
|
||||||
zwztResult.get(1).setEventTypeGrade(1);
|
zwztResult.get(1).setEventTypeGrade(1);
|
||||||
} else {
|
} else {
|
||||||
i = (int) (zwztResult.size() * 0.3);
|
i = (int) (zwztResult.size() * 0.3)+1;
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ public class RAlarmCountServiceImpl implements RAlarmCountService {
|
|||||||
pwwtResult.get(0).setHarmonicTypeGrade(0);
|
pwwtResult.get(0).setHarmonicTypeGrade(0);
|
||||||
pwwtResult.get(1).setHarmonicTypeGrade(1);
|
pwwtResult.get(1).setHarmonicTypeGrade(1);
|
||||||
} else {
|
} else {
|
||||||
i = (int) (pwwtResult.size() * 0.3);
|
i = (int) (pwwtResult.size() * 0.3)+1;
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
@@ -650,7 +650,7 @@ public class RAlarmCountServiceImpl implements RAlarmCountService {
|
|||||||
pwztResult.get(0).setEventTypeGrade(0);
|
pwztResult.get(0).setEventTypeGrade(0);
|
||||||
pwztResult.get(1).setEventTypeGrade(1);
|
pwztResult.get(1).setEventTypeGrade(1);
|
||||||
} else {
|
} else {
|
||||||
i = (int) (pwztResult.size() * 0.3);
|
i = (int) (pwztResult.size() * 0.3)+1;
|
||||||
if (i < 1) {
|
if (i < 1) {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
@@ -665,7 +665,7 @@ public class RAlarmCountServiceImpl implements RAlarmCountService {
|
|||||||
}
|
}
|
||||||
//循环中等的
|
//循环中等的
|
||||||
for (RStatAreaAlarmCountMPO rStatAreaAlarmCountMPO : pwztResult) {
|
for (RStatAreaAlarmCountMPO rStatAreaAlarmCountMPO : pwztResult) {
|
||||||
if (Objects.isNull(rStatAreaAlarmCountMPO.getHarmonicTypeGrade())) {
|
if (Objects.isNull(rStatAreaAlarmCountMPO.getEventTypeGrade())) {
|
||||||
rStatAreaAlarmCountMPO.setEventTypeGrade(1);
|
rStatAreaAlarmCountMPO.setEventTypeGrade(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -613,7 +613,7 @@ public class RStatEventServiceImpl implements RStatEventService {
|
|||||||
//天表
|
//天表
|
||||||
rStatEventDPOQueryWrapper.clear();
|
rStatEventDPOQueryWrapper.clear();
|
||||||
rStatEventDPOQueryWrapper.
|
rStatEventDPOQueryWrapper.
|
||||||
in("measurement_point_id", collect1).
|
eq("org_no", deptGetChildrenMoreDTO.getUnitId()).
|
||||||
between("data_date", startDate, endDate).
|
between("data_date", startDate, endDate).
|
||||||
eq("measurement_type_class", getmeasurementType(k, lineSortMap)).
|
eq("measurement_type_class", getmeasurementType(k, lineSortMap)).
|
||||||
eq("data_type", dataTypeMap.get(DicDataEnum.DISTRIBUTION_POINT.getCode()).getId());
|
eq("data_type", dataTypeMap.get(DicDataEnum.DISTRIBUTION_POINT.getCode()).getId());
|
||||||
@@ -622,7 +622,7 @@ public class RStatEventServiceImpl implements RStatEventService {
|
|||||||
//月表
|
//月表
|
||||||
rStatEventMPOQueryWrapper.clear();
|
rStatEventMPOQueryWrapper.clear();
|
||||||
rStatEventMPOQueryWrapper.
|
rStatEventMPOQueryWrapper.
|
||||||
in("measurement_point_id", collect1).
|
eq("org_no", deptGetChildrenMoreDTO.getUnitId()).
|
||||||
between("data_date", startDate, endDate).
|
between("data_date", startDate, endDate).
|
||||||
eq("measurement_type_class", getmeasurementType(k, lineSortMap)).
|
eq("measurement_type_class", getmeasurementType(k, lineSortMap)).
|
||||||
eq("data_type", dataTypeMap.get(DicDataEnum.DISTRIBUTION_POINT.getCode()).getId());
|
eq("data_type", dataTypeMap.get(DicDataEnum.DISTRIBUTION_POINT.getCode()).getId());
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.njcn.system.enums.DicDataEnum;
|
|||||||
import com.njcn.system.enums.DicDataTypeEnum;
|
import com.njcn.system.enums.DicDataTypeEnum;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
import com.njcn.system.pojo.po.DictData;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
zw.forEach(z -> {
|
zw.forEach(z -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getZwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
@@ -219,6 +221,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationDPOS.add(rStatSubstationDPO);
|
rStatSubstationDPOS.add(rStatSubstationDPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -229,8 +232,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
pw.forEach(p -> {
|
pw.forEach(p -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getPwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getPwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
if (!CollectionUtils.isEmpty(lineIds)) {
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
||||||
int sw = 0, sa = 0, in = 0, result = 0;
|
int sw = 0, sa = 0, in = 0, result = 0;
|
||||||
@@ -328,12 +332,14 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
|
|
||||||
rStatSubstationDPOS.add(rStatSubstationDPO);
|
rStatSubstationDPOS.add(rStatSubstationDPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(rStatSubstationDPOS)) {
|
if (!CollectionUtils.isEmpty(rStatSubstationDPOS)) {
|
||||||
rStatSubstationDPOService.saveOrUpdateBatchByMultiId(rStatSubstationDPOS, 500);
|
List<RStatSubstationDPO> collect = rStatSubstationDPOS.stream().distinct().collect(Collectors.toList());
|
||||||
|
rStatSubstationDPOService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,6 +381,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
zw.forEach(z -> {
|
zw.forEach(z -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getZwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
@@ -520,6 +527,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationMPOS.add(rStatSubstationMPO);
|
rStatSubstationMPOS.add(rStatSubstationMPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -530,8 +538,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
pw.forEach(p -> {
|
pw.forEach(p -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getPwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getPwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
if (!CollectionUtils.isEmpty(lineIds)) {
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
||||||
//r_mp_target_warn_d 表中字段求和
|
//r_mp_target_warn_d 表中字段求和
|
||||||
@@ -675,12 +684,14 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationMPOS.add(rStatSubstationMPO);
|
rStatSubstationMPOS.add(rStatSubstationMPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(rStatSubstationMPOS)) {
|
if (!CollectionUtils.isEmpty(rStatSubstationMPOS)) {
|
||||||
rStatSubstationMPOService.saveOrUpdateBatchByMultiId(rStatSubstationMPOS, 500);
|
List<RStatSubstationMPO> collect = rStatSubstationMPOS.stream().distinct().collect(Collectors.toList());
|
||||||
|
rStatSubstationMPOService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -724,6 +735,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
zw.forEach(z -> {
|
zw.forEach(z -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getZwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
@@ -841,6 +853,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationQPOS.add(rStatSubstationQPO);
|
rStatSubstationQPOS.add(rStatSubstationQPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -851,8 +864,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
pw.forEach(p -> {
|
pw.forEach(p -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getPwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getPwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
if (!CollectionUtils.isEmpty(lineIds)) {
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
||||||
//r_mp_target_warn_d 表中字段求和
|
//r_mp_target_warn_d 表中字段求和
|
||||||
@@ -968,12 +982,14 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationQPOS.add(rStatSubstationQPO);
|
rStatSubstationQPOS.add(rStatSubstationQPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(rStatSubstationQPOS)) {
|
if (!CollectionUtils.isEmpty(rStatSubstationQPOS)) {
|
||||||
rStatSubstationQPOService.saveOrUpdateBatchByMultiId(rStatSubstationQPOS, 500);
|
List<RStatSubstationQPO> collect = rStatSubstationQPOS.stream().distinct().collect(Collectors.toList());
|
||||||
|
rStatSubstationQPOService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1016,6 +1032,8 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
zw.forEach(z -> {
|
zw.forEach(z -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(z).getData();
|
||||||
|
//判空
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getZwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
@@ -1133,6 +1151,7 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationYPOS.add(rStatSubstationYPO);
|
rStatSubstationYPOS.add(rStatSubstationYPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1143,8 +1162,9 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
pw.forEach(p -> {
|
pw.forEach(p -> {
|
||||||
//获取监测点对象集合
|
//获取监测点对象集合
|
||||||
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
LineDevGetBandDTO lineDevGetDTOs = commTerminalGeneralClient.substationGetLine(p).getData();
|
||||||
|
if (Objects.nonNull(lineDevGetDTOs.getPwList())) {
|
||||||
//获取监测点id集合
|
//获取监测点id集合
|
||||||
List<String> lineIds = lineDevGetDTOs.getZwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> lineIds = lineDevGetDTOs.getPwList().stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
//判空
|
//判空
|
||||||
if (!CollectionUtils.isEmpty(lineIds)) {
|
if (!CollectionUtils.isEmpty(lineIds)) {
|
||||||
//r_mp_target_warn_d 表中字段求和
|
//r_mp_target_warn_d 表中字段求和
|
||||||
@@ -1260,12 +1280,14 @@ public class RStatSubstationServiceImpl implements RStatSubstationService {
|
|||||||
}
|
}
|
||||||
rStatSubstationYPOS.add(rStatSubstationYPO);
|
rStatSubstationYPOS.add(rStatSubstationYPO);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(rStatSubstationYPOS)) {
|
if (!CollectionUtils.isEmpty(rStatSubstationYPOS)) {
|
||||||
rStatSubstationYPOService.saveOrUpdateBatchByMultiId(rStatSubstationYPOS, 500);
|
List<RStatSubstationYPO> collect = rStatSubstationYPOS.stream().distinct().collect(Collectors.toList());
|
||||||
|
rStatSubstationYPOService.saveOrUpdateBatchByMultiId(collect, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user