Ver código fonte

详情等bug修复

xushili 1 ano atrás
pai
commit
b72bb29627

+ 2 - 2
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/bmk/MyTest.java

@@ -36,8 +36,8 @@ public class MyTest implements CommandLineRunner {
                     econ.setId(i*3000+j);
                     econ.setInverterId(tree.getId());
                     econ.setIllumination((double) i);
-                    econ.setActualPower(DoubleUtils.getRoundingNum(i / 60, 2));
-                    econ.setOptimalPower(DoubleUtils.getRoundingNum(i / 55, 2));
+                    econ.setActualPower(DoubleUtils.getRoundingNum(i / 60d, 2));
+                    econ.setOptimalPower(DoubleUtils.getRoundingNum(i / 55d, 2));
                     list.add(econ);
                 }
             }

+ 23 - 15
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -6,14 +6,17 @@ import com.alibaba.fastjson.TypeReference;
 import com.gyee.common.model.StringUtils;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.model.fitting.ProBasicOrganizeEquipment;
+import com.gyee.runeconomy.model.fitting.ProEconInPowerCurveFitting;
 import com.gyee.runeconomy.service.auto.*;
 import com.gyee.runeconomy.service.fitting.IProBasicOrganizeEquipmentService;
+import com.gyee.runeconomy.service.fitting.IProEconInPowerCurveFittingService;
 import com.gyee.runeconomy.service.fitting.ProBasicOrganizeEquipmentServiceImpl;
 import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
 import com.gyee.runeconomy.util.redis.RedisService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.CommandLineRunner;
+import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -28,6 +31,7 @@ import java.util.stream.Collectors;
  * @Description : 缓存
  */
 @Component
