malijun 5 mesiacov pred
rodič
commit
a411eabd8e

+ 12 - 8
ruoyi-admin/src/test/java/com/ruoyi/JavaFunctionJobHandler.java

@@ -1777,16 +1777,20 @@ public class JavaFunctionJobHandler extends IJobHandler {
         List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperrp);
 
 
-        ProEconReportIndicatorPool GSPJFS = new ProEconReportIndicatorPool();
-        GSPJFS.setRecordDate(time0.toLocalDateTime().toLocalDate());
-        GSPJFS.setForeignKeyId("GJNY_SXGS_DBXNY_ZGS0");
-        GSPJFS.setCompanyId("GJNY_SXGS_DBXNY_ZGS");
-        reportIndicatorPoolService.save(GSPJFS);
 
 
-        wrapperrp = new QueryWrapper<>();
-        wrapperrp.eq("record_date", time0).eq("foreign_key_id", "GJNY_SXGS_DBXNY_ZGS0");
-        ProEconReportIndicatorPool pools2 = reportIndicatorPoolService.getOne(wrapperrp);
+
+        QueryWrapper<ProEconReportIndicatorPool> wrapperrp2 = new QueryWrapper<>();
+        wrapperrp2.eq("record_date", time0).eq("foreign_key_id", "GJNY_SXGS_DBXNY_ZGS0");
+        ProEconReportIndicatorPool pools2 = reportIndicatorPoolService.getOne(wrapperrp2);
+
+        if (pools2 == null){
+            ProEconReportIndicatorPool GSPJFS = new ProEconReportIndicatorPool();
+            GSPJFS.setRecordDate(time0.toLocalDateTime().toLocalDate());
+            GSPJFS.setForeignKeyId("GJNY_SXGS_DBXNY_ZGS0");
+            GSPJFS.setCompanyId("GJNY_SXGS_DBXNY_ZGS");
+            reportIndicatorPoolService.saveOrUpdate(GSPJFS);
+        }
 
 
         TurbineInfoDay day, month, year;