2 Commits 5d3a31d5e6 ... 15e1e1988f

Auteur SHA1 Message Date
  malijun 15e1e1988f Merge remote-tracking branch 'origin/master' il y a 5 mois
  malijun 91e37729de 公司指标 il y a 5 mois

+ 7 - 6
ruoyi-admin/src/test/java/com/ruoyi/JavaFunctionJobHandler.java

@@ -1786,7 +1786,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
 
         wrapperrp = new QueryWrapper<>();
         wrapperrp.eq("record_date", time0).eq("foreign_key_id", "GJNY_SXGS_DBXNY_ZGS0");
-        List<ProEconReportIndicatorPool> pools2 = reportIndicatorPoolService.list(wrapperrp);
+        ProEconReportIndicatorPool pools2 = reportIndicatorPoolService.getOne(wrapperrp);
+
 
         TurbineInfoDay day, month, year;
         String projectId;
@@ -1804,11 +1805,11 @@ public class JavaFunctionJobHandler extends IJobHandler {
             double v1 = pools.stream().mapToDouble(ProEconReportIndicatorPool::getRpjfs).average().orElse(0);
             double v2 = pools.stream().mapToDouble(ProEconReportIndicatorPool::getYpjfs).average().orElse(0);
             double v3 = pools.stream().mapToDouble(ProEconReportIndicatorPool::getNpjfs).average().orElse(0);
-            if (CollUtil.isNotEmpty(pools2)) {
-                pools2.get(0).setRpjfs(v1);
-                pools2.get(0).setYpjfs(v2);
-                pools2.get(0).setNpjfs(v3);
-                reportIndicatorPoolService.saveOrUpdateBatch(pools2);
+            if (!(pools2 == null)) {
+                pools2.setRpjfs(v1);
+                pools2.setYpjfs(v2);
+                pools2.setNpjfs(v3);
+                reportIndicatorPoolService.saveOrUpdate(pools2);
             }
             reportIndicatorPoolService.saveOrUpdateBatch(pools);
         } else {