xushili 9 meses atrás
pai
commit
80b9baaefe

+ 75 - 20
ruoyi-admin/src/test/java/com/ruoyi/JavaFunctionJobHandler.java

@@ -729,7 +729,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         Map<String, PointData> latest2 = adapter.getHistorySection(goldenUri(), keys, time2.getTime());
         Map<String, PointData> latest1 = adapter.getHistorySection(goldenUri(), keys, time1.getTime());
 
-        List<LineInfoDay> byDate = getLineinfoByDate(time0.toJdkDate());
+        List<LineInfoDay> byDate = getLineinfoByDate(time0);
         Map<String, LineInfoDay> collect = new HashMap<>();
         if (!byDate.isEmpty()) {
             collect = byDate.stream().collect(Collectors.toMap(LineInfoDay::getLineId, Function.identity()));
@@ -743,7 +743,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
                 day.setStationId(info.getStationId());
                 day.setProjectId(info.getProjectId());
                 day.setLineId(info.getLineId());
-                day.setRecordDate(time0.toJdkDate());
+                day.setRecordDate(time0);
             } else {
                 day = collect.get(info.getLineId());
             }
@@ -775,9 +775,9 @@ public class JavaFunctionJobHandler extends IJobHandler {
         DateTime time0 = DateUtil.offsetDay(time, -1);
 
         QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0.toJdkDate()).groupBy("station_id");
+        wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0).groupBy("station_id");
         List<LineInfoDay> list = lineInfoDayService.list(wrapper);
-        List<StationInfoDay> byDate = getStationinfoByDate(time0.toJdkDate());
+        List<StationInfoDay> byDate = getStationinfoByDate(time0);
         //        list = list.stream().filter(b -> b.getStationId().equals("GJNY_SXGS_ZZ_FDC_STA")).collect(Collectors.toList());
 
         Map<String, StationInfoDay> collect = new HashMap<>();
@@ -791,7 +791,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
             if (byDate.isEmpty()) {
                 infoDay = new StationInfoDay();
                 infoDay.setStationId(day.getStationId());
-                infoDay.setRecordDate(time0.toJdkDate());
+                infoDay.setRecordDate(time0);
             } else {
                 infoDay = collect.get(day.getStationId());
             }
@@ -837,7 +837,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         DateTime time0 = DateUtil.offsetDay(time, -1);
 
         QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0.toJdkDate()).groupBy("station_id");
+        wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0).groupBy("station_id");
         List<TurbineInfoDay> list = turbineInfoDayService.list(wrapper);
         Map<String, TurbineInfoDay> dayMap = list.stream().collect(Collectors.toMap(TurbineInfoDay::getStationId, Function.identity()));
         List<StationInfoDay> byDate = getStationinfoByDate(time0);
@@ -905,7 +905,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
         //风速
         Map<String, String> collectFs = getEntityMap("AI066", "turbine");
 
-        Map<String, TurbineInfoDay> dayMap = getTurbineinfoMap(time0.toJdkDate(), entityZt);
+        Map<String, TurbineInfoDay> dayMap = getTurbineinfoMap(time0, entityZt);
 
         String tbId;
         TurbineInfoDay infoDay;
