Browse Source

获取数据3

GYEE 7 months ago
parent
commit
646cf849be

+ 3 - 3
ruoyi-admin/pom.xml

@@ -28,11 +28,11 @@
         </dependency>
 
         <!-- spring-boot-devtools -->
-        <dependency>
+        <!--<dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional> <!-- 表示依赖不会传递 -->
-        </dependency>
+            <optional>true</optional> &lt;!&ndash; 表示依赖不会传递 &ndash;&gt;
+        </dependency>-->
 
         <!-- swagger3-->
         <dependency>

+ 282 - 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.net.URI;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
@@ -64,6 +65,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
     private IPredictExaminService predictExaminService;
     @Resource
     private IStationInfoMin2Service stationInfoMin2Service;
+    @Resource
+    private IProjectInfoMin2Service projectInfoMin2Service;
 
     @Override
     public void execute() throws Exception {
@@ -3235,6 +3238,30 @@ public class JavaFunctionJobHandler extends IJobHandler {
         stationInfoMinService.saveOrUpdate(byMin);
     }
 
+    public Map<Double, Long> calcSectionZtts(Date time, String stId, Function<PointInfo, String> fun) {
+        Map<Double, Long> diztTs = calcSectionDiztTs(time, stId, fun);
+        Map<Double, Long> aiztTs = calcSectionAiztTs(time, stId, fun);
+        if (diztTs.isEmpty()) {
+            return aiztTs;
+        } else if (aiztTs.isEmpty()) {
+            return diztTs;
+        } else if (diztTs.size() > aiztTs.size()) {
+            diztTs.forEach((k, v) -> {
+                long l = aiztTs.getOrDefault(k, 0L);
+                if (v == null) v = 0L;
+                v = v + l;
+            });
+            return diztTs;
+        } else {
+            aiztTs.forEach((k, v) -> {
+                long l = diztTs.getOrDefault(k, 0L);
+                if (v == null) v = 0L;
+                v = v + l;
+            });
+            return aiztTs;
+        }
+    }
+
     public Map<Double, Long> calcSectionStationZtts(Date time, String stId) {
         Map<Double, Long> diztTs = calcSectionStationDiztTs(time, stId);
         Map<Double, Long> aiztTs = calcSectionStationAiztTs(time, stId);
@@ -3608,6 +3635,103 @@ public class JavaFunctionJobHandler extends IJobHandler {
         return entityAiZt;
     }
 
+    public Map<Double, Long> calcSectionDiztTs(Date time, String id, Function<PointInfo, String> fun) {
+        List<PointInfo> entity = new ArrayList<>();
+        List<PointInfo> result = new ArrayList<>();
+        List<PointInfo> entity0 = getEntity("MX000", "state");
+        List<PointInfo> entity1 = getEntity("MX001", "state");
+        List<PointInfo> entity2 = getEntity("MX002", "state");
+        List<PointInfo> entity4 = getEntity("MX004", "state");
+        List<PointInfo> entity6 = getEntity("MX006", "state");
+        entity.addAll(entity0);
+        entity.addAll(entity1);
+        entity.addAll(entity2);
+        entity.addAll(entity4);
+        entity.addAll(entity6);
+        entity = entity.stream().filter(pi -> id.equals(fun.apply(pi))).collect(Collectors.toList());
+        if (CollUtil.isEmpty(entity)) return new HashMap<>();
+        String keys = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
+        Map<String, PointData> latest = adapter.getHistorySection(goldenUri(), keys, time.getTime());
+
+        Map<String, Map<String, PointInfo>> wtUcPis = entity.stream().collect(Collectors.groupingBy(PointInfo::getTurbineId, Collectors.toMap(PointInfo::getUniformCode, Function.identity())));
+        wtUcPis.forEach((wtId, map) -> {
+            PointInfo info2 = map.get("MX002");
+            PointData data2 = latest.get(info2.getPointKey());
+            if (data2.getValue() == 1.0) {
+                data2.setDoubleValue(2.0);
+                data2.setBooleanValue(false);
+                info2.setPointDatas(Collections.singletonList(data2));
+                result.add(info2);
+            } else {
+                PointInfo info0 = map.get("MX000");
+                PointData data0 = latest.get(info0.getPointKey());
+                if (data0.getValue() == 1.0) {
+                    data0.setDoubleValue(0.0);
+                    data0.setBooleanValue(false);
+                    info0.setPointDatas(Collections.singletonList(data0));
+                    result.add(info0);
+                } else {
+                    PointInfo info6 = map.get("MX006");
+                    PointData data6 = latest.get(info6.getPointKey());
+                    if (data6.getValue() == 1.0) {
+                        data6.setDoubleValue(6.0);
+                        data6.setBooleanValue(false);
+                        info6.setPointDatas(Collections.singletonList(data6));
+                        result.add(info6);
+                    } else {
+                        PointInfo info4 = map.get("MX004");
+                        PointData data4 = latest.get(info4.getPointKey());
+                        if (data4.getValue() == 1.0) {
+                            data4.setDoubleValue(4.0);
+                            data4.setBooleanValue(false);
+                            info4.setPointDatas(Collections.singletonList(data4));
+                            result.add(info4);
+                        } else {
+                            PointInfo info1 = map.get("MX001");
+                            PointData data1 = latest.get(info1.getPointKey());
+                            if (data1.getValue() == 1.0) {
+                                data1.setDoubleValue(1.0);
+                                data1.setBooleanValue(false);
+                                info1.setPointDatas(Collections.singletonList(data1));
+                                result.add(info1);
+                            } else {
+                                System.out.println("wtId: " + wtId + ",状态值无批配: " + data1.getValue());
+                                data1.setDoubleValue(2.0);
+                                info1.setPointDatas(Collections.singletonList(data1));
+                                result.add(info1);
+                            }
+                        }
+                    }
+                }
+            }
+        });
+        Map<Double, Long> longMap = result.stream().collect(Collectors.groupingBy(pi -> pi.getPointDatas().get(0).getValue(), Collectors.counting()));
+        return longMap;
+    }
+
+    public Map<Double, Long> calcSectionAiztTs(Date time, String id, Function<PointInfo, String> fun) {
+        List<PointInfo> entityAiZt = getEntity("AI422", "state");
+        entityAiZt = entityAiZt.stream().filter(pi -> id.equals(fun.apply(pi))).collect(Collectors.toList());
+        if (CollUtil.isEmpty(entityAiZt)) return new HashMap<>();
+        List<StateAi> list = stateAiService.list();
+        //机型,源状态,目标状态
+        Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
+        String collect = entityAiZt.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
+        Map<String, PointData> latest = adapter.getHistorySection(goldenUri(), collect, time.getTime());
+        for (PointInfo info : entityAiZt) {
+            PointData data = latest.get(info.getPointKey());
+            Integer m = collectAi.get(info.getSpare()).get((int) data.getValue());
+            if (m == null) {
+                m = 2;
+                System.out.println("ai状态未配对:" + data.getValue());
+            }
+            data.setDoubleValue(m);
+            info.setPointDatas(Collections.singletonList(data));
+        }
+        Map<Double, Long> longMap = entityAiZt.stream().collect(Collectors.groupingBy(pi -> pi.getPointDatas().get(0).getValue(), Collectors.counting()));
+        return longMap;
+    }
+
     public void getAgoAvg(List<PointInfo> entity, Date start, Date end) {
         for (PointInfo info : entity) {
             DoubleStatData snap = adapter.getHistoryStat(goldenUri(), info.getPointKey(), start.getTime(), end.getTime());
@@ -4879,6 +5003,155 @@ public class JavaFunctionJobHandler extends IJobHandler {
         stationInfoMin2Service.save(min2);
     }
 
+    public List<PointInfo> filterPointInfo(List<PointInfo> entity, String id, Function<PointInfo, String> fun) {
+        return entity.stream().filter(e -> id.equals(fun.apply(e))).collect(Collectors.toList());
+    }
+
+    public List<PointInfo> sortPointInfo(List<PointInfo> entity, Function<PointInfo, String> fun) {
+        return entity.stream().sorted(Comparator.comparing(fun)).collect(Collectors.toList());
+    }
+
+    public void calcProjectPjfsHjwdMin2(Date begin, Date end, String stId, StationInfoMin2 min) {
+        //风速
+        List<PointInfo> entityFs = getEntity("AI066", "turbine");
+        entityFs = filterPointInfo(entityFs, stId, PointInfo::getStationId);
+        Map<String, List<PointInfo>> pisMap = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getProjectId));
+        List<ProjectInfoMin2> min2s = new ArrayList<>();
+        pisMap.forEach((pjId, pis) -> {
+            List<PointInfo> infos = sortPointInfo(pis, PointInfo::getTurbineId);
+            List<Integer> fjidns = infos.stream().map(pi -> Integer.parseInt(pi.getTurbineId().replaceFirst("GJNY_SXGS_.+_F_WT_", "")
+                    .replaceFirst("_EQ", ""))).collect(Collectors.toList());
+//            Map<Double, Long> zttsMap = calcSectionZtts(end,pjId,PointInfo::getProjectId);
+//            Long l = zttsMap.get(2.0);
+//            if (l == null) l = 0L;
+            //日发电量
+//            List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
+//            entity=filterPointInfo(entity,pjId,PointInfo::getProjectId);
+//            getSectionDataByEntity(entity, goldenUri(), begin, end);
+//            double rfdl = entity.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 >= 32500) rfdl = 32500.0;
+            ProjectInfoMin2 min2 = new ProjectInfoMin2();
+            min2.setStationId(stId);
+            min2.setProjectId(pjId);
+            min2.setRecordDate(end);
+//            min2.setRfdl(rfdl);
+            min2.setRfdl(min.getRfdl());
+            min2.setHjwd(min.getHjwd());
+//            min2.setYxts(l);
+            min2.setYxts(min.getYxts());
+            sm2fs2pm2(fjidns, min2, min);
+            min2s.add(min2);
+        });
+        projectInfoMin2Service.saveBatch(min2s);
+    }
+
+    public ProjectInfoMin2 calcProjectPjfsHjwdMin2(Date end, String pjId) {
+        DateTime begin = DateUtil.offsetMinute(end, -15);
+        //风速
+        List<PointInfo> entityFs = getEntity("AI066", "turbine");
+        entityFs = filterPointInfo(entityFs, pjId, PointInfo::getProjectId);
+        getRawDataByEntity(entityFs, goldenUri(), begin, end);
+        entityFs = sortPointInfo(entityFs, PointInfo::getTurbineId);
+        List<Double> fss = new ArrayList<>();
+        for (PointInfo ef : entityFs) {
+            double v = 0;
+            if (ef.getPointDatas() == null || ef.getPointDatas().isEmpty()) {
+                Map<String, PointData> latest = adapter.getLatest(goldenUri(), ef.getPointKey());
+                PointData data = latest.get(ef.getPointKey());
+                if (data!=null) v = data.getValue();
+            } else {
+                v = ef.getPointDatas().stream().mapToDouble(p -> p.getValue() > 23 ? 23.0 : p.getValue() < 0 ? 0.0 : p.getValue()).average().orElse(0.0);
+            }
+            fss.add(v);
+        }
+        //日发电量
+        List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
+        entity = filterPointInfo(entity, pjId, PointInfo::getProjectId);
+        getSectionDataByEntity(entity, goldenUri(), begin, end);
+        double rfdl = entity.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 >= 32500) rfdl = 32500.0;
+        //环境温度
+        List<PointInfo> entityHjwd = getEntity("AI072", "turbine");
+        entityHjwd = filterPointInfo(entityHjwd, pjId, PointInfo::getProjectId);
+        getRawDataByEntity(entityHjwd, goldenUri(), begin, end);
+        List<Double> hjwds = new ArrayList<>();
+        for (PointInfo wd : entityHjwd) {
+            double v = wd.getPointDatas().stream().filter(p -> p.getValue() != 0.0).mapToDouble(PointData::getValue).average().orElse(0.0);
+            if (v > 83 || v < -60) v = 0;
+            if (v == 0) {
+                v = fjhjwd.getOrDefault(wd.getTurbineId(), 0.0);
+            } else {
+                fjhjwd.put(wd.getTurbineId(), v);
+            }
+            hjwds.add(v);
+        }
+
+        ProjectInfoMin2 min2 = new ProjectInfoMin2();
+        min2.setProjectId(pjId);
+        min2.setRecordDate(end);
+        min2.setRfdl(rfdl);
+        min2.setHjwd(hjwds.stream().filter(d -> d != 0.0).mapToDouble(Double::doubleValue).average().orElse(0.0));
+        sm2fs2pm2(fss, min2);
+        return min2;
+    }
+
+    private void sm2fs2pm2(List<Integer> is, ProjectInfoMin2 pjMin2, StationInfoMin2 stMin2) {
+        List<Double> r = new ArrayList<>();
+        String prefix1 = "getPjfs";
+        try {
+            for (Integer i : is) {
+                // 构造方法名
+                String methodName = prefix1 + i;
+                // 获取方法对象
+                Method method = stMin2.getClass().getMethod(methodName);
+                // 调用方法并获取返回值
+                Double result = (Double) method.invoke(stMin2);
+                // 将结果添加到列表中
+                r.add(result);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        //setPjfs44(Double pjfs44)
+        String prefix2 = "setPjfs";
+        try {
+            for (int i = 0; i < r.size(); i++) {
+                // 构造方法名
+                String methodName = prefix2 + (i + 1);
+                // 获取方法对象
+                Method method = pjMin2.getClass().getMethod(methodName, Double.class);
+                // 调用方法并获取返回值
+                method.invoke(pjMin2, r.get(i));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void sm2fs2pm2(List<Double> fs, ProjectInfoMin2 pjMin2) {
+        String prefix2 = "setPjfs";
+        try {
+            for (int i = 0; i < fs.size(); i++) {
+                // 构造方法名
+                String methodName = prefix2 + (i + 1);
+                // 获取方法对象
+                Method method = pjMin2.getClass().getMethod(methodName, Double.class);
+                // 调用方法并获取返回值
+                method.invoke(pjMin2, fs.get(i));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
     public StationInfoMin2 calcStationPjfsHjwdMin2(Date end, String stId) {
         DateTime begin = DateUtil.offsetMinute(end, -15);
         //出线
@@ -4957,31 +5230,31 @@ public class JavaFunctionJobHandler extends IJobHandler {
         }
         switch (i) {
             case 1:
-                min2.setpjfs1(v);
+                min2.setPjfs1(v);
                 break;
             case 2:
-                min2.setpjfs2(v);
+                min2.setPjfs2(v);
                 break;
             case 3:
-                min2.setpjfs3(v);
+                min2.setPjfs3(v);
                 break;
             case 4:
-                min2.setpjfs4(v);
+                min2.setPjfs4(v);
                 break;
             case 5:
-                min2.setpjfs5(v);
+                min2.setPjfs5(v);
                 break;
             case 6:
-                min2.setpjfs6(v);
+                min2.setPjfs6(v);
                 break;
             case 7:
-                min2.setpjfs7(v);
+                min2.setPjfs7(v);
                 break;
             case 8:
-                min2.setpjfs8(v);
+                min2.setPjfs8(v);
                 break;
             case 9:
-                min2.setpjfs9(v);
+                min2.setPjfs9(v);
                 break;
             case 10:
                 min2.setPjfs10(v);

+ 139 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/PredictController.java

@@ -8,10 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ruoyi.ucp.entity.*;
 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 com.ruoyi.ucp.service.*;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -22,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+//@RestController
 @RestController
 @RequestMapping("/predict")
 public class PredictController {
@@ -38,9 +36,16 @@ public class PredictController {
     private IHistoryPredictService historyPredictService;
     @Resource
     private IStationInfoMinService stationInfoMinService;
+    @Resource
+    private IStationInfoMin2Service stationInfoMin2Service;
+    @Resource
+    private IProjectInfoMin2Service projectInfoMin2Service;
+
 
     private Map<String, PointInfo> tbInfos = new ConcurrentHashMap<>();
 
+    private Map<String, String> pj2st = null;
+
     @GetMapping("/stbs")
     public Map<String, List<Integer>> stbs() {
         QueryWrapper<PointInfo> wrapper = new QueryWrapper<>();
@@ -61,6 +66,18 @@ public class PredictController {
         return list.stream().collect(Collectors.groupingBy(pi -> pi.getStationId(), Collectors.mapping(pi -> pi.getTurbineId(), Collectors.toList())));
     }
 
+    @GetMapping("/projectIds")
+    public Map<String, List<String>> projectIds() {
+        QueryWrapper<PointInfo> wrapper = new QueryWrapper<>();
+        wrapper.lambda().eq(PointInfo::getInstitutionType, "turbine")
+                .in(PointInfo::getUniformCode, "AI121");
+        List<PointInfo> list = pointInfoService.list(wrapper);
+        if (pj2st == null) {
+            pj2st = list.stream().collect(Collectors.toMap(PointInfo::getProjectId, PointInfo::getStationId, (k1, k2) -> k1));
+        }
+        return list.stream().collect(Collectors.groupingBy(pi -> pi.getProjectId(), Collectors.mapping(pi -> pi.getTurbineId(), Collectors.toList())));
+    }
+
     @GetMapping("/snap")
     public Map<String, Collection<GlycSj>> haha(@RequestParam(value = "stationId", required = false) String stationId,
                                                 @RequestParam(value = "beginTime", required = false) String beginTime,
@@ -312,13 +329,13 @@ public class PredictController {
                                                 @RequestParam(value = "endTime", required = false) String endTime) {
 
         DateTime begin = DateUtil.parse(beginTime);
-        DateTime middle = DateUtil.parse("2024-11-03");
+        DateTime middle = DateUtil.parse("2024-11-07");
         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<>();
+//                List<StationInfoMin> min=new ArrayList<>();
         int i = 1;
         DateTime minBegin = middle, minEnd = DateUtil.offsetMinute(middle, 15);
         while (minEnd.isBefore(end)) {
@@ -333,6 +350,60 @@ public class PredictController {
         return list;
     }
 
+    @GetMapping("/snap/station")
+    public List<StationInfoMin2> latestStation(@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-07");
+        DateTime end = DateUtil.parse(endTime);
+        QueryWrapper<StationInfoMin2> minWrapper = new QueryWrapper<>();
+        minWrapper.lambda().eq(StationInfoMin2::getStationId, stationId).between(StationInfoMin2::getRecordDate, begin, middle)
+                .orderByAsc(StationInfoMin2::getRecordDate);
+        List<StationInfoMin2> list = stationInfoMin2Service.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);
+            StationInfoMin2 day = task.calcStationPjfsHjwdMin2(minEnd, stationId);
+            System.out.println(minBegin.toString() + "," + minEnd.toString());
+            i++;
+            minBegin = minEnd;
+            list.add(day);
+        }
+        if (stationId.equals("GJNY_SXGS_CSL_FDC_STA")) {
+            list.stream().peek(m2 -> m2.setYxts(0L)).collect(Collectors.toList());
+        }
+        return list;
+    }
+
+    @GetMapping("/snap/project")
+    public List<ProjectInfoMin2> latestProject(@RequestParam(value = "projectId", required = false) String projectId,
+                                               @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-07");
+        DateTime end = DateUtil.parse(endTime);
+        QueryWrapper<ProjectInfoMin2> minWrapper = new QueryWrapper<>();
+        minWrapper.lambda().eq(ProjectInfoMin2::getProjectId, projectId).between(ProjectInfoMin2::getRecordDate, begin, middle)
+                .orderByAsc(ProjectInfoMin2::getRecordDate);
+        List<ProjectInfoMin2> list = projectInfoMin2Service.list(minWrapper);
+        int i = 1;
+        DateTime minBegin = middle, minEnd = DateUtil.offsetMinute(middle, 15);
+        while (minEnd.isBefore(end)) {
+            minEnd = DateUtil.offsetMinute(middle, i * 15);
+            ProjectInfoMin2 min2 = task.calcProjectPjfsHjwdMin2(minEnd, projectId);
+            System.out.println(minBegin.toString() + "," + minEnd.toString());
+            i++;
+            minBegin = minEnd;
+            list.add(min2);
+        }
+        return list;
+    }
+
     @GetMapping("/latest/station/dq")
     public StationInfoMin latestStationDq(@RequestParam(value = "stationId", required = false) String stationId) {
         DateTime date = DateUtil.beginOfMinute(DateUtil.date());
@@ -342,6 +413,24 @@ public class PredictController {
         return task.calcStationSjglAgcPjfsHjwdDlMin2(minute, date, stationId);
     }
 
+    @GetMapping("/latest/station")
+    public StationInfoMin2 latestStation(@RequestParam(value = "stationId", required = false) String stationId) {
+        DateTime date = DateUtil.beginOfMinute(DateUtil.date());
+        int i = Math.floorDiv(date.minute(), 15) * 15;
+        date.setMinutes(i);
+        StationInfoMin2 min2 = task.calcStationPjfsHjwdMin2(date, stationId);
+        if (stationId.equals("GJNY_SXGS_CSL_FDC_STA")) min2.setYxts(0L);
+        return min2;
+    }
+    @GetMapping("/latest/project")
+    public ProjectInfoMin2 latestProject(@RequestParam(value = "projectId", required = false) String projectId) {
+        DateTime date = DateUtil.beginOfMinute(DateUtil.date());
+        int i = Math.floorDiv(date.minute(), 15) * 15;
+        date.setMinutes(i);
+        ProjectInfoMin2 min2 = task.calcProjectPjfsHjwdMin2(date, projectId);
+        return min2;
+    }
+
     @GetMapping("/latest/station/dq2")
     public StationInfoMin latestStationDq2(@RequestParam(value = "stationId", required = false) String stationId) {
         DateTime date = DateUtil.beginOfMinute(DateUtil.date());
@@ -575,7 +664,7 @@ public class PredictController {
     }
 
     @PostMapping("/write/station/{type}")
-    public boolean writeStationDq(@PathVariable String type, @RequestBody Map<String, List<GlycSj2>> data) {
+    public boolean writeStation(@PathVariable String type, @RequestBody Map<String, List<GlycSj2>> data) {
         try {
             DateTime date = DateUtil.beginOfMinute(DateUtil.date());
             int i = Math.floorDiv(date.minute(), 15) * 15;
@@ -605,7 +694,7 @@ public class PredictController {
                     rp.setPredictPower(glycsj.getPower());
                     rp.setPredictEnergy(glycsj.getEnergy());
                     rpList.add(rp);
-                    if(predictType.equals("ZCQ")) continue;
+                    if (predictType.equals("ZCQ")) continue;
                     HistoryPredict hp = new HistoryPredict();
                     hp.setModelId(modelId);
                     hp.setPredictType(predictType);
@@ -627,6 +716,48 @@ public class PredictController {
         }
         return true;
     }
+
+    @PostMapping("/write/project/{type}")
+    public boolean writeProject(@PathVariable String type, @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<String> ids = new ArrayList<>();
+            String modelId = "1";
+            String predictType = type.toUpperCase();
+            String deviceType = "project";
+            data.forEach((pjId, glycsjs) -> {
+                //yyyy-MM-dd HH:mm:ss
+                //GJNY_SXGS_CSLF01_EG
+                //2024-10-23 15:00:00
+                String sstId = pjId.replaceFirst("GJNY_SXGS_", "").replaceFirst("EG", "");
+                for (GlycSj2 glycsj : glycsjs) {
+                    DateTime ycTime = DateUtil.parseDateTime(glycsj.getTime());
+                    String t = StrUtil.removeSuffix(glycsj.getTime(), ":00").replaceFirst(" ", "_").replaceFirst(":", "-");
+                    RealtimePredict rp = new RealtimePredict();
+                    rp.setId(predictType + "_" + modelId + "_" + sstId + t);
+                    ids.add(rp.getId());
+                    rp.setModelId(modelId);
+                    rp.setPredictType(predictType);
+                    rp.setDeviceType(deviceType);
+                    rp.setTime(ycTime);
+                    rp.setSiteId(pj2st.get(pjId));
+                    rp.setPeriodId(pjId);
+                    rp.setPredictPower(glycsj.getEnergy() * 4);
+                    rp.setPredictEnergy(glycsj.getEnergy());
+                    rpList.add(rp);
+                }
+            });
+            realtimePredictService.removeBatchByIds(ids);
+            realtimePredictService.saveBatch(rpList);
+        } 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

+ 29 - 4
ruoyi-admin/src/test/java/com/ruoyi/GetDataTest.java

@@ -10,12 +10,11 @@ import cn.hutool.core.thread.ExecutorBuilder;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.CharsetUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.ruoyi.ucp.entity.GlycSj;
-import com.ruoyi.ucp.entity.PointData;
-import com.ruoyi.ucp.entity.PointInfo;
-import com.ruoyi.ucp.entity.StationInfoMin;
+import com.ruoyi.ucp.entity.*;
 import com.ruoyi.ucp.feign.AdapterApi;
 import com.ruoyi.ucp.service.IPointInfoService;
+import com.ruoyi.ucp.service.IProjectInfoMin2Service;
+import com.ruoyi.ucp.service.IStationInfoMin2Service;
 import com.ruoyi.ucp.service.IStationInfoMinService;
 import com.ruoyi.web.controller.JavaFunctionJobHandler;
 import org.junit.Test;
@@ -44,6 +43,10 @@ public class GetDataTest {
     private JavaFunctionJobHandler task;
     @Resource
     private IStationInfoMinService stationInfoMinService;
+    @Resource
+    private IStationInfoMin2Service stationInfoMin2Service;
+    @Resource
+    private IProjectInfoMin2Service projectInfoMin2Service;
 
     @Test
     public void test2() {
@@ -89,6 +92,28 @@ public class GetDataTest {
         }
     }
     @Test
+    public void test10() {
+        DateTime begin = DateUtil.parse("2023-04-18");
+//        DateTime begin = DateUtil.parse("2023-05-24 21:15:00");
+        DateTime end = DateUtil.parse("2024-11-07");
+//        DateTime end = DateUtil.parse("2023-04-19");
+        String stId = "GJNY_SXGS_CSL_FDC_STA";
+        QueryWrapper<StationInfoMin2> wrapper=new QueryWrapper<>();
+        wrapper.lambda().eq(StationInfoMin2::getStationId,stId).between(StationInfoMin2::getRecordDate,begin,end);
+        List<StationInfoMin2> list = stationInfoMin2Service.list(wrapper);
+        Map<String, StationInfoMin2> collect = list.stream().collect(Collectors.toMap(im -> DateUtil.date(im.getRecordDate()).toString(), Function.identity()));
+        //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.calcProjectPjfsHjwdMin2(minBegin, minEnd, stId,collect.get(DateUtil.date(minEnd).toString()));
+            System.out.println(minBegin.toString() + "," + minEnd.toString());
+            i++;
+            minBegin = minEnd;
+        }
+    }
+    @Test
     public void test5() {
         task.getPoint();
     }

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

@@ -188,12 +188,12 @@ public class NewTests {
 
     @Test
     public void test4() {
-        while (true){
-            task.calcStationRealtimeLLgl();
-            ThreadUtil.sleep(60000);
-        }
-//        DateTime start = DateUtil.parse("2024-01-02");
-//        DateTime end = DateUtil.parse("2024-11-05");
+//        while (true){
+//            task.calcStationRealtimeLLgl();
+//            ThreadUtil.sleep(60000);
+//        }
+        DateTime start = DateUtil.parse("2024-8-17");
+        DateTime end = DateUtil.parse("2024-11-17");
 //        DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
 //        List<String> stIds = new ArrayList<>();
 //        stIds.add("GJNY_SXGS_FSG_FDC_STA");
@@ -206,7 +206,7 @@ public class NewTests {
 ////            task.calcTurbineStateMin(date);
 ////            task.khjfbc(stIds,date);
 //        }
-//        task.calcGlqxnhSurplus(start, end);
+        task.calcGlqxnhSurplus(start, end);
 
     }
 

+ 673 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/ProjectInfoMin2.java

@@ -0,0 +1,673 @@
+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 java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-11-10
+ */
+@TableName("project_info_min2")
+public class ProjectInfoMin2 implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @JsonIgnore
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    @JsonIgnore
+    private String stationId;
+
+    @JsonIgnore
+    private String projectId;
+
+    @JsonProperty("record_date")
+    private Date recordDate;
+
+    private Double rfdl;
+
+    private Double hjwd;
+
+    private Long yxts;
+
+    private Double tqfs;
+
+    private Double pjfs1;
+
+    private Double pjfs2;
+
+    private Double pjfs3;
+
+    private Double pjfs4;
+
+    private Double pjfs5;
+
+    private Double pjfs6;
+
+    private Double pjfs7;
+
+    private Double pjfs8;
+
+    private Double pjfs9;
+
+    private Double pjfs10;
+
+    private Double pjfs11;
+
+    private Double pjfs12;
+
+    private Double pjfs13;
+
+    private Double pjfs14;
+
+    private Double pjfs15;
+
+    private Double pjfs16;
+
+    private Double pjfs17;
+
+    private Double pjfs18;
+
+    private Double pjfs19;
+
+    private Double pjfs20;
+
+    private Double pjfs21;
+
+    private Double pjfs22;
+
+    private Double pjfs23;
+
+    private Double pjfs24;
+
+    private Double pjfs25;
+
+    private Double pjfs26;
+
+    private Double pjfs27;
+
+    private Double pjfs28;
+
+    private Double pjfs29;
+
+    private Double pjfs30;
+
+    private Double pjfs31;
+
+    private Double pjfs32;
+
+    private Double pjfs33;
+
+    private Double pjfs34;
+
+    private Double pjfs35;
+
+    private Double pjfs36;
+
+    private Double pjfs37;
+
+    private Double pjfs38;
+
+    private Double pjfs39;
+
+    private Double pjfs40;
+
+    private Double pjfs41;
+
+    private Double pjfs42;
+
+    private Double pjfs43;
+
+    private Double pjfs44;
+
+    private Double pjfs45;
+
+    private Double pjfs46;
+
+    private Double pjfs47;
+
+    private Double pjfs48;
+
+    private Double pjfs49;
+
+    private Double pjfs50;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getStationId() {
+        return stationId;
+    }
+
+    public void setStationId(String stationId) {
+        this.stationId = stationId;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public Date getRecordDate() {
+        return recordDate;
+    }
+
+    public void setRecordDate(Date recordDate) {
+        this.recordDate = recordDate;
+    }
+
+    public Double getRfdl() {
+        return rfdl;
+    }
+
+    public void setRfdl(Double rfdl) {
+        this.rfdl = rfdl;
+    }
+
+    public Double getHjwd() {
+        return hjwd;
+    }
+
+    public void setHjwd(Double hjwd) {
+        this.hjwd = hjwd;
+    }
+
+    public Long getYxts() {
+        return yxts;
+    }
+
+    public void setYxts(Long yxts) {
+        this.yxts = yxts;
+    }
+
+    public Double getTqfs() {
+        return tqfs;
+    }
+
+    public void setTqfs(Double tqfs) {
+        this.tqfs = tqfs;
+    }
+
+    public Double getPjfs1() {
+        return pjfs1;
+    }
+
+    public void setPjfs1(Double pjfs1) {
+        this.pjfs1 = pjfs1;
+    }
+
+    public Double getPjfs2() {
+        return pjfs2;
+    }
+
+    public void setPjfs2(Double pjfs2) {
+        this.pjfs2 = pjfs2;
+    }
+
+    public Double getPjfs3() {
+        return pjfs3;
+    }
+
+    public void setPjfs3(Double pjfs3) {
+        this.pjfs3 = pjfs3;
+    }
+
+    public Double getPjfs4() {
+        return pjfs4;
+    }
+
+    public void setPjfs4(Double pjfs4) {
+        this.pjfs4 = pjfs4;
+    }
+
+    public Double getPjfs5() {
+        return pjfs5;
+    }
+
+    public void setPjfs5(Double pjfs5) {
+        this.pjfs5 = pjfs5;
+    }
+
+    public Double getPjfs6() {
+        return pjfs6;
+    }
+
+    public void setPjfs6(Double pjfs6) {
+        this.pjfs6 = pjfs6;
+    }
+
+    public Double getPjfs7() {
+        return pjfs7;
+    }
+
+    public void setPjfs7(Double pjfs7) {
+        this.pjfs7 = pjfs7;
+    }
+
+    public Double getPjfs8() {
+        return pjfs8;
+    }
+
+    public void setPjfs8(Double pjfs8) {
+        this.pjfs8 = pjfs8;
+    }
+
+    public Double getPjfs9() {
+        return pjfs9;
+    }
+
+    public void setPjfs9(Double pjfs9) {
+        this.pjfs9 = pjfs9;
+    }
+
+    public Double getPjfs10() {
+        return pjfs10;
+    }
+
+    public void setPjfs10(Double pjfs10) {
+        this.pjfs10 = pjfs10;
+    }
+
+    public Double getPjfs11() {
+        return pjfs11;
+    }
+
+    public void setPjfs11(Double pjfs11) {
+        this.pjfs11 = pjfs11;
+    }
+
+    public Double getPjfs12() {
+        return pjfs12;
+    }
+
+    public void setPjfs12(Double pjfs12) {
+        this.pjfs12 = pjfs12;
+    }
+
+    public Double getPjfs13() {
+        return pjfs13;
+    }
+
+    public void setPjfs13(Double pjfs13) {
+        this.pjfs13 = pjfs13;
+    }
+
+    public Double getPjfs14() {
+        return pjfs14;
+    }
+
+    public void setPjfs14(Double pjfs14) {
+        this.pjfs14 = pjfs14;
+    }
+
+    public Double getPjfs15() {
+        return pjfs15;
+    }
+
+    public void setPjfs15(Double pjfs15) {
+        this.pjfs15 = pjfs15;
+    }
+
+    public Double getPjfs16() {
+        return pjfs16;
+    }
+
+    public void setPjfs16(Double pjfs16) {
+        this.pjfs16 = pjfs16;
+    }
+
+    public Double getPjfs17() {
+        return pjfs17;
+    }
+
+    public void setPjfs17(Double pjfs17) {
+        this.pjfs17 = pjfs17;
+    }
+
+    public Double getPjfs18() {
+        return pjfs18;
+    }
+
+    public void setPjfs18(Double pjfs18) {
+        this.pjfs18 = pjfs18;
+    }
+
+    public Double getPjfs19() {
+        return pjfs19;
+    }
+
+    public void setPjfs19(Double pjfs19) {
+        this.pjfs19 = pjfs19;
+    }
+
+    public Double getPjfs20() {
+        return pjfs20;
+    }
+
+    public void setPjfs20(Double pjfs20) {
+        this.pjfs20 = pjfs20;
+    }
+
+    public Double getPjfs21() {
+        return pjfs21;
+    }
+
+    public void setPjfs21(Double pjfs21) {
+        this.pjfs21 = pjfs21;
+    }
+
+    public Double getPjfs22() {
+        return pjfs22;
+    }
+
+    public void setPjfs22(Double pjfs22) {
+        this.pjfs22 = pjfs22;
+    }
+
+    public Double getPjfs23() {
+        return pjfs23;
+    }
+
+    public void setPjfs23(Double pjfs23) {
+        this.pjfs23 = pjfs23;
+    }
+
+    public Double getPjfs24() {
+        return pjfs24;
+    }
+
+    public void setPjfs24(Double pjfs24) {
+        this.pjfs24 = pjfs24;
+    }
+
+    public Double getPjfs25() {
+        return pjfs25;
+    }
+
+    public void setPjfs25(Double pjfs25) {
+        this.pjfs25 = pjfs25;
+    }
+
+    public Double getPjfs26() {
+        return pjfs26;
+    }
+
+    public void setPjfs26(Double pjfs26) {
+        this.pjfs26 = pjfs26;
+    }
+
+    public Double getPjfs27() {
+        return pjfs27;
+    }
+
+    public void setPjfs27(Double pjfs27) {
+        this.pjfs27 = pjfs27;
+    }
+
+    public Double getPjfs28() {
+        return pjfs28;
+    }
+
+    public void setPjfs28(Double pjfs28) {
+        this.pjfs28 = pjfs28;
+    }
+
+    public Double getPjfs29() {
+        return pjfs29;
+    }
+
+    public void setPjfs29(Double pjfs29) {
+        this.pjfs29 = pjfs29;
+    }
+
+    public Double getPjfs30() {
+        return pjfs30;
+    }
+
+    public void setPjfs30(Double pjfs30) {
+        this.pjfs30 = pjfs30;
+    }
+
+    public Double getPjfs31() {
+        return pjfs31;
+    }
+
+    public void setPjfs31(Double pjfs31) {
+        this.pjfs31 = pjfs31;
+    }
+
+    public Double getPjfs32() {
+        return pjfs32;
+    }
+
+    public void setPjfs32(Double pjfs32) {
+        this.pjfs32 = pjfs32;
+    }
+
+    public Double getPjfs33() {
+        return pjfs33;
+    }
+
+    public void setPjfs33(Double pjfs33) {
+        this.pjfs33 = pjfs33;
+    }
+
+    public Double getPjfs34() {
+        return pjfs34;
+    }
+
+    public void setPjfs34(Double pjfs34) {
+        this.pjfs34 = pjfs34;
+    }
+
+    public Double getPjfs35() {
+        return pjfs35;
+    }
+
+    public void setPjfs35(Double pjfs35) {
+        this.pjfs35 = pjfs35;
+    }
+
+    public Double getPjfs36() {
+        return pjfs36;
+    }
+
+    public void setPjfs36(Double pjfs36) {
+        this.pjfs36 = pjfs36;
+    }
+
+    public Double getPjfs37() {
+        return pjfs37;
+    }
+
+    public void setPjfs37(Double pjfs37) {
+        this.pjfs37 = pjfs37;
+    }
+
+    public Double getPjfs38() {
+        return pjfs38;
+    }
+
+    public void setPjfs38(Double pjfs38) {
+        this.pjfs38 = pjfs38;
+    }
+
+    public Double getPjfs39() {
+        return pjfs39;
+    }
+
+    public void setPjfs39(Double pjfs39) {
+        this.pjfs39 = pjfs39;
+    }
+
+    public Double getPjfs40() {
+        return pjfs40;
+    }
+
+    public void setPjfs40(Double pjfs40) {
+        this.pjfs40 = pjfs40;
+    }
+
+    public Double getPjfs41() {
+        return pjfs41;
+    }
+
+    public void setPjfs41(Double pjfs41) {
+        this.pjfs41 = pjfs41;
+    }
+
+    public Double getPjfs42() {
+        return pjfs42;
+    }
+
+    public void setPjfs42(Double pjfs42) {
+        this.pjfs42 = pjfs42;
+    }
+
+    public Double getPjfs43() {
+        return pjfs43;
+    }
+
+    public void setPjfs43(Double pjfs43) {
+        this.pjfs43 = pjfs43;
+    }
+
+    public Double getPjfs44() {
+        return pjfs44;
+    }
+
+    public void setPjfs44(Double pjfs44) {
+        this.pjfs44 = pjfs44;
+    }
+
+    public Double getPjfs45() {
+        return pjfs45;
+    }
+
+    public void setPjfs45(Double pjfs45) {
+        this.pjfs45 = pjfs45;
+    }
+
+    public Double getPjfs46() {
+        return pjfs46;
+    }
+
+    public void setPjfs46(Double pjfs46) {
+        this.pjfs46 = pjfs46;
+    }
+
+    public Double getPjfs47() {
+        return pjfs47;
+    }
+
+    public void setPjfs47(Double pjfs47) {
+        this.pjfs47 = pjfs47;
+    }
+
+    public Double getPjfs48() {
+        return pjfs48;
+    }
+
+    public void setPjfs48(Double pjfs48) {
+        this.pjfs48 = pjfs48;
+    }
+
+    public Double getPjfs49() {
+        return pjfs49;
+    }
+
+    public void setPjfs49(Double pjfs49) {
+        this.pjfs49 = pjfs49;
+    }
+
+    public Double getPjfs50() {
+        return pjfs50;
+    }
+
+    public void setPjfs50(Double pjfs50) {
+        this.pjfs50 = pjfs50;
+    }
+
+    @Override
+    public String toString() {
+        return "ProjectInfoMin2{" +
+            "id = " + id +
+            ", stationId = " + stationId +
+            ", projectId = " + projectId +
+            ", recordDate = " + recordDate +
+            ", rfdl = " + rfdl +
+            ", hjwd = " + hjwd +
+            ", yxts = " + yxts +
+            ", tqfs = " + tqfs +
+            ", pjfs1 = " + pjfs1 +
+            ", pjfs2 = " + pjfs2 +
+            ", pjfs3 = " + pjfs3 +
+            ", pjfs4 = " + pjfs4 +
+            ", pjfs5 = " + pjfs5 +
+            ", pjfs6 = " + pjfs6 +
+            ", pjfs7 = " + pjfs7 +
+            ", pjfs8 = " + pjfs8 +
+            ", pjfs9 = " + pjfs9 +
+            ", pjfs10 = " + pjfs10 +
+            ", pjfs11 = " + pjfs11 +
+            ", pjfs12 = " + pjfs12 +
+            ", pjfs13 = " + pjfs13 +
+            ", pjfs14 = " + pjfs14 +
+            ", pjfs15 = " + pjfs15 +
+            ", pjfs16 = " + pjfs16 +
+            ", pjfs17 = " + pjfs17 +
+            ", pjfs18 = " + pjfs18 +
+            ", pjfs19 = " + pjfs19 +
+            ", pjfs20 = " + pjfs20 +
+            ", pjfs21 = " + pjfs21 +
+            ", pjfs22 = " + pjfs22 +
+            ", pjfs23 = " + pjfs23 +
+            ", pjfs24 = " + pjfs24 +
+            ", pjfs25 = " + pjfs25 +
+            ", pjfs26 = " + pjfs26 +
+            ", pjfs27 = " + pjfs27 +
+            ", pjfs28 = " + pjfs28 +
+            ", pjfs29 = " + pjfs29 +
+            ", pjfs30 = " + pjfs30 +
+            ", pjfs31 = " + pjfs31 +
+            ", pjfs32 = " + pjfs32 +
+            ", pjfs33 = " + pjfs33 +
+            ", pjfs34 = " + pjfs34 +
+            ", pjfs35 = " + pjfs35 +
+            ", pjfs36 = " + pjfs36 +
+            ", pjfs37 = " + pjfs37 +
+            ", pjfs38 = " + pjfs38 +
+            ", pjfs39 = " + pjfs39 +
+            ", pjfs40 = " + pjfs40 +
+            ", pjfs41 = " + pjfs41 +
+            ", pjfs42 = " + pjfs42 +
+            ", pjfs43 = " + pjfs43 +
+            ", pjfs44 = " + pjfs44 +
+            ", pjfs45 = " + pjfs45 +
+            ", pjfs46 = " + pjfs46 +
+            ", pjfs47 = " + pjfs47 +
+            ", pjfs48 = " + pjfs48 +
+            ", pjfs49 = " + pjfs49 +
+            ", pjfs50 = " + pjfs50 +
+        "}";
+    }
+}

File diff suppressed because it is too large
+ 2 - 987
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/StationInfoMin2.java


+ 16 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/mapper/ProjectInfoMin2Mapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.ucp.mapper;
+
+import com.ruoyi.ucp.entity.ProjectInfoMin2;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-11-10
+ */
+public interface ProjectInfoMin2Mapper extends BaseMapper<ProjectInfoMin2> {
+
+}

+ 16 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/IProjectInfoMin2Service.java

@@ -0,0 +1,16 @@
+package com.ruoyi.ucp.service;
+
+import com.ruoyi.ucp.entity.ProjectInfoMin2;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-11-10
+ */
+public interface IProjectInfoMin2Service extends IService<ProjectInfoMin2> {
+
+}

+ 50 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/service/impl/ProjectInfoMin2ServiceImpl.java

@@ -0,0 +1,50 @@
+package com.ruoyi.ucp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.ucp.entity.ProjectInfoMin2;
+import com.ruoyi.ucp.mapper.ProjectInfoMin2Mapper;
+import com.ruoyi.ucp.service.IProjectInfoMin2Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-11-10
+ */
+@Service
+@DataSource(DataSourceType.SLAVE)
+public class ProjectInfoMin2ServiceImpl extends ServiceImpl<ProjectInfoMin2Mapper, ProjectInfoMin2> implements IProjectInfoMin2Service {
+    @Override
+    public boolean saveOrUpdate(ProjectInfoMin2 entity) {
+        return super.saveOrUpdate(entity);
+    }
+
+    @Override
+    public boolean save(ProjectInfoMin2 entity) {
+        return super.save(entity);
+    }
+
+    @Override
+    public boolean saveBatch(Collection<ProjectInfoMin2> entityList) {
+        return super.saveBatch(entityList);
+    }
+
+    @Override
+    public boolean saveOrUpdateBatch(Collection<ProjectInfoMin2> entityList) {
+        return super.saveOrUpdateBatch(entityList);
+    }
+
+    @Override
+    public List<ProjectInfoMin2> list(Wrapper<ProjectInfoMin2> queryWrapper) {
+        return super.list(queryWrapper);
+    }
+}