GYEE 7 ماه پیش
والد
کامیت
b1eb314693

+ 112 - 29
ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

@@ -248,7 +248,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
     }
 
     public URI goldenUri() {
-        return URI.create("http://172.16.12.103:8011/ts");
+        return URI.create("http://172.16.12.103:8017/ts");
     }
 
     public Map<String, String> getEntityMap(String uniformCode, String institutionType) {
@@ -3196,6 +3196,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
     //此处加公式
 
     public Map<String, Double> calcRealtimeTurbineZt(String stId) {
+
         List<PointInfo> turbineZt = calcRealtimeTurbineDizt();
         List<PointInfo> turbineAizt = calcRealtimeTurbineAizt();
         turbineZt.addAll(turbineAizt);
@@ -3210,17 +3211,11 @@ public class JavaFunctionJobHandler extends IJobHandler {
     public void calcStationMinZtts(Date time, String stId) {
         Map<Double, Long> map = calcSectionStationZtts(time, stId);
         StationInfoMin byMin = getStationinfoByMinOne(time, stId);
-        //0 待机
-        //1 运行
-        //2 故障
-        //3 检修
-        //4 限电
-        //5 受累
-        //6 离线
-        byMin.setDjts(map.get(0));
-        byMin.setYxts(map.get(1));
-        byMin.setGzts(map.get(2));
-        byMin.setJxts(map.get(3));
+        //0 待机-,1 停机,2 发电-,4 故障-,6 检修,8 限电,12 离线
+        byMin.setDjts(map.get(0.0));
+        byMin.setYxts(map.get(2.0));
+        byMin.setGzts(map.get(4.0));
+        byMin.setJxts(map.get(6.0));
         stationInfoMinService.saveOrUpdate(byMin);
     }
 
@@ -3304,7 +3299,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
     public void getRawDataByEntity(List<PointInfo> entity, URI uri, Date start, Date end) {
         for (PointInfo info : entity) {
             List<PointData> snap = adapter.getHistoryRaw(uri, info.getPointKey(), start.getTime(), end.getTime());
-            //            ThreadUtil.sleep(5);
+//            ThreadUtil.sleep(5);
             info.setPointDatas(snap);
         }
     }
@@ -3432,7 +3427,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
                                 info1.setPointDatas(Collections.singletonList(data1));
                                 result.add(info1);
                             } else {
-                                Map<String, PointData> latest2 = adapter.getLatest(goldenUri(), collect);
+//                                Map<String, PointData> latest2 = adapter.getLatest(goldenUri(), collect);
                                 data1.setDoubleValue(2.0);
                                 System.out.println("wtId: " + wtId + ",状态值无批配: " + data1.getValue());
                                 info1.setPointDatas(Collections.singletonList(data1));
@@ -4251,50 +4246,138 @@ public class JavaFunctionJobHandler extends IJobHandler {
         List<StationInfoMin> byDate = getStationinfoByMin(end, stId);
         byDate = byDate.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
 
+        Map<Double, Long> map = calcSectionStationZtts(end, stId);
         for (StationInfoMin day : byDate) {
             String id = day.getStationId();
-            //            if (day.getPjfs() == null || day.getPjfs() == 0) {
+//            if (day.getPjfs() == null || day.getPjfs() == 0) {
             List<PointInfo> fsInfos = fssMap.get(id);
             double pjfs = fsInfos.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
             day.setPjfs(pjfs);
-            //            }
-            //            if (day.getPjgl() == null || day.getPjgl() == 0) {
+//            }
+//            if (day.getPjgl() == null || day.getPjgl() == 0) {
             PointInfo cxInfo = statMapCx.get(id);
             double cxgl = cxInfo.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0);
             cxgl = cxgl * cxInfo.getCoef();
 
-            if (cxgl < 0 && pjfs > 3) cxgl = nihe(pjfs);
+            if (cxgl <= 0 && day.getPjfs() > 3) cxgl = nihe(day.getPjfs());
+            if (cxgl > 169600 && day.getPjfs() < 3) cxgl = 0;
+            if (cxgl > 169600 && day.getPjfs() > 3) cxgl = nihe(day.getPjfs());
             day.setPjgl(cxgl);
-            //            }
-            //            if (day.getAgc() == null || day.getAgc() == 0) {
+//            }
+//            if (day.getAgc() == null || day.getAgc() == 0) {
             PointInfo agcInfo = mapAgc.get(id);
             double agc = agcInfo.getPointDatas().get(0).getValue() * agcInfo.getCoef();
-            if (agc < cxgl) agc = cxgl;
+            if (agc < day.getPjgl()) agc = day.getPjgl();
             day.setAgc(agc);
-            //            }
-            //            if (day.getRfdl() == null || day.getRfdl() == 0) {
+//            }
+//            if (day.getRfdl() == null || day.getRfdl() == 0) {
             List<PointInfo> fdlInfos = fdlsMap.get(id);
             double rfdl = fdlInfos.stream().mapToDouble(pi -> {
                 double v = (pi.getPointDatas().get(1).getValue() - pi.getPointDatas().get(0).getValue()) * pi.getCoef();
                 if (v < 0) v = 0;
-                if (v > 7500) v = 7500.0;
+//                if (v > 10500) v = 10500.0;
                 return v;
             }).sum();
-            if (rfdl < 660 && cxgl > 0) rfdl = cxgl / 4.0;
+            if ((rfdl < 660 && day.getPjgl() > 0) || rfdl >= 45500) rfdl = day.getPjgl() / 4.0;
             day.setRfdl(rfdl);
-            //            }
-            //            if (day.getHjwd() == null || day.getHjwd() == 0) {
+            if (day.getPjgl() == 169600.0 && rfdl != 42400.0) {
+                day.setPjgl(rfdl * 4);
+                day.setAgc(day.getPjgl());
+            }
+            if (day.getAgc() == 170000 && rfdl != 42400.0) {
+                day.setAgc(rfdl * 4);
+            }
+//            }
+//            if (day.getHjwd() == null || day.getHjwd() == 0) {
             List<PointInfo> hjwdInfos = hjwdsMap.get(id);
             double hjwd = hjwdInfos.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
             day.setHjwd(hjwd);
-            //            }
+//            }
+            //0 待机-,1 停机,2 发电-,4 故障-,6 检修,8 限电,12 离线
+            day.setDjts(map.get(0.0));
+            day.setYxts(map.get(2.0));
+            day.setGzts(map.get(4.0));
+            day.setJxts(map.get(6.0));
         }
         stationInfoMinService.saveOrUpdateBatch(byDate);
     }
+    public StationInfoMin calcStationSjglAgcPjfsHjwdDlMin2(Date begin, Date end, String stId) {
+        //AGC
+        List<PointInfo> entityAgc = getEntity("AGC002", "booster");
+        entityAgc = entityAgc.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
+        getSectionDataByEntity(entityAgc, goldenUri(), end);
+        Map<String, PointInfo> mapAgc = entityAgc.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
+        //出线
+        List<PointInfo> entityCx = getEntity("AGC001", "booster");
+        entityCx = entityCx.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
+        Map<String, PointInfo> statMapCx = getRawDataByEntity(entityCx, goldenUri(), begin, end, PointInfo::getStationId);
+        //风速
+        List<PointInfo> entityFs = getEntity("AI066", "turbine");
+        entityFs = entityFs.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
+        getRawDataByEntity(entityFs, goldenUri(), begin, end);
+        Map<String, List<PointInfo>> fssMap = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
+        //环境温度
+        List<PointInfo> entityHjwd = getEntity("AI072", "turbine");
+        entityHjwd = entityHjwd.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
+        getRawDataByEntity(entityHjwd, goldenUri(), begin, end);
+        Map<String, List<PointInfo>> hjwdsMap = entityHjwd.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
+        //日发电量
+        List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
+        entity = entity.stream().filter(e -> !"".equals(e.getProjectId()) && stId.equals(e.getStationId())).collect(Collectors.toList());
+        getSectionDataByEntity(entity, goldenUri(), begin, end);
+        Map<String, List<PointInfo>> fdlsMap = entity.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
+
+        List<StationInfoMin> byDate = getStationinfoByMin(end, stId);
+        byDate = byDate.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
+        Map<Double, Long> map = calcSectionStationZtts(end, stId);
+        for (StationInfoMin day : byDate) {
+            String id = day.getStationId();
+            List<PointInfo> fsInfos = fssMap.get(id);
+            double pjfs = fsInfos.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
+            day.setPjfs(pjfs);
+            PointInfo cxInfo = statMapCx.get(id);
+            double cxgl = cxInfo.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0);
+            cxgl = cxgl * cxInfo.getCoef();
+            if (cxgl > 169600 && day.getPjfs() < 3) cxgl = 0;
+            day.setPjgl(cxgl);
+            PointInfo agcInfo = mapAgc.get(id);
+            double agc = agcInfo.getPointDatas().get(0).getValue() * agcInfo.getCoef();
+            if (agc < day.getPjgl()) agc = day.getPjgl();
+            day.setAgc(agc);
+            List<PointInfo> fdlInfos = fdlsMap.get(id);
+            double rfdl = fdlInfos.stream().mapToDouble(pi -> {
+                double v = (pi.getPointDatas().get(1).getValue() - pi.getPointDatas().get(0).getValue()) * pi.getCoef();
+                if (v < 0) v = 0;
+                return v;
+            }).sum();
+            if ((rfdl < 660 && day.getPjgl() > 0) || rfdl > 45500) rfdl = day.getPjgl() / 4.0;
+            day.setRfdl(rfdl);
+            if (day.getPjgl() == 169600.0 && rfdl != 42400.0) {
+                day.setPjgl(rfdl * 4);
+                day.setAgc(day.getPjgl());
+            }
+            if (day.getAgc() == 170000 && rfdl != 42400.0) {
+                day.setAgc(rfdl * 4);
+            }
+            List<PointInfo> hjwdInfos = hjwdsMap.get(id);
+            double hjwd = hjwdInfos.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
+            day.setHjwd(hjwd);
+            //0 待机-,1 停机,2 发电-,4 故障-,6 检修,8 限电,12 离线
+            day.setDjts(map.get(0.0));
+            day.setYxts(map.get(2.0));
+            day.setGzts(map.get(4.0));
+            day.setJxts(map.get(6.0));
+        }
+        return byDate.get(0);
+    }
 
     private double nihe(double pjfs) {
         //LJS
-        return -90.4382 * Math.pow(pjfs, 3) + 1661.275 * Math.pow(pjfs, 2) + 2245.86 * pjfs - 17011.14;
+//        if (pjfs > 13) return 94251.0;
+//        return -90.4382 * Math.pow(pjfs, 3) + 1661.275 * Math.pow(pjfs, 2) + 2245.86 * pjfs - 17011.14;
+        //FSG
+        if (pjfs > 8.62) return 35880.0;
+        return -286.3119 * Math.pow(pjfs, 3) + 4837.637 * Math.pow(pjfs, 2) -19121.73 * pjfs + 24636.96;
     }
 
     public void getPoint() {

+ 196 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/PredictController.java

@@ -11,6 +11,7 @@ import com.ruoyi.ucp.feign.AdapterApi;
 import com.ruoyi.ucp.service.IHistoryPredictService;
 import com.ruoyi.ucp.service.IPointInfoService;
 import com.ruoyi.ucp.service.IRealtimePredictService;
+import com.ruoyi.ucp.service.IStationInfoMinService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -22,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-//@RestController
+@RestController
 @RequestMapping("/predict")
 public class PredictController {
 
@@ -36,6 +37,8 @@ public class PredictController {
     private IRealtimePredictService realtimePredictService;
     @Resource
     private IHistoryPredictService historyPredictService;
+    @Resource
+    private IStationInfoMinService stationInfoMinService;
 
     private Map<String, PointInfo> tbInfos = new ConcurrentHashMap<>();
 
@@ -299,6 +302,78 @@ public class PredictController {
         });
         return result;
     }
+    @GetMapping("/snap/station/dq")
+    public List<StationInfoMin> latestStationDq(@RequestParam(value = "stationId",required = false) String stationId,
+                                                @RequestParam(value = "beginTime",required = false) String beginTime,
+                                                @RequestParam(value = "endTime",required = false) String endTime) {
+
+        DateTime begin = DateUtil.parse(beginTime);
+        DateTime middle = DateUtil.parse("2024-11-03");
+        DateTime end = DateUtil.parse(endTime);
+        QueryWrapper<StationInfoMin> minWrapper = new QueryWrapper<>();
+        minWrapper.lambda().eq(StationInfoMin::getStationId,stationId).between(StationInfoMin::getRecordDate,begin,middle)
+                .orderByAsc(StationInfoMin::getRecordDate);
+        List<StationInfoMin> list = stationInfoMinService.list(minWrapper);
+//        List<StationInfoMin> min=new ArrayList<>();
+        int i = 1;
+        DateTime minBegin = middle, minEnd = DateUtil.offsetMinute(middle, 15);
+        while (minEnd.isBefore(end)) {
+            minEnd = DateUtil.offsetMinute(middle, i * 15);
+            StationInfoMin day = task.calcStationSjglAgcPjfsHjwdDlMin2(minBegin, minEnd, stationId);
+            System.out.println(minBegin.toString() + "," + minEnd.toString());
+            i++;
+            minBegin = minEnd;
+            list.add(day);
+        }
+
+        return list;
+    }
+    @GetMapping("/latest/station/dq")
+    public StationInfoMin latestStationDq(@RequestParam(value = "stationId",required = false) String stationId) {
+        DateTime date = DateUtil.beginOfMinute(DateUtil.date());
+        int i = Math.floorDiv(date.minute(), 15) * 15;
+        date.setMinutes(i);
+        DateTime minute = DateUtil.offsetMinute(date, -15);
+        return task.calcStationSjglAgcPjfsHjwdDlMin2(minute, date, stationId);
+    }
+    @GetMapping("/latest/station/dq2")
+    public StationInfoMin latestStationDq2(@RequestParam(value = "stationId",required = false) String stationId) {
+        DateTime date = DateUtil.beginOfMinute(DateUtil.date());
+        int i = Math.floorDiv(date.minute(), 15) * 15;
+        date.setMinutes(i);
+        DateTime minute = DateUtil.offsetMinute(date, -15);
+        //AGC
+        PointInfo entityAgc = getEntity("AGC002", "booster",stationId);
+        getLatestByEntity(entityAgc);
+        //出线
+        PointInfo entityCx = getEntity("AGC001", "booster",stationId);
+        getRawDataByEntity(entityCx,minute,date);
+        //风速
+        List<PointInfo> entityFs = getEntitys("AI066", "turbine",stationId);
+        getRawDataByEntity(entityFs,minute,date);
+        //环境温度
+        List<PointInfo> entityHjwd = getEntitys("AI072", "turbine",stationId);
+        getLatestByEntity(entityHjwd);
+        //日发电量
+        PointInfo entity = getEntity("Z-ZXYG-JX", "meter",stationId);
+        getSectionDataByEntity(entity,minute,date);
+
+        StationInfoMin day = new StationInfoMin();
+        day.setStationId(stationId);
+        day.setRecordDate(date);
+        double pjfs = entityFs.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
+        day.setPjfs(pjfs);
+        double cxgl = entityCx.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0);
+        cxgl = cxgl * entityCx.getCoef();
+        day.setPjgl(cxgl);
+        double agc = entityAgc.getPointDatas().get(0).getValue() * entityAgc.getCoef();
+        day.setAgc(agc);
+        double rfdl = (entity.getPointDatas().get(1).getValue() - entity.getPointDatas().get(0).getValue()) * entity.getCoef();
+        day.setRfdl(rfdl);
+        double hjwd = entityHjwd.stream().mapToDouble(pi -> pi.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0)).average().orElse(0);
+        day.setHjwd(hjwd);
+        return day;
+    }
     @GetMapping("/haha2")
     public Map<String, Collection<GlycSj>> haha2(@RequestParam(value = "stationId",required = false) String stationId,
                                    @RequestParam(value = "beginTime",required = false) String beginTime,
@@ -489,7 +564,127 @@ public class PredictController {
         }
         return true;
     }
