wangb@gyee-china.com 1 рік тому
батько
коміт
b70afabe74

+ 88 - 20
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/NewIvPvCurveFittingService.java

@@ -639,14 +639,17 @@ public class NewIvPvCurveFittingService {
 //        interval = 5 * 60; //5分钟-300
 
         //获得测点
-        Map<String, String> zglpoints = getPoints1(stationid,inverters, "zgl");
-        Map<String, String> llglpoints = getPoints1(stationid,inverters, "llgl");
-        Map<String, String> adypoints = getPoints1(stationid,inverters, "ady");
-        Map<String, String> bdypoints = getPoints1(stationid, inverters,"bdy");
-        Map<String, String> cdypoints = getPoints1(stationid, inverters,"cdy");
-        Map<String, String> adlpoints = getPoints1(stationid,inverters, "adl");
-        Map<String, String> bdlpoints = getPoints1(stationid, inverters,"bdl");
-        Map<String, String> cdlpoints = getPoints1(stationid, inverters,"cdl");
+//        if (inverters.size()>1){
+//            for (String s : inverters){
+
+        Map<String, String> zglpoints = getPoints1(stationid, inverters, "zgl");
+        Map<String, String> llglpoints = getPoints1(stationid, inverters, "llgl");
+        Map<String, String> adypoints = getPoints1(stationid, inverters, "ady");
+        Map<String, String> bdypoints = getPoints1(stationid, inverters, "bdy");
+        Map<String, String> cdypoints = getPoints1(stationid, inverters, "cdy");
+        Map<String, String> adlpoints = getPoints1(stationid, inverters, "adl");
+        Map<String, String> bdlpoints = getPoints1(stationid, inverters, "bdl");
+        Map<String, String> cdlpoints = getPoints1(stationid, inverters, "cdl");
 
         List<ProBasicWeatherStation> weatherStations = weatherStationService.getBaseMapper().selectList(null);
         List<ProBasicWeatherStation> collect = weatherStations.stream().filter(c -> stationid.equals(c.getWindpowerstationId())).collect(Collectors.toList());
@@ -740,6 +743,8 @@ public class NewIvPvCurveFittingService {
             infosLit.add(infos);
         }
 
+//            }
+//        }
         return infosLit;
     }
 
@@ -802,15 +807,29 @@ public class NewIvPvCurveFittingService {
 
     private Map<String, String> getPoints1(String stationid, List<String> inverters, String key) {
 
-        for (String wt : inverters) {
+//        for (String wt : inverters) {
             switch (key) {
                 case "zgl":
                     //总功率
-                    return InitialRunner.newzglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL") && c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
-                case "llgl":
-                    //总功率
-                    return InitialRunner.newllglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                    Map<String, String> intial = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap = InitialRunner.newzglMap.get(stationid).stream()
+                                .filter(c -> !c.getNemCode().equals("INTIAL") && c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
 
+                        intial.putAll(tempMap);
+                    }
+                    return intial;
+                    case "llgl":
+                    //总功率
+                        Map<String, String> intial1 = new HashMap<>();
+                        for (String wt : inverters) {
+                            Map<String, String> tempMap1 = InitialRunner.newllglMap.get(stationid).stream().filter(c -> !c.getNemCode().equals("INTIAL") &&
+                                    c.getWindturbineId().equals(wt))
+                                    .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                            intial1.putAll(tempMap1);
+                        }
+                        return intial1;
                 case "ady":
                     List<ProBasicEquipmentPoint> adyPoints = null;
                     if ("HZJ_GDC".equals(stationid)) {
@@ -821,24 +840,73 @@ public class NewIvPvCurveFittingService {
                         adyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG005");
                     }
 
-                    return adyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                    Map<String, String> intial2 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap2 = adyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId()
+                                .equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial2.putAll(tempMap2);
+                    }
+                    return intial2;
+
                 case "bdy":
                     List<ProBasicEquipmentPoint> bdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG008");
-                    return bdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+
+                    Map<String, String> intial3 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap3 = bdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial3.putAll(tempMap3);
+                    }
+                    return intial3;
+
                 case "cdy":
                     List<ProBasicEquipmentPoint> cdyPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG011");
-                    return cdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+
+                    Map<String, String> intial4 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap4 = cdyPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial4.putAll(tempMap4);
+                    }
+                    return intial4;
+
+
                 case "adl":
                     List<ProBasicEquipmentPoint> adlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG004");
-                    return adlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+
+                    Map<String, String> intial5 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap5 = adlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial5.putAll(tempMap5);
+                    }
+                    return intial5;
+
+
                 case "bdl":
                     List<ProBasicEquipmentPoint> bdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG007");
-                    return bdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+
+                    Map<String, String> intial6 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap6 = bdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial6.putAll(tempMap6);
+                    }
+                    return intial6;
+
                 case "cdl":
                     List<ProBasicEquipmentPoint> cdlPoints = proBasicEquipmentPointService.getPoints(stationid, null, "AIG010");
-                    return cdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt)).collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+
+                    Map<String, String> intial7 = new HashMap<>();
+                    for (String wt : inverters) {
+                        Map<String, String> tempMap7 = cdlPoints.stream().filter(c -> !c.getNemCode().equals("INTIAL")&& c.getWindturbineId().equals(wt))
+                                .collect(Collectors.toMap(ProBasicEquipmentPoint::getWindturbineId, ProBasicEquipmentPoint::getNemCode));
+                        intial7.putAll(tempMap7);
+                    }
+                    return intial7;
+
             }
-        }
+//        }
         return new HashMap<>();
     }
 

+ 1 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ScatterpointService.java

@@ -29,7 +29,7 @@ public class ScatterpointService {
     public Map<String, Object> dataFittingCurve(String stationid,List<String> inverters, long start, long end,int interval,int maxs,int mins,int maxpower,int minpower ){
 
         Map<String, Object> map = new HashMap<>();
-//        ProEconPowerFittingAnalySis obj = proEconPowerFittingAnalySisService.selectItemById(id);
+
         Map<String, List<PhotovoltaicInfo>> datasInfos = curveFittingService.getDatas2File1(stationid,inverters, start, end, interval);
 
         List<PhotovoltaicInfo> infos = new ArrayList<>();