Bladeren bron

品牌对标修改

wangb 1 jaar geleden
bovenliggende
commit
d4331869d2

+ 78 - 57
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -1205,7 +1205,7 @@ public List<ProBasicOrganizeTree> modellist(String wpids) {
     public List<WxsslVo> ppdb(String companys, String type, String wpids,String model, String beginDate, String endDate, String target, String sort) {
         List<WxsslVo> resultList = new ArrayList<>();
         QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
-        qw.select("windpowerstation_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
+        qw.select("windpowerstation_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");;
 
         qw.ge("record_date", DateUtils.parseDate(beginDate)).le("record_date", DateUtils.parseDate(endDate));
         if (StringUtils.isNotEmpty(wpids)) {
@@ -1246,73 +1246,94 @@ public List<ProBasicOrganizeTree> modellist(String wpids) {
     }
 
 
-    private List<WxsslVo> getxinWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw, List<WxsslVo> resultList, String type,String model,String wpids) {
-
+    private List<WxsslVo> getxinWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw, List<WxsslVo> resultList, String type,String wpids,String model) {
+
+        List<List<ProEconEquipmentInfoDay1>> peeidls = new ArrayList<>();
+        String[] splitWp = wpids.split(",");
+        for (String s : splitWp) {
+            String[] splitMd = model.split(",");
+            for (String s1 : splitMd) {
+                List<String> wtls = CacheContext.wtls.stream().filter(c -> !Objects.isNull(c.getModelId()) &&c.getPcodes().contains(s) &&
+                        s1.equals(c.getModelId())).map(ot->ot.getId()).collect(Collectors.toList());
+                if(wtls.size()==0) continue;
+                QueryWrapper<ProEconEquipmentInfoDay1> wiqw = qw.clone().in("windturbine_id", wtls);
+                List<ProEconEquipmentInfoDay1> listls =proEconEquipmentInfoDay1Service.list(wiqw);
+                for (ProEconEquipmentInfoDay1 listl : listls) {
+                    listl.setWindturbineId(s1);
+                }
+                peeidls.add(listls);
+            }
+        }
         Map<String, Integer> station = CacheContext.wpls
                 .stream().collect(Collectors.toMap(ProBasicOrganizeTree::getId, ProBasicOrganizeTree::getOrderNum));
 
-        List<ProBasicOrganizeTree> wtls = CacheContext.wtls.stream().filter(c -> model.equals(c.getModelId())).collect(Collectors.toList());
+//        List<String> wtls = CacheContext.wtls.stream().filter(c -> !Objects.isNull(c.getModelId()) && model.contains(c.getModelId()))
+//                .map(ot->ot.getId()).collect(Collectors.toList());
 
-        List<ProEconEquipmentInfoDay1> listls =proEconEquipmentInfoDay1Service.list(qw);
 
         List<ProEconEquipmentInfoDay1> list = new ArrayList<>();
-        for (ProBasicOrganizeTree wt : wtls){
-            for (ProEconEquipmentInfoDay1 lst : listls) {
-                if (lst.getWindturbineId().equals(wt.getId())){
-                    list.add(lst);
-                }
-            }
-        }
+
+//        for (ProBasicOrganizeTree wt : wtls){
+//            for (ProEconEquipmentInfoDay1 lst : listls) {
+//                if (lst.getWindturbineId().equals(wt.getId())){
+//                    list.add(lst);
+//                }
+//            }
+//        }
 
         if (!type.equals(TYPE_DATE))
-            list = list.stream().filter(a -> a.getWindpowerstationId() != null || a.getProjectId() != null ||
-                    a.getLineId() != null || a.getWindturbineId() != null || a.getSquareId() != null ||
-                    a.getId() != null).collect(Collectors.toList());
-        for (ProEconEquipmentInfoDay1 i : list) {
-            WxsslVo vo = new WxsslVo();
+//            peeidls = peeidls.stream().filter(a -> a.getWindpowerstationId() != null || a.getProjectId() != null ||
+//                    a.getLineId() != null || a.getWindturbineId() != null || a.getSquareId() != null ||
+//                    a.getId() != null).collect(Collectors.toList());
+
+        for (List<ProEconEquipmentInfoDay1> peeidl : peeidls) {
+            for (ProEconEquipmentInfoDay1 i : peeidl) {
+                WxsslVo vo = new WxsslVo();
+
+                if (type.equals(TYPE_WIND)) {
+                    vo.setId(i.getWindpowerstationId());
+                    vo.setName(i.getWindturbineId());
+                    vo.setOrdernum(station.get(i.getWindpowerstationId()).doubleValue());
+                } else if (type.equals(TYPE_PROJECT)) {
+                    vo.setId(i.getProjectId());
+                    vo.setName(CacheContext.pjmap.get(i.getProjectId().trim()).getModelId());
+                    vo.setOrdernum(CacheContext.pjmap.get(i.getProjectId().trim()).getOrderNum().doubleValue());
+                } else if (type.equals(TYPE_LINE)) {
+                    vo.setId(i.getLineId());
+                    vo.setName(CacheContext.lnmap.get(i.getLineId().trim()).getModelId());
+                    vo.setOrdernum(CacheContext.lnmap.get(i.getLineId().trim()).getOrderNum().doubleValue());
+                } else if (type.equals(TYPE_WINDTURBINE)) {
+                    vo.setId(i.getWindturbineId());
+                    vo.setName(CacheContext.wtmap.get(i.getWindturbineId().trim()).getModelId());
+                    vo.setOrdernum(CacheContext.wtmap.get(i.getWindturbineId().trim()).getOrderNum().doubleValue());
+                } else if (type.equals(TYPE_SQUARE)) {
+                    vo.setId(i.getSquareId());
+                    vo.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getSquareId()).getModelId());
+                    vo.setOrdernum(CacheContext.proBasicOrganizeTreesMap.get(i.getSquareId()).getOrderNum().doubleValue());
+                } else if (type.equals(TYPE_COMPANY)) {
+                    vo.setId(i.getId());
+                    vo.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getAname());
+                    vo.setOrdernum(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getOrderNum().doubleValue());
+                }
 
-            if (type.equals(TYPE_WIND)) {
-                vo.setId(i.getWindpowerstationId());
-                vo.setName(CacheContext.wpmap.get(i.getWindpowerstationId().trim()).getAname());
-                vo.setOrdernum(station.get(i.getWindpowerstationId()).doubleValue());
-            } else if (type.equals(TYPE_PROJECT)) {
-                vo.setId(i.getProjectId());
-                vo.setName(CacheContext.pjmap.get(i.getProjectId().trim()).getAname());
-                vo.setOrdernum(CacheContext.pjmap.get(i.getProjectId().trim()).getOrderNum().doubleValue());
-            } else if (type.equals(TYPE_LINE)) {
-                vo.setId(i.getLineId());
-                vo.setName(CacheContext.lnmap.get(i.getLineId().trim()).getAname());
-                vo.setOrdernum(CacheContext.lnmap.get(i.getLineId().trim()).getOrderNum().doubleValue());
-            } else if (type.equals(TYPE_WINDTURBINE)) {
-                vo.setId(i.getWindturbineId());
-                vo.setName(CacheContext.wtmap.get(i.getWindturbineId().trim()).getModelId());
-                vo.setOrdernum(CacheContext.wtmap.get(i.getWindturbineId().trim()).getOrderNum().doubleValue());
-            } else if (type.equals(TYPE_SQUARE)) {
-                vo.setId(i.getSquareId());
-                vo.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getSquareId()).getAname());
-                vo.setOrdernum(CacheContext.proBasicOrganizeTreesMap.get(i.getSquareId()).getOrderNum().doubleValue());
-            } else if (type.equals(TYPE_COMPANY)) {
-                vo.setId(i.getId());
-                vo.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getAname());
-                vo.setOrdernum(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getOrderNum().doubleValue());
+                vo.setDate(i.getRecordDate());
+                vo.setFdl(DoubleUtils.keepPrecision(i.getRfdl() / 10000, 2));
+                vo.setLlfdl(DoubleUtils.keepPrecision(i.getRllfdl() / 10000, 2));
+                vo.setJxssdl(DoubleUtils.keepPrecision((i.getRjxssdl() + i.getRcnsljxssdl()) / 10000, 2));
+                vo.setGzssdl(DoubleUtils.keepPrecision((i.getRgzssdl() + i.getRcnslgzssdl()) / 10000, 2));
+                vo.setXdssdl(DoubleUtils.keepPrecision((i.getRxdtjssdl() + i.getRxdjclssdl()) / 10000, 2));
+                vo.setSlssdl(DoubleUtils.keepPrecision((i.getRcwsltqssdl() + i.getRcwsldwssdl()) / 10000, 2));
+                vo.setXnssdl(DoubleUtils.keepPrecision((i.getRdjssdl() + i.getRsdtjssdl() + i.getRqxjclssdl() + i.getRxnssdl()) / 10000, 2));
+                vo.setZssdl(DoubleUtils.keepPrecision(vo.getGzssdl() + vo.getJxssdl() + vo.getXdssdl() + vo.getXnssdl() + vo.getSlssdl(), 2));
+                vo.setFnlyl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getFdl() / vo.getLlfdl() * 100, 2) : 0);
+                vo.setGzssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getGzssdl() / vo.getLlfdl() * 100, 2) : 0);
+                vo.setJxssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getJxssdl() / vo.getLlfdl() * 100, 2) : 0);
+                vo.setQfl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getXdssdl() / vo.getLlfdl() * 100, 2) : 0);
+                vo.setXnssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getXnssdl() / vo.getLlfdl() * 100, 2) : 0);
+                vo.setSlssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getSlssdl() / vo.getLlfdl() * 100, 2) : 0);
+                resultList.add(vo);
             }
 
