|
@@ -0,0 +1,867 @@
|
|
|
+package com.gyee.frame.service.health;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.gyee.common.contant.ContantXk;
|
|
|
+import com.gyee.common.model.PointData;
|
|
|
+import com.gyee.frame.common.spring.InitialRunner;
|
|
|
+import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.model.vo.*;
|
|
|
+import com.gyee.frame.service.auto.*;
|
|
|
+import com.gyee.frame.util.DateUtils;
|
|
|
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
|
|
|
+import com.gyee.frame.util.RealTimeDataBaseFactory;
|
|
|
+import com.gyee.frame.util.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+
|
|
|
+@Service
|
|
|
+public class HealthReportService {
|
|
|
+
|
|
|
+ private static Logger logger = LoggerFactory.getLogger(HealthReportService.class);
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IAlarmcountService alarmcountService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IAlertrulefailureService alertrulefailureService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
+ @Resource
|
|
|
+ private IProEconEquipmentInfoDayTopService proEconEquipmentInfoDayTopService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProEconEquipmentInfoDay4Service proEconEquipmentInfoDay4Service;
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProEconHealthReportMainService proEconHealthReportMainService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProEconHealthReportTargetService proEconHealthReportTargetService;
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProEconRecommenMainService proEconRecommenMainService;
|
|
|
+
|
|
|
+ IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得健康报告指标信息
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public Map<String,List<ProEconHealthReportTarget>> getconHealthReportTargetMap(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+ Map<String,List<ProEconHealthReportTarget>> map=new HashMap<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+
|
|
|
+ QueryWrapper<ProEconHealthReportTarget> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date", recordDate);
|
|
|
+ queryWrapper.eq("wt_id", wtId);
|
|
|
+ List<ProEconHealthReportTarget> ls=proEconHealthReportTargetService.list(queryWrapper);
|
|
|
+
|
|
|
+ if(!ls.isEmpty())
|
|
|
+ {
|
|
|
+ List<ProEconHealthReportTarget> ls1=new ArrayList<>();
|
|
|
+ List<ProEconHealthReportTarget> ls2=new ArrayList<>();
|
|
|
+ List<ProEconHealthReportTarget> ls3=new ArrayList<>();
|
|
|
+ for(ProEconHealthReportTarget et:ls)
|
|
|
+ {
|
|
|
+ if(et.getName().equals("3-5米曲线偏差率"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("5-11米曲线偏差率"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("11米以上曲线偏差率"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("小风切入风速"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("小风切出风速"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("性能评价"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("发电机健康状态"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("齿轮箱健康状态"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("变桨健康状态"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("主轴健康状态"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ }else if(et.getName().equals("风能利用率"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("设备可利用率"))
|
|
|
+ {
|
|
|
+ ls1.add(et);
|
|
|
+ ls3.add(et);
|
|
|
+ }else if(et.getName().equals("发电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("检修损失电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("故障损失电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("受累损失电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("限电损失电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("性能损失电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("风速"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("理论发电量"))
|
|
|
+ {
|
|
|
+ ls2.add(et);
|
|
|
+ }else if(et.getName().equals("运行小时"))
|
|
|
+ {
|
|
|
+ ls3.add(et);
|
|
|
+ }else if(et.getName().equals("待机小时"))
|
|
|
+ {
|
|
|
+ ls3.add(et);
|
|
|
+ }else if(et.getName().equals("检修小时"))
|
|
|
+ {
|
|
|
+ ls3.add(et);
|
|
|
+ }else if(et.getName().equals("故障小时"))
|
|
|
+ {
|
|
|
+ ls3.add(et);
|
|
|
+ }else if(et.getName().equals("限电小时"))
|
|
|
+ {
|
|
|
+ ls3.add(et);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("ls1",ls1);
|
|
|
+ map.put("ls2",ls2);
|
|
|
+ map.put("ls3",ls3);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得健康报告主表信息
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public ProEconHealthReportMain getEconHealthReportMain(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+ ProEconHealthReportMain vo=new ProEconHealthReportMain();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+
|
|
|
+ QueryWrapper<ProEconHealthReportMain> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date", recordDate);
|
|
|
+ queryWrapper.eq("wt_id", wtId);
|
|
|
+ List<ProEconHealthReportMain> ls=proEconHealthReportMainService.list(queryWrapper);
|
|
|
+
|
|
|
+ if(!ls.isEmpty())
|
|
|
+ {
|
|
|
+ vo=ls.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得推荐检修信息
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public StateJudgmentVo getStateJudgment(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+
|
|
|
+ StateJudgmentVo vo = new StateJudgmentVo();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+
|
|
|
+ List<ProEconRecommenMain> sjls = proEconRecommenMainService.findRecommenmainList(wtId,recordDate);
|
|
|
+
|
|
|
+ if (!sjls.isEmpty()) {
|
|
|
+
|
|
|
+ if(InitialRunner.wtmap.containsKey(wtId))
|
|
|
+ {
|
|
|
+ ProBasicEquipment wt=InitialRunner.wtmap.get(wtId);
|
|
|
+ for (ProEconRecommenMain sj : sjls) {
|
|
|
+
|
|
|
+ if(StringUtils.notEmp(sj.getTopThreeFault()))
|
|
|
+ {
|
|
|
+ String[] gzarr=sj.getTopThreeFault().split(",");
|
|
|
+ if(StringUtils.notEmp(gzarr) && gzarr.length==3)
|
|
|
+ {
|
|
|
+
|
|
|
+ if(gzarr[0]!=null && !gzarr.equals("null"))
|
|
|
+ {
|
|
|
+ String gz1=gzarr[0];
|
|
|
+ String gz2=gzarr[1];
|
|
|
+ String gz3=gzarr[2];
|
|
|
+
|
|
|
+ List<Alertrulefailure> afls=alertrulefailureService.getPartByAlertrule(gz1,wt.getModelId());
|
|
|
+ if(!afls.isEmpty())
|
|
|
+ {
|
|
|
+
|
|
|
+ Alertrulefailure af=afls.get(0);
|
|
|
+ vo.setTop1(gz1);
|
|
|
+ vo.setTop2(gz2);
|
|
|
+ vo.setTop3(gz3);
|
|
|
+ vo.setGzpc(af.getGzpc());
|
|
|
+ vo.setGzcl(af.getGzyy());
|
|
|
+ vo.setGqj(af.getGqj());
|
|
|
+ vo.setRecordDate(sj.getRecordDate());
|
|
|
+ vo.setXqsc(af.getXqsc());
|
|
|
+ vo.setWtId(wt.getId());
|
|
|
+ vo.setWtName(wt.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得健康状态不良数据统计
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public List<HealthNumVo> getHealthNumVoList(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+ List<HealthNumVo> vos = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+
|
|
|
+ ProBasicEquipment wt = InitialRunner.wtmap.get(wtId);
|
|
|
+
|
|
|
+
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(recordDate);
|
|
|
+ Date endDate = c.getTime();
|
|
|
+ c.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
+ Date beginDate = DateUtils.truncate(c.getTime());
|
|
|
+
|
|
|
+ HealthNumVo vo1 = new HealthNumVo();
|
|
|
+ vo1.setDateRange("1天");
|
|
|
+ getHealthNumVo(vo1, wt, endDate, beginDate);
|
|
|
+
|
|
|
+ c.setTime(recordDate);
|
|
|
+ endDate = c.getTime();
|
|
|
+ c.add(Calendar.DAY_OF_MONTH, -3);
|
|
|
+ beginDate = DateUtils.truncate(c.getTime());
|
|
|
+ HealthNumVo vo2 = new HealthNumVo();
|
|
|
+ vo2.setDateRange("3天");
|
|
|
+ getHealthNumVo(vo2, wt, endDate, beginDate);
|
|
|
+
|
|
|
+ c.setTime(recordDate);
|
|
|
+ endDate = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ beginDate = DateUtils.truncate(c.getTime());
|
|
|
+ HealthNumVo vo3 = new HealthNumVo();
|
|
|
+ vo3.setDateRange("统计期内");
|
|
|
+ getHealthNumVo(vo3, wt, endDate, beginDate);
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得等级评估结果
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public List<EquipmentInfoDayTopVo> getEquipmentInfoDayTopVoList(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+ List<EquipmentInfoDayTopVo> vos = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+
|
|
|
+
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDayTop> queryWrapperTop = new QueryWrapper<>();
|
|
|
+ queryWrapperTop.eq("record_date", recordDate);
|
|
|
+ queryWrapperTop.eq("windturbine_Id", wtId);
|
|
|
+ queryWrapperTop.eq("types", 2);
|
|
|
+ List<ProEconEquipmentInfoDayTop> eidTopls = proEconEquipmentInfoDayTopService.list(queryWrapperTop);
|
|
|
+ if (!eidTopls.isEmpty()) {
|
|
|
+ for (ProEconEquipmentInfoDayTop eid : eidTopls) {
|
|
|
+
|
|
|
+ EquipmentInfoDayTopVo vo = new EquipmentInfoDayTopVo();
|
|
|
+ vo.setWtId(eid.getWindturbineId());
|
|
|
+ if (InitialRunner.wtmap.containsKey(eid.getWindturbineId())) {
|
|
|
+ ProBasicEquipment wt = InitialRunner.wtmap.get(eid.getWindturbineId());
|
|
|
+ vo.setWtName(wt.getName());
|
|
|
+ }
|
|
|
+ vo.setWtLevel(eid.getDayLevel());
|
|
|
+ vo.setWtNum(eid.getDayRank());
|
|
|
+ List<EquipmentInfoDayTopSubVo> topls = new ArrayList<>();
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "发电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "理论发电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "平均功率");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "故障损失电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "限电损失电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "检修损失电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "故障时间");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "检修时间");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "停机时间");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "平均切入风速");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "性能损失电量");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "拟合优度");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "功率一致性系数");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "设备可利用率");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "等效可利用系数");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "有效风时速");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "平均风速");
|
|
|
+ setEquipmentInfoDayTopSubVoList(topls, eid, "静风频率");
|
|
|
+ vo.setTopls(topls);
|
|
|
+
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setEquipmentInfoDayTopSubVoList(List<EquipmentInfoDayTopSubVo> topls, ProEconEquipmentInfoDayTop eid, String name) {
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(eid) && StringUtils.notEmp(name)) {
|
|
|
+
|
|
|
+
|
|
|
+ switch (name) {
|
|
|
+ case "发电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("发电量");
|
|
|
+ subVo.setValue(eid.getDayfdl());
|
|
|
+ subVo.setNum(eid.getMonthfdl());
|
|
|
+ subVo.setScore(eid.getYearfdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "理论发电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("理论发电量");
|
|
|
+ subVo.setValue(eid.getDayllfdl());
|
|
|
+ subVo.setNum(eid.getMonthllfdl());
|
|
|
+ subVo.setScore(eid.getYearllfdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "平均功率": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("平均功率");
|
|
|
+ subVo.setValue(eid.getDaygl());
|
|
|
+ subVo.setNum(eid.getMonthgl());
|
|
|
+ subVo.setScore(eid.getYeargl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "故障损失电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("故障损失电量");
|
|
|
+ subVo.setValue(eid.getDaygzssdl());
|
|
|
+ subVo.setNum(eid.getMonthgzssdl());
|
|
|
+ subVo.setScore(eid.getYeargzssdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "限电损失电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("限电损失电量");
|
|
|
+ subVo.setValue(eid.getDayxdssdl());
|
|
|
+ subVo.setNum(eid.getMonthxdssdl());
|
|
|
+ subVo.setScore(eid.getYearxdssdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "检修损失电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("检修损失电量");
|
|
|
+ subVo.setValue(eid.getDaywhssdl());
|
|
|
+ subVo.setNum(eid.getMonthwhssdl());
|
|
|
+ subVo.setScore(eid.getYearwhssdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "故障时间": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("故障时间");
|
|
|
+ subVo.setValue(eid.getDaygzsj());
|
|
|
+ subVo.setNum(eid.getMonthgzsj());
|
|
|
+ subVo.setScore(eid.getYeargzsj());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "检修时间": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("检修时间");
|
|
|
+ subVo.setValue(eid.getDaywhsj());
|
|
|
+ subVo.setNum(eid.getMonthwhsj());
|
|
|
+ subVo.setScore(eid.getYearwhsj());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "运行时间": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("运行时间");
|
|
|
+ subVo.setValue(eid.getDayyxsj());
|
|
|
+ subVo.setNum(eid.getMonthyxsj());
|
|
|
+ subVo.setScore(eid.getYearyxsj());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "停机时间": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("");
|
|
|
+ subVo.setTargetName("停机时间");
|
|
|
+ subVo.setValue(eid.getDaytjsj());
|
|
|
+ subVo.setNum(eid.getMonthtjsj());
|
|
|
+ subVo.setScore(eid.getYeartjsj());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "平均切入风速": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("性能");
|
|
|
+ subVo.setTargetName("平均切入风速");
|
|
|
+ subVo.setValue(eid.getDayxfqr());
|
|
|
+ subVo.setNum(eid.getMonthxfqr());
|
|
|
+ subVo.setScore(eid.getYearxfqr());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "性能损失电量": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("性能");
|
|
|
+ subVo.setTargetName("性能损失电量");
|
|
|
+ subVo.setValue(eid.getDayxnssdl());
|
|
|
+ subVo.setNum(eid.getMonthxnssdl());
|
|
|
+ subVo.setScore(eid.getYearxnssdl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "拟合优度": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("性能");
|
|
|
+ subVo.setTargetName("拟合优度");
|
|
|
+ subVo.setValue(eid.getDaynhyd());
|
|
|
+ subVo.setNum(eid.getMonthnhyd());
|
|
|
+ subVo.setScore(eid.getYearnhyd());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "功率一致性系数": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("可靠性管理");
|
|
|
+ subVo.setTargetName("功率一致性系数");
|
|
|
+ subVo.setValue(eid.getDayglyzxxs());
|
|
|
+ subVo.setNum(eid.getMonthglyzxxs());
|
|
|
+ subVo.setScore(eid.getYearglyzxxs());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "设备可利用率": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("可靠性管理");
|
|
|
+ subVo.setTargetName("设备可利用率");
|
|
|
+ subVo.setValue(eid.getDaysbklyl());
|
|
|
+ subVo.setNum(eid.getMonthsbklyl());
|
|
|
+ subVo.setScore(eid.getYearsbklyl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "等效可利用系数": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("可靠性管理");
|
|
|
+ subVo.setTargetName("等效可利用系数");
|
|
|
+ subVo.setValue(eid.getDaydxkyxs());
|
|
|
+ subVo.setNum(eid.getMonthdxkyxs());
|
|
|
+ subVo.setScore(eid.getYeardxkyxs());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "有效风时速": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("可靠性管理");
|
|
|
+ subVo.setTargetName("有效风时速");
|
|
|
+ subVo.setValue(eid.getDayyxfss());
|
|
|
+ subVo.setNum(eid.getMonthyxfss());
|
|
|
+ subVo.setScore(eid.getYearyxfss());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "平均风速": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("资源");
|
|
|
+ subVo.setTargetName("平均风速");
|
|
|
+ subVo.setValue(eid.getDayfs());
|
|
|
+ subVo.setNum(eid.getMonthfs());
|
|
|
+ subVo.setScore(eid.getYearfs());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case "静风频率": {
|
|
|
+ EquipmentInfoDayTopSubVo subVo = new EquipmentInfoDayTopSubVo();
|
|
|
+ subVo.setTypes("资源");
|
|
|
+ subVo.setTargetName("静风频率");
|
|
|
+ subVo.setValue(eid.getDayjfpl());
|
|
|
+ subVo.setNum(eid.getMonthjfpl());
|
|
|
+ subVo.setScore(eid.getYearjfpl());
|
|
|
+ topls.add(subVo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得部件健康得分曲线
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public List<DataVlueVo> getHealthDataVlueVo(Date recordDate, String wtId, String type) throws Exception {
|
|
|
+
|
|
|
+ List<DataVlueVo> vos = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId) && StringUtils.notEmp(type)) {
|
|
|
+
|
|
|
+ ProBasicEquipment wt = InitialRunner.wtmap.get(wtId);
|
|
|
+
|
|
|
+
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(recordDate);
|
|
|
+ Date endDate = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, -1);
|
|
|
+ Date beginDate = DateUtils.truncate(c.getTime());
|
|
|
+ ProBasicEquipmentPoint point = null;
|
|
|
+ if (type.equals("fdj")) {
|
|
|
+ point = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL003);
|
|
|
+
|
|
|
+ } else if (type.equals("clx")) {
|
|
|
+ point = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL002);
|
|
|
+
|
|
|
+ } else if (type.equals("bj")) {
|
|
|
+ point = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL004);
|
|
|
+
|
|
|
+ } else if (type.equals("zz")) {
|
|
|
+ point = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL005);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> fjjkztls = realApiUtil.getHistoryDatasSnap(point.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
|
|
|
+ Double fdj = 0.0;
|
|
|
+
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ DataVlueVo vo = new DataVlueVo();
|
|
|
+ vo.setRecordDate(new Date(pd.getPointTime()));
|
|
|
+ vo.setValue(pd.getPointValueInDouble());
|
|
|
+ vos.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+ private HealthNumVo getHealthNumVo(HealthNumVo vo, ProBasicEquipment wt, Date endDate, Date beginDate) throws Exception {
|
|
|
+
|
|
|
+
|
|
|
+ ProBasicEquipmentPoint fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JKZT003);
|
|
|
+ //发电机不良健康状态统计
|
|
|
+ List<PointData> fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
|
|
|
+ Double fdj = 0.0;
|
|
|
+
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ if (pd.getPointValueInDouble() == 3 || pd.getPointValueInDouble() == 4) {
|
|
|
+ fdj = fdj + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setFdj(fdj.intValue());
|
|
|
+ fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JKZT002);
|
|
|
+ //齿轮箱不良健康状态统计
|
|
|
+ fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
|
|
|
+ Double clx = 0.0;
|
|
|
+
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ if (pd.getPointValueInDouble() == 3 || pd.getPointValueInDouble() == 4) {
|
|
|
+ clx = clx + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JKZT004);
|
|
|
+ //变桨不良健康状态统计
|
|
|
+ fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
|
|
|
+ Double bj = 0.0;
|
|
|
+
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ if (pd.getPointValueInDouble() == 3 || pd.getPointValueInDouble() == 4) {
|
|
|
+ bj = bj + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setBj(bj.intValue());
|
|
|
+
|
|
|
+ fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JKZT005);
|
|
|
+ //主轴不良健康状态统计
|
|
|
+ fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
|
|
|
+ Double zz = 0.0;
|
|
|
+
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ if (pd.getPointValueInDouble() == 3 || pd.getPointValueInDouble() == 4) {
|
|
|
+ zz = zz + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setZz(zz.intValue());
|
|
|
+
|
|
|
+ vo.setTotal(Integer.valueOf(String.valueOf(fdj + clx + bj + zz)));
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得报警部件次数统计
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<AlarmcountResultVo> getAlarmcountVoList(Date recordDate, String wtId) {
|
|
|
+
|
|
|
+ List<AlarmcountResultVo> vos = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(DateUtils.truncate(recordDate));
|
|
|
+
|
|
|
+ Date end = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ Date begin = c.getTime();
|
|
|
+
|
|
|
+ ProBasicEquipment wt = InitialRunner.wtmap.get(wtId);
|
|
|
+
|
|
|
+ Map<String, AlarmcountVo> map = new HashMap<>();
|
|
|
+ List<AlarmcountVo> vomodells = alarmcountService.findAlarmCountByModelId(wt.getModelId(), begin, end);
|
|
|
+ if (!vomodells.isEmpty()) {
|
|
|
+ for (AlarmcountVo vo : vomodells) {
|
|
|
+ map.put(vo.getName() + vo.getAlertText(), vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AlarmcountVo> vols = alarmcountService.findAlarmCountByWt(wtId, begin, end);
|
|
|
+
|
|
|
+ if (!vols.isEmpty()) {
|
|
|
+ for (AlarmcountVo vo : vols) {
|
|
|
+ AlarmcountResultVo po = new AlarmcountResultVo();
|
|
|
+ if (map.containsKey(vo.getName() + vo.getAlertText())) {
|
|
|
+ AlarmcountVo avgvo = map.get(vo.getName() + vo.getAlertText());
|
|
|
+ po.setAvgtimes(avgvo.getTimes());
|
|
|
+ po.setAvgcounts(avgvo.getCounts());
|
|
|
+ }
|
|
|
+
|
|
|
+ po.setName(vo.getName());
|
|
|
+ po.setAlertText(vo.getAlertText());
|
|
|
+ po.setModelId(wt.getModelId());
|
|
|
+ po.setWtId(wt.getId());
|
|
|
+ po.setTimes(vo.getTimes());
|
|
|
+ po.setCounts(vo.getCounts());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return vos;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得曲线偏差率列表
|
|
|
+ *
|
|
|
+ * @param recordDate
|
|
|
+ * @param wtId
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public List<DataVlueVo> getHealthReportQxpc(Date recordDate, String wtId) throws Exception {
|
|
|
+
|
|
|
+
|
|
|
+ List<DataVlueVo> vols = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(DateUtils.truncate(recordDate));
|
|
|
+
|
|
|
+ Date end = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ Date begin = c.getTime();
|
|
|
+
|
|
|
+
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
|
|
|
+ queryWrapper4.ge("record_date", begin);
|
|
|
+ queryWrapper4.le("record_date", end);
|
|
|
+ queryWrapper4.eq("windturbine_id", wtId);
|
|
|
+
|
|
|
+ List<ProEconEquipmentInfoDay4> eid4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
|
|
|
+ if (!eid4ls.isEmpty()) {
|
|
|
+ for (ProEconEquipmentInfoDay4 eid : eid4ls) {
|
|
|
+ DataVlueVo vo = new DataVlueVo();
|
|
|
+
|
|
|
+ vo.setValue(eid.getRqxpcbbzsj());
|
|
|
+ vo.setWtId(wtId);
|
|
|
+ vo.setRecordDate(eid.getRecordDate());
|
|
|
+ vols.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return vols;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void setHealthStatus(ProEconHealthReportTarget po, Date recordDate, ProBasicEquipment wt, String code) throws Exception {
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(recordDate);
|
|
|
+
|
|
|
+ Date endDate = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ Date beginDate = DateUtils.truncate(c.getTime());
|
|
|
+
|
|
|
+ ProBasicEquipmentPoint fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), code);
|
|
|
+ //获得当月健康状态
|
|
|
+ double jktzdy = judgeHealthStatus(endDate, beginDate, fjjkzt);
|
|
|
+ po.setMonthValue(jktzdy);
|
|
|
+ c.setTime(endDate);
|
|
|
+ c.add(Calendar.MONTH, -1);
|
|
|
+ endDate = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+
|
|
|
+ beginDate = c.getTime();
|
|
|
+ //获得上月健康状态
|
|
|
+ double jktzsy = judgeHealthStatus(endDate, beginDate, fjjkzt);
|
|
|
+ po.setLastMonth1Value(jktzsy);
|
|
|
+ c.setTime(endDate);
|
|
|
+ c.add(Calendar.MONTH, -1);
|
|
|
+ endDate = c.getTime();
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ beginDate = c.getTime();
|
|
|
+ //获得大上月健康状态
|
|
|
+ double jktzdsy = judgeHealthStatus(endDate, beginDate, fjjkzt);
|
|
|
+ po.setLastMonth2Value(jktzdsy);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private double judgeHealthStatus(Date endDate, Date beginDate, ProBasicEquipmentPoint fjjkzt) throws Exception {
|
|
|
+ List<PointData> fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 21600l);
|
|
|
+ double statusvalue = 1;
|
|
|
+ String status = "良好";
|
|
|
+ double lh = 0;
|
|
|
+ double zc = 0;
|
|
|
+ double zy = 0;
|
|
|
+ double yz = 0;
|
|
|
+ if (!fjjkztls.isEmpty()) {
|
|
|
+ for (PointData pd : fjjkztls) {
|
|
|
+ if (pd.getPointValueInDouble() == 1) {
|
|
|
+ lh = lh + 1;
|
|
|
+ } else if (pd.getPointValueInDouble() == 2) {
|
|
|
+ zc = zc + 1;
|
|
|
+ } else if (pd.getPointValueInDouble() == 3) {
|
|
|
+ zy = zy + 1;
|
|
|
+ } else if (pd.getPointValueInDouble() == 4) {
|
|
|
+ yz = yz + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Double> values = new ArrayList<>();
|
|
|
+
|
|
|
+ values.add(lh);
|
|
|
+ values.add(zc);
|
|
|
+ values.add(zy);
|
|
|
+ values.add(yz);
|
|
|
+
|
|
|
+ statusvalue = values.indexOf(Collections.max(values)) + 1;
|
|
|
+
|
|
|
+// switch (statusvalue) {
|
|
|
+// case 0:
|
|
|
+// return "良好";
|
|
|
+// case 1:
|
|
|
+// return "正常";
|
|
|
+// case 2:
|
|
|
+// return "注意";
|
|
|
+// case 3:
|
|
|
+// return "严重";
|
|
|
+//
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ return statusvalue;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|