Browse Source

refactor(ucp): 修改数据查询接口参数类型

- 将 ILineInfoDayService、IMeterInfoDayService、IStationInfoDayService 和 ITurbineInfoDayService 接口中的 getDatasByPartSelects 方法的最后一个参数类型从 SFunction 变为 String
- 修改了这些接口的方法签名,以适应新的参数类型
xushili 2 months ago
parent
commit
8ebf592b5e
17 changed files with 355 additions and 125 deletions
  1. 295 69
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java
  2. 2 1
      ruoyi-admin/src/main/resources/application.yml
  3. 19 9
      ruoyi-admin/src/test/java/com/ruoyi/NewTests.java
  4. 2 1
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java
  5. 1 1
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java
  6. 1 1
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java
  7. 1 1
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/ILineInfoDayService.java
  8. 1 2
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/IMeterInfoDayService.java
  9. 1 1
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/IStationInfoDayService.java
  10. 1 1
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/ITurbineInfoDayService.java
  11. 4 8
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/LineInfoDayServiceImpl.java
  12. 3 8
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/MeterInfoDayServiceImpl.java
  13. 7 5
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/ProBasicProjectPlanServiceImpl.java
  14. 6 1
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/ProEconEquipmentInfoJsServiceImpl.java
  15. 4 5
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/StationInfoDayServiceImpl.java
  16. 5 9
      universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/TurbineInfoDayServiceImpl.java
  17. 2 2
      universal-computing-platform/src/main/java/com/ruoyi/ucp/util/SqlUtil.java

+ 295 - 69
ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

@@ -25,7 +25,6 @@ import org.apache.commons.math3.fitting.WeightedObservedPoints;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.lang.reflect.Field;
@@ -38,7 +37,7 @@ import java.util.function.Function;
 import java.util.stream.Collectors;
 
 //@Service