-            vo.setDate(i.getRecordDate());
-            vo.setFdl(DoubleUtils.keepPrecision(i.getRfdl() / 10000, 2));
-            vo.setLlfdl(DoubleUtils.keepPrecision(i.getRllfdl() / 10000, 2));
-            vo.setJxssdl(DoubleUtils.keepPrecision((i.getRjxssdl() + i.getRcnsljxssdl()) / 10000, 2));
-            vo.setGzssdl(DoubleUtils.keepPrecision((i.getRgzssdl() + i.getRcnslgzssdl()) / 10000, 2));
-            vo.setXdssdl(DoubleUtils.keepPrecision((i.getRxdtjssdl() + i.getRxdjclssdl()) / 10000, 2));
-            vo.setSlssdl(DoubleUtils.keepPrecision((i.getRcwsltqssdl() + i.getRcwsldwssdl()) / 10000, 2));
-            vo.setXnssdl(DoubleUtils.keepPrecision((i.getRdjssdl() + i.getRsdtjssdl() + i.getRqxjclssdl() + i.getRxnssdl()) / 10000, 2));
-            vo.setZssdl(DoubleUtils.keepPrecision(vo.getGzssdl() + vo.getJxssdl() + vo.getXdssdl() + vo.getXnssdl() + vo.getSlssdl(), 2));
-            vo.setFnlyl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getFdl() / vo.getLlfdl() * 100, 2) : 0);
-            vo.setGzssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getGzssdl() / vo.getLlfdl() * 100, 2) : 0);
-            vo.setJxssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getJxssdl() / vo.getLlfdl() * 100, 2) : 0);
-            vo.setQfl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getXdssdl() / vo.getLlfdl() * 100, 2) : 0);
-            vo.setXnssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getXnssdl() / vo.getLlfdl() * 100, 2) : 0);
-            vo.setSlssl(vo.getLlfdl() != 0 ? DoubleUtils.keepPrecision(vo.getSlssdl() / vo.getLlfdl() * 100, 2) : 0);
-            resultList.add(vo);
         }
         SortUtils.sort(resultList, "llfdl", SortUtils.DESC);
         for (int i = 0; i < resultList.size(); i++) {