Ver código fonte

风机信息量化评级管理

wangchangsheng 2 anos atrás
pai
commit
6b301a496f

+ 110 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/ProEconEquipmentInfoDayTopController.java

@@ -0,0 +1,110 @@
+package com.gyee.runeconomy.controller;
+
+
+import com.gyee.runeconomy.dto.R;
+import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.model.auto.ProEconEquipmentInfoDayTop;
+import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDayTopService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 风机日信息表排行 前端控制器
+ * </p>
+ *
+ * @author wang
+ * @since 2022-11-25
+ */
+@RestController
+@RequestMapping("//pro-econ-equipment-info-day-top")
+@Api(value = "风机信息表排行", tags = "风机信息表排行")
+public class ProEconEquipmentInfoDayTopController {
+
+
+    @Autowired
+    private IProEconEquipmentInfoDayTopService proEconEquipmentInfoDayTopService;
+
+
+    /**
+     * 风机信息量化评级管理
+     *
+     * @param companyId
+     * @param types
+     * @param staType
+     * @return
+     */
+    @GetMapping(value = "/equipmentinfo-day-list")
+    @ApiOperation(value = "风机信息量化评级管理列表", notes = "风机信息量化评级管理列表")
+    public R getEquipmentInfoDayTopList(
+            @RequestParam(value = "companyId", required = false) String companyId,
+            @RequestParam(value = "windpowerstationId", required = false) String windpowerstationId,
+            @RequestParam(value = "types", required = true) Integer types,
+            @RequestParam(value = "staType", required = true) String staType,
+            @RequestParam(value = "date", required = true) String date) {
+
+        List<ProEconEquipmentInfoDayTop> list = proEconEquipmentInfoDayTopService.getEquipmentInfoDayTopList(companyId, windpowerstationId, types, staType, date);
+        if (null != list) {
+            return R.data(ResultMsg.ok(list));
+        } else {
+            return R.data(ResultMsg.error());
+        }
+    }
+
+    /**
+     * 风机信息量化评级管理单机历史记录
+     *
+     * @param windturbineId
+     * @param types
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @GetMapping(value = "/equipmentinfo-day-history-list")
+    @ApiOperation(value = "风机信息量化评级管理历史记录", notes = "风机信息量化评级管理历史记录")
+    public R getEquipmentInfoDayTopHistoryList(
+            @RequestParam(value = "windturbineId", required = false) String windturbineId,
+            @RequestParam(value = "types", required = true) Integer types,
+            @RequestParam(value = "beginDate", required = true) String beginDate,
+            @RequestParam(value = "endDate", required = true) String endDate) {
+
+        List<ProEconEquipmentInfoDayTop> list = proEconEquipmentInfoDayTopService.getEquipmentInfoDayTopHistoryList(windturbineId, types, beginDate, endDate);
+        if (null != list) {
+            return R.data(ResultMsg.ok(list));
+        } else {
+            return R.data(ResultMsg.error());
+        }
+    }
+
+
+    /**
+     * 风机信息量化评级比较
+     *
+     * @param ids
+     * @return
+     */
+    @GetMapping(value = "/equipmentinfo-day-compare-list")
+    @ApiOperation(value = "风机信息量化评级比较", notes = "风机信息量化评级比较")
+    public R getEquipmentInfoDayTopCompareList(
+            @RequestParam(value = "ids", required = true) List<Long> ids,
+            @RequestParam(value = "types", required = true) Integer types) {
+
+        Map<String, Object> map = proEconEquipmentInfoDayTopService.getEquipmentInfoDayTopCompareList(ids,types);
+        if (null != map) {
+            return R.data(ResultMsg.ok(map));
+        } else {
+            return R.data(ResultMsg.error());
+        }
+    }
+
+
+}

+ 181 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/EquipmentInfoDayTopDTO.java

