فهرست منبع

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/ZllglDTO.java
wangchangsheng 2 سال پیش
والد
کامیت
8b9c98993d
17فایلهای تغییر یافته به همراه447 افزوده شده و 196 حذف شده
  1. 3 0
      common/src/main/java/com/gyee/common/contant/ContantXk.java
  2. 142 7
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/AccessStatusService.java
  3. 1 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java
  4. 49 48
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/ElectricityMeteringService.java
  5. 1 1
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicEquipmentController.java
  6. 1 1
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicLineController.java
  7. 1 1
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicMeterPointController.java
  8. 1 1
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicPowerstationPointController.java
  9. 38 0
      web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/model/auto/ProBasicPowerstation.java
  10. 8 5
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineDetailLineChartController.java
  11. 9 5
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineDetailPieChartAController.java
  12. 24 12
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineGoodnessDetailController.java
  13. 2 1
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/ZllglDTO.java
  14. 9 5
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WpwindDayInfoService.java
  15. 16 12
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WtwindDayInfoService.java
  16. 141 96
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java
  17. 1 1
      web/runeconomy-xk/src/main/resources/application.yml

+ 3 - 0
common/src/main/java/com/gyee/common/contant/ContantXk.java

@@ -192,6 +192,9 @@ public class ContantXk {
     public static final String INTERRUPTIONGF ="AIG013,AIG017,AIG009,AIG006";
 
 
+    public static final String QCZT = "QCZT";
+
+
 
 
 

+ 142 - 7
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/AccessStatusService.java

@@ -2,28 +2,163 @@ package com.gyee.generation.service.realtimelibrary;
 /*
 @author   谢生杰
 @date   2022/11/29-9:56
+秒刷新
 */
 
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.DateUtils;
 import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.ProBasicMeterPoint;
-import com.gyee.generation.model.auto.ProBasicPowerstation;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.util.PointUtil;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class AccessStatusService {
+    @Resource
+    private IEdosUtil edosUtil;
+    @Value("${second}")
+    private String second;
 
-    public void accessStatus(){
+    /**
+     * 场站接入状态
+     * @throws Exception
+     */
+    public void accessStatus() throws Exception {
 
-
-        Map<String, ProBasicMeterPoint> meterpointMap = CacheContext.meterpointMap;
+        List<PointData> resultList = new ArrayList<>();
+        List<ProBasicMeterPoint> meterpoints = CacheContext.meterpoints;
         List<ProBasicPowerstation> wpls = CacheContext.wpls;
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
+        List<ProBasicWeatherStation> wswpls = CacheContext.wswpls;
+        Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> wswppointmap = CacheContext.wswppointmap;
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Date currentDate = DateUtils.getCurrentDate();
 
         wpls.stream().forEach(wp->{
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wp.getId());
+            ProBasicPowerstationPoint djlpoint = powerstationPointMap.get(ContantXk.DQJRZT);
+            ProBasicPowerstationPoint agcpoint = powerstationPointMap.get(ContantXk.AGCJRZT);
+            ProBasicPowerstationPoint glycpoint = powerstationPointMap.get(ContantXk.GLYCJRZT);
+            ProBasicPowerstationPoint cftpoint = powerstationPointMap.get(ContantXk.QXZJRZT);
+            ProBasicPowerstationPoint sbjrpoint = powerstationPointMap.get(ContantXk.SBJRZT);
+
+            ProBasicPowerstationPoint qcztPoint = powerstationPointMap.get(ContantXk.QCZT);
+            double djlzt = 0;
+            double fjzt = 0;
+            double agczt = 0;
+            double glyczt = 0;
+            double cftzt = 0;
+            Optional<ProBasicMeterPoint> swdlOptional = meterpoints.stream().filter(me -> me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("出线") && me.getMeterSort().equals("主")).findFirst();
+            Optional<ProBasicSubStation> subStationOptional = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).findFirst();
+            Optional<ProBasicWeatherStation> wsOptional = wswpls.stream().filter(ws -> ws.getWindpowerstationId().equals(wp.getId())).findFirst();
+            try {
+                double qczt = edosUtil.getSectionData(qcztPoint, currentDate.getTime()).getPointValueInDouble();
+                if (qczt == 6){
+                    fjzt = 1;
+                }
 
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (swdlOptional.isPresent()){
+                ProBasicMeterPoint proBasicMeterPoint = swdlOptional.get();
+                try {
+                    Long pointTime = edosUtil.getRealData(proBasicMeterPoint.getNemCode()).getPointTime();
+                    if ((currentDate.getTime() - pointTime) / 1000 > Integer.parseInt(second)){
+                        djlzt = 1;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            if (wsOptional.isPresent()){
+                Map<String, ProBasicPowerstationPoint> basicPowerstationPointMap = wswppointmap.get(wsOptional.get().getId());
+                ProBasicPowerstationPoint proBasicPowerstationPoint = basicPowerstationPointMap.get(ContantXk.FCCFTWD);
+                try {
+                    Long pointTime = edosUtil.getRealData(proBasicPowerstationPoint.getNemCode()).getPointTime();
+                    if ((currentDate.getTime() - pointTime) / 1000 > Integer.parseInt(second)){
+                        cftzt = 1;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            if (subStationOptional.isPresent()){
+                Map<String, ProBasicPowerstationPoint> basicPowerstationPointMap = subwppointmap.get(subStationOptional.get().getId());
+                ProBasicPowerstationPoint agcpowerstationPoint = basicPowerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
+                try {
+                    Long pointTime = edosUtil.getRealData(agcpowerstationPoint.getNemCode()).getPointTime();
+                    if ((currentDate.getTime() - pointTime) / 1000 > Integer.parseInt(second)){
+                        agczt = 1;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                ProBasicPowerstationPoint glycpowerstationPoint = basicPowerstationPointMap.get(ContantXk.TPOINT_WP_YCGL);
+                try {
+                    Long pointTime = edosUtil.getRealData(glycpowerstationPoint.getNemCode()).getPointTime();
+                    if ((currentDate.getTime() - pointTime) / 1000 > Integer.parseInt(second)){
+                        glyczt = 1;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            resultList.add(PointUtil.createPointData(currentDate,djlzt,djlpoint.getNemCode(),djlpoint.getName()));
+            resultList.add(PointUtil.createPointData(currentDate,agczt,agcpoint.getNemCode(),agcpoint.getName()));
+            resultList.add(PointUtil.createPointData(currentDate,glyczt,glycpoint.getNemCode(),glycpoint.getName()));
+            resultList.add(PointUtil.createPointData(currentDate,cftzt,cftpoint.getNemCode(),cftpoint.getName()));
+            resultList.add(PointUtil.createPointData(currentDate,fjzt,sbjrpoint.getNemCode(),sbjrpoint.getName()));
         });
+        edosUtil.sendMultiPoint(resultList);
 
     }
+
+    /**
+     * 全场状态
+     */
+    public void fullFieldState() throws Exception {
+        List<PointData> resultList = new ArrayList<>();
+        Date currentDate = DateUtils.getCurrentDate();
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+        Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, List<ProBasicEquipment>> wpwtmap = CacheContext.wpwtmap;
+        wpls.stream().forEach(wp->{
+            Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wp.getId());
+            ProBasicPowerstationPoint powerstationPoint = powerstationPointMap.get(ContantXk.QCZT);
+            List<ProBasicEquipment> proBasicEquipments = wpwtmap.get(wp.getId());
+            List<String> pointIds = new ArrayList<>();
+            proBasicEquipments.stream().forEach(wt->{
+                ProBasicEquipmentPoint equipmentPoint = wtpAimap.get(wt.getId()).get(ContantXk.SBZT);
+                pointIds.add(equipmentPoint.getNemCode());
+            });
+            double zt = 0;
+            try {
+                List<PointData> realData = edosUtil.getRealData(pointIds);
+                List<Double> doubles = realData.stream().map(real -> real.getPointValueInDouble()).collect(Collectors.toList());
+                if (Collections.max(doubles).equals(Collections.min(doubles))){
+                    zt = Collections.max(doubles);
+                }else if(doubles.stream().filter(i->i.equals(1)).collect(Collectors.toList()).size()>0){
+                    zt = 1;
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            resultList.add(PointUtil.createPointData(currentDate,zt,powerstationPoint.getNemCode(),powerstationPoint.getName()));
+        });
+        edosUtil.sendMultiPoint(resultList);
+    }
+
+
+
+
 }

+ 1 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java

@@ -20,6 +20,7 @@ import java.util.stream.Collectors;
 @author   谢生杰
 @date   2022/11/9-9:29
 计算日月年
+15分钟
 */
 @Service
 public class CycleCalculationService {

+ 49 - 48
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/ElectricityMeteringService.java

@@ -51,6 +51,7 @@ public class ElectricityMeteringService {
         Date yearFirstZero = DateUtils.getYearFirstZero();
         Date currentDate = DateUtils.getCurrentDate();
         Date tomorrow = DateUtils.addDays(samedayZero,1);
+        Date date = DateUtils.addSeconds(currentDate, -1);
 
         List<PointData> lineResultList = new ArrayList<>();
         lnls.stream().forEach(line->{
@@ -58,30 +59,30 @@ public class ElectricityMeteringService {
             //线路发电量
             log.info(line.getName()+"电计量电量计算开始!");
             Optional<ProBasicMeterPoint> fdlOptional = meterpoints.stream().filter(me -> me.getLineId().equals(line.getId()) &&   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("进线") && me.getMeterSort().equals("主")).findFirst();
-            getLineFdl(samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, proBasicWppointMap, fdlOptional);
+            getLineFdl(samedayZero, monthFirstZero, yearFirstZero, date,currentDate, lineResultList, proBasicWppointMap, fdlOptional);
             log.info(line.getName()+"电计量电量计算完毕!");
 
             //线路上网电量
             log.info(line.getName()+"电计量上网电量计算开始!");
             List<PointData> fdlList = new ArrayList<>();
             Optional<ProBasicMeterPoint> swdlOptional = meterpoints.stream().filter(me ->   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("出线") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
-            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, swdlOptional);
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, date,currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, swdlOptional);
             log.info(line.getName()+"电计量上网电量计算完毕!");
             //线路购网电量
             log.info(line.getName()+"电计量购网电量计算开始!");
             Optional<ProBasicMeterPoint> gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformCode().equals("FXYG") && me.getMeterType().equals("出线") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
-            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, gwdlOptional);
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, date,currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, gwdlOptional);
             log.info(line.getName()+"电计量购网电量计算完毕!");
 
             //线路厂用电量
             log.info(line.getName()+"电计量厂用电量计算开始!");
             Optional<ProBasicMeterPoint> zybOptional = meterpoints.stream().filter(me->   me.getUniformCode().equals("ZXYG") && me.getMeterType().equals("站用变") && me.getMeterSort().equals("主") && me.getLineId().contains(line.getId())).findFirst();
-            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, zybOptional);
+            getLineOtherFdl(linepointmap, samedayZero, monthFirstZero, yearFirstZero,date, currentDate, lineResultList, line, proBasicWppointMap, fdlOptional, fdlList, zybOptional);
             log.info(line.getName()+"电计量厂用电量计算完毕!");
 
             //农网购网电量
             log.info(line.getName()+"农网购网电量计算开始!");
-            setZero(lineResultList,currentDate,proBasicWppointMap,ContantXk.RNWGWDL,ContantXk.YNWGWDL,ContantXk.NNWGWDL);
+            setZero(lineResultList,date,currentDate,proBasicWppointMap,ContantXk.RNWGWDL,ContantXk.YNWGWDL,ContantXk.NNWGWDL);
             log.info(line.getName()+"农网购网电量计算完毕!");
         });
         //线路存储
@@ -143,39 +144,39 @@ public class ElectricityMeteringService {
                 }
             });
             ProBasicPowerstationPoint rfdlpoint = proBasicWppointMap.get(ContantXk.RFDLSYZ);
-            proResultList.add(PointUtil.createPointData(currentDate,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
             ProBasicPowerstationPoint yfdlpoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
-            proResultList.add(PointUtil.createPointData(currentDate,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
             ProBasicPowerstationPoint nfdlpoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
-            proResultList.add(PointUtil.createPointData(currentDate,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
 
             ProBasicPowerstationPoint rswdlpoint = proBasicWppointMap.get(ContantXk.RSWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
             ProBasicPowerstationPoint yswdlpoint = proBasicWppointMap.get(ContantXk.YSWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
             ProBasicPowerstationPoint nswdlpoint = proBasicWppointMap.get(ContantXk.NSWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
 
             ProBasicPowerstationPoint rgwgwdlpoint = proBasicWppointMap.get(ContantXk.RGWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
             ProBasicPowerstationPoint ygwgwdlpoint = proBasicWppointMap.get(ContantXk.YGWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
             ProBasicPowerstationPoint ngwgwdlpoint = proBasicWppointMap.get(ContantXk.NGWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
 
             ProBasicPowerstationPoint rnwgwdlpoint = proBasicWppointMap.get(ContantXk.RNWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
             ProBasicPowerstationPoint ynwgwdlpoint = proBasicWppointMap.get(ContantXk.YNWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
             ProBasicPowerstationPoint nnwgwdlpoint = proBasicWppointMap.get(ContantXk.NNWGWDL);
-            proResultList.add(PointUtil.createPointData(currentDate,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
 
             ProBasicPowerstationPoint rcydlpoint = proBasicWppointMap.get(ContantXk.RCYDL);
-            proResultList.add(PointUtil.createPointData(currentDate,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
             ProBasicPowerstationPoint ycydlpoint = proBasicWppointMap.get(ContantXk.YCYDL);
-            proResultList.add(PointUtil.createPointData(currentDate,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
             ProBasicPowerstationPoint ncydlpoint = proBasicWppointMap.get(ContantXk.NCYDL);
-            proResultList.add(PointUtil.createPointData(currentDate,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
+            proResultList.add(PointUtil.createPointData(date,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
 
         });
         //期次存储
@@ -237,39 +238,39 @@ public class ElectricityMeteringService {
                 }
             });
             ProBasicPowerstationPoint rfdlpoint = wpBasicWppointMap.get(ContantXk.RFDLSYZ);
-            wpResultList.add(PointUtil.createPointData(currentDate,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,rfdl.get(),rfdlpoint.getNemCode(),rfdlpoint.getName()));
             ProBasicPowerstationPoint yfdlpoint = wpBasicWppointMap.get(ContantXk.YFDLSYZ);
-            wpResultList.add(PointUtil.createPointData(currentDate,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,yfdl.get(),yfdlpoint.getNemCode(),yfdlpoint.getName()));
             ProBasicPowerstationPoint nfdlpoint = wpBasicWppointMap.get(ContantXk.YFDLSYZ);
-            wpResultList.add(PointUtil.createPointData(currentDate,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,nfdl.get(),yfdlpoint.getNemCode(),nfdlpoint.getName()));
 
             ProBasicPowerstationPoint rswdlpoint = wpBasicWppointMap.get(ContantXk.RSWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,rswdl.get(),rswdlpoint.getNemCode(),rswdlpoint.getName()));
             ProBasicPowerstationPoint yswdlpoint = wpBasicWppointMap.get(ContantXk.YSWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,yswdl.get(),yswdlpoint.getNemCode(),yswdlpoint.getName()));
             ProBasicPowerstationPoint nswdlpoint = wpBasicWppointMap.get(ContantXk.NSWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,nswdl.get(),nswdlpoint.getNemCode(),nswdlpoint.getName()));
 
             ProBasicPowerstationPoint rgwgwdlpoint = wpBasicWppointMap.get(ContantXk.RGWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,rgwgwdl.get(),rgwgwdlpoint.getNemCode(),rgwgwdlpoint.getName()));
             ProBasicPowerstationPoint ygwgwdlpoint = wpBasicWppointMap.get(ContantXk.YGWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,ygwgwdl.get(),ygwgwdlpoint.getNemCode(),ygwgwdlpoint.getName()));
             ProBasicPowerstationPoint ngwgwdlpoint = wpBasicWppointMap.get(ContantXk.NGWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,ngwgwdl.get(),ngwgwdlpoint.getNemCode(),ngwgwdlpoint.getName()));
 
             ProBasicPowerstationPoint rnwgwdlpoint = wpBasicWppointMap.get(ContantXk.RNWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,rnwgwdl.get(),rnwgwdlpoint.getNemCode(),rnwgwdlpoint.getName()));
             ProBasicPowerstationPoint ynwgwdlpoint = wpBasicWppointMap.get(ContantXk.YNWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,ynwgwdl.get(),ynwgwdlpoint.getNemCode(),ynwgwdlpoint.getName()));
             ProBasicPowerstationPoint nnwgwdlpoint = wpBasicWppointMap.get(ContantXk.NNWGWDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,nnwgwdl.get(),nnwgwdlpoint.getNemCode(),nnwgwdlpoint.getName()));
 
             ProBasicPowerstationPoint rcydlpoint = wpBasicWppointMap.get(ContantXk.RCYDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,rcydl.get(),rcydlpoint.getNemCode(),rcydlpoint.getName()));
             ProBasicPowerstationPoint ycydlpoint = wpBasicWppointMap.get(ContantXk.YCYDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,ycydl.get(),ycydlpoint.getNemCode(),ycydlpoint.getName()));
             ProBasicPowerstationPoint ncydlpoint = wpBasicWppointMap.get(ContantXk.NCYDL);
-            wpResultList.add(PointUtil.createPointData(currentDate,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
+            wpResultList.add(PointUtil.createPointData(date,ncydl.get(),ncydlpoint.getNemCode(),ncydlpoint.getName()));
 
         });
         //场站存储
@@ -282,10 +283,10 @@ public class ElectricityMeteringService {
     }
 
 
-    private void setZero(List<PointData> resultList, Date currentDate, Map<String, ProBasicPowerstationPoint> linemap, String rcode, String ycode, String ncode) {
+    private void setZero(List<PointData> resultList,Date date, Date currentDate, Map<String, ProBasicPowerstationPoint> linemap, String rcode, String ycode, String ncode) {
         //线路日发电量
         PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
+        r.setPointTime(date.getTime());
         r.setPointValue("0");
         r.setPointValueInDouble(0);
         r.setEdnaId(linemap.get(rcode).getNemCode());
@@ -293,7 +294,7 @@ public class ElectricityMeteringService {
         resultList.add(r);
         //线路月发电量
         PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
+        y.setPointTime(date.getTime());
         y.setPointValue("0");
         y.setPointValueInDouble(0);
         y.setEdnaId(linemap.get(ycode).getNemCode());
@@ -301,7 +302,7 @@ public class ElectricityMeteringService {
         resultList.add(y);
         //线路年发电量
         PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
+        n.setPointTime(date.getTime());
         n.setPointValue("0");
         n.setPointValueInDouble(0);
         n.setEdnaId(linemap.get(ncode).getNemCode());
@@ -309,13 +310,13 @@ public class ElectricityMeteringService {
         resultList.add(n);
     }
 
-    private void getLineOtherFdl(Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, List<PointData> lineResultList, ProBasicLine line, Map<String, ProBasicPowerstationPoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional, List<PointData> fdlList, Optional<ProBasicMeterPoint> swdlOptional) {
+    private void getLineOtherFdl(Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date date,Date currentDate, List<PointData> lineResultList, ProBasicLine line, Map<String, ProBasicPowerstationPoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional, List<PointData> fdlList, Optional<ProBasicMeterPoint> swdlOptional) {
         if (swdlOptional.isPresent()){
             ProBasicMeterPoint swdlMeterpoint = swdlOptional.get();
             if (StringUtils.isEmpty(fdlList)){
                 String[] lines = swdlMeterpoint.getLineId().split("\\|");
                 Arrays.stream(lines).forEach(l->{
-                    getLineFdl(samedayZero, monthFirstZero, yearFirstZero, currentDate, fdlList, proBasicWppointMap, fdlOptional);
+                    getLineFdl(samedayZero, monthFirstZero, yearFirstZero, date,currentDate, fdlList, proBasicWppointMap, fdlOptional);
                 });
             }
             //获取电量百分比,算其他电量
@@ -339,17 +340,17 @@ public class ElectricityMeteringService {
                 //线路上网电量
                 double xlswdl = (real - sameday) * magnification / xs * percentageMap.get("percentage");
                 ProBasicPowerstationPoint rpoint = proBasicWppointMap.get(ContantXk.RSWDL);
-                PointData rpointData = PointUtil.createPointData(currentDate, xlswdl, rpoint.getNemCode(), rpoint.getName());
+                PointData rpointData = PointUtil.createPointData(date, xlswdl, rpoint.getNemCode(), rpoint.getName());
                 lineResultList.add(rpointData);
                 //线路月上网发电量
                 double xlyswdl = (real - month) * magnification / xs * percentageMap.get("ypercentage");
                 ProBasicPowerstationPoint ypoint = proBasicWppointMap.get(ContantXk.YSWDL);
-                PointData ypointData = PointUtil.createPointData(currentDate, xlyswdl, ypoint.getNemCode(), ypoint.getName());
+                PointData ypointData = PointUtil.createPointData(date, xlyswdl, ypoint.getNemCode(), ypoint.getName());
                 lineResultList.add(ypointData);
                 //线路年上网发电量
                 double xlnswfdl = (real - year) * magnification / xs * percentageMap.get("npercentage");
                 ProBasicPowerstationPoint npoint = proBasicWppointMap.get(ContantXk.NSWDL);
-                PointData npointData = PointUtil.createPointData(currentDate, xlnswfdl, npoint.getNemCode(), npoint.getName());
+                PointData npointData = PointUtil.createPointData(date, xlnswfdl, npoint.getNemCode(), npoint.getName());
                 lineResultList.add(npointData);
 
             } catch (Exception e) {
@@ -358,7 +359,7 @@ public class ElectricityMeteringService {
         }
     }
 
-    private void getLineFdl(Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, List<PointData> lineResultList, Map<String, ProBasicPowerstationPoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional) {
+    private void getLineFdl(Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date date,Date currentDate, List<PointData> lineResultList, Map<String, ProBasicPowerstationPoint> proBasicWppointMap, Optional<ProBasicMeterPoint> fdlOptional) {
         if (fdlOptional.isPresent()){
             ProBasicMeterPoint proBasicMeterPoint = fdlOptional.get();
             String pointid = proBasicMeterPoint.getId();
@@ -377,17 +378,17 @@ public class ElectricityMeteringService {
                 //线路日发电量
                 double xlrfdl = (real - sameday) * magnification / xs;
                 ProBasicPowerstationPoint rpoint = proBasicWppointMap.get(ContantXk.RFDLSYZ);
-                PointData r = PointUtil.createPointData(currentDate, xlrfdl, rpoint.getNemCode(),rpoint.getName());
+                PointData r = PointUtil.createPointData(date, xlrfdl, rpoint.getNemCode(),rpoint.getName());
                 lineResultList.add(r);
                 //线路月发电量
                 double xlyfdl = (real - month) * magnification / xs;
                 ProBasicPowerstationPoint ypoint = proBasicWppointMap.get(ContantXk.YFDLSYZ);
-                PointData y = PointUtil.createPointData(currentDate, xlyfdl,ypoint.getNemCode(),ypoint.getName());
+                PointData y = PointUtil.createPointData(date, xlyfdl,ypoint.getNemCode(),ypoint.getName());
                 lineResultList.add(y);
                 //线路年发电量
                 double xlnfdl = (real - year) * magnification / xs;
                 ProBasicPowerstationPoint npoint = proBasicWppointMap.get(ContantXk.NFDLSYZ);
-                PointData n = PointUtil.createPointData(currentDate, xlnfdl,npoint.getNemCode(),npoint.getName());
+                PointData n = PointUtil.createPointData(date, xlnfdl,npoint.getNemCode(),npoint.getName());
                 lineResultList.add(n);
             } catch (Exception e) {
                 e.printStackTrace();

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicEquipmentController.java

@@ -33,7 +33,7 @@ public class ProBasicEquipmentController {
     /**
      * 查询
      * @param id
-     * @param code
+     * @param nemCode
      * @param companyId
      * @param regionId
      * @param windpowerstationId

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicLineController.java

@@ -33,7 +33,7 @@ public class ProBasicLineController {
     /**
      * 查询
      * @param id
-     * @param code
+     * @param nemCode
      * @param name
      * @param aname
      * @param pageNum

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicMeterPointController.java

@@ -33,7 +33,7 @@ public class ProBasicMeterPointController {
      * 查询
      *
      * @param id
-     * @param code
+     * @param nemCode
      * @param windpowerstationId
      * @param name
      * @param pageNum

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicPowerstationPointController.java

@@ -34,7 +34,7 @@ public class ProBasicPowerstationPointController {
      * 查询
      *
      * @param id
-     * @param code
+     * @param nemCode
      * @param name
      * @param model
      * @param uniformCode

+ 38 - 0
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/model/auto/ProBasicPowerstation.java

@@ -1,6 +1,7 @@
 package com.gyee.backconfig.model.auto;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -226,6 +227,43 @@ public class ProBasicPowerstation extends Model {
      */
     private String spare4;
 
+    /**
+     * 核准容量
+     */
+    private BigDecimal appCapacity;
+
+    /**
+     * 在建容量
+     */
+    private BigDecimal conCapacity;
+
+    /**
+     * 并网容量
+     */
+    private BigDecimal gridCapacity;
+
+    private BigDecimal hoiCapacity;
+
+    /**
+     * 首批并网时间
+     */
+    private LocalDate firstGridTime;
+
+    /**
+     * 整场投运时间
+     */
+    private LocalDate wholeGridTime;
+
+    /**
+     * 测风塔数量
+     */
+    private Integer anemoNumber;
+
+    /**
+     * 升压站数量
+     */
+    private Integer stationNumber;
+
 
     @TableField(exist = false)
     private List<ProBasicProject> Children = new ArrayList<>();

+ 8 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineDetailLineChartController.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.controller.goodness;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.common.util.DateUtils;
 import com.gyee.common.vo.benchmark.DataVo;
@@ -26,7 +27,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 风机区间图表功能展示
@@ -118,10 +118,13 @@ public class WindturbineDetailLineChartController {
     public R getInputSmall(String wtId, String recorddate) throws Exception {
         Date date = DateUtils.parseDate(recorddate);
         double inputsmall=0.0;
-        List<ProEconInOrOutSpeedTotal> ls = proEconInOrOutSpeedTotalService.list().stream().filter(i->
-                i.getWindturbineId().equals(wtId)
-                && i.getRecordDate().compareTo(DateUtils.truncate(date))==0
-        ).collect(Collectors.toList());
+        QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("windturbine_id",wtId).eq("record_date",date);
+        List<ProEconInOrOutSpeedTotal> ls = proEconInOrOutSpeedTotalService.list(queryWrapper);
+//                .stream().filter(i->
+//                i.getWindturbineId().equals(wtId)
+//                && i.getRecordDate().compareTo(DateUtils.truncate(date))==0
+//        ).collect(Collectors.toList());
         if(!ls.isEmpty())
         {
             ProEconInOrOutSpeedTotal is=ls.get(0);

+ 9 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineDetailPieChartAController.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.controller.goodness;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.util.DateUtils;
 import com.gyee.runeconomy.dto.DataVo;
 import com.gyee.runeconomy.dto.R;
@@ -20,7 +21,6 @@ import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * 单机性能分析列表
@@ -54,10 +54,14 @@ public class WindturbineDetailPieChartAController {
         if (StringUtils.notEmp(recorddate) && StringUtils.notEmp(wtId) && StringUtils.notEmp(type)) {
 
             Date date= DateUtils.parseDate(recorddate);
-            List<ProEconInOrOutSpeedTotal2> ls = proEconInOrOutSpeedTotal2Service.list().stream().filter(i->
-                    i.getWindturbineId().equals(wtId)
-            && i.getRecordDate().compareTo(DateUtils.truncate(date)) ==0
-            ).collect(Collectors.toList());
+
+            QueryWrapper<ProEconInOrOutSpeedTotal2> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).eq("record_date",date);
+            List<ProEconInOrOutSpeedTotal2> ls = proEconInOrOutSpeedTotal2Service.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindturbineId().equals(wtId)
+//            && i.getRecordDate().compareTo(DateUtils.truncate(date)) ==0
+//            ).collect(Collectors.toList());
 
             if (!ls.isEmpty()) {
 

+ 24 - 12
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbineGoodnessDetailController.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.controller.goodness;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.util.DateUtils;
 import com.gyee.common.vo.benchmark.ValueVo;
 import com.gyee.runeconomy.dto.DataVo;
@@ -25,7 +26,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 风机明细信息页面
@@ -68,9 +68,12 @@ public class WindturbineGoodnessDetailController {
         if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate)) {
 
             Date date=DateUtils.parseDate(recorddate);
-            List<ProEconWtAlysisDay>  wtadls=proEconWtAlysisDayService.list().stream().filter(i->i.getWindturbineId().equals(wtId )
-           && i.getRecordDate().compareTo(date)==0
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconWtAlysisDay> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",date).eq("windturbine_id",wtId);
+            List<ProEconWtAlysisDay>  wtadls=proEconWtAlysisDayService.list(queryWrapper);
+//                    .stream().filter(i->i.getWindturbineId().equals(wtId )
+//           && i.getRecordDate().compareTo(date)==0
+//            ).collect(Collectors.toList());
 
             if(!wtadls.isEmpty())
             {
@@ -146,10 +149,15 @@ public class WindturbineGoodnessDetailController {
 
             int year=cal.get(Calendar.YEAR);
             int month=cal.get(Calendar.MONTH)+1;
-            List<ProEconWtCurveFittingMonth> wcls = proEconWtCurveFittingMonthService.list().stream().filter(i->
-                    i.getWindturbineId().equals(wtId)
-                    && i.getYear().equals(String.valueOf(year)) && i.getMonth().equals(String.valueOf(month))
-            ).collect(Collectors.toList());
+
+            QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).eq("year",year).eq("month",month);
+
+            List<ProEconWtCurveFittingMonth> wcls = proEconWtCurveFittingMonthService.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindturbineId().equals(wtId)
+//                    && i.getYear().equals(String.valueOf(year)) && i.getMonth().equals(String.valueOf(month))
+//            ).collect(Collectors.toList());
             if (!wcls.isEmpty()) {
                 if (wtmap.containsKey(wtId)) {
                     ProBasicEquipment wt = wtmap.get(wtId);
@@ -205,10 +213,14 @@ public class WindturbineGoodnessDetailController {
         if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate)) {
 
             Date date = DateUtils.parseDate(recorddate);
-            List<ProEconWtwindDayInfo> wtdls = proEconWtwindDayInfoService.list().stream().filter(i->
-                    i.getWindturbineId().equals(wtId)
-                    && i.getRecordDate().compareTo(date) ==0
-            ).collect(Collectors.toList());
+
+            QueryWrapper<ProEconWtwindDayInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).eq("record_date",date);
+            List<ProEconWtwindDayInfo> wtdls = proEconWtwindDayInfoService.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindturbineId().equals(wtId)
+//                    && i.getRecordDate().compareTo(date) ==0
+//            ).collect(Collectors.toList());
 
 
             if (!wtdls.isEmpty()) {

+ 2 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/ZllglDTO.java

@@ -1,3 +1,4 @@
+
 package com.gyee.runeconomy.dto;
 
 import lombok.Data;
@@ -11,4 +12,4 @@ public class ZllglDTO {
     private double theoryPower;
     private double ensurePower;
 
-}
+}

+ 9 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WpwindDayInfoService.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.util.DateUtils;
 import com.gyee.common.vo.benchmark.ValueVo;
 import com.gyee.runeconomy.model.auto.ProEconWpwindDayInfo;
@@ -9,7 +10,6 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class WpwindDayInfoService {
@@ -28,10 +28,14 @@ public class WpwindDayInfoService {
 
         if (StringUtils.notEmp(wpId) && StringUtils.notEmp(recorddate)) {
 
-            list = proEconWpwindDayInfoService.list().stream().filter(i->
-                    i.getWindpowerstationId().equals(wpId)
-                            && i.getRecordDate().compareTo(DateUtils.truncate(recorddate)) ==0
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconWpwindDayInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windpowerstation_id",wpId)
+                                .eq("record_date",DateUtils.truncate(recorddate));
+            list = proEconWpwindDayInfoService.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindpowerstationId().equals(wpId)
+//                            && i.getRecordDate().compareTo(DateUtils.truncate(recorddate)) ==0
+//            ).collect(Collectors.toList());
 
 
         }

+ 16 - 12
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/WtwindDayInfoService.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.util.DateUtils;
 import com.gyee.common.vo.benchmark.ValueVo;
 import com.gyee.runeconomy.model.auto.ProEconWtwindDayInfo;
@@ -12,7 +13,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 @Service
 public class WtwindDayInfoService {
@@ -32,11 +32,13 @@ public class WtwindDayInfoService {
 
 
         if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate)) {
-
-            list = proEconWtwindDayInfoService.list().stream().filter(i->
-                    i.getWindturbineId().equals(wtId)
-                            && i.getRecordDate().compareTo(DateUtils.truncate(recorddate)) ==0
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconWtwindDayInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).eq("record_date",DateUtils.truncate(recorddate));
+            list = proEconWtwindDayInfoService.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindturbineId().equals(wtId)
+//                            && i.getRecordDate().compareTo(DateUtils.truncate(recorddate)) ==0
+//            ).collect(Collectors.toList());
 
 
         }
@@ -51,12 +53,14 @@ public class WtwindDayInfoService {
         List<ProEconWtwindDayInfo> list = new ArrayList<>();
 
         if ( StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
-
-            list = proEconWtwindDayInfoService.list().stream().filter(i->
-                    i.getWindturbineId().equals(wtId)
-                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
-                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconWtwindDayInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).ge("record_date",DateUtils.truncate(beginDate)).le("record_date",DateUtils.truncate(endDate));
+            list = proEconWtwindDayInfoService.list(queryWrapper);
+//                    .stream().filter(i->
+//                    i.getWindturbineId().equals(wtId)
+//                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+//                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+//            ).collect(Collectors.toList());
 
 
         }

+ 141 - 96
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java

@@ -1,5 +1,6 @@
 package com.gyee.runeconomy.service.singleanalysis;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.model.StringUtils;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
@@ -35,21 +36,27 @@ public class SingleAnalysisService {
         List<ProEconInOrOutSpeedTotal> iostls=null;
         if(StringUtils.notEmp(wpId))
         {
-            iostls= proEconInOrOutSpeedTotalService.list()
-                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
-                            && i.getCompanyId().equals(cmId)
-                            && i.getTypes().equals(type)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("types",type).eq("record_date",recordDate)
+                    .eq("company_id",cmId).eq("windpowerstation_id",wpId);
+            iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
+//                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
+//                            && i.getCompanyId().equals(cmId)
+//                            && i.getTypes().equals(type)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }else
         {
-            iostls= proEconInOrOutSpeedTotalService.list()
-                    .stream().filter(i-> i.getCompanyId().equals(cmId)
-                            && i.getTypes().equals(type)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("types",type).eq("record_date",recordDate)
+                    .eq("company_id",cmId);
+            iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
+//                    .stream().filter(i-> i.getCompanyId().equals(cmId)
+//                            && i.getTypes().equals(type)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }
 
         //List转map
@@ -64,19 +71,25 @@ public class SingleAnalysisService {
         List<ProEconEquipmentInfoDay1> iostls=null;
         if(StringUtils.notEmp(wpId))
         {
-            iostls= proEconEquipmentInfoDay1Service.list()
-                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
-                            && i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("types",type).eq("record_date",recordDate)
+                    .eq("company_id",cmId).eq("windpowerstation_id",wpId);
+            iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
+//                            && i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }else
         {
-            iostls= proEconEquipmentInfoDay1Service.list()
-                    .stream().filter(i-> i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("types",type).eq("record_date",recordDate)
+                    .eq("company_id",cmId);
+            iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                    .stream().filter(i-> i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }
 
         //List转map
@@ -90,20 +103,26 @@ public class SingleAnalysisService {
 
         if(StringUtils.notEmp(wpId))
         {
-            iostls= proEconEquipmentInfoDay2Service.list()
-                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
-                            && i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("types",type).eq("record_date",recordDate)
+                    .eq("company_id",cmId).eq("windpowerstation_id",wpId);
+            iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
+//                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
+//                            && i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }else
         {
-            iostls= proEconEquipmentInfoDay2Service.list()
-                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
-                            && i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",recordDate)
+                    .eq("company_id",cmId);
+            iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
+//                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
+//                            && i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }
         //List转map
         Map<String, ProEconEquipmentInfoDay2> iostmap=iostls.stream().
@@ -114,13 +133,16 @@ public class SingleAnalysisService {
 
 
         List<ProEconPowerstationInfoDay5> iostls=null;
-        iostls= proEconPowerstationInfoDay5Service.list()
-                .stream().filter(i->
-                        i.getCompanyId() !=null
-                                && i.getCompanyId().equals(cmId)
-                                && i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate).isNotNull("company_id")
+                .eq("company_id",cmId);
+        iostls= proEconPowerstationInfoDay5Service.list(queryWrapper);
+//                .stream().filter(i->
+//                        i.getCompanyId() !=null
+//                                && i.getCompanyId().equals(cmId)
+//                                && i.getRecordDate().compareTo(recordDate) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconPowerstationInfoDay5> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconPowerstationInfoDay5::getWindpowerstationId, Function.identity(), (key1, key2) -> key2));
@@ -133,19 +155,25 @@ public class SingleAnalysisService {
         List<ProEconEquipmentInfoDay4> iostls= null;
         if(StringUtils.notEmp(wpId))
         {
-            iostls= proEconEquipmentInfoDay4Service.list()
-                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
-                            && i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",recordDate)
+                    .eq("company_id",cmId).eq("windpowerstation_id",wpId);
+            iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
+//                    .stream().filter(i->i.getWindpowerstationId().equals(wpId)
+//                            && i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }else
         {
-            iostls= proEconEquipmentInfoDay4Service.list()
-                    .stream().filter(i-> i.getCompanyId().equals(cmId)
-                            && i.getRecordDate().compareTo(recordDate) == 0
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",recordDate)
+                    .eq("company_id",cmId).eq("windpowerstation_id",wpId);
+            iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
+//                    .stream().filter(i-> i.getCompanyId().equals(cmId)
+//                            && i.getRecordDate().compareTo(recordDate) == 0
+//                    )
+//                    .collect(Collectors.toList());
         }
         //List转map
         Map<String, ProEconEquipmentInfoDay4> iostmap=iostls.stream().
@@ -157,11 +185,14 @@ public class SingleAnalysisService {
     private Map<String, ProEconInOrOutSpeedTotal> queryInOrOutSpeedTotalByWt(String wtId, Date recordDate) {
 
 
-        List<ProEconInOrOutSpeedTotal> iostls= proEconInOrOutSpeedTotalService.list()
-                .stream().filter(i->i.getWindturbineId().equals(wtId)
-                        && i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate)
+                .eq("windturbine_id",wtId);
+        List<ProEconInOrOutSpeedTotal> iostls= proEconInOrOutSpeedTotalService.list(queryWrapper);
+//                .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                        && i.getRecordDate().compareTo(recordDate) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconInOrOutSpeedTotal> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconInOrOutSpeedTotal::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -170,12 +201,14 @@ public class SingleAnalysisService {
 
     private Map<String, ProEconEquipmentInfoDay1> queryEquipmentInfoDay1ByWt(String wtId,  Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list()
-                .stream().filter(i->i.getWindturbineId().equals(wtId)
-                        && i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate)
+                .eq("windturbine_id",wtId);
+        List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                        && i.getRecordDate().compareTo(recordDate) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay1> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay1::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -183,12 +216,14 @@ public class SingleAnalysisService {
     }
     private Map<String, ProEconEquipmentInfoDay2> queryEquipmentInfoDay2ByWt(String wtId,  Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list()
-                .stream().filter(i->i.getWindturbineId().equals(wtId)
-                        && i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate)
+                .eq("windturbine_id",wtId);
+        List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
+//                .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                        && i.getRecordDate().compareTo(recordDate) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay2> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay2::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -198,12 +233,14 @@ public class SingleAnalysisService {
 
     private Map<String, ProEconEquipmentInfoDay4> queryEquipmentInfoDay4ByWt(String wtId, Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list()
-                .stream().filter(i->i.getWindturbineId().equals(wtId)
-                        && i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate)
+                .eq("windturbine_id",wtId);
+        List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
+//                .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                        && i.getRecordDate().compareTo(recordDate) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay4> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay4::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -735,13 +772,15 @@ public class SingleAnalysisService {
             Map<String,Map<Long,ProEconEquipmentInfoDay1>> day1map=new HashMap<>();
             Map<String,Map<Long,ProEconEquipmentInfoDay2>> day2map=new HashMap<>();
 
-
-            List<ProEconEquipmentInfoDay1> wtday1ls = proEconEquipmentInfoDay1Service.list()
-                    .stream().filter(i->i.getWindturbineId() !=null && i.getWindturbineId().equals(wtId)
-                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
-                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",wtId).ge("record_date",beginDate)
+           .le("record_date",endDate);
+            List<ProEconEquipmentInfoDay1> wtday1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                    .stream().filter(i->i.getWindturbineId() !=null && i.getWindturbineId().equals(wtId)
+//                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+//                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+//                    )
+//                    .collect(Collectors.toList());
            if(!wtday1ls.isEmpty())
            {
                for(ProEconEquipmentInfoDay1 wtday1:wtday1ls)
@@ -759,12 +798,15 @@ public class SingleAnalysisService {
                    }
                }
            }
-            List<ProEconEquipmentInfoDay2> wtday2ls = proEconEquipmentInfoDay2Service.list()
-                    .stream().filter(i->i.getWindturbineId().equals(wtId)
-                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
-                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("windturbine_id",wtId).ge("record_date",beginDate)
+                    .le("record_date",endDate);
+            List<ProEconEquipmentInfoDay2> wtday2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+//                    .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+//                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+//                    )
+//                    .collect(Collectors.toList());
             if(!wtday2ls.isEmpty())
             {
                 for(ProEconEquipmentInfoDay2 wtday2:wtday2ls)
@@ -782,12 +824,15 @@ public class SingleAnalysisService {
                     }
                 }
             }
-            List<ProEconEquipmentInfoDay4> wtday4ls = proEconEquipmentInfoDay4Service.list()
-                    .stream().filter(i->i.getWindturbineId().equals(wtId)
-                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
-                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
-                    )
-                    .collect(Collectors.toList());
+            QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+            queryWrapper4.eq("windturbine_id",wtId).ge("record_date",beginDate)
+                    .le("record_date",endDate);
+            List<ProEconEquipmentInfoDay4> wtday4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+//                    .stream().filter(i->i.getWindturbineId().equals(wtId)
+//                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+//                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+//                    )
+//                    .collect(Collectors.toList());
             ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
             ProBasicPowerstation wp = CacheContext.wpmap.get(wt.getWindpowerstationId());
 

+ 1 - 1
web/runeconomy-xk/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 spring:
   profiles:
 #    active: jn
-    active: yun
+    active: xk
 #    active: xk