This commit is contained in:
wr
2025-04-09 14:24:19 +08:00
parent 84cd56330e
commit 2c12f4966a

View File

@@ -167,7 +167,7 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
if (line.getBigObjType().equals(powerStation.getId())) { if (line.getBigObjType().equals(powerStation.getId())) {
if (BooleanUtil.or(isDipThrough(0, 150, 1, voltageLevel, newListRmsData), if (BooleanUtil.or(isDipThrough(0, 150, 1, voltageLevel, newListRmsData),
isDipThrough(20, 625, 1, voltageLevel, newListRmsData), isDipThrough(20, 625, 1, voltageLevel, newListRmsData),
isDipThrough(20, 90, null, voltageLevel, newListRmsData))) { isDipThrough(20, 90, 3, voltageLevel, newListRmsData))) {
spThroughPO.setIsOrNot(1); spThroughPO.setIsOrNot(1);
} }
} }
@@ -238,11 +238,7 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
try { try {
Field minTime = RActivePowerRangeDto.class.getDeclaredField("minsTime" + i); Field minTime = RActivePowerRangeDto.class.getDeclaredField("minsTime" + i);
Field minNum = RActivePowerRangeDto.class.getDeclaredField("minsNum" + i);
Field isOrNot = RActivePowerRangeDto.class.getDeclaredField("isOrNot" + i);
minTime.setAccessible(true); minTime.setAccessible(true);
minNum.setAccessible(true);
isOrNot.setAccessible(true);
minTime.set(dto, "[]"); minTime.set(dto, "[]");
if (CollUtil.isNotEmpty(min[i])) { if (CollUtil.isNotEmpty(min[i])) {
List<String> mins = min[i].stream().distinct().collect(Collectors.toList()); List<String> mins = min[i].stream().distinct().collect(Collectors.toList());
@@ -250,14 +246,16 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
if (CollUtil.isNotEmpty(limitTime)) { if (CollUtil.isNotEmpty(limitTime)) {
List<String> collect = mins.stream().filter(x -> limitTime.contains(x)).sorted().collect(Collectors.toList()); List<String> collect = mins.stream().filter(x -> limitTime.contains(x)).sorted().collect(Collectors.toList());
if (CollUtil.isNotEmpty(collect)) { if (CollUtil.isNotEmpty(collect)) {
Field minNum = RActivePowerRangeDto.class.getDeclaredField("minsNum" + i);
Field isOrNot = RActivePowerRangeDto.class.getDeclaredField("isOrNot" + i);
minNum.setAccessible(true);
isOrNot.setAccessible(true);
minTime.set(dto, JSON.toJSONString(collect)); minTime.set(dto, JSON.toJSONString(collect));
minNum.set(dto, collect.size());
isOrNot.set(dto, 1); isOrNot.set(dto, 1);
} else {
minTime.set(dto, "[]");
} }
} }
} }
minNum.set(dto, min[i].size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -374,16 +372,17 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
} }
} }
if (3 == option) { if (3 == option) {
//方案三20%以上至90%时,需要判断上升信息 //todo 方案三20%以上至90%时,需要判断信息
if (NumberUtil.isIn(curValue, BigDecimal.valueOf(20), BigDecimal.valueOf(90))) {
// if (voltageLevel > v && anchorPoint != -1.0) { temp.add(num);
// anchorPoint = time + ms; } else {
// } else if (anchorPoint.equals(time)) { if (CollUtil.isNotEmpty(temp)) {
// if (v < voltageLevel*0.9) { if (isMonotonic(temp)) {
// return true; return true;
// } }
// anchorPoint = -1.0; temp = new ArrayList<>();
// } }
}
} }
} }
} }
@@ -391,6 +390,32 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
return false; return false;
} }
/**
* 判断有不连续的暂降
*
* @param temp
* @return
*/
private boolean isMonotonic(List<String> temp) {
List<Integer> nums = temp.stream().map(x -> Integer.valueOf(x.split("_")[1])).collect(Collectors.toList());
//增加
boolean increasing = true;
//减少
boolean decreasing = true;
for (int i = 0; i < nums.size() - 1; i++) {
if (nums.get(i) > nums.get(i + 1)) {
increasing = false;
}
if (nums.get(i) > nums.get(i + 1)) {
decreasing = false;
}
// 提前终止循环,如果已确定非升序且非降序
if (!increasing && !decreasing) {
break;
}
}
return increasing || decreasing;
}
/** /**
* 暂升 * 暂升