@@ -1679,17 +1679,17 @@ public class JavaFunctionJobHandler extends IJobHandler {
 
                 //存入数据库
                 String turbineId = turbine.getTurbineId();
-                Date jdkDate = timeBegin.toJdkDate();
+                Date jdkDate = timeBegin;
                 System.out.println(turbineId + " " + jdkDate);
                 QueryWrapper<TurbineInfoDay> turbineInfoDayQueryWrapper = new QueryWrapper<>();
                 turbineInfoDayQueryWrapper.eq("turbine_id", turbine.getTurbineId());
-                turbineInfoDayQueryWrapper.eq("record_date", timeBegin.toJdkDate());
+                turbineInfoDayQueryWrapper.eq("record_date", timeBegin);
                 TurbineInfoDay one = turbineInfoDayService.getOne(turbineInfoDayQueryWrapper);
                 System.out.println(one);
                 if (one == null) {
                     TurbineInfoDay turbineInfoDay = new TurbineInfoDay();
                     turbineInfoDay.setTurbineId(turbine.getTurbineId());
-                    turbineInfoDay.setRecordDate(timeBegin.toJdkDate());
+                    turbineInfoDay.setRecordDate(timeBegin);
                     turbineInfoDay.setXfqrfs(avgCutInWindSpeed);
                     System.out.println(turbineInfoDay);
 
@@ -1904,17 +1904,17 @@ public class JavaFunctionJobHandler extends IJobHandler {
 
             //存入数据库
             String turbineId = turbine.getTurbineId();
-            Date jdkDate = timeBegin.toJdkDate();
+            Date jdkDate = timeBegin;
             System.out.println(turbineId + " " + jdkDate);
             QueryWrapper<TurbineInfoDay> turbineInfoDayQueryWrapper = new QueryWrapper<>();
             turbineInfoDayQueryWrapper.eq("turbine_id", turbine.getTurbineId());
-            turbineInfoDayQueryWrapper.eq("record_date", timeBegin.toJdkDate());
+            turbineInfoDayQueryWrapper.eq("record_date", timeBegin);
             TurbineInfoDay one = turbineInfoDayService.getOne(turbineInfoDayQueryWrapper);
             System.out.println(one);
             if (one == null) {
                 TurbineInfoDay turbineInfoDay = new TurbineInfoDay();
                 turbineInfoDay.setTurbineId(turbine.getTurbineId());
-                turbineInfoDay.setRecordDate(timeBegin.toJdkDate());
+                turbineInfoDay.setRecordDate(timeBegin);
                 turbineInfoDay.setHjwd(avgCutInWindSpeed);
                 System.out.println(turbineInfoDay);
                 interest.add(turbineInfoDay);
@@ -1951,11 +1951,11 @@ public class JavaFunctionJobHandler extends IJobHandler {
         List<StationInfoDay> days = stationInfoDayService.list(wrapper);
         Map<String, StationInfoDay> dayMap = days.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
         wrapper = new QueryWrapper<>();
-        wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfMonth.toJdkDate(), time0.toJdkDate()).groupBy("station_id");
+        wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfMonth, time0).groupBy("station_id");
         List<StationInfoDay> monthDays = stationInfoDayService.list(wrapper);
         Map<String, StationInfoDay> monthMap = monthDays.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
         wrapper = new QueryWrapper<>();
-        wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfYear.toJdkDate(), time0.toJdkDate()).groupBy("station_id");
+        wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfYear, time0).groupBy("station_id");
         List<StationInfoDay> yearDays = stationInfoDayService.list(wrapper);
         Map<String, StationInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
 
@@ -2773,24 +2773,33 @@ public class JavaFunctionJobHandler extends IJobHandler {
         stationInfoDayService.saveOrUpdateBatch(byDate);
     }*/
 
-    public void writeReportPool5SPjfsLlfdl(Date date) {
+    public void writeReportPool5SPjfsLlfdlZtsj(Date date) {
         //date当天零点
         DateTime time = DateUtil.beginOfDay(date);
         //date昨天零点
         DateTime time0 = DateUtil.offsetDay(time, -1);
         DateTime beginOfMonth = DateUtil.beginOfMonth(time0);
         DateTime beginOfYear = DateUtil.beginOfYear(time0);
-
+        
         QueryWrapper<TurbineInfoDay> wrapper = new QueryWrapper<>();
-        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss,sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,project_id,station_id").eq("record_date", time0).groupBy("project_id,station_id");
+        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss," +
+                "sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,sum(dj_min) dj_min,sum(tj_min) tj_min,sum(yx_min) yx_min,sum(gz_min) gz_min," +
+                        "sum(jx_min) jx_min,sum(xd_min) xd_min,sum(lx_min) lx_min,project_id,station_id")
+                .eq("record_date", time0).groupBy("project_id,station_id");
         List<TurbineInfoDay> days = turbineInfoDayService.list(wrapper);
         Map<String, TurbineInfoDay> dayMap = days.stream().collect(Collectors.toMap(TurbineInfoDay::getProjectId, Function.identity()));
         wrapper = new QueryWrapper<>();
-        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss,sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,project_id,station_id").between("record_date", beginOfMonth, time0).groupBy("project_id,station_id");
+        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss," +
+                "sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,sum(dj_min) dj_min,sum(tj_min) tj_min,sum(yx_min) yx_min,sum(gz_min) gz_min," +
+                        "sum(jx_min) jx_min,sum(xd_min) xd_min,sum(lx_min) lx_min,project_id,station_id")
+                .between("record_date", beginOfMonth, time0).groupBy("project_id,station_id");
         List<TurbineInfoDay> monthDays = turbineInfoDayService.list(wrapper);
         Map<String, TurbineInfoDay> monthMap = monthDays.stream().collect(Collectors.toMap(TurbineInfoDay::getProjectId, Function.identity()));
         wrapper = new QueryWrapper<>();
-        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss,sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,project_id,station_id").between("record_date", beginOfYear, time0).groupBy("project_id,station_id");
+        wrapper.select("sum(llfdl) llfdl,sum(jhjxss) jhjxss,sum(fjhjxss) fjhjxss,sum(xdss) xdss,sum(slss) slss,sum(xnss) xnss," +
+                "sum(gzss) gzss,sum(djss) djss,avg(pjfs) pjfs,sum(dj_min) dj_min,sum(tj_min) tj_min,sum(yx_min) yx_min,sum(gz_min) gz_min," +
+                        "sum(jx_min) jx_min,sum(xd_min) xd_min,sum(lx_min) lx_min,project_id,station_id")
+                .between("record_date", beginOfYear, time0).groupBy("project_id,station_id");
         List<TurbineInfoDay> yearDays = turbineInfoDayService.list(wrapper);
         Map<String, TurbineInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(TurbineInfoDay::getProjectId, Function.identity()));
 
