Procházet zdrojové kódy

计划电量取值修改

wangb před 1 rokem
rodič
revize
a5fecf63c3

+ 17 - 19
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java

@@ -1783,6 +1783,7 @@ public class MonitorService {
 
             String month = wtpointmap.get(ContantXk.YFDL).getNemCode();
             String rfdl = wtpointmap.get(ContantXk.RFDL).getNemCode();
+            String nfdl = wtpointmap.get(ContantXk.RFDL).getNemCode();
 
             if (timetype.contains("year")) {
                 Calendar cal = Calendar.getInstance();
@@ -1835,34 +1836,31 @@ public class MonitorService {
                         List<ProBasicProjectPlan> threejh = threels.stream().filter(wp -> wp.getWindpowerstationId().equals(wpls.getId())).collect(Collectors.toList());
 
                         bnjhdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本年计划电量合
-//                        bnsjdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getOutageHours).sum(); //本年实际电量合
 
-                        Map<String, ProBasicPowerstationPoint> wtpointmap1 = pointwpmap.get(wpls.getId());
-                        String yearsjdl = wtpointmap1.get(ContantXk.NFDL).getNemCode();
+                        twojhdlsum += twojh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //去年计划电量合
 
+                        threejhdlsum += threejh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //前年计划电量合
 
-                        PointData bnsjdl = edosUtil.getHistMatrix(yearsjdl, currentDate.getTime() / 1000);
+                    }
 
-                        bnsjdlsum += bnsjdl.getPointValueInDouble();
+//                    Map<String, ProBasicPowerstationPoint> wtpointmap1 = pointwpmap.get(wpls.getId());
+//                    String yearsjdl = wtpointmap1.get(ContantXk.NFDL).getNemCode();
 
-                        twojhdlsum += twojh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //去年计划电量合
-//                        twosjdlsum += twojh.stream().mapToDouble(ProBasicProjectPlan::getOutageHours).sum(); //去年实际电量合
-                        PointData qnsjdl = edosUtil.getHistMatrix(yearsjdl, twoDate.getTime() / 1000);
-                        twosjdlsum += qnsjdl.getPointValueInDouble();
+                    PointData bnsjdl = edosUtil.getHistMatrix(nfdl, currentDate.getTime() / 1000);
+                    PointData qnsjdl = edosUtil.getHistMatrix(nfdl, twoDate.getTime() / 1000);
+                    PointData threensjdl = edosUtil.getHistMatrix(nfdl, threeDate.getTime() / 1000);
 
-                        threejhdlsum += threejh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //前年计划电量合
-//                        threesjdlsum += threejh.stream().mapToDouble(ProBasicProjectPlan::getOutageHours).sum(); //前年实际电量合
-                        PointData threensjdl = edosUtil.getHistMatrix(yearsjdl, threeDate.getTime() / 1000);
-                        threesjdlsum += threensjdl.getPointValueInDouble();
-                    }
+                    threesjdlsum += threensjdl.getPointValueInDouble();
+                    twosjdlsum += qnsjdl.getPointValueInDouble();
+                    bnsjdlsum += bnsjdl.getPointValueInDouble();
 
                     vos.get(0).setJhdl(StringUtils.round(bnjhdlsum, 2));
                     vos.get(1).setJhdl(StringUtils.round(twojhdlsum, 2));
                     vos.get(2).setJhdl(StringUtils.round(threejhdlsum, 2));
 
-                    vos.get(0).setSjdl(StringUtils.round(bnsjdlsum, 2));
-                    vos.get(1).setSjdl(StringUtils.round(twosjdlsum, 2));
-                    vos.get(2).setSjdl(StringUtils.round(threesjdlsum, 2));
+                    vos.get(0).setSjdl(StringUtils.round(bnsjdlsum /100, 2));
+                    vos.get(1).setSjdl(StringUtils.round(twosjdlsum /100, 2));
+                    vos.get(2).setSjdl(StringUtils.round(threesjdlsum /100, 2));
 
                 }
             }
@@ -1889,7 +1887,7 @@ public class MonitorService {
                         vo.setHours(i);
 
                         PointData data = edosUtil.getSectionData(month, DateUtils.getEndOfDay(DateUtils.getMonthLast(date)).getTime());
-                        vo.setSjdl(DoubleUtils.keepPrecision(data.getPointValueInDouble(), 2));
+                        vo.setSjdl(DoubleUtils.keepPrecision(data.getPointValueInDouble() /10000, 2));
                         date = DateUtils.addMonths(date, -1);
                         vos.add(vo);
                         SortUtils.sort(vos, "hours", SortUtils.ASC);
@@ -1918,7 +1916,7 @@ public class MonitorService {
                         ProjectplanVo vo = new ProjectplanVo();
                         vo.setJhdl(StringUtils.round(byjhdlsum / 30, 2));
                         PointData data = edosUtil.getSectionData(rfdl, DateUtils.getEndOfDay(date).getTime());
-                        vo.setSjdl(DoubleUtils.keepPrecision(data.getPointValueInDouble(), 2));
+                        vo.setSjdl(DoubleUtils.keepPrecision(data.getPointValueInDouble() /10000, 2));
                         date = DateUtils.addDays(date, -1);
 
                         vo.setHours(i);