-@Service
+//@Service
 public class JavaFunctionJobHandler extends IJobHandler {
     private static final Logger logger = LoggerFactory.getLogger(JavaFunctionJobHandler.class);
 
@@ -221,16 +220,17 @@ public class JavaFunctionJobHandler extends IJobHandler {
     }
 
     public MeterInfoDay getMeterinfoByDate(Date date, PointInfo entity) {
+        String[] split = entity.getUniformCode().split("-");
+        String mtId = split[split.length - 1];
         QueryWrapper<MeterInfoDay> wrapper = new QueryWrapper<>();
         wrapper.eq("record_date", date);
-        wrapper.eq("meter_id", entity.getUniformCode());
+        wrapper.eq("meter_id", mtId);
         List<MeterInfoDay> list = meterInfoDayService.list(wrapper);
         if (CollUtil.isEmpty(list)) {
             MeterInfoDay day = new MeterInfoDay();
             day.setStationId(entity.getStationId());
             day.setBoosterId(entity.getBoosterId());
-            String[] split = entity.getUniformCode().split("-");
-            day.setMeterId(split[split.length - 1]);
+            day.setMeterId(mtId);
             day.setRecordDate(date);
             list.add(day);
         }
@@ -1164,11 +1164,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
             fsData = fsData.stream().peek(pd -> pd.setDoubleValue(NumberUtil.round(pd.getValue() > 25 ? 25.0 : pd.getValue(), 2).doubleValue())).collect(Collectors.toList());
             Map<String, Double> loss = getTurbinePowerLoss(infoDay.getRfdl(), ztInfo, fsData, glpi.getPointDatas());
             infoDay.setJhjxss(loss.get("jxss") + loss.get("sdtj"));
-            infoDay.setFjhjxss(loss.get("gzss") + loss.get("djss") + loss.get("fdjcl"));
+            infoDay.setFjhjxss(loss.get("gzss") + loss.get("fdjcl"));
             infoDay.setXdss(loss.get("xdjcl") + loss.get("xdtj"));
             infoDay.setSlss(0.0);
             infoDay.setDjss(loss.get("djss"));
             infoDay.setGzss(loss.get("gzss"));
+            infoDay.setXnss(loss.get("xnss") + loss.get("djss"));
             //if (infoDay.getRfdl() == 0) {
             //    infoDay.setXnss(0.0);
             //} else {
@@ -1643,12 +1644,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
             TurbineInfoDay infoDay = dayMap.get(wtId);
             Map<String, Double> loss = getTurbinePowerLoss(infoDay.getRfdl(), ztMapMapInfos.get(stId).get(wtId), fsMapMap.get(stId).get(wtId), glMapMap.get(stId).get(wtId));
             infoDay.setJhjxss(loss.get("jxss") + loss.get("sdtj"));
-            infoDay.setFjhjxss(loss.get("gzss") + loss.get("djss") + loss.get("fdjcl"));
+            infoDay.setFjhjxss(loss.get("gzss") + loss.get("fdjcl"));
             infoDay.setXdss(loss.get("xdjcl") + loss.get("xdtj"));
             infoDay.setSlss(0.0);
             infoDay.setDjss(loss.get("djss"));
             infoDay.setGzss(loss.get("gzss"));
-            infoDay.setXnss(loss.get("xnss"));
+            infoDay.setXnss(loss.get("xnss") + loss.get("djss"));
             //if (infoDay.getRfdl() == 0) {
             //    infoDay.setXnss(0.0);
             //} else {
@@ -2119,8 +2120,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         List<StateAi> list = stateAiService.list();
         Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
 
-        //        Map<String, Map<Double,Double>> fitMap = new HashMap<>();
-        //        entityFs = entityFs.stream().filter(ef -> !CalcCache.keys.contains(ef.getTurbineId())).collect(Collectors.toList());
+        entityFs = entityFs.stream().filter(ef -> !CalcCache.keys.contains(ef.getTurbineId())).collect(Collectors.toList());
         for (PointInfo ef : entityFs) {
             String wtId = ef.getTurbineId();
             PointInfo glInfo = glMap.get(wtId);
@@ -2135,23 +2135,60 @@ public class JavaFunctionJobHandler extends IJobHandler {
             if (turbineZt != null) {
                 double capacity = map.get(turbineZt.getSpare()).getPowerProduction();
                 fit = dataProcessAndFit(ef, glInfo, turbineZt, CalcCache.bzgl.get(turbineZt.getSpare()), capacity);
-                //                fitMap.put(wtId, fit);
                 turbineZt.setPointDatas(null);
             }
             if (turbineAizt != null) {
                 double capacity = map.get(turbineAizt.getSpare()).getPowerProduction();
                 fit = dataProcessAndFit(ef, glInfo, turbineAizt, CalcCache.bzgl.get(turbineAizt.getSpare()), capacity);
-                //                fitMap.put(wtId, fit);
                 turbineAizt.setPointDatas(null);
             }
             ef.setPointDatas(null);
             glInfo.setPointDatas(null);
-            String key = "glqxnh:" + (end.getMonth() + 1) + ":" + wtId;
+            String key = "glqxnh:" + end.getMonth() + ":" + wtId;
+            stringRedisTemplate.opsForValue().set(key, JSON.toJSONString(fit));
+            CalcCache.fitcoef.put(key, new ConcurrentHashMap<>(fit));
+        }
+        System.out.println("苹果天涯");
+    }
+
+    public void calcGlqxnh_ha(Date start, Date end) {
+        //风速
+        List<PointInfo> entityFs = getEntity("AI066", "turbine");
+        //功率
+        List<PointInfo> entityGl = getEntity("AI114", "turbine");
+        Map<String, PointInfo> glMap = entityGl.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
+
+        Map<String, EquipmentModel> map = equipmentModelService.map();
+
+        List<PointInfo> entityAiZt = getEntity("AI422", "state");
+        Map<String, PointInfo> aiztMap = entityAiZt.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
+        List<StateAi> list = stateAiService.list();
+        Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
+
+        entityFs = entityFs.stream().filter(ef -> !CalcCache.keys.contains(ef.getTurbineId())).collect(Collectors.toList());
+        for (PointInfo ef : entityFs) {
+            String wtId = ef.getTurbineId();
+            PointInfo glInfo = glMap.get(wtId);
+            getSnapDataByEntity(ef, start, end, 60);
+            getSnapDataByEntity(glInfo, start, end, 60);
+            List<PointData> peek = ef.getPointDatas().stream().peek(pd -> pd.setDoubleValue(NumberUtil.round(pd.getValue(), 2).doubleValue())).collect(Collectors.toList());
+            ef.setPointDatas(peek);
+
+            PointInfo turbineAizt = calcTurbineAizt2(aiztMap.get(wtId), collectAi, start, end, 60);
+            Map<Double, Double> fit = new TreeMap<>();
+            if (turbineAizt != null) {
+                double capacity = map.get(turbineAizt.getSpare()).getPowerProduction();
+                fit = dataProcessAndFit(ef, glInfo, turbineAizt, CalcCache.bzgl.get(turbineAizt.getSpare()), capacity);
+                turbineAizt.setPointDatas(null);
+            }
+            ef.setPointDatas(null);
+            glInfo.setPointDatas(null);
+            String key = "glqxnh:" + end.getMonth() + ":" + wtId;
+            //String key = "glqxnh:0:" + wtId;
             stringRedisTemplate.opsForValue().set(key, JSON.toJSONString(fit));
             CalcCache.fitcoef.put(key, new ConcurrentHashMap<>(fit));
         }
         System.out.println("苹果天涯");
-        //        stringRedisTemplate.opsForValue().set("glqxnh", JSON.toJSONString(fitMap));
     }
 
     public void calcGlqxnhSurplus(Date start, Date end) {
@@ -4007,7 +4044,10 @@ public class JavaFunctionJobHandler extends IJobHandler {
         //date昨天零点
         DateTime time0 = DateUtil.offsetDay(time, -1);
         //1号主变高压侧正向有功
-        MeterInfoDay zbgyc1Day = calcMeterSimple("B-FXYG-ZBGYC1", time0, time, "ZB");
+        PointInfo zbgyc1Et = new PointInfo();
+        zbgyc1Et.setUniformCode("B-ZXYG-ZBGYC1");
+        zbgyc1Et.setStationId("NX_FGS_HA_FDC_STA");
+        MeterInfoDay zbgyc1Day = getMeterinfoByDate(time0, zbgyc1Et);
         zbgyc1Day.setHdl(0d);
         //1号主变低压侧正向有功
         MeterInfoDay zbdyc1Day = calcMeterSimple("B-ZXYG-ZBDYC1", time0, time, "ZB");
@@ -4038,7 +4078,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         meterInfoDayService.saveOrUpdateBatch(save);
     }
 
-    public void calcStationKqmd(Date date, String uniform_code) {
+    public void calcStationKqmd(Date date) {
         //date当天零点
         DateTime time = DateUtil.beginOfDay(date);
         //date昨天零点
@@ -4142,11 +4182,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
             Map<DateTime, List<Double>> dtlMap = czztMapMap.get(stId);
             PointInfo kyfdlPi = kyfdlMap.get(stId);
             List<PointData> kyfdlDatas = Optional.ofNullable(kyfdlPi).map(PointInfo::getPointDatas).orElse(Collections.emptyList());
-            Map<Long, List<PointData>> kydlMap = kyfdlDatas.stream().collect(Collectors.groupingBy(pd -> pd.getTs() % (15 * 60 * 1000)));
+            Map<Long, List<PointData>> kydlMap = kyfdlDatas.stream().collect(Collectors.groupingBy(pd -> (pd.getTs() - pd.getTs() % (15 * 60 * 1000))));
             double actualPower = 0, availablePower = 0;
             for (StationInfoMin min : mins) {
                 List<Double> doubles = dtlMap.get(min.getRecordDate());
                 List<PointData> kypd = kydlMap.get(min.getRecordDate().getTime());
+                if (CollUtil.isEmpty(kypd)) continue;
                 //限电
                 if (calcXdRate(doubles) > 0.6) continue;
                 actualPower += min.getRfdl();
@@ -4206,8 +4247,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
             double klyl = (24 * 60 - day.getGzMin()) / (24 * 60);
             double fnlyl = day.getRfdl() / day.getLlfdl();
             day.setLyxs(lyxs);
-            day.setKlyl(klyl);
-            day.setFnlyl(fnlyl);
+            day.setKlyl(klyl * 100);
+            day.setFnlyl(fnlyl * 100);
         }
         turbineInfoDayService.saveOrUpdateBatch(byDate);
     }
@@ -6908,8 +6949,81 @@ public class JavaFunctionJobHandler extends IJobHandler {
     }
 
     //计算惠安报表汇总
-    public void calcHaBbHzSs(Date date) {
-
+    public void calcHaBbHzSs() {
+        DateTime date = DateUtil.date();
+        DateTime begin = DateUtil.beginOfDay(date);
+        //计算指标配置
+        QueryWrapper<ProBaseBackfill> fillWrapper = new QueryWrapper<>();
+        fillWrapper.lambda().eq(ProBaseBackfill::getPushTime, "12");
+        List<ProBaseBackfill> fills = proBaseBackfillService.list(fillWrapper);
+        Map<String, Map<String, Map<String, ProBaseBackfill>>> fillMapMap = fills.stream().collect(Collectors.groupingBy(ProBaseBackfill::getType,
+                Collectors.groupingBy(ProBaseBackfill::getTaskDescription, Collectors.toMap(ProBaseBackfill::getOperatingMode, Function.identity()))));
+        //指标保存表
+        QueryWrapper<ProEconEquipmentInfoJs> eijWrapper = new QueryWrapper<>();
+        eijWrapper.lambda().eq(ProEconEquipmentInfoJs::getRecordDate, begin);
+        List<ProEconEquipmentInfoJs> eijs = proEconEquipmentInfoJsService.list(eijWrapper);
+        Map<String, ProEconEquipmentInfoJs> eijMap = eijs.stream().collect(Collectors.toMap(ProEconEquipmentInfoJs::getMeterId, Function.identity(), (k1, k2) -> k1));
+        Map<String, ProBaseBackfill> fillMapBq01 = fillMapMap.get("SJFDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq02 = fillMapMap.get("SWDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq03 = fillMapMap.get("GWDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq04 = fillMapMap.get("CYDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq05 = fillMapMap.get("CYDLV").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq06 = fillMapMap.get("ZHCYDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq07 = fillMapMap.get("ZHCYDLV").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq08 = fillMapMap.get("PJFS").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq09 = fillMapMap.get("DJWHDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq10 = fillMapMap.get("GZSSDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq11 = fillMapMap.get("JHFDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq12 = fillMapMap.get("LYXSS").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq13 = fillMapMap.get("SBKLYL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq14 = fillMapMap.get("SLSSDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq15 = fillMapMap.get("XDL").get("本期");
+        Map<String, ProBaseBackfill> fillMapBq16 = fillMapMap.get("XDLV").get("本期");
+        String select1 = SqlUtil.getSelectSum("swdl,gwdl,cydl,rfdl,hdl");
+        String select2 = SqlUtil.getSelectAvg("pjfs,klyl,fnlyl,bll") + SqlUtil.getSelectSum("gzss,xdss,xnss,lyxs,gzcs,gz_min,tj_min,dj_min,yx_min,llfdl,yxfss");
+        List<LineInfoDay> lidsBqQc = lineInfoDayService.getDatasByPartSelects(date, DatePart.CURRENT, select1, "project_id");
+        List<TurbineInfoDay> tidsBqQc = turbineInfoDayService.getDatasByPartSelects(date, DatePart.CURRENT, select2, "project_id");
+        List<ProBasicProjectPlan> plantsBqQc = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.CURRENT, "project_id");
+        List<LineInfoDay> lidsBqCz = lineInfoDayService.getDatasByPartSelects(date, DatePart.CURRENT, select1, "station_id");
+        List<TurbineInfoDay> tidsBqCz = turbineInfoDayService.getDatasByPartSelects(date, DatePart.CURRENT, select2, "station_id");
+        List<ProBasicProjectPlan> plantsBqCz = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.CURRENT, "windpowerstation_id");
+
+        lineCalcHz(lidsBqQc, fillMapBq01, LineInfoDay::getProjectId, lid -> Double.valueOf(lid.getRfdl()), eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq02, LineInfoDay::getProjectId, LineInfoDay::getSwdl, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq03, LineInfoDay::getProjectId, LineInfoDay::getGwdl, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq04, LineInfoDay::getProjectId, LineInfoDay::getCydl, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq05, LineInfoDay::getProjectId, lid -> lid.getCydl() / lid.getRfdl() * 100, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq06, LineInfoDay::getProjectId, lid -> lid.getRfdl() - lid.getSwdl() + lid.getGwdl(), eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq07, LineInfoDay::getProjectId, lid -> (lid.getRfdl() - lid.getSwdl() + lid.getGwdl()) / lid.getRfdl(), eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq08, TurbineInfoDay::getProjectId, TurbineInfoDay::getPjfs, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq09, LineInfoDay::getProjectId, lid -> 0d, eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq10, TurbineInfoDay::getProjectId, TurbineInfoDay::getGzss, eijMap, begin);
+        lineCalcHz(plantsBqQc, fillMapBq11, ProBasicProjectPlan::getProjectId, pbpp -> pbpp.getGeneratingCapacity() / plantsBqQc.size(), eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq12, TurbineInfoDay::getProjectId, TurbineInfoDay::getLyxs, eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq13, TurbineInfoDay::getProjectId, TurbineInfoDay::getKlyl, eijMap, begin);
+        lineCalcHz(lidsBqQc, fillMapBq14, LineInfoDay::getProjectId, lid -> 0d, eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq15, TurbineInfoDay::getProjectId, TurbineInfoDay::getXdss, eijMap, begin);
+        lineCalcHz(tidsBqQc, fillMapBq16, TurbineInfoDay::getProjectId, TurbineInfoDay::getXdss, eijMap, begin);
+        lineCalcHz2(lidsBqQc, fillMapBq16, LineInfoDay::getProjectId, lid -> Double.valueOf(lid.getRfdl()), eijMap, begin);
+
+        lineCalcHz(lidsBqCz, fillMapBq01, LineInfoDay::getStationId, lid -> Double.valueOf(lid.getRfdl()), eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq02, LineInfoDay::getStationId, LineInfoDay::getSwdl, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq03, LineInfoDay::getStationId, LineInfoDay::getGwdl, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq04, LineInfoDay::getStationId, LineInfoDay::getCydl, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq05, LineInfoDay::getStationId, lid -> lid.getCydl() / lid.getRfdl() * 100, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq06, LineInfoDay::getStationId, lid -> lid.getRfdl() - lid.getSwdl() + lid.getGwdl(), eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq07, LineInfoDay::getStationId, lid -> (lid.getRfdl() - lid.getSwdl() + lid.getGwdl()) / lid.getRfdl(), eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq08, TurbineInfoDay::getStationId, TurbineInfoDay::getPjfs, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq09, LineInfoDay::getStationId, lid -> 0d, eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq10, TurbineInfoDay::getStationId, TurbineInfoDay::getGzss, eijMap, begin);
+        lineCalcHz(plantsBqCz, fillMapBq11, ProBasicProjectPlan::getWindpowerstationId, pbpp -> pbpp.getGeneratingCapacity() / plantsBqCz.size(), eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq12, TurbineInfoDay::getStationId, TurbineInfoDay::getLyxs, eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq13, TurbineInfoDay::getStationId, TurbineInfoDay::getKlyl, eijMap, begin);
+        lineCalcHz(lidsBqCz, fillMapBq14, LineInfoDay::getStationId, lid -> 0d, eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq15, TurbineInfoDay::getStationId, TurbineInfoDay::getXdss, eijMap, begin);
+        lineCalcHz(tidsBqCz, fillMapBq16, TurbineInfoDay::getStationId, TurbineInfoDay::getXdss, eijMap, begin);
+        lineCalcHz2(lidsBqCz, fillMapBq16, LineInfoDay::getStationId, lid -> Double.valueOf(lid.getRfdl()), eijMap, begin);
+        proEconEquipmentInfoJsService.saveOrUpdateBatch(eijMap.values());
     }
 
     //计算惠安报表汇总实时
@@ -6926,7 +7040,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         QueryWrapper<ProEconEquipmentInfoJs> eijWrapper = new QueryWrapper<>();
         eijWrapper.lambda().eq(ProEconEquipmentInfoJs::getRecordDate, yesterday);
         List<ProEconEquipmentInfoJs> eijs = proEconEquipmentInfoJsService.list(eijWrapper);
-        Map<String, ProEconEquipmentInfoJs> eijMap = eijs.stream().collect(Collectors.toMap(ProEconEquipmentInfoJs::getMeterId, Function.identity()));
+        Map<String, ProEconEquipmentInfoJs> eijMap = eijs.stream().collect(Collectors.toMap(ProEconEquipmentInfoJs::getMeterId, Function.identity(), (k1, k2) -> k1));
         //风机日月发电量
         Map<String, ProBaseBackfill> fillMapFdlR = fillMapMap.get("FDL").get("日");
         Map<String, ProBaseBackfill> fillMapFdlY = fillMapMap.get("FDL").get("月");
@@ -6934,24 +7048,18 @@ public class JavaFunctionJobHandler extends IJobHandler {
         Map<String, ProBaseBackfill> fillMapFdlR2 = fillMapMap.get("FDLFJ").get("日");
         Map<String, ProBaseBackfill> fillMapFdlY2 = fillMapMap.get("FDLFJ").get("月");
         Map<String, ProBaseBackfill> fillMapFdlN2 = fillMapMap.get("FDLFJ").get("年");
-        List<TurbineInfoDay> tidsR = turbineInfoDayService.getDatasByPartSelects(date, DatePart.DAY, "rfdl", TurbineInfoDay::getTurbineId);
-        for (TurbineInfoDay day : tidsR) {
-            String tbId = day.getTurbineId();
-            ProBaseBackfill fill = fillMapFdlR.get(tbId);
-            ProEconEquipmentInfoJs js = getPeeijs(fill, eijMap, yesterday);
-            js.setStopCode(day.getRfdl());
-        }
-        List<TurbineInfoDay> tidsY = turbineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, "rfdl", TurbineInfoDay::getTurbineId);
-        for (TurbineInfoDay day : tidsY) {
-            String tbId = day.getTurbineId();
-            ProBaseBackfill fill = fillMapFdlY.get(tbId);
-            ProEconEquipmentInfoJs js = getPeeijs(fill, eijMap, yesterday);
-            js.setStopCode(day.getRfdl());
-        }
+
+        List<TurbineInfoDay> tidsR = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, SqlUtil.getSelectSum("rfdl"), "turbine_id");
+        List<TurbineInfoDay> tidsY = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, SqlUtil.getSelectSum("rfdl"), "turbine_id");
+        lineCalcHz(tidsR, fillMapFdlR, TurbineInfoDay::getTurbineId, tid -> Double.valueOf(tid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(tidsY, fillMapFdlY, TurbineInfoDay::getTurbineId, tid -> Double.valueOf(tid.getRfdl()), eijMap, yesterday);
         //实际发电量	SJFDL,上网电量	SWDL,购网电量	GWDL,场用电量	CYDL,场用电率	CYDL,综合场用电量	ZHCYDL
         //综合场用电率	ZHCYDL,平均风速	PJFS,定检维护电量	DJWHDL,故障损失电量	GZSSDL,计划发电量	JHFDL
         //利用小时数	LYXSS,设备可利用率	SBKLYL,受累损失电量	SLSSDL,限电量	XDL,限电率	XDL
+        Map<String, ProBaseBackfill> fillMapR02 = fillMapMap.get("SWDL").get("日");
+        Map<String, ProBaseBackfill> fillMapR03 = fillMapMap.get("GWDL").get("日");
         Map<String, ProBaseBackfill> fillMapR17 = fillMapMap.get("HDL").get("日");
+        Map<String, ProBaseBackfill> fillMapR18 = fillMapMap.get("FNLYL").get("日");
         Map<String, ProBaseBackfill> fillMapY01 = fillMapMap.get("SJFDL").get("月");
         Map<String, ProBaseBackfill> fillMapY02 = fillMapMap.get("SWDL").get("月");
         Map<String, ProBaseBackfill> fillMapY03 = fillMapMap.get("GWDL").get("月");
@@ -6969,6 +7077,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         Map<String, ProBaseBackfill> fillMapY15 = fillMapMap.get("XDL").get("月");
         Map<String, ProBaseBackfill> fillMapY16 = fillMapMap.get("XDLV").get("月");
         Map<String, ProBaseBackfill> fillMapY17 = fillMapMap.get("HDL").get("月");
+        Map<String, ProBaseBackfill> fillMapY18 = fillMapMap.get("FNLYL").get("月");
         Map<String, ProBaseBackfill> fillMapN01 = fillMapMap.get("SJFDL").get("年");
         Map<String, ProBaseBackfill> fillMapN02 = fillMapMap.get("SWDL").get("年");
         Map<String, ProBaseBackfill> fillMapN03 = fillMapMap.get("GWDL").get("年");
@@ -6985,54 +7094,163 @@ public class JavaFunctionJobHandler extends IJobHandler {
         Map<String, ProBaseBackfill> fillMapN14 = fillMapMap.get("SLSSDL").get("年");
         Map<String, ProBaseBackfill> fillMapN15 = fillMapMap.get("XDL").get("年");
         Map<String, ProBaseBackfill> fillMapN16 = fillMapMap.get("XDLV").get("年");
+        Map<String, ProBaseBackfill> fillMapN18 = fillMapMap.get("FNLYL").get("年");
+        Map<String, ProBaseBackfill> fillMapR19 = fillMapMap.get("GZCS").get("日");
+        Map<String, ProBaseBackfill> fillMapY19 = fillMapMap.get("GZCS").get("月");
+        Map<String, ProBaseBackfill> fillMapN19 = fillMapMap.get("GZCS").get("年");
+        Map<String, ProBaseBackfill> fillMapR20 = fillMapMap.get("GZSC").get("日");
+        Map<String, ProBaseBackfill> fillMapY20 = fillMapMap.get("GZSC").get("月");
+        Map<String, ProBaseBackfill> fillMapN20 = fillMapMap.get("GZSC").get("年");
+        Map<String, ProBaseBackfill> fillMapR21 = fillMapMap.get("JHTJSC").get("日");
+        Map<String, ProBaseBackfill> fillMapY21 = fillMapMap.get("JHTJSC").get("月");
+        Map<String, ProBaseBackfill> fillMapN21 = fillMapMap.get("JHTJSC").get("年");
+        Map<String, ProBaseBackfill> fillMapR22 = fillMapMap.get("JSDJSC").get("日");
+        Map<String, ProBaseBackfill> fillMapY22 = fillMapMap.get("JSDJSC").get("月");
+        Map<String, ProBaseBackfill> fillMapN22 = fillMapMap.get("JSDJSC").get("年");
+        Map<String, ProBaseBackfill> fillMapR23 = fillMapMap.get("KQMD").get("日");
+        Map<String, ProBaseBackfill> fillMapY23 = fillMapMap.get("KQMD").get("月");
+        Map<String, ProBaseBackfill> fillMapN23 = fillMapMap.get("KQMD").get("年");
+        Map<String, ProBaseBackfill> fillMapR24 = fillMapMap.get("KYDLZQL").get("日");
+        Map<String, ProBaseBackfill> fillMapY24 = fillMapMap.get("KYDLZQL").get("月");
+        Map<String, ProBaseBackfill> fillMapN24 = fillMapMap.get("KYDLZQL").get("年");
+        Map<String, ProBaseBackfill> fillMapR25 = fillMapMap.get("LLFDL").get("日");
+        Map<String, ProBaseBackfill> fillMapY25 = fillMapMap.get("LLFDL").get("月");
+        Map<String, ProBaseBackfill> fillMapN25 = fillMapMap.get("LLFDL").get("年");
+        Map<String, ProBaseBackfill> fillMapR26 = fillMapMap.get("PJQW").get("日");
+        Map<String, ProBaseBackfill> fillMapY26 = fillMapMap.get("PJQW").get("月");
+        Map<String, ProBaseBackfill> fillMapN26 = fillMapMap.get("PJQW").get("年");
+        Map<String, ProBaseBackfill> fillMapR27 = fillMapMap.get("PJTJSC").get("日");
+        Map<String, ProBaseBackfill> fillMapY27 = fillMapMap.get("PJTJSC").get("月");
+        Map<String, ProBaseBackfill> fillMapN27 = fillMapMap.get("PJTJSC").get("年");
+        Map<String, ProBaseBackfill> fillMapR28 = fillMapMap.get("QFXDLV").get("日");
+        Map<String, ProBaseBackfill> fillMapY28 = fillMapMap.get("QFXDLV").get("月");
+        Map<String, ProBaseBackfill> fillMapN28 = fillMapMap.get("QFXDLV").get("年");
+        Map<String, ProBaseBackfill> fillMapR29 = fillMapMap.get("XNSSDL").get("日");
+        Map<String, ProBaseBackfill> fillMapY29 = fillMapMap.get("XNSSDL").get("月");
+        Map<String, ProBaseBackfill> fillMapN29 = fillMapMap.get("XNSSDL").get("年");
+        Map<String, ProBaseBackfill> fillMapR30 = fillMapMap.get("XNSSL").get("日");
+        Map<String, ProBaseBackfill> fillMapY30 = fillMapMap.get("XNSSL").get("月");
+        Map<String, ProBaseBackfill> fillMapN30 = fillMapMap.get("XNSSL").get("年");
+        Map<String, ProBaseBackfill> fillMapR31 = fillMapMap.get("YXBLL").get("日");
+        Map<String, ProBaseBackfill> fillMapY31 = fillMapMap.get("YXBLL").get("月");
+        Map<String, ProBaseBackfill> fillMapN31 = fillMapMap.get("YXBLL").get("年");
+        Map<String, ProBaseBackfill> fillMapR32 = fillMapMap.get("YXFSS").get("日");
+        Map<String, ProBaseBackfill> fillMapY32 = fillMapMap.get("YXFSS").get("月");
+        Map<String, ProBaseBackfill> fillMapN32 = fillMapMap.get("YXFSS").get("年");
+        Map<String, ProBaseBackfill> fillMapR33 = fillMapMap.get("YXXS").get("日");
+        Map<String, ProBaseBackfill> fillMapY33 = fillMapMap.get("YXXS").get("月");
+        Map<String, ProBaseBackfill> fillMapN33 = fillMapMap.get("YXXS").get("年");
+        Map<String, ProBaseBackfill> fillMapR34 = fillMapMap.get("ZRYSTJSC").get("日");
+        Map<String, ProBaseBackfill> fillMapY34 = fillMapMap.get("ZRYSTJSC").get("月");
+        Map<String, ProBaseBackfill> fillMapN34 = fillMapMap.get("ZRYSTJSC").get("年");
         String select1 = SqlUtil.getSelectSum("swdl,gwdl,cydl,rfdl,hdl");
-        String select2 = SqlUtil.getSelectAvg("pjfs,klyl") + "," + SqlUtil.getSelectSum("gzss,xdss,lyxs");
+        String select2 = SqlUtil.getSelectAvg("pjfs,klyl,fnlyl,bll") + SqlUtil.getSelectSum("gzss,xdss,xnss,lyxs,gzcs,gz_min,tj_min,dj_min,yx_min,llfdl,yxfss");
         String select3 = SqlUtil.getSelectSum("fdl,hdl");
-        String select4 = SqlUtil.getSelectSum("rfdl_fj");
+        String select4 = SqlUtil.getSelectAvg("qfxdl") + SqlUtil.getSelectSum("rfdl,rfdl_fj,kqmd,hjwd");
         //线路
-        List<LineInfoDay> lidsRXl = lineInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select1, LineInfoDay::getLineId);
-        List<LineInfoDay> lidsYXl = lineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select1, LineInfoDay::getLineId);
-        List<LineInfoDay> lidsYQc = lineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select1, LineInfoDay::getProjectId);
-        List<LineInfoDay> lidsRCz = lineInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select1, LineInfoDay::getStationId);
-        List<LineInfoDay> lidsYCz = lineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select1, LineInfoDay::getStationId);
-        List<LineInfoDay> lidsNQc = lineInfoDayService.getDatasByPartSelects(date, DatePart.YEAR, select1, LineInfoDay::getProjectId);
-        List<LineInfoDay> lidsNCz = lineInfoDayService.getDatasByPartSelects(date, DatePart.YEAR, select1, LineInfoDay::getStationId);
+        List<LineInfoDay> lidsRXl = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select1, "line_id");
+        List<LineInfoDay> lidsYXl = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select1, "line_id");
+        List<LineInfoDay> lidsYQc = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select1, "project_id");
+        List<LineInfoDay> lidsRCz = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select1, "station_id");
+        List<LineInfoDay> lidsYCz = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select1, "station_id");
+        List<LineInfoDay> lidsNQc = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.YEAR, select1, "project_id");
+        List<LineInfoDay> lidsNCz = lineInfoDayService.getDatasByPartSelects(yesterday, DatePart.YEAR, select1, "station_id");
         //风机