+@Order(1)
 public class CacheContext implements CommandLineRunner {
     Logger logger = LoggerFactory.getLogger(CacheContext.class);
 
@@ -88,6 +92,8 @@ public class CacheContext implements CommandLineRunner {
     private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
     @Resource
     private IProEconWtPowerCurveFittingService wtPowerCurveFittingService;
+    @Resource
+    private IProEconInPowerCurveFittingService inPowerCurveFittingService;
 
     public static List<ProBasicBranch> bnls = new ArrayList<>();
     //    public static List<ProBasicEquipment> wtls = new ArrayList<>();
@@ -178,6 +184,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, ProBasicOrganizeTree> proBasicOrganizeTreesMap;
     public static List<ProBasicOrganizeEquipment> organizeEquipmentList;//把树形展开的设备列表
     public static List<ProEconWtPowerCurveFitting> wtPowerCurveFittingList;
+    public static List<ProEconInPowerCurveFitting> inPowerCurveFittingList;
 
     @Override
     public void run(String... args) throws Exception {
@@ -188,6 +195,7 @@ public class CacheContext implements CommandLineRunner {
 
         organizeEquipmentList = proBasicOrganizeEquipmentService.list().stream().filter(pboe -> pboe.getIsAble() == 1).collect(Collectors.toList());
         wtPowerCurveFittingList = wtPowerCurveFittingService.list();
+        inPowerCurveFittingList = inPowerCurveFittingService.list();
 
         //List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
         //Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
@@ -195,7 +203,7 @@ public class CacheContext implements CommandLineRunner {
         bnls = proBasicBranchService.list();
         //List<String> bnlids = bnls.stream().map(bnl -> bnl.getId()).collect(Collectors.toList());
         //Map<String, Object> objectMap = redisService.batchGetKeys(bnlids);
-        bnls.stream().forEach(bn -> {
+        /*bnls.stream().forEach(bn -> {
             String bnString = redisService.get(bn.getId());
             Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(bnString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
             });
@@ -208,7 +216,7 @@ public class CacheContext implements CommandLineRunner {
                 bns.add(bn);
                 wtbnmap.put(bn.getInteverId(), bns);
             }
-        });
+        });*/
 
         equipmentmodels = proEconEquipmentmodelService.list();
         equipmentmodels.stream().forEach(e -> {
@@ -395,7 +403,7 @@ public class CacheContext implements CommandLineRunner {
             wtmap.put(wt.getId(), wt);
             //标杆风机初始化
             wtstandardmap.put(wt.getId(), wt.getId());
-            String wtString = redisService.get(wt.getId());
+            /*String wtString = redisService.get(wt.getId());
             Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
             });
             wtpAimap.put(wt.getId(), stringWindturbinetestingpointnewMap);
@@ -453,7 +461,7 @@ public class CacheContext implements CommandLineRunner {
                 Map<String, ProBasicOrganizeTree> map = new HashMap<>();
                 map.put(wt.getId(), wt);
                 cmwtmap.put(wt.getOrgType().contains("ZGS"), map);
-            }
+            }*/
         });
 
 
@@ -503,28 +511,28 @@ public class CacheContext implements CommandLineRunner {
                 prolist.add(p);
                 wppromap.put(p.getOrgType().contains("STA"), prolist);
             }
-            String pjString = redisService.get(p.getId());
+            /*String pjString = redisService.get(p.getId());
             Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
             });
-            propointmap.put(p.getId(), stringWindpowerstationpointnewMap);
+            propointmap.put(p.getId(), stringWindpowerstationpointnewMap);*/
 
         });
 
 
 
         subwpls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("SBS")).collect(Collectors.toList());
-        subwpls.stream().forEach(sub->{
+        /*subwpls.stream().forEach(sub->{
 
             String subString = redisService.get(sub.getId());
             Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
             });
             subwppointmap.put(sub.getId(), stringWindpowerstationpointnewMap);
 
-        });
+        });*/
 
 
         weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
-        weawpls.stream().forEach(weather -> {
+        /*weawpls.stream().forEach(weather -> {
 
             String subString = redisService.get(weather.getId());
             Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
@@ -532,13 +540,13 @@ public class CacheContext implements CommandLineRunner {
             weatherwppointmap.put(weather.getId(), stringWindpowerstationpointnewMap);
 
 
-        });
+        });*/
 
 
 
         //树形线路
         lnls = proBasicOrganizeTrees.stream().filter(i -> StringUtils.isNotNull(pjmap.get(i.getParentCode()))).collect(Collectors.toList());
-        lnls.stream().forEach(l -> {
+        /*lnls.stream().forEach(l -> {
             lnmap.put(l.getId(), l);
             if (prolinemap.containsKey(l.getOrgType().contains("EG"))) {
                 prolinemap.get(l.getOrgType().contains("EG")).add(l);
@@ -551,7 +559,7 @@ public class CacheContext implements CommandLineRunner {
             Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
             });
             linepointmap.put(l.getId(), stringWindpowerstationpointnewMap);
-        });
+        });*/
 
 
         for (ProBasicOrganizeTree wp : wpls) {
@@ -568,14 +576,14 @@ public class CacheContext implements CommandLineRunner {
             meterpointMap.put(meterpoint.getId(), meterpoint);
         });
 
-        wpls.stream().forEach(wp->{
+        /*wpls.stream().forEach(wp->{
 
             wpmap.put(wp.getId(), wp);
             String wpString = redisService.get(wp.getId());
             Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
             });
             wppointmap.put(wp.getId(), stringMapMap);
-        });
+        });*/
 
 
 
@@ -618,4 +626,4 @@ public class CacheContext implements CommandLineRunner {
 
         logger.info("缓存结束------------------------------------------------------------");
     }
-}
+}

+ 8 - 5
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -165,6 +165,9 @@ public class BenchmarkingService {
         }
 
         List<ProEconEquipmentInfoDay1> list = proEconEquipmentInfoDay1Service.list(qw);
+        list = list.stream().filter(a -> a.getWindpowerstationId() != null || a.getProjectId() != null ||
+                a.getLineId() != null || a.getWindturbineId() != null ).collect(Collectors.toList());
+
         AtomicReference<Double> llfdl = new AtomicReference<>((double) 0);
         AtomicReference<Double> sjfdl = new AtomicReference<>((double) 0);
         AtomicReference<Double> pjfs = new AtomicReference<>((double) 0);
@@ -792,23 +795,23 @@ public class BenchmarkingService {
                 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.setName(CacheContext.pjmap.get(i.getProjectId().trim()).getNemName());
                 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.setName(CacheContext.lnmap.get(i.getLineId().trim()).getNemName());
                 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()).getAname());
+                vo.setName(CacheContext.wtmap.get(i.getWindturbineId().trim()).getNemName());
                 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.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getSquareId()).getNemName());
                 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.setName(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getNemName());
                 vo.setOrdernum(CacheContext.proBasicOrganizeTreesMap.get(i.getId()).getOrderNum().doubleValue());
             }