@@ -2866,6 +2875,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setRxnssdl(day.getXnss());
         pool.setRxdjclssdl(day.getXdss());
         pool.setRllfdl(day.getLlfdl());
+        pool.setRhjdjxs(day.getDjMin()/60);
+        pool.setRhjgztjxs(day.getGzMin()/60);
+        pool.setRhjtxzdxs(day.getLxMin()/60);
+        pool.setRhjjxtjxs(day.getJxMin()/60);
+        pool.setRhjxdxs(day.getXdMin()/60);
+        pool.setRhjyxxs(day.getYxMin()/60);
+        pool.setRhjslxs(0.0);
+
         pool.setYpjfs(month.getPjfs());
         pool.setYgzssdl(month.getGzss() == null ? month.getFjhjxss() * 0.11 : month.getGzss());
         pool.setYjxssdl(month.getJhjxss());
@@ -2873,6 +2890,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setYxnssdl(month.getXnss());
         pool.setYxdjclssdl(month.getXdss());
         pool.setYllfdl(month.getLlfdl());
+        pool.setYhjdjxs(month.getDjMin()/60);
+        pool.setYhjgztjxs(month.getGzMin()/60);
+        pool.setYhjtxzdxs(month.getLxMin()/60);
+        pool.setYhjjxtjxs(month.getJxMin()/60);
+        pool.setYhjxdxs(month.getXdMin()/60);
+        pool.setYhjyxxs(month.getYxMin()/60);
+        pool.setYhjslxs(0.0);
+
         pool.setNpjfs(year.getPjfs());
         pool.setNgzssdl(year.getGzss() == null ? year.getFjhjxss() * 0.11 : year.getGzss());
         pool.setNjxssdl(year.getJhjxss());
@@ -2880,6 +2905,13 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setNxnssdl(year.getXnss());
         pool.setNxdjclssdl(year.getXdss());
         pool.setNllfdl(year.getLlfdl());
+        pool.setNhjdjxs(year.getDjMin()/60);
+        pool.setNhjgztjxs(year.getGzMin()/60);
+        pool.setNhjtxzdxs(year.getLxMin()/60);
+        pool.setNhjjxtjxs(year.getJxMin()/60);
+        pool.setNhjxdxs(year.getXdMin()/60);
+        pool.setNhjyxxs(year.getYxMin()/60);
+        pool.setNhjslxs(0.0);
     }
 
     public void poolSetValue(ProEconReportIndicatorPool pool, List<ProEconReportIndicatorPool> pools) {
@@ -2891,6 +2923,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setRxnssdl(p.getRxnssdl());
         pool.setRxdjclssdl(p.getRxdjclssdl());
         pool.setRllfdl(p.getRllfdl());
+        pool.setRhjdjxs(p.getRhjdjxs());
+        pool.setRhjgztjxs(p.getRhjgztjxs());
+        pool.setRhjtxzdxs(p.getRhjtxzdxs());
+        pool.setRhjjxtjxs(p.getRhjjxtjxs());
+        pool.setRhjxdxs(p.getRhjxdxs());
+        pool.setRhjyxxs(p.getRhjyxxs());
+        pool.setRhjslxs(0.0);
+        
         pool.setYpjfs(p.getYpjfs() / pools.size());
         pool.setYgzssdl(p.getYgzssdl());
         pool.setYjxssdl(p.getYjxssdl());
@@ -2898,6 +2938,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setYxnssdl(p.getYxnssdl());
         pool.setYxdjclssdl(p.getYxdjclssdl());
         pool.setYllfdl(p.getYllfdl());
+        pool.setYhjdjxs(p.getYhjdjxs());
+        pool.setYhjgztjxs(p.getYhjgztjxs());
+        pool.setYhjtxzdxs(p.getYhjtxzdxs());
+        pool.setYhjjxtjxs(p.getYhjjxtjxs());
+        pool.setYhjxdxs(p.getYhjxdxs());
+        pool.setYhjyxxs(p.getYhjyxxs());
+        pool.setYhjslxs(0.0);
+
         pool.setNpjfs(p.getNpjfs() / pools.size());
         pool.setNgzssdl(p.getNgzssdl());
         pool.setNjxssdl(p.getNjxssdl());
@@ -2905,6 +2953,13 @@ public class JavaFunctionJobHandler extends IJobHandler {
         pool.setNxnssdl(p.getNxnssdl());
         pool.setNxdjclssdl(p.getNxdjclssdl());
         pool.setNllfdl(p.getNllfdl());
+        pool.setNhjdjxs(p.getNhjdjxs());
+        pool.setNhjgztjxs(p.getNhjgztjxs());
+        pool.setNhjtxzdxs(p.getNhjtxzdxs());
+        pool.setNhjjxtjxs(p.getNhjjxtjxs());
+        pool.setNhjxdxs(p.getNhjxdxs());
+        pool.setNhjyxxs(p.getNhjyxxs());
+        pool.setNhjslxs(0.0);
     }
 
     public <T> T sumProperties(List<T> list, Class<T> clazz) {