فهرست منبع

品牌对标接口bug修改

wangb 1 سال پیش
والد
کامیت
b303db62d7
1فایلهای تغییر یافته به همراه63 افزوده شده و 49 حذف شده
  1. 63 49
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

+ 63 - 49
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -1320,13 +1320,28 @@ public class BenchmarkingService {
     private List<WxsslVo> getxinWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw, List<WxsslVo> resultList, String type, String companys,String wpids, String model) {
 
         List<ProEconEquipmentInfoDay1> peeidls = new ArrayList<>();
-        String[] splitMd = model.split(",");
+        List<String> splitMd = null;
         if (!model.isEmpty()) {
+             splitMd = Arrays.asList(model.split(","));
+        }else if (model.isEmpty()){
+            List<String> models = null;
+            if (!wpids.isEmpty()) {
+                models = CacheContext.organizeEquipmentList.stream().filter(
+                        oe -> wpids.contains(oe.getWindpowerstationId())).map(ot -> ot.getModelId()).collect(Collectors.toList());
+                splitMd = models.stream().distinct().collect(Collectors.toList());
+            }else if (wpids.isEmpty() && companys.endsWith("ZGS")){
+                models = CacheContext.organizeEquipmentList.stream().filter(
+                        oe -> companys.contains(oe.getCompanyId())).map(ot -> ot.getModelId()).collect(Collectors.toList());
+                splitMd = models.stream().distinct().collect(Collectors.toList());
+            }else if (wpids.isEmpty()&&companys.endsWith("RGN")){
+                models = CacheContext.organizeEquipmentList.stream().filter(
+                        oe -> companys.contains(oe.getRegionId())).map(ot -> ot.getModelId()).collect(Collectors.toList());
+                splitMd = models.stream().distinct().collect(Collectors.toList());
+            }
+        }
+//        if (!model.isEmpty()) {
             for (String s1 : splitMd) {
 
-
-//                    List<String> wtls = CacheContext.wtls.stream().filter(c -> !Objects.isNull(c.getModelId()) && c.getNemName().contains("逆变器") &&
-//                            s1.equals(c.getModelId())).map(ot -> ot.getId()).collect(Collectors.toList());
                 List<String> wtls = null;
                 if (!wpids.isEmpty()) {
                     wtls = CacheContext.organizeEquipmentList.stream().filter(
@@ -1368,51 +1383,50 @@ public class BenchmarkingService {
 
                 peeidls.add(infoDay1);
             }
-        } else if (model.isEmpty()) {
-            List<String> wtls = null;
-            if (!wpids.isEmpty()) {
-                wtls = CacheContext.organizeEquipmentList.stream().filter(
-                        oe -> wpids.contains(oe.getWindpowerstationId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
-            }else if (wpids.isEmpty() && companys.endsWith("ZGS")){
-                wtls = CacheContext.organizeEquipmentList.stream().filter(
-                        oe -> companys.contains(oe.getCompanyId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
-            }else if (wpids.isEmpty()&&companys.endsWith("RGN")){
-                wtls = CacheContext.organizeEquipmentList.stream().filter(
-                        oe -> companys.contains(oe.getRegionId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
-            }
-
-            QueryWrapper<ProEconEquipmentInfoDay1> wiqw = qw.clone().in("windturbine_id", wtls);
-            List<ProEconEquipmentInfoDay1> listls = proEconEquipmentInfoDay1Service.list(wiqw);
-            List<ProBasicOrganizeTree> treeList = CacheContext.wtls.stream().filter(wt -> wt.getEqType().equals("IN")).collect(Collectors.toList());
-
-
-                for (ProEconEquipmentInfoDay1 listl : listls) {
-                    ProEconEquipmentInfoDay1 infoDay1 = new ProEconEquipmentInfoDay1();
-                    for (ProBasicOrganizeTree t1 : treeList) {
-                    if (t1.getPcodes().contains(listl.getWindpowerstationId())) {
-                        infoDay1.setRfdl((infoDay1.getRfdl() != null ? infoDay1.getRfdl() : 0) + (listl.getRfdl() != null ? listl.getRfdl() : 0));
-                        infoDay1.setRllfdl((infoDay1.getRllfdl() != null ? infoDay1.getRllfdl() : 0) + (listl.getRllfdl() != null ? listl.getRllfdl() : 0));
-                        infoDay1.setRpjfs((infoDay1.getRpjfs() != null ? infoDay1.getRpjfs() : 0) + (listl.getRpjfs() != null ? listl.getRpjfs() : 0));
-                        infoDay1.setRjxssdl((infoDay1.getRjxssdl() != null ? infoDay1.getRjxssdl() : 0) + (listl.getRjxssdl() != null ? listl.getRjxssdl() : 0));
-                        infoDay1.setRcnsljxssdl((infoDay1.getRcnsljxssdl() != null ? infoDay1.getRcnsljxssdl() : 0) + (listl.getRcnsljxssdl() != null ? listl.getRcnsljxssdl() : 0));
-                        infoDay1.setRgzssdl((infoDay1.getRgzssdl() != null ? infoDay1.getRgzssdl() : 0) + (listl.getRgzssdl() != null ? listl.getRgzssdl() : 0));
-                        infoDay1.setRcnslgzssdl((infoDay1.getRcnslgzssdl() != null ? infoDay1.getRcnslgzssdl() : 0) + (listl.getRcnslgzssdl() != null ? listl.getRcnslgzssdl() : 0));
-                        infoDay1.setRxdtjssdl((infoDay1.getRxdtjssdl() != null ? infoDay1.getRxdtjssdl() : 0) + (listl.getRxdtjssdl() != null ? listl.getRxdtjssdl() : 0));
-                        infoDay1.setRxdjclssdl((infoDay1.getRxdjclssdl() != null ? infoDay1.getRxdjclssdl() : 0) + (listl.getRxdjclssdl() != null ? listl.getRxdjclssdl() : 0));
-                        infoDay1.setRdjssdl((infoDay1.getRdjssdl() != null ? infoDay1.getRdjssdl() : 0) + (listl.getRdjssdl() != null ? listl.getRdjssdl() : 0));
-                        infoDay1.setRqxjclssdl((infoDay1.getRqxjclssdl() != null ? infoDay1.getRqxjclssdl() : 0) + (listl.getRqxjclssdl() != null ? listl.getRqxjclssdl() : 0));
-                        infoDay1.setRsdtjssdl((infoDay1.getRsdtjssdl() != null ? infoDay1.getRsdtjssdl() : 0) + (listl.getRsdtjssdl() != null ? listl.getRsdtjssdl() : 0));
-                        infoDay1.setRxnssdl((infoDay1.getRxnssdl() != null ? infoDay1.getRxnssdl() : 0) + (listl.getRxnssdl() != null ? listl.getRxnssdl() : 0));
-                        infoDay1.setRcwsldwssdl((infoDay1.getRcwsldwssdl() != null ? infoDay1.getRcwsldwssdl() : 0) + (listl.getRcwsldwssdl() != null ? listl.getRcwsldwssdl() : 0));
-                        infoDay1.setRcwsltqssdl((infoDay1.getRcwsltqssdl() != null ? infoDay1.getRcwsltqssdl() : 0) + (listl.getRcwsltqssdl() != null ? listl.getRcwsltqssdl() : 0));
-                        infoDay1.setWindpowerstationId(listl.getWindpowerstationId());
-                        infoDay1.setWindturbineId(t1.getModelId());
-                    }
-                }
-                    peeidls.add(infoDay1);
-            }
-
-        }
+//        }
+//        else if (model.isEmpty()) {
+//            List<String> wtls = null;
+//            if (!wpids.isEmpty()) {
+//                wtls = CacheContext.organizeEquipmentList.stream().filter(
+//                        oe -> wpids.contains(oe.getWindpowerstationId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
+//            }else if (wpids.isEmpty() && companys.endsWith("ZGS")){
+//                wtls = CacheContext.organizeEquipmentList.stream().filter(
+//                        oe -> companys.contains(oe.getCompanyId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
+//            }else if (wpids.isEmpty()&&companys.endsWith("RGN")){
+//                wtls = CacheContext.organizeEquipmentList.stream().filter(
+//                        oe -> companys.contains(oe.getRegionId())).map(ot -> ot.getWindturbineId()).collect(Collectors.toList());
+//            }
+//
+//            QueryWrapper<ProEconEquipmentInfoDay1> wiqw = qw.clone().in("windturbine_id", wtls);
+//            List<ProEconEquipmentInfoDay1> listls = proEconEquipmentInfoDay1Service.list(wiqw);
+//            List<ProBasicOrganizeTree> treeList = CacheContext.wtls.stream().filter(wt -> wt.getEqType().equals("IN")).collect(Collectors.toList());
+//            Map<String, ProBasicOrganizeTree> collect = treeList.stream().collect(Collectors.toMap(ProBasicOrganizeTree::getId, Function.identity()));
+//
+//            ProEconEquipmentInfoDay1 infoDay1 = new ProEconEquipmentInfoDay1();
+//            for (ProEconEquipmentInfoDay1 listl : listls) {
+//
+//                        infoDay1.setRfdl((infoDay1.getRfdl() != null ? infoDay1.getRfdl() : 0) + (listl.getRfdl() != null ? listl.getRfdl() : 0));
+//                        infoDay1.setRllfdl((infoDay1.getRllfdl() != null ? infoDay1.getRllfdl() : 0) + (listl.getRllfdl() != null ? listl.getRllfdl() : 0));
+//                        infoDay1.setRpjfs((infoDay1.getRpjfs() != null ? infoDay1.getRpjfs() : 0) + (listl.getRpjfs() != null ? listl.getRpjfs() : 0));
+//                        infoDay1.setRjxssdl((infoDay1.getRjxssdl() != null ? infoDay1.getRjxssdl() : 0) + (listl.getRjxssdl() != null ? listl.getRjxssdl() : 0));
+//                        infoDay1.setRcnsljxssdl((infoDay1.getRcnsljxssdl() != null ? infoDay1.getRcnsljxssdl() : 0) + (listl.getRcnsljxssdl() != null ? listl.getRcnsljxssdl() : 0));
+//                        infoDay1.setRgzssdl((infoDay1.getRgzssdl() != null ? infoDay1.getRgzssdl() : 0) + (listl.getRgzssdl() != null ? listl.getRgzssdl() : 0));
+//                        infoDay1.setRcnslgzssdl((infoDay1.getRcnslgzssdl() != null ? infoDay1.getRcnslgzssdl() : 0) + (listl.getRcnslgzssdl() != null ? listl.getRcnslgzssdl() : 0));
+//                        infoDay1.setRxdtjssdl((infoDay1.getRxdtjssdl() != null ? infoDay1.getRxdtjssdl() : 0) + (listl.getRxdtjssdl() != null ? listl.getRxdtjssdl() : 0));
+//                        infoDay1.setRxdjclssdl((infoDay1.getRxdjclssdl() != null ? infoDay1.getRxdjclssdl() : 0) + (listl.getRxdjclssdl() != null ? listl.getRxdjclssdl() : 0));
+//                        infoDay1.setRdjssdl((infoDay1.getRdjssdl() != null ? infoDay1.getRdjssdl() : 0) + (listl.getRdjssdl() != null ? listl.getRdjssdl() : 0));
+//                        infoDay1.setRqxjclssdl((infoDay1.getRqxjclssdl() != null ? infoDay1.getRqxjclssdl() : 0) + (listl.getRqxjclssdl() != null ? listl.getRqxjclssdl() : 0));
+//                        infoDay1.setRsdtjssdl((infoDay1.getRsdtjssdl() != null ? infoDay1.getRsdtjssdl() : 0) + (listl.getRsdtjssdl() != null ? listl.getRsdtjssdl() : 0));
+//                        infoDay1.setRxnssdl((infoDay1.getRxnssdl() != null ? infoDay1.getRxnssdl() : 0) + (listl.getRxnssdl() != null ? listl.getRxnssdl() : 0));
+//                        infoDay1.setRcwsldwssdl((infoDay1.getRcwsldwssdl() != null ? infoDay1.getRcwsldwssdl() : 0) + (listl.getRcwsldwssdl() != null ? listl.getRcwsldwssdl() : 0));
+//                        infoDay1.setRcwsltqssdl((infoDay1.getRcwsltqssdl() != null ? infoDay1.getRcwsltqssdl() : 0) + (listl.getRcwsltqssdl() != null ? listl.getRcwsltqssdl() : 0));
+//                        infoDay1.setWindpowerstationId(listl.getWindpowerstationId());
+//                        infoDay1.setWindturbineId(collect.get(listl.getWindturbineId()).getModelId());
+//                    //}
+//            }
+//            peeidls.add(infoDay1);
+//
+//        }
 
         if (!peeidls.isEmpty() && peeidls.size() > 0) {
             if (peeidls.get(0).getWindturbineId() != null && !peeidls.get(0).getWindturbineId().isEmpty()