+    @PostMapping("/write/station/dq")
+    public boolean writeStationDq(@RequestBody Map<String, List<GlycSj2>> data) {
+        try {
+            DateTime date = DateUtil.beginOfMinute(DateUtil.date());
+            int i = Math.floorDiv(date.minute(), 15) * 15;
+            date.setMinutes(i);
+            List<RealtimePredict> rpList = new ArrayList<>();
+            List<HistoryPredict> hpList = new ArrayList<>();
+            List<String> ids=new ArrayList<>();
+            data.forEach((tbId,glycsjs)->{
+                for (GlycSj2 glycsj : glycsjs) {
+                    RealtimePredict rp = new RealtimePredict();
+                    rp.setId(tbId+glycsj.getTime());
+                    ids.add(rp.getId());
+                    rp.setModelId("1");
+                    rp.setPredictType("DQ");
+                    rp.setDeviceType("station");
+                    rp.setTime(DateUtil.parseDateTime(glycsj.getTime()));
+                    rp.setSiteId(tbId);
+                    rp.setPredictPower(glycsj.getPower());
+                    rp.setPredictEnergy(glycsj.getEnergy());
+                    rpList.add(rp);
+                    HistoryPredict hp = new HistoryPredict();
+                    hp.setModelId("1");
+                    hp.setPredictType("DQ");
+                    hp.setDeviceType("station");
+                    hp.setDataTime(date);
+                    hp.setPredictTime(DateUtil.parseDateTime(glycsj.getTime()));
+                    hp.setSiteId(tbId);
+                    hp.setPredictPower(glycsj.getPower());
+                    hp.setPredictEnergy(glycsj.getEnergy());
+                    hpList.add(hp);
+                }
+            });
+            realtimePredictService.removeBatchByIds(ids);
+            realtimePredictService.saveBatch(rpList);
+            historyPredictService.saveBatch(hpList);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+        return true;
+    }
     //2024-11-2 00:00:00   ---2024-11-2 00:15:00,2024-11-2 00:30:00,2024-11-2 00:45:00
     //2024-11-2 00:15:00   ---2024-11-2 00:30:00,2024-11-2 00:45:00,2024-11-2 01:00:00
     //2024-11-2 00:30:00   ---2024-11-2 00:45:00,2024-11-2 01:00:00,2024-11-2 01:15:00
+
+    public StationInfoMin getStationinfoByMin(Date date, String stId) {
+        QueryWrapper<StationInfoMin> wrapper = new QueryWrapper<>();
+        wrapper.eq("record_date", date).eq("station_id", stId);
+        List<StationInfoMin> list = stationInfoMinService.list(wrapper);
+        if (CollUtil.isEmpty(list)) {
+            StationInfoMin day = new StationInfoMin();
+            day.setStationId(stId);
+            day.setRecordDate(date);
+            list.add(day);
+        }
+        return list.get(0);
+    }
+    public PointInfo getEntity(String uniformCode, String institutionType,String stId) {
+        PointInfo pi = new PointInfo();
+        pi.setUniformCode(uniformCode);
+        pi.setInstitutionType(institutionType);
+        pi.setStationId(stId);
+        List<PointInfo> byEntity = pointInfoService.getByEntity(pi);
+        return byEntity.get(0);
+    }
+    public void getRawDataByEntity(List<PointInfo> entity, Date start, Date end) {
+        for (PointInfo info : entity) {
+            List<PointData> snap = adapterApi.getHistoryRaw(goldenUri(), info.getPointKey(), start.getTime(), end.getTime());
+            info.setPointDatas(snap);
+        }
+    }
+    public void getRawDataByEntity(PointInfo entity, Date start, Date end) {
+        List<PointData> snap = adapterApi.getHistoryRaw(goldenUri(), entity.getPointKey(), start.getTime(), end.getTime());
+        entity.setPointDatas(snap);
+    }
+    public List<PointInfo> getEntitys(String uniformCode, String institutionType,String stId) {
+        PointInfo pi = new PointInfo();
+        pi.setUniformCode(uniformCode);
+        pi.setInstitutionType(institutionType);
+        pi.setStationId(stId);
+        return pointInfoService.getByEntity(pi);
+    }
+    public void getSectionDataByEntity(PointInfo entity, Date end) {
+        Map<String, PointData> section = adapterApi.getHistorySection(goldenUri(), entity.getPointKey(), end.getTime());
+        section.forEach((k,v)->{
+            entity.setPointDatas(Collections.singletonList(v));
+        });
+    }
+    public URI goldenUri() {
+        return URI.create("http://172.16.12.103:8011/ts");
+    }
+    public void getLatestByEntity(PointInfo entity) {
+        Map<String, PointData> latest = adapterApi.getLatest(goldenUri(), entity.getPointKey());
+        latest.forEach((k,v)->{
+            entity.setPointDatas(Collections.singletonList(v));
+        });
+    }
+    public void getSectionDataByEntity(List<PointInfo> entitys, Date start, Date end) {
+        String collect = entitys.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
+        Map<String, PointData> section0 = adapterApi.getHistorySection(goldenUri(), collect, start.getTime());
+        Map<String, PointData> section1 = adapterApi.getHistorySection(goldenUri(), collect, end.getTime());
+        for (PointInfo entity : entitys) {
+            entity.setPointDatas(new ArrayList<>());
+            entity.getPointDatas().add(section0.get(entity.getPointKey()));
+            entity.getPointDatas().add(section1.get(entity.getPointKey()));
+        }
+    }
+    public void getSectionDataByEntity(PointInfo entity, Date start, Date end) {
+        Map<String, PointData> section0 = adapterApi.getHistorySection(goldenUri(), entity.getPointKey(), start.getTime());
+        Map<String, PointData> section1 = adapterApi.getHistorySection(goldenUri(), entity.getPointKey(), end.getTime());
+        entity.setPointDatas(new ArrayList<>());
+        entity.getPointDatas().add(section0.get(entity.getPointKey()));
+        entity.getPointDatas().add(section1.get(entity.getPointKey()));
+    }
+    public void getLatestByEntity(List<PointInfo> entity) {
+        String collect = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
+        Map<String, PointData> latest = adapterApi.getLatest(goldenUri(), collect);
+        entity.forEach(e -> {
+            e.setPointDatas(Collections.singletonList(latest.get(e.getPointKey())));
+        });
+    }
 }

