|
@@ -55,7 +55,12 @@ public class EnBusinessPolicy {
|
|
|
this.policyInfos = array.toJavaList(EnPolicyInfo.class);
|
|
this.policyInfos = array.toJavaList(EnPolicyInfo.class);
|
|
|
// 将尖峰平谷信息填入EnPolicyInfo中
|
|
// 将尖峰平谷信息填入EnPolicyInfo中
|
|
|
var elecPriceSet = policyInfos.stream().map(EnPolicyInfo::getElecPrice).collect(Collectors.toSet()).stream().sorted().toList();
|
|
var elecPriceSet = policyInfos.stream().map(EnPolicyInfo::getElecPrice).collect(Collectors.toSet()).stream().sorted().toList();
|
|
|
- policyInfos = policyInfos.stream().peek(price -> price.setPricePeriod(EnPolicyInfo.PRICE_PERIOD[elecPriceSet.indexOf(price.getElecPrice())])).toList();
|
|
|
|
|
|
|
+ if (elecPriceSet.size() > 1) {
|
|
|
|
|
+ policyInfos = policyInfos.stream().peek(price -> price.setPricePeriod(EnPolicyInfo.PRICE_PERIOD[elecPriceSet.indexOf(price.getElecPrice())])).toList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 统一电价
|
|
|
|
|
+ policyInfos = policyInfos.stream().peek(price -> price.setPricePeriod("统")).toList();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|