-        List<TurbineInfoDay> tidsRXl = turbineInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select2, TurbineInfoDay::getLineId);
-        List<TurbineInfoDay> tidsYXl = turbineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select2, TurbineInfoDay::getLineId);
-        List<TurbineInfoDay> tidsYQc = turbineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select2, TurbineInfoDay::getProjectId);
-        List<TurbineInfoDay> tidsYCz = turbineInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select2, TurbineInfoDay::getStationId);
-        List<TurbineInfoDay> tidsNQc = turbineInfoDayService.getDatasByPartSelects(date, DatePart.YEAR, select2, TurbineInfoDay::getProjectId);
-        List<TurbineInfoDay> tidsNCz = turbineInfoDayService.getDatasByPartSelects(date, DatePart.YEAR, select2, TurbineInfoDay::getStationId);
+        List<TurbineInfoDay> tidsRXl = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select2, "line_id");
+        List<TurbineInfoDay> tidsRCz = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select2, "station_id");
+        List<TurbineInfoDay> tidsYXl = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select2, "line_id");
+        List<TurbineInfoDay> tidsYQc = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select2, "project_id");
+        List<TurbineInfoDay> tidsYCz = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select2, "station_id");
+        List<TurbineInfoDay> tidsNQc = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.YEAR, select2, "project_id");
+        List<TurbineInfoDay> tidsNCz = turbineInfoDayService.getDatasByPartSelects(yesterday, DatePart.YEAR, select2, "station_id");
         //场站