+ 28 - 6
ruoyi-admin/src/test/java/com/ruoyi/GetDataTest.java

@@ -1,5 +1,7 @@
 package com.ruoyi;
 
+import cn.hutool.core.date.DateField;
+import cn.hutool.core.date.DateRange;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.text.csv.CsvUtil;
@@ -43,16 +45,17 @@ public class GetDataTest {
     public void test2() {
 //        DateTime begin = DateUtil.parse("2023-03-21");
         DateTime begin = DateUtil.parse("2023-04-18");
-//        DateTime begin = DateUtil.parse("2024-08-08 13:30:00");
+//        DateTime begin = DateUtil.parse("2024-08-19 11:00:00");
 //        DateTime end = DateUtil.parse("2024-08-08 14:00:00");
-        DateTime end = DateUtil.parse("2024-11-01");
+        DateTime end = DateUtil.parse("2024-11-03");
+//        DateTime end = DateUtil.parse("2024-08-19 11:30:00");
 //        DateTime end = DateUtil.parse("2024-08-08 13:45:00");
-        //LJS,FSG,JSL
+        //LJS,FSG,JSL,ZZ,XZ,CSL
         int i = 1;
         DateTime minBegin = begin, minEnd = DateUtil.offsetMinute(begin, 15);
         while (minEnd.isBefore(end)) {
             minEnd = DateUtil.offsetMinute(begin, i * 15);
-            task.calcStationSjglAgcPjfsHjwdDlMin(minBegin, minEnd, "GJNY_SXGS_LJS_FDC_STA");
+            task.calcStationSjglAgcPjfsHjwdDlMin(minBegin, minEnd, "GJNY_SXGS_CSL_FDC_STA");
             System.out.println(minBegin.toString() + "," + minEnd.toString());
             i++;
             minBegin = minEnd;
@@ -63,9 +66,28 @@ public class GetDataTest {
         task.getPoint();
     }
     @Test
+    public void test6() {
+        DateTime begin = DateUtil.parse("2023-04-18");
+        DateTime end = DateUtil.parse("2024-11-03");
+        //LJS,FSG,JSL
+        int i = 1;
+        DateTime minBegin = begin, minEnd = DateUtil.offsetMinute(begin, 15);
+        while (minEnd.isBefore(end)) {
+            minEnd = DateUtil.offsetMinute(begin, i * 15);
+            task.calcStationMinZtts(minEnd, "GJNY_SXGS_JSL_FDC_STA");
+            System.out.println(minBegin.toString() + "," + minEnd.toString());
+            i++;
+            minBegin = minEnd;
+        }
+    }
+    @Test
     public void test3() {
-        DateTime date = DateUtil.date();
-        task.calcPredictExamin(date);
+        DateTime start = DateUtil.parse("2024-10-31");
+        DateTime end = DateUtil.parse("2024-11-03");
+        DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
+        for (DateTime date : range) {
+            task.calcPredictExamin(date);
+        }
     }
 
     @Test

+ 3 - 3
ruoyi-admin/src/test/java/com/ruoyi/NewTests.java

@@ -160,14 +160,14 @@ public class NewTests {
 //            task.writeReportPool(date);
 //            task.writeReportPoolProject(date);
 //            task.calcStationHourPjglRfdl(DateUtil.date());
-            task.calcTurbine5s2(date);
+//            task.calcTurbine5s2(date);
         }
 //        task.calcStationHourPjglRfdl(DateUtil.date());
-//        DateTime date = DateUtil.date();
+        DateTime date = DateUtil.date();
 //        task.calcStationHourPJGL(date);
 //        task.calcLineRfdl(date);
 //        task.calcStationHourRFDL(date);
-//        task.calcTurbinePjfsPjglKyglLlglMin(DateUtil.date(), 15);
+        task.calcTurbinePjfsPjglKyglLlglMin(DateUtil.date(), 15);
 //        task.calcStationLlglKyglSjglAgcMin(date, 15);
     }
     @Test

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -108,7 +108,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                 // 过滤请求
                 .authorizeRequests()
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
-                .antMatchers("/login", "/register", "/captchaImage","/predict/*").permitAll()
+                .antMatchers("/login", "/register", "/captchaImage","/predict/**").permitAll()
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 1 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/GlycSj2.java

@@ -6,4 +6,5 @@ import lombok.Data;
 public class GlycSj2 {
     private String time;
     private Double power;
+    private Double energy;
 }

+ 11 - 3
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/StationInfoMin.java

@@ -3,6 +3,8 @@ package com.ruoyi.ucp.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -23,24 +25,31 @@ public class StationInfoMin implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @TableId(value = "id", type = IdType.AUTO)
+    @JsonIgnore
     private Integer id;
 
+    @JsonIgnore
     private String stationId;
 
+    @JsonProperty("record_date")
     private Date recordDate;
 
     private Double pjfs;
 
     private Double pjgl;
 
+    @JsonIgnore
     private Double llgl;
 
+    @JsonIgnore
     private Double kygl;
 
     private Double agc;
 
+    @JsonIgnore
     private Double dqycgl;
 
+    @JsonIgnore
     private Double cdqycgl;
 
     private Double rfdl;
@@ -79,8 +88,7 @@ public class StationInfoMin implements Serializable {
     }
 
     public void setPjgl(Double pjgl) {
-        if (pjgl == null) pjgl = 0.0;
-        if (pjgl < -292) pjgl = -292.0;
+        if (pjgl == null || pjgl<0) pjgl = 0.0;
         if (pjgl > 169600) pjgl = 169600.0;
         this.pjgl = pjgl;
     }
@@ -99,7 +107,7 @@ public class StationInfoMin implements Serializable {
     public void setHjwd(Double hjwd) {
         if (hjwd == null) hjwd = 0.0;
         if (hjwd < -30) hjwd = -30.0;
-        if (hjwd > 40) hjwd = 40.0;
+        if (hjwd > 55) hjwd = 55.0;
         this.hjwd = hjwd;
     }
 }