Sfoglia il codice sorgente

预测电量提交

Koishi 1 anno fa
parent
commit
60abee4ce9

+ 6 - 5
realtime/generationXK-service/src/main/java/com/gyee/generation/service/StationPower/StationPowerService.java

@@ -10,6 +10,7 @@ import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
 import com.gyee.generation.model.auto.ProBasicProject;
 import com.gyee.generation.model.auto.ProEconStationPower;
 import com.gyee.generation.service.auto.impl.ProEconStationPowerServiceImpl;
+import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.math.PowerCalculator;
 import com.gyee.generation.util.math.PowerIntegration;
 import com.gyee.generation.util.math.ShortTermPowerPredictionAccuracyCalculator;
@@ -67,7 +68,7 @@ public class StationPowerService {
 
         String wpId = null;
 
-//        for (int g = 0; g <= 56; g++) {
+        for (int g = 0; g <= 3; g++) {
 
             List<ProBasicProject> pjls = CacheContext.pjls;
 
@@ -586,9 +587,9 @@ public class StationPowerService {
                     }
                 }
             }
-//            beginDate = DateUtils.addDays(beginDate, -1);
-//            calendar.add(Calendar.DAY_OF_MONTH, -1);
-//            endDate = calendar.getTime();
-//        }
+            beginDate = DateUtils.addDays(beginDate, +1);
+            calendar.add(Calendar.DAY_OF_MONTH, +1);
+            endDate = calendar.getTime();
+        }
     }
 }

+ 3 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconStationPowerServiceImpl.java

@@ -26,10 +26,13 @@ public class ProEconStationPowerServiceImpl extends ServiceImpl<ProEconStationPo
             proEconStationPowers.stream().forEach(i -> {
                 QueryWrapper<ProEconStationPower> qw = new QueryWrapper<>();
                 qw.lambda().eq(ProEconStationPower::getRecordDate, i.getRecordDate());
+                qw.lambda().eq(ProEconStationPower::getWindpowerstationId, i.getWindpowerstationId());
                 qw.lambda().eq(ProEconStationPower::getId, i.getId());
                 int count = baseMapper.selectCount(qw);
                 if (count <= 0) {
                     baseMapper.insert(i);
+                } else if (count >0){
+                    baseMapper.update(i,qw);
                 }
 
             });