@@ -0,0 +1,181 @@
+package com.gyee.runeconomy.dto;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+@Data
+public class EquipmentInfoDayTopDTO {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private Long id;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 风场名称
+     */
+    private String windpowerstationName;
+
+    /**
+     * 风机编号
+     */
+    private String windturbineId;
+
+    /**
+     * 风机名称
+     */
+    private String windturbineName;
+
+    /**
+     * 日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
+    private Date recordDate;
+
+    /**
+     * 发电量
+     */
+    private Double fdl;
+
+    /**
+     * 理论发电量
+     */
+    private Double llfdl;
+
+    /**
+     * 平均风速
+     */
+    private Double fs;
+
+    /**
+     * 平均功率
+     */
+    private Double gl;
+
+    /**
+     * 故障损失电量
+     */
+    private Double gzssdl;
+
+    /**
+     * 电损失电量
+     */
+    private Double xdssdl;
+
+
+    /**
+     * 护损失电量
+     */
+    private Double whssdl;
+
+
+    /**
+     * 性能损失电量
+     */
+    private Double xnssdl;
+
+
+    /**
+     * 故障时间
+     */
+    private Double gzsj;
+
+    /**
+     * 维护时间
+     */
+    private Double whsj;
+
+    /**
+     * 运行时间
+     */
+    private Double yxsj;
+
+    /**
+     * 停机时间
+     */
+    private Double tjsj;
+
+
+    /**
+     * 利用小时数
+     */
+    private Double lyxs;
+
+    /**
+     * 拟合优度
+     */
+    private Double nhyd;
+
+    /**
+     * 设备可利用率
+     */
+    private Double sbklyl;
+
+
+    /**
+     * 等效可用系数
+     */
+    private Double dxkyxs;
+
+    /**
+     * 有效风时数
+     */
+    private Double yxfss;
+
+    /**
+     * 小风切入
+     */
+    private Double xfqr;
+
+    /**
+     * 静风频率
+     */
+    private Double jfpl;
+
+
+    /**
+     * 功率一致性系数
+     */
+    private Double glyzxxs;
+
+
+    /**
+     * 类型
+     */
+    private Integer types;
+
+    /**
+     * 综合排名
+     */
+    private Integer rank;
+
+    /**
+     * 年
+     */
+    private Integer year;
+
+    /**
+     * 月
+     */
+    private Integer month;
+
+    /**
+     * 分数
+     */
+    private Double score;
+
+    /**
+     * 等级
+     */
+    private String level;
+
+}

+ 49 - 22
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/model/auto/ProEconEquipmentInfoDayTop.java

@@ -1,21 +1,24 @@
 package com.gyee.runeconomy.model.auto;
 
+import java.util.Date;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
-
 /**
  * <p>
  * 风机日信息表排行
  * </p>
  *
- * @author shilin
- * @since 2022-11-09
+ * @author wang
+ * @since 2022-11-25
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -35,6 +38,13 @@ public class ProEconEquipmentInfoDayTop extends Model {
     private String windpowerstationId;
 
     /**
+     * 风场名称
+     */
+    @TableField(exist = false)
+    @JsonInclude(JsonInclude.Include.NON_DEFAULT )
+    private String windpowerstationName;
+
+    /**
      * 项目编号
      */
     private String projectId;
@@ -50,8 +60,16 @@ public class ProEconEquipmentInfoDayTop extends Model {
     private String windturbineId;
 
     /**
+     * 风机名称
+     */
+    @TableField(exist = false)
+    @JsonInclude(JsonInclude.Include.NON_DEFAULT )
+    private String windturbineName;
+
+    /**
      * 日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
     private Date recordDate;
 
     /**
@@ -359,41 +377,50 @@ public class ProEconEquipmentInfoDayTop extends Model {
      */
     private Integer types;
 
+    /**
+     * 综合排名
+     */
+    private Integer dayRank;
 
     /**
-     *年
+     * 综合排名
      */
-    private Integer year;
+    private Integer monthRank;
+
     /**
-     *
+     * 综合排名
      */
-    private Integer month;
+    private Integer yearRank;
 
+    /**
+     * 年
+     */
+    private Integer year;
 
     /**
-     * 综合排名
+     * 
      */
-    private Integer dayRank;
+    private Integer month;
 
     /**
-     * 等级
+     * 分数
      */
-    private String dayLevel;
+    private Double dayScore;
 
     /**
-     * 综合排名
+     * 分数
      */
-    private Integer monthRank;
+    private Double monthScore;
 
     /**
-     * 等级
+     * 分数
      */
-    private String monthLevel;
+    private Double yearScore;
 
     /**
-     * 综合排名
+     * 等级
      */
-    private Integer yearRank;
+    private String dayLevel;
 
     /**
      * 等级
@@ -401,9 +428,9 @@ public class ProEconEquipmentInfoDayTop extends Model {
     private String yearLevel;
 
     /**
-     * 分数
+     * 等级
      */
-    private Double dayScore;
-    private Double monthScore;
-    private Double yearScore;
+    private String monthLevel;
+
+
 }

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