-        List<StationInfoDay> sidR = stationInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select4, StationInfoDay::getStationId);
-        List<StationInfoDay> sidY = stationInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select4, StationInfoDay::getStationId);
-        List<StationInfoDay> sidN = stationInfoDayService.getDatasByPartSelects(date, DatePart.YEAR, select4, StationInfoDay::getStationId);
+        List<StationInfoDay> sidR = stationInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select4, "station_id");
+        List<StationInfoDay> sidY = stationInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select4, "station_id");
+        List<StationInfoDay> sidN = stationInfoDayService.getDatasByPartSelects(yesterday, DatePart.YEAR, select4, "station_id");
         //电计量
-        List<MeterInfoDay> midsRMt = meterInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select3, MeterInfoDay::getMeterId);
-        List<MeterInfoDay> midsYMt = meterInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select3, MeterInfoDay::getMeterId);
-        List<MeterInfoDay> midsRPrt = meterInfoDayService.getDatasByPartSelects(date, DatePart.DAY, select3, MeterInfoDay::getParentId);
-        List<MeterInfoDay> midsYPrt = meterInfoDayService.getDatasByPartSelects(date, DatePart.MONTH, select3, MeterInfoDay::getParentId);
+        List<MeterInfoDay> midsRMt = meterInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select3, "meter_id");
+        List<MeterInfoDay> midsYMt = meterInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select3, "meter_id");
+        List<MeterInfoDay> midsRPrt = meterInfoDayService.getDatasByPartSelects(yesterday, DatePart.DAY, select3, "meter_id");
+        List<MeterInfoDay> midsYPrt = meterInfoDayService.getDatasByPartSelects(yesterday, DatePart.MONTH, select3, "meter_id");
         //计划电量
