xujuanning 1 місяць тому
батько
коміт
bb3e3daad1
18 змінених файлів з 1895 додано та 308 видалено
  1. 2 3
      data-adapter/src/main/java/com/gyee/dataadapter/controller/AdapterController.java
  2. 2 2
      data-adapter/src/main/java/com/gyee/dataadapter/service/IAdapterService.java
  3. 7 28
      data-adapter/src/main/java/com/gyee/dataadapter/service/impl/AdapterServiceImpl.java
  4. 167 25
      runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/bmk/BenchmarkingController.java
  5. 16 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/homepage/EconomyHomePageController.java
  6. 38 2
      runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/specific/SpecificController.java
  7. 17 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/StationInfoMinMapper.java
  8. 16 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/TurbineInfoDayMapper.java
  9. 123 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/model/StationInfoMin.java
  10. 185 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/TurbineInfoDay.java
  11. 3 3
      runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/GeneratingCapacityVo.java
  12. 16 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IStationInfoMinService.java
  13. 16 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/ITurbineInfoDayService.java
  14. 33 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/StationInfoMinServiceImpl.java
  15. 20 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/TurbineInfoDayServiceImpl.java
  16. 778 102
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java
  17. 247 142
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java
  18. 209 1
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

+ 2 - 3
data-adapter/src/main/java/com/gyee/dataadapter/controller/AdapterController.java

