Przeglądaj źródła

考核分数 数据填

GYEE 7 miesięcy temu
rodzic
commit
f1492ed05e

+ 82 - 18
ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

@@ -130,6 +130,19 @@ public class JavaFunctionJobHandler extends IJobHandler {
         return byDate;
     }
 
+    public List<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;
+    }
+
 
     public StationInfoDay getStationinfoByDate(Date date, String stId) {
         QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
@@ -1896,7 +1909,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
             }
             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));
         }
@@ -2018,6 +2031,15 @@ public class JavaFunctionJobHandler extends IJobHandler {
         }
     }
 
+    public void getSectionDataByEntity(List<PointInfo> entitys, URI uri, Date end) {
+        String collect = entitys.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
+        Map<String, PointData> section1 = adapter.getHistorySection(uri, collect, end.getTime());
+        for (PointInfo entity : entitys) {
+            entity.setPointDatas(new ArrayList<>());
+            entity.getPointDatas().add(section1.get(entity.getPointKey()));
+        }
+    }
+
     public void getSnapDataByEntity(List<PointInfo> entity, URI uri, Date start, Date end, int interval) {
         for (PointInfo info : entity) {
             getSnapDataByEntity(info, uri, start, end, interval);
@@ -3236,7 +3258,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);
         }
     }
@@ -4061,7 +4083,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
         //AGC
         List<PointInfo> entityAgc = getEntity("AGC002", "booster");
         entityAgc = entityAgc.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
-        Map<String, PointInfo> statMapAgc = getRawDataByEntity(entityAgc, goldenUri(), begin, end, PointInfo::getStationId);
+        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());
@@ -4082,33 +4105,74 @@ public class JavaFunctionJobHandler extends IJobHandler {
         getSectionDataByEntity(entity, goldenUri(), begin, end);
         Map<String, List<PointInfo>> fdlsMap = entity.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
 
-        List<StationInfoMin> byDate = getStationinfoByMin(end, entityAgc);
+        List<StationInfoMin> byDate = getStationinfoByMin(end, stId);
+        byDate = byDate.stream().filter(e -> stId.equals(e.getStationId())).collect(Collectors.toList());
 
         for (StationInfoMin day : byDate) {
             String id = day.getStationId();
-            PointInfo agcInfo = statMapAgc.get(id);
-            PointInfo cxInfo = statMapCx.get(id);
+//            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);
-            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.setPjfs(pjfs);
+//            }
+//            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);
+            day.setPjgl(cxgl);
+//            }
+//            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;
+            day.setAgc(agc);
+//            }
+//            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 > 720000) v = 0;
+                if (v < 0) v = 0;
+                if (v > 7500) v = 7500.0;
                 return v;
             }).sum();
-            double agc = agcInfo.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0);
-            double cxgl = cxInfo.getPointDatas().stream().mapToDouble(PointData::getValue).average().orElse(0.0);
-            day.setAgc(agc * agcInfo.getCoef());
-            day.setPjgl(cxgl * cxInfo.getCoef());
-            day.setPjfs(pjfs);
+            if (rfdl < 660 && cxgl > 0) rfdl = cxgl / 4.0;
             day.setRfdl(rfdl);
+//            }
+//            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);
+//            }
         }
         stationInfoMinService.saveOrUpdateBatch(byDate);
     }
 