-        List<ProBasicProjectPlan> plantsYQc = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.MONTH, "projectid");
-        List<ProBasicProjectPlan> plantsYCz = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.MONTH, "station");
-        List<ProBasicProjectPlan> plantsNQc = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.YEAR, "projectid");
-        List<ProBasicProjectPlan> plantsNCz = proBasicProjectPlanService.getDatasByPartSelect(date, DatePart.YEAR, "station");
+        List<ProBasicProjectPlan> plantsYQc = proBasicProjectPlanService.getDatasByPartSelect(yesterday, DatePart.MONTH, "project_id");
+        List<ProBasicProjectPlan> plantsYCz = proBasicProjectPlanService.getDatasByPartSelect(yesterday, DatePart.MONTH, "windpowerstation_id");
+        List<ProBasicProjectPlan> plantsNQc = proBasicProjectPlanService.getDatasByPartSelect(yesterday, DatePart.YEAR, "project_id");
+        List<ProBasicProjectPlan> plantsNCz = proBasicProjectPlanService.getDatasByPartSelect(yesterday, DatePart.YEAR, "windpowerstation_id");
+
+        //故障次数、时长。。。
+        lineCalcHz(tidsRCz, fillMapR19, TurbineInfoDay::getStationId, tid -> Double.valueOf(tid.getGzcs()), eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY19, TurbineInfoDay::getStationId, tid -> Double.valueOf(tid.getGzcs()), eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN19, TurbineInfoDay::getStationId, tid -> Double.valueOf(tid.getGzcs()), eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR20, TurbineInfoDay::getStationId, tid -> tid.getGzMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY20, TurbineInfoDay::getStationId, tid -> tid.getGzMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN20, TurbineInfoDay::getStationId, tid -> tid.getGzMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR21, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY21, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN21, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR22, TurbineInfoDay::getStationId, tid -> tid.getDjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY22, TurbineInfoDay::getStationId, tid -> tid.getDjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN22, TurbineInfoDay::getStationId, tid -> tid.getDjMin() / 60, eijMap, yesterday);
+        lineCalcHz(sidR, fillMapR23, StationInfoDay::getStationId, StationInfoDay::getKqmd, eijMap, yesterday);
+        lineCalcHz(sidY, fillMapY23, StationInfoDay::getStationId, StationInfoDay::getKqmd, eijMap, yesterday);
+        lineCalcHz(sidN, fillMapN23, StationInfoDay::getStationId, StationInfoDay::getKqmd, eijMap, yesterday);
+        lineCalcHz(sidR, fillMapR24, StationInfoDay::getStationId, StationInfoDay::getKydlzql, eijMap, yesterday);
+        lineCalcHz(sidY, fillMapY24, StationInfoDay::getStationId, StationInfoDay::getKydlzql, eijMap, yesterday);
+        lineCalcHz(sidN, fillMapN24, StationInfoDay::getStationId, StationInfoDay::getKydlzql, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR25, TurbineInfoDay::getStationId, tid -> tid.getLlfdl() / 1000, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY25, TurbineInfoDay::getStationId, tid -> tid.getLlfdl() / 1000, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN25, TurbineInfoDay::getStationId, tid -> tid.getLlfdl() / 1000, eijMap, yesterday);
+        lineCalcHz(sidR, fillMapR26, StationInfoDay::getStationId, StationInfoDay::getHjwd, eijMap, yesterday);
+        lineCalcHz(sidY, fillMapY26, StationInfoDay::getStationId, StationInfoDay::getHjwd, eijMap, yesterday);
+        lineCalcHz(sidN, fillMapN26, StationInfoDay::getStationId, StationInfoDay::getHjwd, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR27, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY27, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN27, TurbineInfoDay::getStationId, tid -> tid.getTjMin() / 60, eijMap, yesterday);
+        lineCalcHz(sidR, fillMapR28, StationInfoDay::getStationId, StationInfoDay::getQfxdl, eijMap, yesterday);
+        lineCalcHz(sidY, fillMapY28, StationInfoDay::getStationId, StationInfoDay::getQfxdl, eijMap, yesterday);
+        lineCalcHz(sidN, fillMapN28, StationInfoDay::getStationId, StationInfoDay::getQfxdl, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR29, TurbineInfoDay::getStationId, tid -> tid.getXnss() / 1000, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY29, TurbineInfoDay::getStationId, tid -> tid.getXnss() / 1000, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN29, TurbineInfoDay::getStationId, tid -> tid.getXnss() / 1000, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR30, TurbineInfoDay::getStationId, TurbineInfoDay::getXnss, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY30, TurbineInfoDay::getStationId, TurbineInfoDay::getXnss, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN30, TurbineInfoDay::getStationId, TurbineInfoDay::getXnss, eijMap, yesterday);
+        lineCalcHz2(sidR, fillMapR30, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz2(sidY, fillMapY30, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz2(sidN, fillMapN30, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR31, TurbineInfoDay::getStationId, TurbineInfoDay::getBll, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY31, TurbineInfoDay::getStationId, TurbineInfoDay::getBll, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN31, TurbineInfoDay::getStationId, TurbineInfoDay::getBll, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR32, TurbineInfoDay::getStationId, TurbineInfoDay::getYxfss, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY32, TurbineInfoDay::getStationId, TurbineInfoDay::getYxfss, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN32, TurbineInfoDay::getStationId, TurbineInfoDay::getYxfss, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR33, TurbineInfoDay::getStationId, tid -> tid.getYxMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY33, TurbineInfoDay::getStationId, tid -> tid.getYxMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN33, TurbineInfoDay::getStationId, tid -> tid.getYxMin() / 60, eijMap, yesterday);
+        lineCalcHz(tidsRCz, fillMapR34, TurbineInfoDay::getStationId, tid -> 0d, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY34, TurbineInfoDay::getStationId, tid -> 0d, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN34, TurbineInfoDay::getStationId, tid -> 0d, eijMap, yesterday);
+        //风能利用率
+        lineCalcHz(tidsRCz, fillMapR18, TurbineInfoDay::getStationId, TurbineInfoDay::getFnlyl, eijMap, yesterday);
+        lineCalcHz(tidsYCz, fillMapY18, TurbineInfoDay::getStationId, TurbineInfoDay::getFnlyl, eijMap, yesterday);
+        lineCalcHz(tidsNCz, fillMapN18, TurbineInfoDay::getStationId, TurbineInfoDay::getFnlyl, eijMap, yesterday);
         //发电量日
         lineCalcHz(midsRMt, fillMapFdlR, MeterInfoDay::getMeterId, MeterInfoDay::getFdl, eijMap, yesterday);
         lineCalcHz(sidR, fillMapFdlR2, StationInfoDay::getStationId, StationInfoDay::getRfdlFj, eijMap, yesterday);
-        lineCalcHz(sidR, fillMapFdlR, StationInfoDay::getStationId, sid-> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
-        lineCalcHz(lidsRXl, fillMapFdlR, LineInfoDay::getLineId, lid-> Double.valueOf(lid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(sidR, fillMapFdlR, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(lidsRXl, fillMapFdlR, LineInfoDay::getLineId, lid -> Double.valueOf(lid.getRfdl()), eijMap, yesterday);
         lineCalcHz(tidsRXl, fillMapFdlR2, TurbineInfoDay::getLineId, TurbineInfoDay::getRfdl, eijMap, yesterday);
+        lineCalcHz(lidsRCz, fillMapR03, LineInfoDay::getStationId, LineInfoDay::getGwdl, eijMap, yesterday);
+        lineCalcHz(lidsRCz, fillMapR02, LineInfoDay::getStationId, LineInfoDay::getSwdl, eijMap, yesterday);
         //发电量月
         lineCalcHz(midsYMt, fillMapFdlY, MeterInfoDay::getMeterId, MeterInfoDay::getFdl, eijMap, yesterday);
         lineCalcHz(sidY, fillMapFdlY2, StationInfoDay::getStationId, StationInfoDay::getRfdlFj, eijMap, yesterday);
-        lineCalcHz(sidY, fillMapFdlY, StationInfoDay::getStationId, sid-> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
-        lineCalcHz(lidsYXl, fillMapFdlY, LineInfoDay::getLineId, lid-> Double.valueOf(lid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(sidY, fillMapFdlY, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(lidsYXl, fillMapFdlY, LineInfoDay::getLineId, lid -> Double.valueOf(lid.getRfdl()), eijMap, yesterday);
         lineCalcHz(tidsYXl, fillMapFdlY2, TurbineInfoDay::getLineId, TurbineInfoDay::getRfdl, eijMap, yesterday);
         //发电量年
         lineCalcHz(sidN, fillMapFdlN2, StationInfoDay::getStationId, StationInfoDay::getRfdlFj, eijMap, yesterday);
-        lineCalcHz(sidN, fillMapFdlN, StationInfoDay::getStationId, sid-> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
+        lineCalcHz(sidN, fillMapFdlN, StationInfoDay::getStationId, sid -> Double.valueOf(sid.getRfdl()), eijMap, yesterday);
         //耗电量日
         lineCalcHz(midsRMt, fillMapR17, MeterInfoDay::getMeterId, MeterInfoDay::getHdl, eijMap, yesterday);
         lineCalcHz(lidsRXl, fillMapR17, LineInfoDay::getLineId, LineInfoDay::getHdl, eijMap, yesterday);
@@ -7115,7 +7333,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         lineCalcHz(tidsNCz, fillMapN15, TurbineInfoDay::getStationId, TurbineInfoDay::getXdss, eijMap, yesterday);
         lineCalcHz(tidsNCz, fillMapN16, TurbineInfoDay::getStationId, TurbineInfoDay::getXdss, eijMap, yesterday);
         lineCalcHz2(lidsNCz, fillMapN16, LineInfoDay::getStationId, lid -> Double.valueOf(lid.getRfdl()), eijMap, yesterday);
-
+        proEconEquipmentInfoJsService.saveOrUpdateBatch(eijMap.values());
     }
 
     public <T> void lineCalcHz(List<T> items, Map<String, ProBaseBackfill> fillMap, Function<T, String> type, Function<T, Double> algorithm, Map<String, ProEconEquipmentInfoJs> eijMap, DateTime yesterday) {
@@ -7134,7 +7352,15 @@ public class JavaFunctionJobHandler extends IJobHandler {
             ProBaseBackfill fill = fillMap.get(id);
             if (fill == null) continue;
             ProEconEquipmentInfoJs js = getPeeijs(fill, eijMap, yesterday);
-            js.setStopCode(js.getStopCode() / algorithm.apply(item));
+            double apply = algorithm.apply(item);
+            double v;
+            if (apply == 0) {
+                v = 100d;
+            } else {
+                v = js.getStopCode() / apply * 100;
+                if (v > 100) v = 100d;
+            }
+            js.setStopCode(v);
         }
     }
 

+ 2 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -10,7 +10,7 @@ ruoyi:
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
 #  profile: /home/ruoyi
-  profile: C:/ruoyi/
+  profile: D:/ruoyi/
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
@@ -130,6 +130,7 @@ token:
 mybatis-plus:
   typeAliasesPackage: com.ruoyi.**.domain
   mapper-locations: classpath*:mapper/**/*Mapper.xml
+  log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
 # PageHelper分页插件
 pagehelper:

+ 19 - 9
ruoyi-admin/src/test/java/com/ruoyi/NewTests.java

@@ -240,8 +240,8 @@ public class NewTests {
 
     @Test
     public void test6() {
-        DateTime begin = DateUtil.parse("2024-09-20 19:00:00");
-        DateTime end = DateUtil.parse("2024-12-25 09:00:00");
+        DateTime begin = DateUtil.parse("2024-10-07 23:30:00");
+        DateTime end = DateUtil.parse("2025-01-02 14:00:00");
         DateTime minEnd = begin;
         while (minEnd.isBefore(end)) {
             minEnd = DateUtil.offsetMinute(begin, 15);
@@ -307,18 +307,21 @@ public class NewTests {
     @Test
     public void test9() {
         DateTime date = DateUtil.date();
-        task.calcLineRfdlSameDay();
-        task.calcStationSwGwCyDlSameDay();
-        task.calcStationZhcyRfDlSameDay();
-        task.calcLineSwGWCyDlSameDay();
+        //task.calcLineRfdlSameDay();
+        //task.calcStationSwGwCyDlSameDay();
+        //task.calcStationZhcyRfDlSameDay();
+        //task.calcLineSwGWCyDlSameDay();
+        //task.calcTurbineStateMin(date);
+        //task.calcTurbineLyxs(date);
+        task.calcTurbine5s2(date);
     }
 
     @Test
     public void test10() {
 //        DateTime date = DateUtil.date();
         // 创建日期范围生成器
-        DateTime start = DateUtil.parse("2024-12-12");
-        DateTime end = DateUtil.parse("2024-12-25");
+        DateTime start = DateUtil.parse("2024-12-26");
+        DateTime end = DateUtil.parse("2024-12-30");
         DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
         for (DateTime date : range) {
             System.out.println(DateUtil.date() + ":" + date);
@@ -347,7 +350,14 @@ public class NewTests {
     public void test11() {
         while (true) {
             task.calcRealtimeTurbineZt();
-            ThreadUtil.sleep(1000);
+            ThreadUtil.sleep(100000);
         }
     }
+
+    @Test
+    public void test12() {
+        DateTime end = DateUtil.beginOfDay(DateUtil.date());
+        DateTime start = DateUtil.offsetMonth(end, -3);
+        task.calcGlqxnh_ha(start, end);
+    }
 }

+ 2 - 1
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.PostConstruct;
 import java.util.List;
 
 /**
@@ -33,7 +34,7 @@ public class SysJobServiceImpl implements ISysJobService {
     /**
      * 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
      */
-//    @PostConstruct
+    @PostConstruct
     public void init() throws SchedulerException, TaskException {
         scheduler.clear();
         List<SysJob> jobList = jobMapper.selectJobAll();

+ 1 - 1
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java

@@ -13,6 +13,6 @@ import org.quartz.JobExecutionContext;
 public class QuartzDisallowConcurrentExecution extends AbstractQuartzJob {
     @Override
     protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception {
-//        JobInvokeUtil.invokeMethod2(sysJob);
+        JobInvokeUtil.invokeMethod2(sysJob);
     }
 }

+ 1 - 1
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java

@@ -11,6 +11,6 @@ import org.quartz.JobExecutionContext;
 public class QuartzJobExecution extends AbstractQuartzJob {
     @Override
     protected void doExecute(JobExecutionContext context, SysJob sysJob) throws Exception {
-//        JobInvokeUtil.invokeMethod2(sysJob);
+        JobInvokeUtil.invokeMethod2(sysJob);
     }
 }

+ 1 - 1
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/ILineInfoDayService.java

@@ -23,5 +23,5 @@ public interface ILineInfoDayService extends IService<LineInfoDay> {
     public Map<String, LineInfoDay> getByEntity(PointInfo pointInfo);
 
     Map<String, LineInfoDay> getDatasByPartSelect(Date date, DatePart datePart, String selects, SFunction<LineInfoDay,String> groupId);
-    List<LineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<LineInfoDay,String>... groupIds);
+    List<LineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds);
 }

+ 1 - 2
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/IMeterInfoDayService.java

@@ -1,6 +1,5 @@
 package com.ruoyi.ucp.service;
 
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.ucp.entity.MeterInfoDay;
 import com.ruoyi.ucp.util.DatePart;
@@ -19,5 +18,5 @@ import java.util.List;
 public interface IMeterInfoDayService extends IService<MeterInfoDay> {
 
 
-    List<MeterInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<MeterInfoDay,String>... groupIds);
+    List<MeterInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds);
 }

+ 1 - 1
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/IStationInfoDayService.java

@@ -19,5 +19,5 @@ import java.util.Map;
  */
 public interface IStationInfoDayService extends IService<StationInfoDay> {
     Map<String, StationInfoDay> getDatasByPartSelect(Date date, DatePart datePart, String selects, SFunction<StationInfoDay,String> groupId);
-    List<StationInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<StationInfoDay,String> groupId);
+    List<StationInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupId);
 }

+ 1 - 1
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/ITurbineInfoDayService.java

@@ -18,6 +18,6 @@ import java.util.Map;
  * @since 2024-05-29
  */
 public interface ITurbineInfoDayService extends IService<TurbineInfoDay> {
-    List<TurbineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<TurbineInfoDay,String>... groupIds);
+    List<TurbineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds);
     Map<String, TurbineInfoDay> getDatasByPartSelect(Date date, DatePart datePart, String selects, SFunction<TurbineInfoDay,String> groupId);
 }

+ 4 - 8
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/LineInfoDayServiceImpl.java

@@ -77,17 +77,13 @@ public class LineInfoDayServiceImpl extends ServiceImpl<LineInfoDayMapper, LineI
         wrapper.select(selects);
         wrapper.lambda().between(LineInfoDay::getRecordDate, beginEnd[0], beginEnd[1])
                 .select(groupId).groupBy(groupId);
-        List<LineInfoDay> days = baseMapper.selectList(wrapper);
+        List<LineInfoDay> days = super.list(wrapper);
         return days.stream().collect(Collectors.toMap(groupId, Function.identity()));
     }
-    public List<LineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<LineInfoDay,String>... groupIds) {
+    public List<LineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds) {
         DateTime[] beginEnd = SqlUtil.getBeginEnd(date, datePart);
         QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select(selects);
-        for (SFunction<LineInfoDay, String> groupId : groupIds) {
-            wrapper.lambda().select(groupId).groupBy(groupId);
-        }
-        wrapper.lambda().between(LineInfoDay::getRecordDate, beginEnd[0], beginEnd[1]);
-        return baseMapper.selectList(wrapper);
+        wrapper.select(selects + groupIds).groupBy(groupIds).between("record_date", beginEnd[0], beginEnd[1]);
+        return super.list(wrapper);
     }
 }

+ 3 - 8
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/MeterInfoDayServiceImpl.java

@@ -2,7 +2,6 @@ package com.ruoyi.ucp.service.impl;
 
 import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.ucp.entity.MeterInfoDay;
 import com.ruoyi.ucp.mapper.MeterInfoDayMapper;
@@ -30,14 +29,10 @@ public class MeterInfoDayServiceImpl extends ServiceImpl<MeterInfoDayMapper, Met
         return super.saveOrUpdateBatch(entityList);
     }
 
-    public List<MeterInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<MeterInfoDay,String>... groupIds) {
+    public List<MeterInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds) {
         DateTime[] beginEnd = SqlUtil.getBeginEnd(date, datePart);
         QueryWrapper<MeterInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select(selects);
-        for (SFunction<MeterInfoDay, String> groupId : groupIds) {
-            wrapper.lambda().select(groupId).groupBy(groupId);
-        }
-        wrapper.lambda().between(MeterInfoDay::getRecordDate, beginEnd[0], beginEnd[1]);
-        return baseMapper.selectList(wrapper);
+        wrapper.select(selects + groupIds).groupBy(groupIds).between("record_date", beginEnd[0], beginEnd[1]);
+        return super.list(wrapper);
     }
 }

+ 7 - 5
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/ProBasicProjectPlanServiceImpl.java

@@ -44,11 +44,11 @@ public class ProBasicProjectPlanServiceImpl extends ServiceImpl<ProBasicProjectP
         wrapperPlan.select("sum(generating_capacity) generating_capacity,"+groupId).groupBy(groupId)
                 .eq("year", String.valueOf(begin.year()));
         switch (groupId){
-            case "station":
-                wrapperPlan.likeRight("project_id","_EG");
+            case "project_id":
+                wrapperPlan.likeLeft("project_id","_EG");
                 break;
-            case "project":
-                wrapperPlan.likeRight("project_id","_STA");
+            case "windpowerstation_id":
+                wrapperPlan.likeLeft("project_id","_STA");
                 break;
         }
         switch (datePart){
@@ -56,8 +56,10 @@ public class ProBasicProjectPlanServiceImpl extends ServiceImpl<ProBasicProjectP
                 wrapperPlan.eq("month", String.valueOf(begin.month() + 1));
                 break;
             case YEAR:
+                wrapperPlan.isNotNull("month");
                 break;
         }
-        return baseMapper.selectList(wrapperPlan);
+        List<ProBasicProjectPlan> list = super.list(wrapperPlan);
+        return list;
     }
 }

+ 6 - 1
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/ProEconEquipmentInfoJsServiceImpl.java

@@ -6,6 +6,8 @@ import com.ruoyi.ucp.mapper.ProEconEquipmentInfoJsMapper;
 import com.ruoyi.ucp.service.IProEconEquipmentInfoJsService;
 import org.springframework.stereotype.Service;
 
+import java.util.Collection;
+
 /**
  * <p>
  * 计算测点 服务实现类
@@ -16,5 +18,8 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class ProEconEquipmentInfoJsServiceImpl extends ServiceImpl<ProEconEquipmentInfoJsMapper, ProEconEquipmentInfoJs> implements IProEconEquipmentInfoJsService {
-
+    @Override
+    public boolean saveOrUpdateBatch(Collection<ProEconEquipmentInfoJs> entityList) {
+        return super.saveOrUpdateBatch(entityList);
+    }
 }

+ 4 - 5
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/StationInfoDayServiceImpl.java

@@ -67,14 +67,13 @@ public class StationInfoDayServiceImpl extends ServiceImpl<StationInfoDayMapper,
         wrapper.select(selects);
         wrapper.lambda().between(StationInfoDay::getRecordDate, beginEnd[0], beginEnd[1])
                 .select(groupId).groupBy(groupId);
-        List<StationInfoDay> days = baseMapper.selectList(wrapper);
+        List<StationInfoDay> days = super.list(wrapper);
         return days.stream().collect(Collectors.toMap(groupId, Function.identity()));
     }
-    public List<StationInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<StationInfoDay,String> groupId) {
+    public List<StationInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupId) {
         DateTime[] beginEnd = SqlUtil.getBeginEnd(date, datePart);
         QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select(selects);
-        wrapper.lambda().select(groupId).between(StationInfoDay::getRecordDate, beginEnd[0], beginEnd[1]).groupBy(groupId);
-        return baseMapper.selectList(wrapper);
+        wrapper.select(selects + groupId).groupBy(groupId).between("record_date", beginEnd[0], beginEnd[1]);
+        return super.list(wrapper);
     }
 }

+ 5 - 9
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/TurbineInfoDayServiceImpl.java

@@ -60,24 +60,20 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
         return super.saveOrUpdateBatch(entityList);
     }
 
-    public List<TurbineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, SFunction<TurbineInfoDay,String>... groupIds) {
+    public List<TurbineInfoDay> getDatasByPartSelects(Date date, DatePart datePart, String selects, String groupIds) {
         DateTime[] beginEnd = SqlUtil.getBeginEnd(date, datePart);
         QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select(selects);
-        for (SFunction<TurbineInfoDay, String> groupId : groupIds) {
-            wrapper.lambda().select(groupId).groupBy(groupId);
-        }
-        wrapper.lambda().between(TurbineInfoDay::getRecordDate, beginEnd[0], beginEnd[1]);
-        return baseMapper.selectList(wrapper);
+        wrapper.select(selects + groupIds).groupBy(groupIds).between("record_date", beginEnd[0], beginEnd[1]);
+        return super.list(wrapper);
     }
 
-    public Map<String, TurbineInfoDay> getDatasByPartSelect(Date date, DatePart datePart, String selects, SFunction<TurbineInfoDay,String> groupId) {
+    public Map<String, TurbineInfoDay> getDatasByPartSelect(Date date, DatePart datePart, String selects, SFunction<TurbineInfoDay, String> groupId) {
         DateTime[] beginEnd = SqlUtil.getBeginEnd(date, datePart);
         QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
         wrapper.select(selects);
         wrapper.lambda().between(TurbineInfoDay::getRecordDate, beginEnd[0], beginEnd[1])
                 .select(groupId).groupBy(groupId);
-        List<TurbineInfoDay> days = baseMapper.selectList(wrapper);
+        List<TurbineInfoDay> days = super.list(wrapper);
         return days.stream().collect(Collectors.toMap(groupId, Function.identity()));
     }
 }

+ 2 - 2
universal-computing-platform/src/main/java/com/ruoyi/ucp/util/SqlUtil.java

@@ -12,7 +12,7 @@ public class SqlUtil {
         for (String s : split) {
             sb.append("sum(").append(s).append(") ").append(s).append(",");
         }
-        sb.deleteCharAt(sb.length()-1);
+        //sb.deleteCharAt(sb.length()-1);
         return sb.toString();
     }
 
@@ -22,7 +22,7 @@ public class SqlUtil {
         for (String s : split) {
             sb.append("avg(").append(s).append(") ").append(s).append(",");
         }
-        sb.deleteCharAt(sb.length()-1);
+        //sb.deleteCharAt(sb.length()-1);
         return sb.toString();
     }
     public static DateTime[] getBeginEnd(Date date, DatePart datePart) {