Quellcode durchsuchen

设备无费率处理

skyline vor 1 Jahr
Ursprung
Commit
2b256c2b3c

+ 5 - 0
entity/src/main/java/com/kym/entity/platform/response/PlatformBusinessPolicy.java

@@ -57,6 +57,11 @@ public class PlatformBusinessPolicy {
 
     @JSONCreator
     PlatformBusinessPolicy(@JSONField(name = "PolicyInfos") JSONArray array) {
+        // 如果策略信息为空,不做转换(朗新新站点切换会出现此问题)
+        if (array == null || array.isEmpty()) {
+            policyInfos = null;
+            return;
+        }
         this.policyInfos = array.toJavaList(PlatformPolicyInfo.class);
         // 将尖峰平谷信息填入EnPolicyInfo中
         var elecPriceSet = policyInfos.stream().map(PlatformPolicyInfo::getElecPrice).collect(Collectors.toSet()).stream().sorted().toList();