@@ -89,7 +89,7 @@ public class AdapterController {
 
 
     @GetMapping("/history/stat2")
-    public List<DoubleStatData> getHistoryStat(@RequestParam("tagName") String tagName,
+    public DoubleStatData getHistoryStat(@RequestParam("tagName") String tagName,
                                                 @RequestParam("startTs") Long startTs,
                                                 @RequestParam("endTs") Long endTs) {
         List<DoubleStatData> result = new ArrayList<>();
@@ -101,11 +101,10 @@ public class AdapterController {
                 result.add(new DoubleStatData(max.get(i), min.get(i), avg.get(i)));
             }
         }
-        return result;
+        return result.get(0);
     }
 
 
-
     @GetMapping("/history/section")
     public Map<String, PointData> getHistorySection(@RequestParam("tagNames") String tagNames, @RequestParam("ts") Long ts) {
         return tsDataService.getHistorySection(ts, tagNames);

+ 2 - 2
data-adapter/src/main/java/com/gyee/dataadapter/service/IAdapterService.java

@@ -13,8 +13,6 @@ public interface IAdapterService {
     TotalPointData getTotalData(String start, String end, Integer sampleType, Integer sampleRate, String paths,
                                 String pageIndex, String pageSize, Boolean isDesc);
 
-    TotalPointData getTotalData3(String start, String end, Integer sampleType, String paths,
-                                String pageIndex, String pageSize, Boolean isDesc);
 
     TotalPointData getTotalData(Date start, Date end, Integer sampleType, Integer sampleRate, String paths,
                                 String pageIndex, String pageSize, Boolean isDesc);
@@ -22,6 +20,8 @@ public interface IAdapterService {
     //历史数据接口
     TotalPointData getTotalData(Date start, Date end, Integer sampleType, Integer sampleRate, String paths);
 
+    TotalPointData getTotalData(Date start, Date end, Integer sampleType, String paths);
+
     List<PointData> getPointData(Date start, Date end, Integer sampleType, Integer sampleRate, String paths);
 
     List<PointData> getPointData2(Date start, Date end, Integer sampleType, String paths);

Різницю між файлами не показано, бо вона завелика
+ 7 - 28
data-adapter/src/main/java/com/gyee/dataadapter/service/impl/AdapterServiceImpl.java


+ 167 - 25
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/bmk/BenchmarkingController.java

@@ -119,16 +119,37 @@ public class BenchmarkingController {
         }
     }
 
+    @GetMapping(value = "/performance2")
+    @ApiOperation(value = "风机绩效榜", notes = "风机绩效榜")
+    public R performance2(@RequestParam(value = "companyid") String companyid,
+                         @RequestParam(value = "getype") String getype,
+                         @RequestParam(value = "sttype") String sttype,
+                         @RequestParam(value = "beginDate") String beginDate,
+                         @RequestParam(value = "endDate") String endDate,
+                         @RequestParam(value = "wpids") String wpids,
+                         @RequestParam(value = "projectids") String projectids,
+                         @RequestParam(value = "lineids") String lineids,
+                         @RequestParam(value = "target", required = false) String target,
+                         @RequestParam(value = "sort", required = false) String sort) {
+        List<FjjxbVo> resultList = benchmarkingService.performance2(companyid, getype, sttype, beginDate, endDate, wpids, projectids, lineids, target, sort);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
     @GetMapping(value = "/performance")
     @ApiOperation(value = "风机绩效榜", notes = "风机绩效榜")
-    public R performance(@RequestParam(value = "companyid", required = true) String companyid,
-                         @RequestParam(value = "getype", required = true) String getype,
-                         @RequestParam(value = "sttype", required = true) String sttype,
-                         @RequestParam(value = "beginDate", required = true) String beginDate,
-                         @RequestParam(value = "endDate", required = true) String endDate,
-                         @RequestParam(value = "wpids", required = true) String wpids,
-                         @RequestParam(value = "projectids", required = true) String projectids,
-                         @RequestParam(value = "lineids", required = true) String lineids,
+    public R performance(@RequestParam(value = "companyid") String companyid,
+                         @RequestParam(value = "getype") String getype,
+                         @RequestParam(value = "sttype") String sttype,
+                         @RequestParam(value = "beginDate") String beginDate,
+                         @RequestParam(value = "endDate") String endDate,
+                         @RequestParam(value = "wpids") String wpids,
+                         @RequestParam(value = "projectids") String projectids,
+                         @RequestParam(value = "lineids") String lineids,
                          @RequestParam(value = "target", required = false) String target,
                          @RequestParam(value = "sort", required = false) String sort) {
         List<FjjxbVo> resultList = benchmarkingService.performance(companyid, getype, sttype, beginDate, endDate, wpids, projectids, lineids, target, sort);
@@ -139,6 +160,7 @@ public class BenchmarkingController {
         }
     }
 
+
     @GetMapping(value = "/performanceMX")
     @ApiOperation(value = "风机绩效榜明细", notes = "风机绩效榜明细")
     public R performanceMX(@RequestParam(value = "companyid", required = true) String companyid,
@@ -160,18 +182,41 @@ public class BenchmarkingController {
     }
 
 
+    @GetMapping("/wxssl2")
+    @ResponseBody
+    @ApiOperation(value = "五项损失率", notes = "五项损失率")
+    public R wxssl2(@RequestParam(value = "companys") String companys,
+                   @RequestParam(value = "type") String type,
+                   @RequestParam(value = "wpids") String wpids,
+                   @RequestParam(value = "projectids") String projectids,
+                   @RequestParam(value = "lineids") String lineids,
+                   @RequestParam(value = "beginDate") String beginDate,
+                   @RequestParam(value = "endDate") String endDate,
+                   @RequestParam(value = "target") String target,
+                   @RequestParam(value = "sort") String sort
+    ) {
+        List<WxsslVo> resultList = benchmarkingService.wxssl2(companys, type, wpids, projectids, lineids, beginDate, endDate, target, sort);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
     @GetMapping("/wxssl")
     @ResponseBody
     @ApiOperation(value = "五项损失率", notes = "五项损失率")
-    public R wxssl(@RequestParam(value = "companys", required = true) String companys,
-                   @RequestParam(value = "type", required = true) String type,
-                   @RequestParam(value = "wpids", required = true) String wpids,
-                   @RequestParam(value = "projectids", required = true) String projectids,
-                   @RequestParam(value = "lineids", required = true) String lineids,
-                   @RequestParam(value = "beginDate", required = true) String beginDate,
-                   @RequestParam(value = "endDate", required = true) String endDate,
-                   @RequestParam(value = "target", required = true) String target,
-                   @RequestParam(value = "sort", required = true) String sort
+    public R wxssl(@RequestParam(value = "companys") String companys,
+                   @RequestParam(value = "type") String type,
+                   @RequestParam(value = "wpids") String wpids,
+                   @RequestParam(value = "projectids") String projectids,
+                   @RequestParam(value = "lineids") String lineids,
+                   @RequestParam(value = "beginDate") String beginDate,
+                   @RequestParam(value = "endDate") String endDate,
+                   @RequestParam(value = "target") String target,
+                   @RequestParam(value = "sort") String sort
     ) {
         List<WxsslVo> resultList = benchmarkingService.wxssl(companys, type, wpids, projectids, lineids, beginDate, endDate, target, sort);
 
@@ -182,10 +227,11 @@ public class BenchmarkingController {
         }
     }
 
-    @GetMapping("/cndb")
+
+    @GetMapping("/cndb2")
     @ResponseBody
     @ApiOperation(value = "场内对标", notes = "场内对标")
-    public R cndb(@RequestParam(value = "companys", required = true) String companys,
+    public R cndb2(@RequestParam(value = "companys", required = true) String companys,
                   @RequestParam(value = "type", required = true) String type,
                   @RequestParam(value = "wpid", required = true) String wpid,
                   @RequestParam(value = "beginDate", required = true) String beginDate,
@@ -195,6 +241,29 @@ public class BenchmarkingController {
                   @RequestParam(value = "pageNum", required = true) int pageNum,
                   @RequestParam(value = "pageSize", required = true) int pageSize
     ) {
+        Map<String, Object> resultList = benchmarkingService.cndb2(companys, type, wpid, beginDate, endDate, target, sort, pageNum, pageSize);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    @GetMapping("/cndb")
+    @ResponseBody
+    @ApiOperation(value = "场内对标", notes = "场内对标")
+    public R cndb(@RequestParam(value = "companys") String companys,
+                  @RequestParam(value = "type") String type,
+                  @RequestParam(value = "wpid") String wpid,
+                  @RequestParam(value = "beginDate") String beginDate,
+                  @RequestParam(value = "endDate") String endDate,
+                  @RequestParam(value = "target") String target,
+                  @RequestParam(value = "sort") String sort,
+                  @RequestParam(value = "pageNum") int pageNum,
+                  @RequestParam(value = "pageSize") int pageSize
+    ) {
         Map<String, Object> resultList = benchmarkingService.cndb(companys, type, wpid, beginDate, endDate, target, sort, pageNum, pageSize);
 
         if (StringUtils.isNotNull(resultList)) {
@@ -323,10 +392,10 @@ public class BenchmarkingController {
     }
 
 
-    @GetMapping("/cjdb")
+    @GetMapping("/cjdb2")
     @ResponseBody
     @ApiOperation(value = "场际对标", notes = "场际对标")
-    public R cjdb(@RequestParam(value = "companys", required = true) String companys,
+    public R cjdb2(@RequestParam(value = "companys", required = true) String companys,
                   @RequestParam(value = "type", required = true) String type,
                   @RequestParam(value = "wpids", required = true) String wpids,
                   @RequestParam(value = "beginDate", required = true) String beginDate,
@@ -336,6 +405,29 @@ public class BenchmarkingController {
                   @RequestParam(value = "pageNum", required = true) int pageNum,
                   @RequestParam(value = "pageSize", required = true) int pageSize
     ) {
+        Map<String, Object> resultList = benchmarkingService.cjdb2(companys, type, wpids, beginDate, endDate, target, sort, pageNum, pageSize);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    @GetMapping("/cjdb")
+    @ResponseBody
+    @ApiOperation(value = "场际对标", notes = "场际对标")
+    public R cjdb(@RequestParam(value = "companys") String companys,
+                  @RequestParam(value = "type") String type,
+                  @RequestParam(value = "wpids") String wpids,
+                  @RequestParam(value = "beginDate") String beginDate,
+                  @RequestParam(value = "endDate") String endDate,
+                  @RequestParam(value = "target") String target,
+                  @RequestParam(value = "sort") String sort,
+                  @RequestParam(value = "pageNum") int pageNum,
+                  @RequestParam(value = "pageSize") int pageSize
+    ) {
         Map<String, Object> resultList = benchmarkingService.cjdb(companys, type, wpids, beginDate, endDate, target, sort, pageNum, pageSize);
 
         if (StringUtils.isNotNull(resultList)) {
@@ -346,10 +438,10 @@ public class BenchmarkingController {
     }
 
 
-    @GetMapping("/xmdb")
+    @GetMapping("/xmdb2")
     @ResponseBody
     @ApiOperation(value = "项目对标", notes = "项目对标")
-    public R xmdb(@RequestParam(value = "companys", required = true) String companys,
+    public R xmdb2(@RequestParam(value = "companys", required = true) String companys,
                   @RequestParam(value = "type", required = true) String type,
                   @RequestParam(value = "wpids", required = true) String wpids,
                   @RequestParam(value = "projectids", required = true) String projectids,
@@ -360,6 +452,30 @@ public class BenchmarkingController {
                   @RequestParam(value = "pageNum", required = true) int pageNum,
                   @RequestParam(value = "pageSize", required = true) int pageSize
     ) {
+        Map<String, Object> resultList = benchmarkingService.xmdb2(companys, type, wpids, projectids, beginDate, endDate, target, sort, pageNum, pageSize);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    @GetMapping("/xmdb")
+    @ResponseBody
+    @ApiOperation(value = "项目对标", notes = "项目对标")
+    public R xmdb(@RequestParam(value = "companys") String companys,
+                  @RequestParam(value = "type") String type,
+                  @RequestParam(value = "wpids") String wpids,
+                  @RequestParam(value = "projectids") String projectids,
+                  @RequestParam(value = "beginDate") String beginDate,
+                  @RequestParam(value = "endDate") String endDate,
+                  @RequestParam(value = "target") String target,
+                  @RequestParam(value = "sort") String sort,
+                  @RequestParam(value = "pageNum") int pageNum,
+                  @RequestParam(value = "pageSize") int pageSize
+    ) {
         Map<String, Object> resultList = benchmarkingService.xmdb(companys, type, wpids, projectids, beginDate, endDate, target, sort, pageNum, pageSize);
 
         if (StringUtils.isNotNull(resultList)) {
@@ -370,10 +486,11 @@ public class BenchmarkingController {
     }
 
 
-    @GetMapping("/xldb")
+
+    @GetMapping("/xldb2")
     @ResponseBody
     @ApiOperation(value = "线路对标", notes = "线路对标")
-    public R xldb(@RequestParam(value = "companys", required = true) String companys,
+    public R xldb2(@RequestParam(value = "companys", required = true) String companys,
                   @RequestParam(value = "type", required = true) String type,
                   @RequestParam(value = "wpids", required = true) String wpids,
                   @RequestParam(value = "projectids", required = true) String projectids,
@@ -385,6 +502,31 @@ public class BenchmarkingController {
                   @RequestParam(value = "pageNum", required = true) int pageNum,
                   @RequestParam(value = "pageSize", required = true) int pageSize
     ) {
+        Map<String, Object> resultList = benchmarkingService.xldb2(companys, type, wpids, projectids, lineids, beginDate, endDate, target, sort, pageNum, pageSize);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    @GetMapping("/xldb")
+    @ResponseBody
+    @ApiOperation(value = "线路对标", notes = "线路对标")
+    public R xldb(@RequestParam(value = "companys") String companys,
+                  @RequestParam(value = "type") String type,
+                  @RequestParam(value = "wpids") String wpids,
+                  @RequestParam(value = "projectids") String projectids,
+                  @RequestParam(value = "lineids") String lineids,
+                  @RequestParam(value = "beginDate") String beginDate,
+                  @RequestParam(value = "endDate") String endDate,
+                  @RequestParam(value = "target") String target,
+                  @RequestParam(value = "sort") String sort,
+                  @RequestParam(value = "pageNum") int pageNum,
+                  @RequestParam(value = "pageSize") int pageSize
+    ) {
         Map<String, Object> resultList = benchmarkingService.xldb(companys, type, wpids, projectids, lineids, beginDate, endDate, target, sort, pageNum, pageSize);
 
         if (StringUtils.isNotNull(resultList)) {

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

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

+ 38 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/specific/SpecificController.java

@@ -54,13 +54,29 @@ public class SpecificController {
      *
      * @return
      */
-    @GetMapping("/maincenterlist")
+    @GetMapping("/maincenterlist2")
     @ResponseBody
     @ApiOperation(value = "综合分析2", notes = "综合分析2")
-    public R maincenterlist(@RequestParam(value = "companys", required = true) String companys,
+    public R maincenterlist2(@RequestParam(value = "companys", required = true) String companys,
                             @RequestParam(value = "type", required = true) String type,
                             @RequestParam(value = "month", required = true) String month) throws ParseException {
 
+        Map<String, List<SpecificCenterVo>> resultMap = specificService.maincenterlist2(companys, type, month);
+        if (StringUtils.isNotNull(resultMap)) {
+            return R.data(ResultMsg.ok(resultMap));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    @GetMapping("/maincenterlist")
+    @ResponseBody
+    @ApiOperation(value = "综合分析2", notes = "综合分析2")
+    public R maincenterlist(@RequestParam(value = "companys") String companys,
+                            @RequestParam(value = "type") String type,
+                            @RequestParam(value = "month") String month) throws ParseException {
+
         Map<String, List<SpecificCenterVo>> resultMap = specificService.maincenterlist(companys, type, month);
         if (StringUtils.isNotNull(resultMap)) {
             return R.data(ResultMsg.ok(resultMap));
@@ -75,6 +91,26 @@ public class SpecificController {
      *
      * @return
      */
+    @GetMapping("/fnlylList2")
+    @ResponseBody
+    @ApiOperation(value = "专题分析-风能利用率", notes = "专题分析-风能利用率")
+    public R fnlylList2(@RequestParam(value = "companys") String companys,
+                       @RequestParam(value = "type") String type,
+                       @RequestParam(value = "year") String year) throws ParseException {
+        List<SpecificTarget> resultList = specificService.fnlylList2(companys, type, year);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 查询风能利用率功能
+     *
+     * @return
+     */
     @GetMapping("/fnlylList")
     @ResponseBody
     @ApiOperation(value = "专题分析-风能利用率", notes = "专题分析-风能利用率")

+ 17 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/StationInfoMinMapper.java

@@ -0,0 +1,17 @@
+package com.gyee.runeconomy.mapper.auto;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.runeconomy.model.StationInfoMin;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-08-05
+ */
+public interface StationInfoMinMapper extends BaseMapper<StationInfoMin> {
+
+}

+ 16 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/mapper/auto/TurbineInfoDayMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.mapper.auto;
+
+import com.gyee.runeconomy.model.auto.TurbineInfoDay;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2024-11-18
+ */
+public interface TurbineInfoDayMapper extends BaseMapper<TurbineInfoDay> {
+
+}

+ 123 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/StationInfoMin.java

@@ -0,0 +1,123 @@
+package com.gyee.runeconomy.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-08-05
+ */
+@Data
+@TableName("station_info_min")
+public class StationInfoMin implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    @JsonIgnore
+    private Integer id;
+
+    @JsonIgnore
+    private String stationId;
+
+    @JsonProperty("record_date")
+    private Date recordDate;
+
+    private Double pjfs;
+
+    private Double pjgl;
+
+    @JsonIgnore
+    private Double llgl;
+
+    @JsonIgnore
+    private Double kygl;
+
+    private Double agc;
+
+    @JsonIgnore
+    private Double dqycgl;
+
+    @JsonIgnore
+    private Double cdqycgl;
+
+    private Double rfdl;
+
+    private Double hjwd;
+    //待机,运行,故障,检修
+    private Long djts;
+    private Long yxts;
+    private Long gzts;
+    private Long jxts;
+
+    public void setLlgl(Double llgl) {
+        if (llgl == null) llgl = 0.0;
+        this.llgl = llgl;
+    }
+
+    public void setKygl(Double kygl) {
+        if (kygl == null) kygl = 0.0;
+        this.kygl = kygl;
+    }
+
+    public void setDjts(Long djts) {
+        if (djts == null) djts = 0L;
+        this.djts = djts;
+    }
+
+    public void setYxts(Long yxts) {
+        if (yxts == null) yxts = 0L;
+        this.yxts = yxts;
+    }
+
+    public void setGzts(Long gzts) {
+        if (gzts == null) gzts = 0L;
+        this.gzts = gzts;
+    }
+
+    public void setJxts(Long jxts) {
+        if (jxts == null) jxts = 0L;
+        this.jxts = jxts;
+    }
+
+    public void setPjfs(Double pjfs) {
+        if (pjfs == null || pjfs < 0) pjfs = 0.0;
+        if (pjfs > 25) pjfs = 25.0;
+        this.pjfs = pjfs;
+    }
+
+    public void setPjgl(Double pjgl) {
+        if (pjgl == null || pjgl<0) pjgl = 0.0;
+        if (pjgl > 169600) pjgl = 169600.0;
+        this.pjgl = pjgl;
+    }
+
+    public void setAgc(Double agc) {
+        if (agc == null || agc < 0) agc = 0.0;
+        if (agc > 170000) agc = 170000.0;
+        this.agc = agc;
+    }
+
+    public void setRfdl(Double rfdl) {
+        if (rfdl == null || rfdl < 0) rfdl = 0.0;
+        this.rfdl = rfdl;
+    }
+
+    public void setHjwd(Double hjwd) {
+        if (hjwd == null) hjwd = 0.0;
+        if (hjwd < -30) hjwd = -30.0;
+        if (hjwd > 55) hjwd = 55.0;
+        this.hjwd = hjwd;
+    }
+}

+ 185 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/TurbineInfoDay.java

@@ -0,0 +1,185 @@
+package com.gyee.runeconomy.model.auto;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2024-11-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("turbine_info_day")
+public class TurbineInfoDay implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("station_id")
+    private String stationId;
+
+    @TableField("project_id")
+    private String projectId;
+
+    @TableField("line_id")
+    private String lineId;
+
+    @TableField("turbine_id")
+    private String turbineId;
+
+    @TableField("record_date")
+    private LocalDate recordDate;
+
+    @TableField("rfdl")
+    private BigDecimal rfdl;
+
+    /**
+     * 计划检修损失
+     */
+    @TableField("jhjxss")
+    private BigDecimal jhjxss;
+
+    /**
+     * 非计划检修损失
+     */
+    @TableField("fjhjxss")
+    private BigDecimal fjhjxss;
+
+    /**
+     * 限电损失
+     */
+    @TableField("xdss")
+    private BigDecimal xdss;
+
+    /**
+     * 受累损失
+     */
+    @TableField("slss")
+    private BigDecimal slss;
+
+    /**
+     * 性能损失
+     */
+    @TableField("xnss")
+    private BigDecimal xnss;
+
+    /**
+     * 理论发电量
+     */
+    @TableField("llfdl")
+    private BigDecimal llfdl;
+
+    @TableField("pjfs")
+    private BigDecimal pjfs;
+
+    /**
+     * 额定风速
+     */
+    @TableField("edfs")
+    private BigDecimal edfs;
+
+    /**
+     * 小风切入风速
+     */
+    @TableField("xfqrfs")
+    private BigDecimal xfqrfs;
+
+    @TableField("hjwd")
+    private BigDecimal hjwd;
+
+    /**
+     * 待机损失
+     */
+    @TableField("djss")
+    private BigDecimal djss;
+
+    /**
+     * 故障损失
+     */
+    @TableField("gzss")
+    private BigDecimal gzss;
+
+    /**
+     * 待机分钟
+     */
+    @TableField("dj_min")
+    private BigDecimal djMin;
+
+    /**
+     * 停机分钟
+     */
+    @TableField("tj_min")
+    private BigDecimal tjMin;
+
+    /**
+     * 运行分钟
+     */
+    @TableField("yx_min")
+    private BigDecimal yxMin;
+
+    /**
+     * 故障分钟
+     */
+    @TableField("gz_min")
+    private BigDecimal gzMin;
+
+    /**
+     * 检修分钟
+     */
+    @TableField("jx_min")
+    private BigDecimal jxMin;
+
+    /**
+     * 限电分钟
+     */
+    @TableField("xd_min")
+    private BigDecimal xdMin;
+
+    /**
+     * 离线分钟
+     */
+    @TableField("lx_min")
+    private BigDecimal lxMin;
+
+    /**
+     * 待机次数
+     */
+    @TableField("djcs")
+    private Integer djcs;
+
+    @TableField("tjcs")
+    private Integer tjcs;
+
+    @TableField("yxcs")
+    private Integer yxcs;
+
+    @TableField("gzcs")
+    private Integer gzcs;
+
+    @TableField("jxcs")
+    private Integer jxcs;
+
+    @TableField("xdcs")
+    private Integer xdcs;
+
+    @TableField("lxcs")
+    private Integer lxcs;
+
+
+}

+ 3 - 3
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/vo/GeneratingCapacityVo.java

@@ -12,7 +12,7 @@ import java.math.BigDecimal;
 @Data
 public class GeneratingCapacityVo {
     private String name;
-    private BigDecimal value;
-    private BigDecimal total;
-    private BigDecimal bfb;
+    private Double value;
+    private Double total;
+    private Double bfb;
 }

+ 16 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IStationInfoMinService.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.service.auto;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.runeconomy.model.StationInfoMin;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-08-05
+ */
+public interface IStationInfoMinService extends IService<StationInfoMin> {
+
+}

+ 16 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/ITurbineInfoDayService.java

@@ -0,0 +1,16 @@
+package com.gyee.runeconomy.service.auto;
+
+import com.gyee.runeconomy.model.auto.TurbineInfoDay;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2024-11-18
+ */
+public interface ITurbineInfoDayService extends IService<TurbineInfoDay> {
+
+}

+ 33 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/StationInfoMinServiceImpl.java

@@ -0,0 +1,33 @@
+package com.gyee.runeconomy.service.auto.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.runeconomy.mapper.auto.StationInfoMinMapper;
+import com.gyee.runeconomy.model.StationInfoMin;
+import com.gyee.runeconomy.service.auto.IStationInfoMinService;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author gfhd
+ * @since 2024-08-05
+ */
+@Service
+public class StationInfoMinServiceImpl extends ServiceImpl<StationInfoMinMapper, StationInfoMin> implements IStationInfoMinService {
+
+    @Override
+    public boolean saveOrUpdate(StationInfoMin entity) {
+        return super.saveOrUpdate(entity);
+    }
+
+    @Override
+    public boolean saveOrUpdateBatch(Collection<StationInfoMin> entityList) {
+        return super.saveOrUpdateBatch(entityList);
+    }
+
+}

+ 20 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/TurbineInfoDayServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.runeconomy.service.auto.impl;
+
+import com.gyee.runeconomy.model.auto.TurbineInfoDay;
+import com.gyee.runeconomy.mapper.auto.TurbineInfoDayMapper;
+import com.gyee.runeconomy.service.auto.ITurbineInfoDayService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author author
+ * @since 2024-11-18
+ */
+@Service
+public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper, TurbineInfoDay> implements ITurbineInfoDayService {
+
+}

Різницю між файлами не показано, бо вона завелика
+ 778 - 102
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java


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

@@ -7,6 +7,7 @@ import com.gyee.common.vo.healthmanager.CompareVo;
 import com.gyee.runeconomy.dto.response.EconHomePagePointRateDTO;
 import com.gyee.runeconomy.dto.response.ProEconPointCodeDTO;
 import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.StationInfoMin;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.model.vo.*;
 import com.gyee.runeconomy.service.auto.*;
@@ -63,10 +64,12 @@ public class EconomyPointHomePageService {
     @Resource
     private IProEconPowerstationInfoDay2Service iProEconPowerstationInfoDay2Service;
 
-
     @Resource
     private IProBasicProjectPlanService iProBasicProjectPlanService;
 
+    @Resource
+    private IStationInfoMinService iStationInfoMinService;
+
 
     /**
      * 指标率相应类
@@ -140,56 +143,54 @@ public class EconomyPointHomePageService {
         qw.lambda().eq(ProEconPowerstationInfoDay1::getRecordDate, now)
                 .eq(ProEconPowerstationInfoDay1::getForeignKeyId, CacheContext.wpls.get(0).getId());
         List<ProEconPowerstationInfoDay1> day1s = proEconPowerstationInfoDay1Service.list(qw);
-        for (ProEconPowerstationInfoDay1 day1 : day1s) {
-            GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
-            rfdl.setName("日发电量");
-            rfdl.setValue(day1.getRfdl());
-            rfdl.setTotal(day1.getRllfdl());
-            rfdl.setBfb(new BigDecimal("5.00"));
-            ls.add(rfdl);
-
-            GeneratingCapacityVo yfdl = new GeneratingCapacityVo();
-            yfdl.setName("月发电量");
-            yfdl.setValue(day1.getYfdl());
-            yfdl.setTotal(day1.getYllfdl());
-            yfdl.setBfb(new BigDecimal("5.00"));
-            ls.add(yfdl);
-
-            GeneratingCapacityVo nfdl = new GeneratingCapacityVo();
-            nfdl.setName("年发电量");
-            nfdl.setValue(day1.getNfdl());
-            nfdl.setTotal(day1.getNllfdl());
-            nfdl.setBfb(new BigDecimal("5.00"));
-            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<ColumnVo> ls2 = new ArrayList<>();
-
-
-        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());
+//            rfdl.setBfb(new BigDecimal("5.00"));
+//            ls.add(rfdl);
+//
+//            GeneratingCapacityVo yfdl = new GeneratingCapacityVo();
+//            yfdl.setName("月发电量");
+//            yfdl.setValue(day1.getYfdl());
+//            yfdl.setTotal(day1.getYllfdl());
+//            yfdl.setBfb(new BigDecimal("5.00"));
+//            ls.add(yfdl);
+//
+//            GeneratingCapacityVo nfdl = new GeneratingCapacityVo();
+//            nfdl.setName("年发电量");
+//            nfdl.setValue(day1.getNfdl());
+//            nfdl.setTotal(day1.getNllfdl());
+//            nfdl.setBfb(new BigDecimal("5.00"));
+//            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<ColumnVo> ls2 = new ArrayList<>();
+//
+//        zbtqdb.put("column", ls1);
+//        zbtqdb.put("data", ls2);
+//        allmap.put("fdl", ls);
+//        allmap.put("zbtqdb", zbtqdb);
 
         return allmap;
     }
@@ -1551,7 +1552,7 @@ public class EconomyPointHomePageService {
     }
 
 
-    public Map<String, Object> getGeneratingCapacity(String companyId) {
+    public Map<String, Object> getGeneratingCapacity2(String companyId) {
         Map<String, Object> allmap = new HashMap<>();
         List<GeneratingCapacityVo> ls = new ArrayList<>();
         LocalDate now = LocalDate.now();
@@ -1559,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;
     }
@@ -1959,4 +1960,108 @@ public class EconomyPointHomePageService {
     }
 
 
+    public Map<String, Object> getGeneratingCapacity(String companyId) {
+        Map<String, Object> allmap = new HashMap<>();
+        List<GeneratingCapacityVo> ls = new ArrayList<>();
+        LocalDate now = LocalDate.now();
+        LocalDate tomorrow = LocalDate.now().plusDays(1);
+        QueryWrapper<StationInfoMin> qw = new QueryWrapper<>();
+        qw.lambda().between(StationInfoMin::getRecordDate, now,tomorrow)
+                .eq(StationInfoMin::getStationId, companyId)
+                .orderByDesc(StationInfoMin::getRecordDate);
+        List<StationInfoMin> day1s = iStationInfoMinService.list(qw);
+        StationInfoMin day1 = day1s.get(0);
+        GeneratingCapacityVo rfdl = new GeneratingCapacityVo();
+            rfdl.setName("日发电量");
+            rfdl.setValue(day1.getRfdl());
+//            rfdl.setTotal(day1.getRllfdl());
+//            Double rbfb = (day1.getRfdl()== 0 || day1.getRllfdl() == 0)
+//                    ? 0.0
+//                    : calDivide(day1.getRllfdl(), day1.getRfdl());
+//            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;
+    }
+
+
 }

+ 209 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -345,6 +345,64 @@ public class SpecificService {
      * @param yearmonth
      * @return
      */
+    public Map<String, List<SpecificCenterVo>> maincenterlist2(String companys, String type, String yearmonth) throws ParseException {
+        Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
+        Date date = DateUtils.parseDate(yearmonth + "-01");
+        Calendar c = Calendar.getInstance();
+        c.setTime(date);
+        int year = c.get(Calendar.YEAR);
+        int month = c.get(Calendar.MONTH) + 1;
+        //定义左边部分的结果list
+        List<SpecificCenterVo> monthresultList = new ArrayList<>();
+        //设置当月数据
+        setCenterDyInfo(companys, type, yearmonth, monthresultList);
+        //设置同期数据
+        setCenterYtqInfo(companys, type, yearmonth, monthresultList);
+        //设置比较数据
+        monthresultList.stream().forEach(i -> {
+            i.setMtbfCompare(null == i.getTqmtbf() ? 2 : (i.getMtbf() > i.getTqmtbf() ? 1 : 2));
+            i.setMttrCompare(null == i.getTqmttr() ? 2 : (i.getMttr() > i.getTqmttr() ? 1 : 2));
+            i.setFwjslCompare(null == i.getTqfwjsl() ? 2 : (i.getFwjsl() > i.getTqfwjsl() ? 1 : 2));
+            i.setZtzhlCompare(null == i.getTqztzhl() ? 2 : (i.getZtzhl() > i.getTqztzhl() ? 1 : 2));
+            i.setXqjslCompare(null == i.getTqxqjsl() ? 2 : (i.getXqjsl() > i.getTqxqjsl() ? 1 : 2));
+        });
+
+        //定义右边部分的结果list
+        List<SpecificCenterVo> yearresultList = new ArrayList<>();
+        //设置当年数据
+        setCenterDnInfo(companys, type, yearmonth, yearresultList);
+        //设置同期数据
+        setCenterNtqInfo(companys, type, yearmonth, yearresultList);
+        //设置比较数据
+        yearresultList.stream().forEach(i -> {
+            i.setMtbfCompare(null == i.getTqmtbf() ? 2 : (i.getMtbf() > i.getTqmtbf() ? 1 : 2));
+            i.setMttrCompare(null == i.getTqmttr() ? 2 : (i.getMttr() > i.getTqmttr() ? 1 : 2));
+            i.setFwjslCompare(null == i.getTqfwjsl() ? 2 : (i.getFwjsl() > i.getTqfwjsl() ? 1 : 2));
+            i.setZtzhlCompare(null == i.getTqztzhl() ? 2 : (i.getZtzhl() > i.getTqztzhl() ? 1 : 2));
+            i.setXqjslCompare(null == i.getTqxqjsl() ? 2 : (i.getXqjsl() > i.getTqxqjsl() ? 1 : 2));
+        });
+
+        //封装最终返回结果
+        monthresultList.stream().forEach(i -> {
+            i.setOrdernum(wpmap.get(i.getWpid()).getOrderNum());
+            i.setWpid(wpmap.get(i.getWpid()).getAname());
+
+        });
+        yearresultList.stream().forEach(i -> {
+            i.setOrdernum(wpmap.get(i.getWpid()).getOrderNum());
+            i.setWpid(wpmap.get(i.getWpid()).getAname());
+
+        });
+        SortUtils.sort(monthresultList, "ordernum", SortUtils.ASC);
+        SortUtils.sort(yearresultList, "ordernum", SortUtils.ASC);
+        Map<String, List<SpecificCenterVo>> resultMap = new HashMap<>();
+        resultMap.put("当月", monthresultList);
+        resultMap.put("当年", yearresultList);
+        return resultMap;
+
+    }
+
+
     public Map<String, List<SpecificCenterVo>> maincenterlist(String companys, String type, String yearmonth) throws ParseException {
         Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
         Date date = DateUtils.parseDate(yearmonth + "-01");
@@ -402,6 +460,7 @@ public class SpecificService {
 
     }
 
+
     /**
      * 设置月同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
      *
@@ -735,8 +794,156 @@ public class SpecificService {
      * @param year
      * @return
      */
-    public List<SpecificTarget> fnlylList(String companys, String type, String year) {
+    public List<SpecificTarget> fnlylList2(String companys, String type, String year) {
+
+        //获取年份所有当月的数据
+        QueryWrapper<ProEconPowerstationInfoDay1> currentqw = new QueryWrapper<>();
+        currentqw.select("foreign_key_id,max(record_date) record_date,sum(rfdl) yfdl,sum(rllfdl) yllfdl");
+        currentqw.eq("location", "wp");
+        currentqw.eq("to_char(record_date,'yyyy')", year);
+        if (type.equals("-1")) {
+            currentqw.like("foreign_key_id", "_FDC_");
+        } else {
+            currentqw.like("foreign_key_id", "_GDC_");
+        }
+        if (companys.endsWith("ZGS") || companys.endsWith("FGS")) {
+            currentqw.eq("company_id", companys);
+        } else {
+            currentqw.eq("region_id", companys);
+        }
+        currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        List<ProEconPowerstationInfoDay1> currentList = proEconPowerstationInfoDay1Service.list(currentqw);
+        currentqw.clear();
+        currentqw.select("foreign_key_id,max(record_date) record_date,sum(rfdl) yfdl,sum(rllfdl) yllfdl");
+        currentqw.eq("foreign_key_id", companys + type);
+        currentqw.eq("to_char(record_date,'yyyy')", year);
+        currentqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        currentList.addAll(proEconPowerstationInfoDay1Service.list(currentqw));
+
+        int subYear = Integer.parseInt(year) - 1;
+        QueryWrapper<ProEconPowerstationInfoDay1> sameperiodqw = new QueryWrapper<>();
+        sameperiodqw.select("foreign_key_id,max(record_date) record_date,sum(rfdl) yfdl,sum(rllfdl) yllfdl");
+        sameperiodqw.eq("location", "wp");
+        if (type.equals("-1")) {
+            currentqw.like("foreign_key_id", "_FDC_");
+        } else {
+            currentqw.like("foreign_key_id", "_GDC_");
+        }
+        if (companys.endsWith("ZGS") || companys.endsWith("FGS")) {
+            currentqw.eq("company_id", companys);
+        } else {
+            currentqw.eq("region_id", companys);
+        }
+        sameperiodqw.eq("to_char(record_date,'yyyy')", String.valueOf(subYear));
+        sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        List<ProEconPowerstationInfoDay1> sameperiodList = proEconPowerstationInfoDay1Service.list(sameperiodqw);
+        sameperiodqw.clear();
+        sameperiodqw.select("foreign_key_id,max(record_date) record_date,sum(rfdl) yfdl,sum(rllfdl) yllfdl");
+        sameperiodqw.eq("foreign_key_id", companys + type);
+        sameperiodqw.eq("to_char(record_date,'yyyy')", String.valueOf(subYear));
+        sameperiodqw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        sameperiodList.addAll(proEconPowerstationInfoDay1Service.list(sameperiodqw));
+
+        //合并当月与同期数据为返回结果
+        List<SpecificTargetVo> resultList = new ArrayList<>();
+
+        currentList.stream().forEach(i -> {
+            SpecificTargetVo vo = new SpecificTargetVo();
+            String wpid = i.getForeignKeyId();
+            vo.setWpid(wpid);
+            if (wpid.contains("_ZGS") || wpid.contains("_FGS" + type)) {
+                vo.setWpname(CacheContext.cpmap.get(companys).getAname());
+            } else if (wpid.contains("_RGN")) {
+                vo.setWpname(CacheContext.rgmap.get(companys).getAname());
+            } else {
+                vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
+            }
+
+            vo.setYear(DateUtils.getYear(i.getRecordDate()));
+            vo.setMonth(DateUtils.getMonth(i.getRecordDate()));
+            vo.setCurrent(DoubleUtils.keepPrecision(i.getYllfdl().doubleValue() != 0 ? i.getYfdl().doubleValue() / i.getYllfdl().doubleValue() * 100 : 0, 2));
+            resultList.add(vo);
+        });
+        resultList.stream().forEach(i -> {
+            Optional<ProEconPowerstationInfoDay1> optional = sameperiodList.stream()
+                    .filter(j -> j.getForeignKeyId().equals(i.getWpid()) && String.valueOf(DateUtils.getMonth(j.getRecordDate())).equals(i.getMonth()))
+                    .findFirst();
+            if (optional.isPresent()) {
+                ProEconPowerstationInfoDay1 tqinfoday = optional.get();
+                i.setSameperiod(DoubleUtils.keepPrecision(tqinfoday.getYllfdl().doubleValue() != 0 ? tqinfoday.getYfdl().doubleValue() / tqinfoday.getYllfdl().doubleValue() * 100 : 0, 2));
+                i.setCompare(i.getCurrent().compareTo(i.getSameperiod()));
+            } else {
+                i.setSameperiod(0.0);
+                i.setCompare(0);
+            }
+        });
+        List<SpecificTarget> resultendList = new ArrayList<>();
+
+        Map<String, Map<Integer, SpecificTargetVo>> map = new HashMap<>();
+
+        resultList.stream().forEach(i -> {
+            if (map.containsKey(i.getWpid())) {
+                Map<Integer, SpecificTargetVo> integerListMap = map.get(i.getWpid());
+                if (!integerListMap.containsKey(i.getMonth())) {
+                    map.get(i.getWpid()).put(i.getMonth(), i);
+                } else {
+
+                }
+            } else {
+                Map<Integer, SpecificTargetVo> tempMap = new HashMap<>();
+                tempMap.put(i.getMonth(), i);
+                map.put(i.getWpid(), tempMap);
+            }
+        });
+        Set<String> wpids = map.keySet();
+        if (StringUtils.isNotNull(wpids)) {
+            wpids.stream().forEach(wpid -> {
+                SpecificTarget vo = new SpecificTarget();
+                vo.setWpid(wpid);
+                int orderNum = 100;
+                if (wpid.contains("_ZGS") || wpid.contains("_FGS" + type)) {
+                    vo.setWpname(CacheContext.cpmap.get(companys).getAname());
+                } else if (wpid.contains("_RGN")) {
+                    vo.setWpname(CacheContext.rgmap.get(companys).getAname());
+                } else {
+                    vo.setWpname(CacheContext.wpmap.get(wpid).getAname());
+                    orderNum = CacheContext.wpmap.get(wpid).getOrderNum();
+                }
+                vo.setOrderNum(orderNum);
+                List<SpecificTargetVo> tempList = new ArrayList<>();
+
+                Map<Integer, SpecificTargetVo> listMap = map.get(wpid);
+                for (int x = 1; x <= 12; x++) {
+                    if (listMap.containsKey(x)) {
+                        tempList.add(listMap.get(x));
+                    } else {
+                        SpecificTargetVo vo1 = new SpecificTargetVo();
+                        vo1.setWpid(wpid);
+                        if (wpid.contains("_ZGS") || wpid.contains("_FGS" + type)) {
+                            vo1.setWpname(CacheContext.cpmap.get(companys).getAname());
+                        } else if (wpid.contains("_RGN")) {
+                            vo1.setWpname(CacheContext.rgmap.get(companys).getAname());
+                        } else {
+                            vo1.setWpname(CacheContext.wpmap.get(wpid).getAname());
+                        }
+                        vo1.setYear(Integer.parseInt(year));
+                        vo1.setMonth(x);
+                        tempList.add(vo1);
+                    }
+                }
 
+                vo.setTargetList(tempList);
+                resultendList.add(vo);
+
+            });
+        }
+        SortUtils.sort(resultendList, "orderNum", SortUtils.ASC);
+
+        return resultendList;
+    }
+
+
+    public List<SpecificTarget> fnlylList(String companys, String type, String year) {
         //获取年份所有当月的数据
         QueryWrapper<ProEconPowerstationInfoDay1> currentqw = new QueryWrapper<>();
         currentqw.select("foreign_key_id,max(record_date) record_date,sum(rfdl) yfdl,sum(rllfdl) yllfdl");
@@ -884,6 +1091,7 @@ public class SpecificService {
     }
 
 
+
     public List<SpecificTarget> fdlList(String companys, String type, String year) {
         //获取年份所有当月的数据
         QueryWrapper<ProEconPowerstationInfoDay5> currentqw = new QueryWrapper<>();