@@ -3,6 +3,9 @@ package com.gyee.runeconomy.service.auto;
 import com.gyee.runeconomy.model.auto.ProEconEquipmentInfoDayTop;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * 风机日信息表排行 服务类
@@ -13,4 +16,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IProEconEquipmentInfoDayTopService extends IService<ProEconEquipmentInfoDayTop> {
 
+
+    /** 管理列表*/
+    List<ProEconEquipmentInfoDayTop> getEquipmentInfoDayTopList(String companyId, String windpowerstationId, Integer types, String staType, String date);
+
+
+    /** 历史数据 */
+    List<ProEconEquipmentInfoDayTop> getEquipmentInfoDayTopHistoryList(String windturbineId, Integer types, String beginDate, String endDate);
+
+
+    /** 对比数据 */
+    Map<String, Object> getEquipmentInfoDayTopCompareList(List<Long> ids, Integer types);
+
+
 }

+ 146 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java

@@ -1,11 +1,23 @@
 package com.gyee.runeconomy.service.auto.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.vo.healthmanager.CompareVo;
+import com.gyee.runeconomy.init.CacheContext;
+import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
 import com.gyee.runeconomy.model.auto.ProEconEquipmentInfoDayTop;
 import com.gyee.runeconomy.mapper.auto.ProEconEquipmentInfoDayTopMapper;
 import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDayTopService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  * 风机日信息表排行 服务实现类
