|
@@ -58,10 +58,9 @@ public class CalculateService {
|
|
|
log.info("加载升压站故障");
|
|
|
List<FaultInfo> syzGz = shardingApi.getFaultInfoList("SYZ", "2023-05-10", "2023-05-13", null, null, null);
|
|
|
syzGzMap = syzGz.stream().filter(fi -> fi.getAlertText().contains("位状态"))
|
|
|
- .map(fi -> {
|
|
|
+ .peek(fi -> {
|
|
|
fi.setConfirmPerson(fi.getAlertText().substring(fi.getAlertText().indexOf("--")));
|
|
|
fi.setAlertText(fi.getAlertText().substring(0, fi.getAlertText().indexOf("--")));
|
|
|
- return fi;
|
|
|
})
|
|
|
.collect(Collectors.groupingBy(FaultInfo::getStationId));
|
|
|
}
|
|
@@ -91,11 +90,11 @@ public class CalculateService {
|
|
|
LinkedHashMap<Long, Long> map = calcElectricityRation(thingId, advanceTime, ts);
|
|
|
StateCause cause;
|
|
|
for (Map.Entry<Long, Long> entry : map.entrySet()) {
|
|
|
- if (entry.getKey().equals(doubleValue)) {
|
|
|
- cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(8.0), new Date(entry.getKey()),
|
|
|
+ if (ts==entry.getKey()) {
|
|
|
+ cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(8.0), new Date(entry.getKey()),
|
|
|
new Date(entry.getValue()), stateMap.get(4.0), stateMap.get(doubleValue), entry.getValue() - entry.getKey());
|
|
|
} else {
|
|
|
- cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(8.0), new Date(entry.getKey()),
|
|
|
+ cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(8.0), new Date(entry.getKey()),
|
|
|
new Date(entry.getValue()), stateMap.get(4.0), stateMap.get(4.0), entry.getValue() - entry.getKey());
|
|
|
}
|
|
|
stateCauseList.add(cause);
|
|
@@ -103,23 +102,23 @@ public class CalculateService {
|
|
|
} else if (advanceState == 2) {
|
|
|
//计算限停
|
|
|
if (judgmentStop(thingId, advanceTime, ts)) {
|
|
|
- StateCause cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(8.0),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(8.0),
|
|
|
new Date(advanceTime), new Date(ts), stateMap.get(2.0), stateMap.get(doubleValue), ts - advanceTime);
|
|
|
stateCauseList.add(cause);
|
|
|
} else {
|
|
|
- StateCause cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(2.0),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(2.0),
|
|
|
new Date(advanceTime), new Date(ts), stateMap.get(2.0), stateMap.get(doubleValue), ts - advanceTime);
|
|
|
stateCauseList.add(cause);
|
|
|
}
|
|
|
} else if (advanceState == 6) {
|
|
|
if (hasFaultEvent(thingId, advanceTime, ts)) {
|
|
|
//故障
|
|
|
- StateCause cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(5.0),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(5.0),
|
|
|
new Date(advanceTime), new Date(ts), stateMap.get(6.0), stateMap.get(doubleValue), ts - advanceTime);
|
|
|
stateCauseList.add(cause);
|
|
|
} else {
|
|
|
//计划检修
|
|
|
- StateCause cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(9.0),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(9.0),
|
|
|
new Date(advanceTime), new Date(ts), stateMap.get(6.0), stateMap.get(doubleValue), ts - advanceTime);
|
|
|
stateCauseList.add(cause);
|
|
|
}
|
|
@@ -132,7 +131,7 @@ public class CalculateService {
|
|
|
calcBurdened(stateCauseList, thingId, advanceTime, ts, 7, doubleValue);
|
|
|
} else if (advanceState == 0) {
|
|
|
if (ts - advanceTime < appConfig.getLongTime().get("fault-min")) continue;
|
|
|
- StateCause cause = new StateCause(thingId2StationId(thingId), thingId, stateMap.get(5.0),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(5.0),
|
|
|
new Date(advanceTime), new Date(ts), stateMap.get(0.0), stateMap.get(doubleValue), ts - advanceTime);
|
|
|
stateCauseList.add(cause);
|
|
|
}
|
|
@@ -162,7 +161,7 @@ public class CalculateService {
|
|
|
//有功设定
|
|
|
double apsDouble = apsRbk.stream().mapToDouble(PointData::getDoubleValue).average().getAsDouble() * (apsTp.getRate() == null ? 1 : apsTp.getRate());
|
|
|
//应发功率
|
|
|
- double apDouble = 0;
|
|
|
+ double apDouble;
|
|
|
if (boostStation.getId().contains("QS")) {
|
|
|
TestingPoint apTp2 = CacheContext.pointMapMap.get("apparent-power").get(boostStation.getId() + "2");
|
|
|
List<PointData> apRbk2 = adapterApi.getValuesByKey(apTp2.getCode(), start, end, 30);
|
|
@@ -350,12 +349,12 @@ public class CalculateService {
|
|
|
}
|
|
|
if (k / size > 9.5) {
|
|
|
//受累
|
|
|
- StateCause cause = new StateCause(stationId, thingId, stateMap.get(10.0), new Date(start), new Date(end),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(10.0), new Date(start), new Date(end),
|
|
|
stateMap.get(starteventstate), stateMap.get(endeventstate), end - start);
|
|
|
stateCauseList.add(cause);
|
|
|
} else {//if(starteventstate==5 || isHasFaultEvent(thingId,start,end)){
|
|
|
//故障
|
|
|
- StateCause cause = new StateCause(stationId, thingId, stateMap.get(5.0), new Date(start), new Date(end),
|
|
|
+ StateCause cause = new StateCause(CacheContext.scEquipTbMap.get(thingId), stateMap.get(5.0), new Date(start), new Date(end),
|
|
|
stateMap.get(starteventstate), stateMap.get(endeventstate), end - start);
|
|
|
stateCauseList.add(cause);
|
|
|
}/*else {
|
|
@@ -432,7 +431,7 @@ public class CalculateService {
|
|
|
}
|
|
|
//限电跳变处理
|
|
|
long t0 = 0;
|
|
|
- long t1 = 0;
|
|
|
+ long t1;
|
|
|
long tstart = 0;
|
|
|
long tend = 0;
|
|
|
LinkedHashMap<Long, Long> llm2 = new LinkedHashMap<>();
|