+    private double nihe(double pjfs) {
+        //LJS
+        return -90.4382 * Math.pow(pjfs, 3) + 1661.275 * Math.pow(pjfs, 2) + 2245.86 * pjfs - 17011.14;
+    }
+
+    public void getPoint() {
+        //AGC
+        List<PointInfo> entityAgc = getEntity("AGC002", "booster");
+        Map<String, PointInfo> mapAgc = entityAgc.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
+        //出线
+        List<PointInfo> entityCx = getEntity("AGC001", "booster");
+        //风速
+        List<PointInfo> entityFs = getEntity("AI066", "turbine");
+        Map<String, List<PointInfo>> fssMap = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
+        //环境温度
+        List<PointInfo> entityHjwd = getEntity("AI072", "turbine");
+        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())).collect(Collectors.toList());
+        Map<String, List<PointInfo>> fdlsMap = entity.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
+        System.out.println();
+    }
+
     public void calcPredictExamin(Date date) {
         DateTime end = DateUtil.beginOfDay(date);
         DateTime begin = DateUtil.offsetDay(end, -1);
@@ -4117,7 +4181,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         entity.addAll(entity1);
         Map<String, EquipmentModel> map = equipmentModelService.map();
 
-        Map<String, Double> tbPowerMap = entity.stream().collect(Collectors.toMap(pi -> pi.getTurbineId(), pi -> map.get(pi.getTurbineId()).getPowerProduction()));
+        Map<String, Double> tbPowerMap = entity.stream().collect(Collectors.toMap(pi -> pi.getTurbineId(), pi -> map.get(pi.getSpare()).getPowerProduction()));
         List<PointInfo> entityGl = getEntity("AI114", "turbine");
         getSnapDataByEntity(entityGl, begin, end, 15 * 60);
         Map<String, PointInfo> glpisMap = entityGl.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
@@ -4136,8 +4200,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
             DateTime hour2 = DateUtil.offsetHour(hour, 4);
             QueryWrapper<HistoryPredict> wrapper = new QueryWrapper<>();
             wrapper.lambda().eq(HistoryPredict::getPredictType, "CDQ").eq(HistoryPredict::getDataTime, hour)
-                    .between(HistoryPredict::getPredictTime, hour, hour2).orderByAsc(HistoryPredict::getDataTime);
-            List<HistoryPredict> predicts = historyPredictService.list(predictWrapper);
+                    .between(HistoryPredict::getPredictTime, hour, hour2).orderByAsc(HistoryPredict::getPredictTime);
+            List<HistoryPredict> predicts = historyPredictService.list(wrapper);
             cdqPredicts.addAll(predicts);
         }
         Map<String, List<HistoryPredict>> cdqPredictsMap = cdqPredicts.stream().collect(Collectors.groupingBy(HistoryPredict::getTurbineId));