@@ -17,4 +29,138 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEquipmentInfoDayTopMapper, ProEconEquipmentInfoDayTop> implements IProEconEquipmentInfoDayTopService {
 
+    @Override
+    public List<ProEconEquipmentInfoDayTop> getEquipmentInfoDayTopList(String companyId, String windpowerstationId, Integer types, String staType, String date) {
+
+        QueryWrapper<ProEconEquipmentInfoDayTop> qw = new QueryWrapper<>();
+
+
+        List<String> wpids = new ArrayList<>();
+        List<ProBasicPowerstation> wplist = CacheContext.wpls;
+        //场站模糊查询
+        if (StringUtils.isNotEmpty(companyId)) {
+            wplist = CacheContext.wpls.stream().filter(wp -> wp.getRegionId().equals(companyId) || wp.getCompanyId().equals(companyId)).collect(Collectors.toList());
+        }
+
+        if (StringUtils.isNotEmpty(staType) && !staType.equals("0")) {
+            String finalType = staType.equals("-1") ? "_FDC" : "_GDC";
+            wplist = wplist.stream().filter(wp -> wp.getId().indexOf(finalType) >= 0).collect(Collectors.toList());
+        }
+        wpids = wplist.stream().map(ProBasicPowerstation::getId).collect(Collectors.toList());
+        if (StringUtils.isNotEmpty(windpowerstationId)) {
+            wpids.add(windpowerstationId);
+        }
+
+        //匹配场站条件
+        if (wpids.size() > 0) {
+            qw.lambda().in(ProEconEquipmentInfoDayTop::getWindpowerstationId, wpids);
+        }
+        if (StringUtils.isNotEmpty(date)) {
+            qw.lambda().eq(ProEconEquipmentInfoDayTop::getRecordDate, DateUtils.parseDate(date));
+        }
+        if (null != types) {
+            qw.lambda().eq(ProEconEquipmentInfoDayTop::getTypes, types);
+        }
+
+        qw.lambda().orderByAsc(ProEconEquipmentInfoDayTop::getWindturbineId);
+        List<ProEconEquipmentInfoDayTop> list = baseMapper.selectList(qw);
+        return list;
+    }
+
+    @Override
+    public List<ProEconEquipmentInfoDayTop> getEquipmentInfoDayTopHistoryList(String windturbineId, Integer types, String beginDate, String endDate) {
+
+        QueryWrapper<ProEconEquipmentInfoDayTop> qw = new QueryWrapper<>();
+
+
+        if (StringUtils.isNotEmpty(windturbineId)) {
+            qw.lambda().eq(ProEconEquipmentInfoDayTop::getWindturbineId, windturbineId);
+        }
+        if (null != types) {
+            qw.lambda().eq(ProEconEquipmentInfoDayTop::getTypes, types);
+        }
+
+        if (StringUtils.isNotEmpty(beginDate) && StringUtils.isNotEmpty(endDate))
+            qw.lambda().ge(ProEconEquipmentInfoDayTop::getRecordDate, DateUtils.parseDate(beginDate)).
+                    le(ProEconEquipmentInfoDayTop::getRecordDate, DateUtils.parseDate(endDate));
+
+
+        List<ProEconEquipmentInfoDayTop> list = baseMapper.selectList(qw);
+
+        return list;
+    }
+
+    @Override
+    public Map<String, Object> getEquipmentInfoDayTopCompareList(List<Long> ids, Integer types) {
+        Map<String, Object> resultMap = new HashMap<>();
+        QueryWrapper<ProEconEquipmentInfoDayTop> qw = new QueryWrapper<>();
+
+
+        if (null != ids && ids.size() > 0) {
+            qw.lambda().in(ProEconEquipmentInfoDayTop::getId, ids);
+        }
+        List<ProEconEquipmentInfoDayTop> list = baseMapper.selectList(qw);
+        resultMap.put("compare", list);
+
+        List<CompareVo> compareList = new ArrayList<>();
+        list.stream().forEach(wtd -> {
+
+                    for (int i = 0; i < 10; i++) {
+                        CompareVo vo = new CompareVo();
+
+                        switch (i) {
+                            case 0:
+                                vo.setTarget("平均切入风速");
+                                vo.setData(wtd.getYearxfqr());
+                                break;
+                            case 1:
+                                vo.setTarget("性能损失电量");
+                                vo.setData(wtd.getYearxnssdl());
+                                break;
+                            case 2:
+                                vo.setTarget("拟合优度");
+                                vo.setData(wtd.getYearnhyd());
+                                break;
+                            case 3:
+                                vo.setTarget("功率一致性系数");
+                                vo.setData(wtd.getYearglyzxxs());
+                                break;
+                            case 4:
+                                vo.setTarget("利用小时");
+                                vo.setData(wtd.getYearlyxs());
+                                break;
+                            case 5:
+                                vo.setTarget("设备可利用率");
+                                vo.setData(wtd.getYearsbklyl());
+                                break;
+                            case 6:
+                                vo.setTarget("等效可利用系数");
+                                vo.setData(wtd.getYeardxkyxs());
+                                break;
+                            case 7:
+                                vo.setTarget("有效风时数");
+                                vo.setData(wtd.getYearyxfss());
+                                break;
+                            case 8:
+                                vo.setTarget("平均风速");
+                                vo.setData(wtd.getYearfs());
+                                break;
+                            case 9:
+                                vo.setTarget("静风频率");
+                                vo.setData(wtd.getYearjfpl());
+                                break;
+                            default:
+                                break;
+                        }
+                        compareList.add(vo);
+                    }
+                     resultMap.put("charts", compareList);
+                });
+
+        return resultMap;
+    }
+
+
+
+
 }

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/threerate/ThreeRateService.java

@@ -108,7 +108,7 @@ public class ThreeRateService {
             wpids = wplist.stream().map(ProBasicPowerstation::getId).collect(Collectors.toList());
 
         }
-        if (StringUtils.isNotEmpty(companyId)) {
+        if (StringUtils.isNotEmpty(windpowerstationId)) {
             wpids.add(windpowerstationId);
         }