瀏覽代碼

修改光伏项目与场站表不算的问题

xieshengjie 3 年之前
父節點
當前提交
887d89a4e0

+ 7 - 8
src/main/java/cn/gyee/tamplate/service/analysis/AnalysisNewService.java

@@ -193,7 +193,7 @@ public class AnalysisNewService {
 //            analysissubtablebottomService.removeByMap(deleteparam);
 
             QueryWrapper<Analysissubtablebottom1> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("recorddate", DateUtils.parseDate(day)).like("wpid","FDC");
+            queryWrapper.eq("recorddate", DateUtils.parseDate(day));
             analysissubtablebottom1Service.remove(queryWrapper);
 
             Map<String, Object> deleteparam = new HashMap<>();
@@ -205,9 +205,7 @@ public class AnalysisNewService {
 
             List<Meterpointvalue> collect = meterpointvalues.stream().filter(i -> meterMap.get(i.getMeterid()) != null).filter(i -> meterMap.get(i.getMeterid()).getDescription() != null).collect(Collectors.toList());
             for (Windpowerstation station : CacheContext.stations) {
-                if (station.getId().endsWith("GDC")) {
-                    continue;
-                }
+
                 Analysismain mainValues = getMainValues(day, station.getId());
                 collect.stream().filter(i -> meterMap.get(i.getMeterid()).getWindpowerstationid().equals(station.getId())).forEach(m -> {
                     Analysissubtablebottom1 analysissubtablebottom = new Analysissubtablebottom1();
@@ -746,7 +744,8 @@ public class AnalysisNewService {
         for (String day : days) {
             Map<String, Object> bdzmap = new HashMap<>();
             bdzmap.put("recorddate", DateUtils.parseDate(day));
-            List<Analysissubtablebottom1> currentDayBdz = analysissubtablebottom1Service.listByMap(bdzmap);
+            List<Analysissubtablebottom> currentDayBdz = analysissubtablebottomService.listByMap(bdzmap);
+            List<Analysissubtablebottom1> currentDayBdz1 = analysissubtablebottom1Service.listByMap(bdzmap);
 
 
             Map<String, Object> deleteparam = new HashMap<>();
@@ -757,7 +756,7 @@ public class AnalysisNewService {
                 if (project.getWindpowerstationid().endsWith("FDC") || project.getWindpowerstationid().equals("MCH_GDC")) {
                     continue;
                 }
-                List<Analysissubtablebottom1> currentDay = currentDayBdz.stream().filter(i -> i.getWpid().equals(project.getWindpowerstationid())).collect(Collectors.toList());
+                List<Analysissubtablebottom> currentDay = currentDayBdz.stream().filter(i -> i.getWpid().equals(project.getWindpowerstationid())).collect(Collectors.toList());
                 List<String> fcfdlmeterids = wpmeterMap.get(project.getWindpowerstationid()).stream()
                         .filter(i -> (
                                 i.getMetersort().equals("主") && i.getMetertype().equals("进线") && i.getDisplaytype().equals("正向有功")
@@ -816,9 +815,9 @@ public class AnalysisNewService {
                 can.setFdl(generatingcapacity / 10000);
                 if (project.getWindpowerstationid().equals("HZJ_GDC")){
                     //首风五乙线
-                    double sfwyx = currentDayBdz.stream().filter(i -> i.getMeterid().equals(SFWYX)).findFirst().get().getDayvaluemodify();
+                    double sfwyx = currentDayBdz1.stream().filter(i -> i.getMeterid().equals(SFWYX)).findFirst().get().getDayvaluemodify();
                     //#4主变高压侧
-                    double jszbgyc = currentDayBdz.stream().filter(i -> i.getMeterid().equals(SHZBGYC)).findFirst().get().getDayvaluemodify();
+                    double jszbgyc = currentDayBdz1.stream().filter(i -> i.getMeterid().equals(SHZBGYC)).findFirst().get().getDayvaluemodify();
                     //(sfwyx*fcswfdl/(jszbgyc+fcswfdl))/10000
                     can.setSwdl((jszbgyc+fcswfdl)!=0?(sfwyx*fcswfdl/(jszbgyc+fcswfdl))/10000:0);
                 }else {

+ 2 - 1
src/test/java/cn/gyee/tamplate/AnalysisTest.java

@@ -34,7 +34,8 @@ public class AnalysisTest {
 //        analysisNewService.saveAnalysisTableBottom("2021-10-28", "2021-10-28");
 //        analysisNewService.savePvProject("2021-10-29", "2021-10-29");
 //        analysisNewService.savePvStation("2021-10-29", "2021-10-29");
-        analysisNewService.saveWindStation("2021-10-29", "2021-10-29");
+        analysisNewService.savePvProject("2021-11-22", "2021-11-22");
+        analysisNewService.savePvStation("2021-11-22", "2021-11-22");
         //  analysisNewService.savaAnalysismain("2021-04-25", "2021-04-25");
 //        analysisNewService.saveAnalysisTableBottom("2021-07-10", "2021-08-02");
 //        analysisNewService.saveWindProject("2021-10-30", "2021-10-30");