wangb 2 veckor sedan
förälder
incheckning
6e25dc3ccf

+ 5 - 5
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/homepage/EconomyHomePageController.java

@@ -120,9 +120,9 @@ public class EconomyHomePageController {
     /**
      * 首页 发电量
      */
-    @GetMapping(value = "/generating-capacity2")
+    @GetMapping(value = "/generating-capacity")
     @ApiOperation(value = "首页-发电量", notes = "首页-发电量")
-    public ResultMsg getHomeGeneratingCapacity2(@RequestParam(value = "companyId", required = false) String companyId) throws Exception {
+    public ResultMsg getHomeGeneratingCapacity(@RequestParam(value = "companyId", required = false) String companyId) throws Exception {
 
         Map<String, Object> map = economyPointHomePageService.getGeneratingCapacity2(companyId);
         if (null != map) {
@@ -136,11 +136,11 @@ public class EconomyHomePageController {
     /**
      * 首页 发电量
      */
-    @GetMapping(value = "/generating-capacity")
+    @GetMapping(value = "/generating-capacity2")
     @ApiOperation(value = "首页-发电量", notes = "首页-发电量")
-    public ResultMsg getHomeGeneratingCapacity(@RequestParam(value = "companyId", required = false) String companyId) throws Exception {
+    public ResultMsg getHomeGeneratingCapacity2(@RequestParam(value = "companyId", required = false) String companyId) throws Exception {
 
-        Map<String, Object> map = economyPointHomePageService.getGeneratingCapacity(companyId);
+        Map<String, Object> map = economyPointHomePageService.getGeneratingCapacity2(companyId);
         if (null != map) {
             return ResultMsg.ok(map);
         } else {

+ 91 - 91
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -1560,96 +1560,96 @@ public class EconomyPointHomePageService {
         qw.lambda().eq(ProEconPowerstationInfoDay1::getRecordDate, now)
                 .eq(ProEconPowerstationInfoDay1::getForeignKeyId, companyId);
         List<ProEconPowerstationInfoDay1> day1s = proEconPowerstationInfoDay1Service.list(qw);
-//        for (ProEconPowerstationInfoDay1 day1 : day1s) {
-//            GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
-//            rfdl.setName("日发电量");
-//            rfdl.setValue(day1.getRfdl());
-//            rfdl.setTotal(day1.getRllfdl());
-//            BigDecimal rbfb = (day1.getRfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getRllfdl().compareTo(BigDecimal.ZERO) == 0)
-//                    ? BigDecimal.ZERO
-//                    : day1.getRllfdl().divide(day1.getRfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
-//            rfdl.setBfb(rbfb);
-//            rfdl.setBfb(rbfb);
-//            ls.add(rfdl);
-//
-//            GeneratingCapacityVo yfdl = new GeneratingCapacityVo();
-//            yfdl.setName("月发电量");
-//            yfdl.setValue(day1.getYfdl());
-//            yfdl.setTotal(day1.getYllfdl());
-//            BigDecimal ybfb = (day1.getYfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getYllfdl().compareTo(BigDecimal.ZERO) == 0)
-//                    ? BigDecimal.ZERO
-//                    : day1.getYllfdl().divide(day1.getYfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
-//            rfdl.setBfb(rbfb);
-//            yfdl.setBfb(ybfb);
-//            ls.add(yfdl);
-//
-//            GeneratingCapacityVo nfdl = new GeneratingCapacityVo();
-//            nfdl.setName("年发电量");
-//            nfdl.setValue(day1.getNfdl().divide(new BigDecimal(1000)));
-//            nfdl.setTotal(day1.getNllfdl().divide(new BigDecimal(1000)));
-//            BigDecimal nbfb = (day1.getNfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getNllfdl().compareTo(BigDecimal.ZERO) == 0)
-//                    ? BigDecimal.ZERO
-//                    : day1.getNllfdl().divide(day1.getNfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
-//            rfdl.setBfb(rbfb);
-//            nfdl.setBfb(nbfb);
-//            ls.add(nfdl);
-//
-//            Map<String, Object> zbtqdb = new HashMap<>();
-//            List<ColumnVo> ls1 = new ArrayList<>();
-//            ColumnVo cl1 = new ColumnVo();
-//            cl1.setName("指标名称");
-//            cl1.setField("wtId");
-//            ColumnVo cl2 = new ColumnVo();
-//            cl2.setName(String.valueOf(LocalDate.now().getYear()));
-//            cl2.setField("recodedate");
-//            ColumnVo cl3 = new ColumnVo();
-//            cl3.setName(String.valueOf(LocalDate.now().getYear() - 1));
-//            cl3.setField("recodedate2");
-//            ColumnVo cl4 = new ColumnVo();
-//            cl4.setName("涨跌%");
-//            cl4.setField("operation");
-//            ls1.add(cl1);
-//            ls1.add(cl2);
-//            ls1.add(cl3);
-//            ls1.add(cl4);
-//
-//            List<ComparetqVo> ls2 = new ArrayList<>();
-//            ComparetqVo cv = new ComparetqVo();
-//            cv.setWtId("发电量");
-//            cv.setRecodedate(String.valueOf(day1.getNfdl().divide(new BigDecimal(1000))));
-//            cv.setRecodedate2(String.valueOf(0));
-//            cv.setOperation("100");
-//            ComparetqVo cv1 = new ComparetqVo();
-//            cv1.setWtId("上网电量");
-//            cv1.setRecodedate(String.valueOf(0.00));
-//            cv1.setRecodedate2(String.valueOf(0));
-//            cv1.setOperation("0");
-//            ComparetqVo cv2 = new ComparetqVo();
-//            cv2.setWtId("网购电量");
-//            cv2.setRecodedate(String.valueOf(0.00));
-//            cv2.setRecodedate2(String.valueOf(0));
-//            cv2.setOperation("0");
-//            ComparetqVo cv3 = new ComparetqVo();
-//            cv3.setWtId("损失电量");
-//            cv3.setRecodedate(String.valueOf(0.00));
-//            cv3.setRecodedate2(String.valueOf(0));
-//            cv3.setOperation("0");
-//            ComparetqVo cv4 = new ComparetqVo();
-//            cv4.setWtId("场用电量");
-//            cv4.setRecodedate(String.valueOf(0.00));
-//            cv4.setRecodedate2(String.valueOf(0));
-//            cv4.setOperation("0");
-//            ls2.add(cv);
-//            ls2.add(cv1);
-//            ls2.add(cv2);
-//            ls2.add(cv3);
-//            ls2.add(cv4);
-//
-//            zbtqdb.put("column", ls1);
-//            zbtqdb.put("data", ls2);
-//            allmap.put("fdl", ls);
-//            allmap.put("zbtqdb", zbtqdb);
-//        }
+        for (ProEconPowerstationInfoDay1 day1 : day1s) {
+            GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
+            rfdl.setName("日发电量");
+            rfdl.setValue(day1.getRfdl());
+            rfdl.setTotal(day1.getRllfdl());
+            BigDecimal rbfb = (day1.getRfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getRllfdl().compareTo(BigDecimal.ZERO) == 0)
+                    ? BigDecimal.ZERO
+                    : day1.getRllfdl().divide(day1.getRfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+            rfdl.setBfb(rbfb);
+            rfdl.setBfb(rbfb);
+            ls.add(rfdl);
+
+            GeneratingCapacityVo yfdl = new GeneratingCapacityVo();
+            yfdl.setName("月发电量");
+            yfdl.setValue(day1.getYfdl());
+            yfdl.setTotal(day1.getYllfdl());
+            BigDecimal ybfb = (day1.getYfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getYllfdl().compareTo(BigDecimal.ZERO) == 0)
+                    ? BigDecimal.ZERO
+                    : day1.getYllfdl().divide(day1.getYfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+            rfdl.setBfb(rbfb);
+            yfdl.setBfb(ybfb);
+            ls.add(yfdl);
+
+            GeneratingCapacityVo nfdl = new GeneratingCapacityVo();
+            nfdl.setName("年发电量");
+            nfdl.setValue(day1.getNfdl().divide(new BigDecimal(1000)));
+            nfdl.setTotal(day1.getNllfdl().divide(new BigDecimal(1000)));
+            BigDecimal nbfb = (day1.getNfdl().compareTo(BigDecimal.ZERO) == 0 || day1.getNllfdl().compareTo(BigDecimal.ZERO) == 0)
+                    ? BigDecimal.ZERO
+                    : day1.getNllfdl().divide(day1.getNfdl(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+            rfdl.setBfb(rbfb);
+            nfdl.setBfb(nbfb);
+            ls.add(nfdl);
+
+            Map<String, Object> zbtqdb = new HashMap<>();
+            List<ColumnVo> ls1 = new ArrayList<>();
+            ColumnVo cl1 = new ColumnVo();
+            cl1.setName("指标名称");
+            cl1.setField("wtId");
+            ColumnVo cl2 = new ColumnVo();
+            cl2.setName(String.valueOf(LocalDate.now().getYear()));
+            cl2.setField("recodedate");
+            ColumnVo cl3 = new ColumnVo();
+            cl3.setName(String.valueOf(LocalDate.now().getYear() - 1));
+            cl3.setField("recodedate2");
+            ColumnVo cl4 = new ColumnVo();
+            cl4.setName("涨跌%");
+            cl4.setField("operation");
+            ls1.add(cl1);
+            ls1.add(cl2);
+            ls1.add(cl3);
+            ls1.add(cl4);
+
+            List<ComparetqVo> ls2 = new ArrayList<>();
+            ComparetqVo cv = new ComparetqVo();
+            cv.setWtId("发电量");
+            cv.setRecodedate(String.valueOf(day1.getNfdl().divide(new BigDecimal(1000))));
+            cv.setRecodedate2(String.valueOf(0));
+            cv.setOperation("100");
+            ComparetqVo cv1 = new ComparetqVo();
+            cv1.setWtId("上网电量");
+            cv1.setRecodedate(String.valueOf(0.00));
+            cv1.setRecodedate2(String.valueOf(0));
+            cv1.setOperation("0");
+            ComparetqVo cv2 = new ComparetqVo();
+            cv2.setWtId("网购电量");
+            cv2.setRecodedate(String.valueOf(0.00));
+            cv2.setRecodedate2(String.valueOf(0));
+            cv2.setOperation("0");
+            ComparetqVo cv3 = new ComparetqVo();
+            cv3.setWtId("损失电量");
+            cv3.setRecodedate(String.valueOf(0.00));
+            cv3.setRecodedate2(String.valueOf(0));
+            cv3.setOperation("0");
+            ComparetqVo cv4 = new ComparetqVo();
+            cv4.setWtId("场用电量");
+            cv4.setRecodedate(String.valueOf(0.00));
+            cv4.setRecodedate2(String.valueOf(0));
+            cv4.setOperation("0");
+            ls2.add(cv);
+            ls2.add(cv1);
+            ls2.add(cv2);
+            ls2.add(cv3);
+            ls2.add(cv4);
+
+            zbtqdb.put("column", ls1);
+            zbtqdb.put("data", ls2);
+            allmap.put("fdl", ls);
+            allmap.put("zbtqdb", zbtqdb);
+        }
 
         return allmap;
     }
@@ -1973,7 +1973,7 @@ public class EconomyPointHomePageService {
         StationInfoMin day1 = day1s.get(0);
         GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
             rfdl.setName("日发电量");
-            rfdl.setValue(day1.getRfdl());
+//            rfdl.setValue(day1.getRfdl());
 //            rfdl.setTotal(day1.getRllfdl());
 //            Double rbfb = (day1.getRfdl()== 0 || day1.getRllfdl() == 0)
 //                    ? 0.0