@@ -4200,7 +4264,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
                     errorPercentage = 100.0;
                 }
             } else {
-                errorPercentage = Math.abs(predictPower.get(i) - actualPower.get(i)) / predictPower.get(i) * 100;
+                errorPercentage = Math.abs(predictPower.get(i) - actualPower.get(i)) / installCapacity * 100;
             }
             if (errorPercentage > maxErrorPercentage) {
                 maxErrorPercentage = errorPercentage;

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

@@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
-@RestController
+//@RestController
 @RequestMapping("/predict")
 public class PredictController {
 
@@ -62,6 +62,7 @@ public class PredictController {
                                    @RequestParam(value = "beginTime",required = false) String beginTime,
                                    @RequestParam(value = "endTime",required = false) String endTime,
                                    @RequestParam(value = "interval",required = false) Integer interval) {
+        //2024-10-15 00:00:00,15,2024-10-15 00:15:00
         DateTime start = DateUtil.parse(beginTime);
         DateTime end = DateUtil.parse(endTime);
         String[] names = {"AI114", "AI066", "AI060", "AI067", "AI082", "AI073", "AI004", "AI047", "AI072", "AI074"};
@@ -488,4 +489,7 @@ public class PredictController {
         }
         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
 }

+ 15 - 0
ruoyi-admin/src/main/resources/FunctionTemplate.java

@@ -1,10 +1,13 @@
 package com.ruoyi;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.text.StrBuilder;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.quartz.handler.IJobHandler;
@@ -18,6 +21,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.lang.reflect.Field;
 import java.net.URI;
 import java.util.*;
 import java.util.function.Function;
@@ -25,6 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
+
 public class JavaFunctionJobHandler extends IJobHandler {
 
     @Resource
@@ -47,6 +52,16 @@ public class JavaFunctionJobHandler extends IJobHandler {
     private ITurbineInfoDayService turbineInfoDayService;
     @Resource
     private IProEconReportIndicatorPoolService reportIndicatorPoolService;
+    @Resource
+    private ITurbineInfoMinService turbineInfoMinService;
+    @Resource
+    private IStationInfoMinService stationInfoMinService;
+    @Resource
+    private IProBasicProjectPlanService proBasicProjectPlanService;
+    @Resource
+    private IHistoryPredictService historyPredictService;
+    @Resource
+    private IPredictExaminService predictExaminService;
 
     @Override
     public void execute() throws Exception {

+ 17 - 2
ruoyi-admin/src/test/java/com/ruoyi/GetDataTest.java

@@ -25,6 +25,7 @@ import java.util.*;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @SpringBootTest
@@ -40,8 +41,13 @@ public class GetDataTest {
 
     @Test
     public void test2() {
-        DateTime begin = DateUtil.parse("2023-03-21");
-        DateTime end = DateUtil.parse("2024-10-30");
+//        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 end = DateUtil.parse("2024-08-08 14:00:00");
+        DateTime end = DateUtil.parse("2024-11-01");
+//        DateTime end = DateUtil.parse("2024-08-08 13:45:00");
+        //LJS,FSG,JSL
         int i = 1;
         DateTime minBegin = begin, minEnd = DateUtil.offsetMinute(begin, 15);
         while (minEnd.isBefore(end)) {
@@ -52,6 +58,15 @@ public class GetDataTest {
             minBegin = minEnd;
         }
     }
+    @Test
+    public void test5() {
+        task.getPoint();
+    }
+    @Test
+    public void test3() {
+        DateTime date = DateUtil.date();
+        task.calcPredictExamin(date);
+    }
 
     @Test
     public void test() {

Plik diff jest za duży
+ 214 - 22
ruoyi-admin/src/test/java/com/ruoyi/JavaFunctionJobHandler.java


+ 35 - 8
ruoyi-admin/src/test/java/com/ruoyi/NewTests.java

@@ -12,6 +12,7 @@ import com.ruoyi.ucp.entity.*;
 import com.ruoyi.ucp.feign.AdapterApi;
 import com.ruoyi.ucp.service.*;
 import com.ruoyi.ucp.util.CalcCache;
+import com.ruoyi.web.controller.JavaFunctionJobHandler;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -36,8 +37,8 @@ public class NewTests {
     public void test() {
 //        task.calcTurbineRFDLSameDay();
 //        task.calcTurbine5s2SameDay();
-        /*Map<Double, Double> a1 = CalcCache.fitcoef.get("GJNY_SXGS_JSL_F_WT_0001_EQ");
-        Map<Double, Double> a3 = CalcCache.fitcoef.get("GJNY_SXGS_JSL_F_WT_0003_EQ");
+        /*Map<Double, Double> a1 = CalcCache.fitcoef.get("GJNY_SXGS_FSG_F_WT_0040_EQ");
+        Map<Double, Double> a3 = CalcCache.fitcoef.get("GJNY_SXGS_FSG_F_WT_0047_EQ");
         TreeMap<Double, Double> b1 = new TreeMap<>();
         TreeMap<Double, Double> b3 = new TreeMap<>();
         b1.putAll(a1);
@@ -59,7 +60,8 @@ public class NewTests {
         System.out.println(sb3);
         System.out.println();*/
 
-//        Date date = DateUtil.date();
+        Date date = DateUtil.parse("2024-10-10");
+        task.calcTurbineSsfsQx(date);
 //        task.ambientTemperature();
 
 //        task.calcTurbine5s2(date);
@@ -80,8 +82,8 @@ public class NewTests {
 //        calcStationZhcydl(date);
 //        calcNhglZs(date);
         // 创建日期范围生成器
-        DateTime date = DateUtil.date();
-        task.calcTurbine5s2(date);
+//        DateTime date = DateUtil.date();
+//        task.calcTurbine5s2(date);
 
 
 //        DateTime start = DateUtil.parse("2023-06-27");
@@ -145,12 +147,12 @@ public class NewTests {
     @Test
     public void test2() {
         // 创建日期范围生成器
-        DateTime start = DateUtil.parse("2024-10-12");
-        DateTime end = DateUtil.parse("2024-10-14");
+        DateTime start = DateUtil.parse("2024-10-19");
+        DateTime end = DateUtil.parse("2024-10-25");
         DateRange range = DateUtil.range(start, end, DateField.HOUR_OF_DAY);
         for (DateTime date : range) {
             System.out.println(DateUtil.date() + ":" + date);
-            task.calcAQTS(date);
+//            task.calcAQTS(date);
 //            task.calcLineRfdl(date,"GJNY_SXGS_JSL_FDC_STA");
 //            task.calcStationSwGwCyRdl(date,"GJNY_SXGS_JSL_FDC_STA");
 //            task.calcStationZhcyRfDl(date,"GJNY_SXGS_JSL_FDC_STA");
@@ -158,6 +160,7 @@ public class NewTests {
 //            task.writeReportPool(date);
 //            task.writeReportPoolProject(date);
 //            task.calcStationHourPjglRfdl(DateUtil.date());
+            task.calcTurbine5s2(date);
         }
 //        task.calcStationHourPjglRfdl(DateUtil.date());
 //        DateTime date = DateUtil.date();
@@ -167,5 +170,29 @@ public class NewTests {
 //        task.calcTurbinePjfsPjglKyglLlglMin(DateUtil.date(), 15);
 //        task.calcStationLlglKyglSjglAgcMin(date, 15);
     }
+    @Test
+    public void test3() {
+        // 创建日期范围生成器
+        DateTime start = DateUtil.parse("2024-10-01");
+        DateTime end = DateUtil.parse("2024-12-16");
+        DateRange range = DateUtil.range(start, end, DateField.MONTH);
+        for (DateTime date : range) {
+            System.out.println(DateUtil.date() + ":" + date);
+            task.calcStationRjhfdl(date);
+
+        }
+    }
+    @Test
+    public void test4() {
+//        while (true){
+//            task.calcStationRealtimeLLgl();
+//            ThreadUtil.sleep(60000);
+//        }
+
+        DateTime start = DateUtil.parse("2023-08-01");
+        DateTime end = DateUtil.parse("2023-11-01");
+        task.calcGlqxnhSurplus(start, end);
+
+    }
 
 }

+ 9 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java

@@ -43,12 +43,21 @@ public class DruidConfig {
         return druidProperties.dataSource(dataSource);
     }
 
+    @Bean
+    @ConfigurationProperties("spring.datasource.druid.glyc")
+    @ConditionalOnProperty(prefix = "spring.datasource.druid.glyc", name = "enabled", havingValue = "true")
+    public DataSource glycDataSource(DruidProperties druidProperties) {
+        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
+        return druidProperties.dataSource(dataSource);
+    }
+
     @Bean(name = "dynamicDataSource")
     @Primary
     public DynamicDataSource dataSource(DataSource masterDataSource) {
         Map<Object, Object> targetDataSources = new HashMap<>();
         targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
         setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
+        setDataSource(targetDataSources, DataSourceType.GLYC.name(), "glycDataSource");
         return new DynamicDataSource(masterDataSource, targetDataSources);
     }
 

+ 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").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()

+ 3 - 0
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/PredictExamin.java

@@ -1,5 +1,7 @@
 package com.ruoyi.ucp.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
@@ -17,6 +19,7 @@ public class PredictExamin implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @TableId(type = IdType.AUTO)
     private Integer id;
 
     private String modelId;

+ 32 - 1
universal-computing-platform/src/main/java/com/ruoyi/ucp/entity/StationInfoMin.java

@@ -10,7 +10,7 @@ import java.util.Date;
 
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author gfhd
@@ -46,4 +46,35 @@ public class StationInfoMin implements Serializable {
     private Double rfdl;
 
     private Double hjwd;
+
+    public void setPjfs(Double pjfs) {
+        if (pjfs == null || pjfs < 0) pjfs = 0.0;
+        if (pjfs > 25) pjfs = 25.0;
+        this.pjfs = pjfs;
+    }
+
+    public void setPjgl(Double pjgl) {
+        if (pjgl == null) pjgl = 0.0;
+        if (pjgl < -292) pjgl = -292.0;
+        if (pjgl > 169600) pjgl = 169600.0;
+        this.pjgl = pjgl;
+    }
+
+    public void setAgc(Double agc) {
+        if (agc == null || agc < 0) agc = 0.0;
+        if (agc > 170000) agc = 170000.0;
+        this.agc = agc;
+    }
+
+    public void setRfdl(Double rfdl) {
+        if (rfdl == null || rfdl < 0) rfdl = 0.0;
+        this.rfdl = rfdl;
+    }
+
+    public void setHjwd(Double hjwd) {
+        if (hjwd == null) hjwd = 0.0;
+        if (hjwd < -30) hjwd = -30.0;
+        if (hjwd > 40) hjwd = 40.0;
+        this.hjwd = hjwd;
+    }
 }

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

@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @author gfhd
  * @since 2024-10-29
  */
-@DS("glyc")
 public interface IPredictExaminService extends IService<PredictExamin> {
 
 }

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

@@ -1,11 +1,17 @@
 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.PredictExamin;
 import com.ruoyi.ucp.mapper.PredictExaminMapper;
 import com.ruoyi.ucp.service.IPredictExaminService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.Collection;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -15,6 +21,20 @@ import org.springframework.stereotype.Service;
  * @since 2024-10-29
  */
 @Service
+@DataSource(DataSourceType.GLYC)
 public class PredictExaminServiceImpl extends ServiceImpl<PredictExaminMapper, PredictExamin> implements IPredictExaminService {
+    @Override
+    public boolean saveBatch(Collection<PredictExamin> entityList) {
+        return super.saveBatch(entityList);
+    }
+
+    @Override
+    public boolean saveOrUpdateBatch(Collection<PredictExamin> entityList) {
+        return super.saveOrUpdateBatch(entityList);
+    }
 
+    @Override
+    public List<PredictExamin> list(Wrapper<PredictExamin> queryWrapper) {
+        return super.list(queryWrapper);
+    }
 }