瀏覽代碼

修改配置信息和多适配器切换

shilin 2 年之前
父節點
當前提交
2bd22c7d6b
共有 22 個文件被更改,包括 1130 次插入862 次删除
  1. 6 1
      web/health-hb/src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java
  2. 4 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/ShutdowneventMapper.java
  3. 7 0
      web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Windturbineinfodaytop2Mapper.java
  4. 33 34
      web/health-hb/src/main/java/com/gyee/frame/model/auto/EquipmentSql.java
  5. 3 3
      web/health-hb/src/main/java/com/gyee/frame/model/auto/Partstatisticsmain.java
  6. 3 3
      web/health-hb/src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2.java
  7. 118 118
      web/health-hb/src/main/java/com/gyee/frame/service/DailyratingmainService.java
  8. 117 117
      web/health-hb/src/main/java/com/gyee/frame/service/Monthlygradeassessmentmain2Service.java
  9. 275 230
      web/health-hb/src/main/java/com/gyee/frame/service/ShutdowneventService.java
  10. 2 2
      web/health-hb/src/main/java/com/gyee/frame/service/WindturbineSqlService.java
  11. 63 0
      web/health-hb/src/main/java/com/gyee/frame/service/Windturbineinfodaytop2Service.java
  12. 4 0
      web/health-hb/src/main/java/com/gyee/frame/service/health/HealthMainService.java
  13. 72 152
      web/health-hb/src/main/java/com/gyee/frame/service/health/HealthOperationService.java
  14. 130 30
      web/health-hb/src/main/java/com/gyee/frame/service/health/HealthSubService.java
  15. 35 19
      web/health-hb/src/main/java/com/gyee/frame/service/stopanalysis/StopAnalysisStaticService.java
  16. 163 135
      web/health-hb/src/main/java/com/gyee/frame/util/golden/EdosUtil.java
  17. 2 2
      web/health-hb/src/main/resources/application-hb.yml
  18. 7 7
      web/health-hb/src/main/resources/application-hf.yml
  19. 13 7
      web/health-hb/src/main/resources/application-hwy.yml
  20. 2 2
      web/health-hb/src/main/resources/mybatis/auto/EquipmentSqlMapper.xml
  21. 24 0
      web/health-hb/src/main/resources/mybatis/auto/ShutdowneventMapper.xml
  22. 47 0
      web/health-hb/src/main/resources/mybatis/auto/Windturbineinfodaytop2Mapper.xml

+ 6 - 1
web/health-hb/src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java

@@ -81,9 +81,14 @@ public class ReliabilityAnalysisController {
                     Windturbinetestingpointnew windAI = windAIService.getWindTurbineTestingPointAi2(wtId, code);
                     List<TsPointData> data = null;
                     if (null !=interval)
+                    {
+                        System.out.println(windAI.getCode());
                         data = remoteService.ShardingService().getHistorySnap(windAI.getCode(), startTs, endTs, interval);
-                    else
+                    }
+                    else{
                         data = remoteService.ShardingService().getHistoryRaw(windAI.getCode(), startTs, endTs);
+                    }
+
 
                     // 查询点的单位和描述属性
                     String unit = "--";

+ 4 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/ShutdowneventMapper.java

@@ -2,9 +2,11 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Shutdownevent;
 import com.gyee.frame.model.auto.ShutdowneventExample;
+import com.gyee.frame.model.custom.ShutdowneventVo;
 import com.gyee.frame.model.custom.SimpleVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface ShutdowneventMapper {
@@ -98,4 +100,6 @@ public interface ShutdowneventMapper {
 
     List<SimpleVo> countStopByWp();
     List<SimpleVo> countStopByPj();
+
+    List<ShutdowneventVo> queryEvents(@Param(value = "wpId") String wpId,@Param(value = "wtId")  String wtId,@Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate,@Param(value = "type") String type);
 }

+ 7 - 0
web/health-hb/src/main/java/com/gyee/frame/mapper/auto/Windturbineinfodaytop2Mapper.java

@@ -4,6 +4,7 @@ import com.gyee.frame.model.auto.Windturbineinfodaytop2;
 import com.gyee.frame.model.auto.Windturbineinfodaytop2Example;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface Windturbineinfodaytop2Mapper {
@@ -96,4 +97,10 @@ public interface Windturbineinfodaytop2Mapper {
     int updateByPrimaryKey(Windturbineinfodaytop2 record);
 
     List<Windturbineinfodaytop2> getWindturbineinfodaytop2List(@Param("wpId") String wpId, @Param("year") Integer year, @Param("month") Integer month);
+
+
+    public List<Windturbineinfodaytop2> findXnfxDay(@Param(value = "wtId")String wtId,@Param(value = "beginDate") Date beginDate,@Param(value = "endDate") Date endDate);
+
+    public List<Windturbineinfodaytop2> findXnfxMonth(@Param(value = "wtId")String wtId,@Param(value = "year") String year,@Param(value = "month") String month);
+
 }

+ 33 - 34
web/health-hb/src/main/java/com/gyee/frame/model/auto/EquipmentSql.java

@@ -1,7 +1,6 @@
 package com.gyee.frame.model.auto;
 
 import java.io.Serializable;
-import java.math.BigDecimal;
 import java.util.Date;
 
 public class EquipmentSql implements Serializable {
@@ -12,7 +11,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal id;
+    private Long id;
 
     /**
      *
@@ -120,7 +119,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal purprice;
+    private Long purprice;
 
     /**
      *
@@ -147,7 +146,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal totalcost;
+    private Long totalcost;
 
     /**
      *
@@ -156,7 +155,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal ytdcost;
+    private Long ytdcost;
 
     /**
      *
@@ -165,7 +164,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal budgetcost;
+    private Long budgetcost;
 
     /**
      *
@@ -201,7 +200,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal totdowntime;
+    private Long totdowntime;
 
     /**
      *
@@ -264,7 +263,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal priority;
+    private Long priority;
 
     /**
      *
@@ -273,7 +272,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal invcost;
+    private Long invcost;
 
     /**
      *
@@ -336,7 +335,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal stockcost;
+    private Long stockcost;
 
     /**
      *
@@ -372,7 +371,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal planyears;
+    private Long planyears;
 
     /**
      *
@@ -417,7 +416,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    private BigDecimal rate;
+    private Double rate;
 
     /**
      *
@@ -489,7 +488,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getId() {
+    public Long getId() {
         return id;
     }
 
@@ -501,7 +500,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setId(BigDecimal id) {
+    public void setId(Long id) {
         this.id = id;
     }
 
@@ -777,7 +776,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getPurprice() {
+    public Long getPurprice() {
         return purprice;
     }
 
@@ -789,7 +788,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setPurprice(BigDecimal purprice) {
+    public void setPurprice(Long purprice) {
         this.purprice = purprice;
     }
 
@@ -849,7 +848,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getTotalcost() {
+    public Long getTotalcost() {
         return totalcost;
     }
 
@@ -861,7 +860,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setTotalcost(BigDecimal totalcost) {
+    public void setTotalcost(Long totalcost) {
         this.totalcost = totalcost;
     }
 
@@ -873,7 +872,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getYtdcost() {
+    public Long getYtdcost() {
         return ytdcost;
     }
 
@@ -885,7 +884,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setYtdcost(BigDecimal ytdcost) {
+    public void setYtdcost(Long ytdcost) {
         this.ytdcost = ytdcost;
     }
 
@@ -897,7 +896,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getBudgetcost() {
+    public Long getBudgetcost() {
         return budgetcost;
     }
 
@@ -909,7 +908,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setBudgetcost(BigDecimal budgetcost) {
+    public void setBudgetcost(Long budgetcost) {
         this.budgetcost = budgetcost;
     }
 
@@ -993,7 +992,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getTotdowntime() {
+    public Long getTotdowntime() {
         return totdowntime;
     }
 
@@ -1005,7 +1004,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setTotdowntime(BigDecimal totdowntime) {
+    public void setTotdowntime(Long totdowntime) {
         this.totdowntime = totdowntime;
     }
 
@@ -1161,7 +1160,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getPriority() {
+    public Long getPriority() {
         return priority;
     }
 
@@ -1173,7 +1172,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setPriority(BigDecimal priority) {
+    public void setPriority(Long priority) {
         this.priority = priority;
     }
 
@@ -1185,7 +1184,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getInvcost() {
+    public Long getInvcost() {
         return invcost;
     }
 
@@ -1197,7 +1196,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setInvcost(BigDecimal invcost) {
+    public void setInvcost(Long invcost) {
         this.invcost = invcost;
     }
 
@@ -1353,7 +1352,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getStockcost() {
+    public Long getStockcost() {
         return stockcost;
     }
 
@@ -1365,7 +1364,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setStockcost(BigDecimal stockcost) {
+    public void setStockcost(Long stockcost) {
         this.stockcost = stockcost;
     }
 
@@ -1449,7 +1448,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getPlanyears() {
+    public Long getPlanyears() {
         return planyears;
     }
 
@@ -1461,7 +1460,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setPlanyears(BigDecimal planyears) {
+    public void setPlanyears(Long planyears) {
         this.planyears = planyears;
     }
 
@@ -1569,7 +1568,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public BigDecimal getRate() {
+    public Double getRate() {
         return rate;
     }
 
@@ -1581,7 +1580,7 @@ public class EquipmentSql implements Serializable {
      *
      * @mbg.generated
      */
-    public void setRate(BigDecimal rate) {
+    public void setRate(Double rate) {
         this.rate = rate;
     }
 

+ 3 - 3
web/health-hb/src/main/java/com/gyee/frame/model/auto/Partstatisticsmain.java

@@ -11,7 +11,7 @@ public class Partstatisticsmain implements Serializable {
      *
      * @mbg.generated
      */
-    private Integer id;
+    private String id;
 
     /**
      *
@@ -848,7 +848,7 @@ public class Partstatisticsmain implements Serializable {
      *
      * @mbg.generated
      */
-    public Integer getId() {
+    public String getId() {
         return id;
     }
 
@@ -860,7 +860,7 @@ public class Partstatisticsmain implements Serializable {
      *
      * @mbg.generated
      */
-    public void setId(Integer id) {
+    public void setId(String id) {
         this.id = id;
     }
 

+ 3 - 3
web/health-hb/src/main/java/com/gyee/frame/model/auto/Statejudgmentrecord2.java

@@ -11,7 +11,7 @@ public class Statejudgmentrecord2 implements Serializable {
      *
      * @mbg.generated
      */
-    private Integer id;
+    private String id;
 
     /**
      *
@@ -119,7 +119,7 @@ public class Statejudgmentrecord2 implements Serializable {
      *
      * @mbg.generated
      */
-    public Integer getId() {
+    public String getId() {
         return id;
     }
 
@@ -131,7 +131,7 @@ public class Statejudgmentrecord2 implements Serializable {
      *
      * @mbg.generated
      */
-    public void setId(Integer id) {
+    public void setId(String id) {
         this.id = id;
     }
 

+ 118 - 118
web/health-hb/src/main/java/com/gyee/frame/service/DailyratingmainService.java

@@ -1,118 +1,118 @@
-package com.gyee.frame.service;
-
-import com.gyee.frame.common.base.BaseService;
-import com.gyee.frame.common.support.Convert;
-import com.gyee.frame.mapper.auto.DailyratingmainMapper;
-import com.gyee.frame.mapper.auto.Daylygradeassessmentmain2Mapper;
-import com.gyee.frame.model.auto.Dailyratingmain;
-import com.gyee.frame.model.auto.DailyratingmainExample;
-import com.gyee.frame.model.auto.Daylygradeassessmentmain2;
-import com.gyee.frame.model.auto.Daylygradeassessmentmain2Example;
-import com.gyee.frame.util.DateUtils;
-import com.gyee.frame.util.SnowflakeIdWorker;
-import com.gyee.frame.util.StringUtils;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-
-@Service
-public class DailyratingmainService implements BaseService<Dailyratingmain, DailyratingmainExample> {
-	@Resource
-	private DailyratingmainMapper DailyratingmainMapper;
-	
-
-
-
-
-	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date recorddate) {
-
-		List<Dailyratingmain> list=new ArrayList<>();
-
-		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate) ) {
-
-			DailyratingmainExample example=new DailyratingmainExample();
-			example.setOrderByClause("recorddate DESC");
-
-			DailyratingmainExample.Criteria criteria =example.createCriteria();
-
-			Date endDate= DateUtils.addDays(recorddate,1);
-			criteria.andRecorddateGreaterThanOrEqualTo(recorddate).andRecorddateLessThan(endDate);
-
-			criteria.andWtidEqualTo(wtId);
-			list= DailyratingmainMapper.selectByExample(example);
-
-		}
-		return list;
-
-	}
-
-	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date beginDate, Date endDate) {
-
-		List<Dailyratingmain> list=new ArrayList<>();
-
-		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) ) {
-
-			DailyratingmainExample example=new DailyratingmainExample();
-			example.setOrderByClause("recorddate DESC");
-
-			DailyratingmainExample.Criteria criteria =example.createCriteria();
-
-			criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThan(endDate);
-
-			criteria.andWtidEqualTo(wtId);
-			list= DailyratingmainMapper.selectByExample(example);
-
-		}
-		return list;
-
-	}
-
-	@Override
-	public int deleteByPrimaryKey(String id) {
-		return 0;
-	}
-
-	@Override
-	public int insertSelective(Dailyratingmain record) {
-		return 0;
-	}
-
-	@Override
-	public Dailyratingmain selectByPrimaryKey(String id) {
-		return null;
-	}
-
-	@Override
-	public int updateByPrimaryKeySelective(Dailyratingmain record) {
-		return 0;
-	}
-
-	@Override
-	public int updateByExampleSelective(Dailyratingmain record, DailyratingmainExample example) {
-		return 0;
-	}
-
-	@Override
-	public int updateByExample(Dailyratingmain record, DailyratingmainExample example) {
-		return 0;
-	}
-
-	@Override
-	public List<Dailyratingmain> selectByExample(DailyratingmainExample example) {
-		return null;
-	}
-
-	@Override
-	public long countByExample(DailyratingmainExample example) {
-		return 0;
-	}
-
-	@Override
-	public int deleteByExample(DailyratingmainExample example) {
-		return 0;
-	}
-}
+//package com.gyee.frame.service;
+//
+//import com.gyee.frame.common.base.BaseService;
+//import com.gyee.frame.common.support.Convert;
+//import com.gyee.frame.mapper.auto.DailyratingmainMapper;
+//import com.gyee.frame.mapper.auto.Daylygradeassessmentmain2Mapper;
+//import com.gyee.frame.model.auto.Dailyratingmain;
+//import com.gyee.frame.model.auto.DailyratingmainExample;
+//import com.gyee.frame.model.auto.Daylygradeassessmentmain2;
+//import com.gyee.frame.model.auto.Daylygradeassessmentmain2Example;
+//import com.gyee.frame.util.DateUtils;
+//import com.gyee.frame.util.SnowflakeIdWorker;
+//import com.gyee.frame.util.StringUtils;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//import java.util.ArrayList;
+//import java.util.Date;
+//import java.util.List;
+//
+//
+//@Service
+//public class DailyratingmainService implements BaseService<Dailyratingmain, DailyratingmainExample> {
+//	@Resource
+//	private DailyratingmainMapper DailyratingmainMapper;
+//
+//
+//
+//
+//
+//	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date recorddate) {
+//
+//		List<Dailyratingmain> list=new ArrayList<>();
+//
+//		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate) ) {
+//
+//			DailyratingmainExample example=new DailyratingmainExample();
+//			example.setOrderByClause("recorddate DESC");
+//
+//			DailyratingmainExample.Criteria criteria =example.createCriteria();
+//
+//			Date endDate= DateUtils.addDays(recorddate,1);
+//			criteria.andRecorddateGreaterThanOrEqualTo(recorddate).andRecorddateLessThan(endDate);
+//
+//			criteria.andWtidEqualTo(wtId);
+//			list= DailyratingmainMapper.selectByExample(example);
+//
+//		}
+//		return list;
+//
+//	}
+//
+//	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date beginDate, Date endDate) {
+//
+//		List<Dailyratingmain> list=new ArrayList<>();
+//
+//		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) ) {
+//
+//			DailyratingmainExample example=new DailyratingmainExample();
+//			example.setOrderByClause("recorddate DESC");
+//
+//			DailyratingmainExample.Criteria criteria =example.createCriteria();
+//
+//			criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThan(endDate);
+//
+//			criteria.andWtidEqualTo(wtId);
+//			list= DailyratingmainMapper.selectByExample(example);
+//
+//		}
+//		return list;
+//
+//	}
+//
+//	@Override
+//	public int deleteByPrimaryKey(String id) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public int insertSelective(Dailyratingmain record) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public Dailyratingmain selectByPrimaryKey(String id) {
+//		return null;
+//	}
+//
+//	@Override
+//	public int updateByPrimaryKeySelective(Dailyratingmain record) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public int updateByExampleSelective(Dailyratingmain record, DailyratingmainExample example) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public int updateByExample(Dailyratingmain record, DailyratingmainExample example) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public List<Dailyratingmain> selectByExample(DailyratingmainExample example) {
+//		return null;
+//	}
+//
+//	@Override
+//	public long countByExample(DailyratingmainExample example) {
+//		return 0;
+//	}
+//
+//	@Override
+//	public int deleteByExample(DailyratingmainExample example) {
+//		return 0;
+//	}
+//}

+ 117 - 117
web/health-hb/src/main/java/com/gyee/frame/service/Monthlygradeassessmentmain2Service.java

@@ -1,117 +1,117 @@
-package com.gyee.frame.service;
-
-import com.gyee.frame.common.base.BaseService;
-import com.gyee.frame.common.support.Convert;
-import com.gyee.frame.mapper.auto.Monthlygradeassessmentmain2Mapper;
-import com.gyee.frame.model.auto.Monthlygradeassessmentmain2;
-import com.gyee.frame.model.auto.Monthlygradeassessmentmain2Example;
-import com.gyee.frame.util.SnowflakeIdWorker;
-import com.gyee.frame.util.StringUtils;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-
-
-@Service
-public class Monthlygradeassessmentmain2Service implements BaseService<Monthlygradeassessmentmain2, Monthlygradeassessmentmain2Example> {
-	@Resource
-	private Monthlygradeassessmentmain2Mapper monthlygradeassessmentmain2Mapper;
-	
-
-	@Override
-	public int deleteByPrimaryKey(String ids) {
-				
-			List<String> lista=Convert.toListStrArray(ids);
-			Monthlygradeassessmentmain2Example example=new Monthlygradeassessmentmain2Example();
-			example.createCriteria().andIdIn(lista);
-			return monthlygradeassessmentmain2Mapper.deleteByExample(example);
-			
-				
-	}
-	
-	
-	@Override
-	public Monthlygradeassessmentmain2 selectByPrimaryKey(String id) {
-				
-			return monthlygradeassessmentmain2Mapper.selectByPrimaryKey(id);
-				
-	}
-
-	
-	@Override
-	public int updateByPrimaryKeySelective(Monthlygradeassessmentmain2 record) {
-		return monthlygradeassessmentmain2Mapper.updateByPrimaryKeySelective(record);
-	}
-	
-	
-	/**
-	 * 添加
-	 */
-	@Override
-	public int insertSelective(Monthlygradeassessmentmain2 record) {
-				
-		//添加雪花主键id
-		record.setId(SnowflakeIdWorker.getUUID());
-			
-				
-		return monthlygradeassessmentmain2Mapper.insertSelective(record);
-	}
-	
-	
-	@Override
-	public int updateByExampleSelective(Monthlygradeassessmentmain2 record, Monthlygradeassessmentmain2Example example) {
-		
-		return monthlygradeassessmentmain2Mapper.updateByExampleSelective(record, example);
-	}
-
-	
-	@Override
-	public int updateByExample(Monthlygradeassessmentmain2 record, Monthlygradeassessmentmain2Example example) {
-		
-		return monthlygradeassessmentmain2Mapper.updateByExample(record, example);
-	}
-
-	@Override
-	public List<Monthlygradeassessmentmain2> selectByExample(Monthlygradeassessmentmain2Example example) {
-		
-		return monthlygradeassessmentmain2Mapper.selectByExample(example);
-	}
-
-	
-	@Override
-	public long countByExample(Monthlygradeassessmentmain2Example example) {
-		
-		return monthlygradeassessmentmain2Mapper.countByExample(example);
-	}
-
-	
-	@Override
-	public int deleteByExample(Monthlygradeassessmentmain2Example example) {
-		
-		return monthlygradeassessmentmain2Mapper.deleteByExample(example);
-	}
-
-	public List<Monthlygradeassessmentmain2> getMonthlygradeassessmentmain2ListBywtId(String wtId, String year, String month) {
-
-
-		List<Monthlygradeassessmentmain2> list=new ArrayList<>();
-
-		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month)) {
-
-			Monthlygradeassessmentmain2Example example=new Monthlygradeassessmentmain2Example();
-			example.setOrderByClause("recorddate DESC");
-
-			Monthlygradeassessmentmain2Example.Criteria criteria =example.createCriteria();
-
-			criteria.andWtidEqualTo(wtId);
-			criteria.andYearEqualTo(year);
-			criteria.andMonthEqualTo(month);
-			list= monthlygradeassessmentmain2Mapper.selectByExample(example);
-
-		}
-		return list;
-
-	}
-}
+//package com.gyee.frame.service;
+//
+//import com.gyee.frame.common.base.BaseService;
+//import com.gyee.frame.common.support.Convert;
+//import com.gyee.frame.mapper.auto.Monthlygradeassessmentmain2Mapper;
+//import com.gyee.frame.model.auto.Monthlygradeassessmentmain2;
+//import com.gyee.frame.model.auto.Monthlygradeassessmentmain2Example;
+//import com.gyee.frame.util.SnowflakeIdWorker;
+//import com.gyee.frame.util.StringUtils;
+//import org.springframework.stereotype.Service;
+//
+//import javax.annotation.Resource;
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//
+//@Service
+//public class Monthlygradeassessmentmain2Service implements BaseService<Monthlygradeassessmentmain2, Monthlygradeassessmentmain2Example> {
+//	@Resource
+//	private Monthlygradeassessmentmain2Mapper monthlygradeassessmentmain2Mapper;
+//
+//
+//	@Override
+//	public int deleteByPrimaryKey(String ids) {
+//
+//			List<String> lista=Convert.toListStrArray(ids);
+//			Monthlygradeassessmentmain2Example example=new Monthlygradeassessmentmain2Example();
+//			example.createCriteria().andIdIn(lista);
+//			return monthlygradeassessmentmain2Mapper.deleteByExample(example);
+//
+//
+//	}
+//
+//
+//	@Override
+//	public Monthlygradeassessmentmain2 selectByPrimaryKey(String id) {
+//
+//			return monthlygradeassessmentmain2Mapper.selectByPrimaryKey(id);
+//
+//	}
+//
+//
+//	@Override
+//	public int updateByPrimaryKeySelective(Monthlygradeassessmentmain2 record) {
+//		return monthlygradeassessmentmain2Mapper.updateByPrimaryKeySelective(record);
+//	}
+//
+//
+//	/**
+//	 * 添加
+//	 */
+//	@Override
+//	public int insertSelective(Monthlygradeassessmentmain2 record) {
+//
+//		//添加雪花主键id
+//		record.setId(SnowflakeIdWorker.getUUID());
+//
+//
+//		return monthlygradeassessmentmain2Mapper.insertSelective(record);
+//	}
+//
+//
+//	@Override
+//	public int updateByExampleSelective(Monthlygradeassessmentmain2 record, Monthlygradeassessmentmain2Example example) {
+//
+//		return monthlygradeassessmentmain2Mapper.updateByExampleSelective(record, example);
+//	}
+//
+//
+//	@Override
+//	public int updateByExample(Monthlygradeassessmentmain2 record, Monthlygradeassessmentmain2Example example) {
+//
+//		return monthlygradeassessmentmain2Mapper.updateByExample(record, example);
+//	}
+//
+//	@Override
+//	public List<Monthlygradeassessmentmain2> selectByExample(Monthlygradeassessmentmain2Example example) {
+//
+//		return monthlygradeassessmentmain2Mapper.selectByExample(example);
+//	}
+//
+//
+//	@Override
+//	public long countByExample(Monthlygradeassessmentmain2Example example) {
+//
+//		return monthlygradeassessmentmain2Mapper.countByExample(example);
+//	}
+//
+//
+//	@Override
+//	public int deleteByExample(Monthlygradeassessmentmain2Example example) {
+//
+//		return monthlygradeassessmentmain2Mapper.deleteByExample(example);
+//	}
+//
+//	public List<Monthlygradeassessmentmain2> getMonthlygradeassessmentmain2ListBywtId(String wtId, String year, String month) {
+//
+//
+//		List<Monthlygradeassessmentmain2> list=new ArrayList<>();
+//
+//		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(year) && StringUtils.notEmp(month)) {
+//
+//			Monthlygradeassessmentmain2Example example=new Monthlygradeassessmentmain2Example();
+//			example.setOrderByClause("recorddate DESC");
+//
+//			Monthlygradeassessmentmain2Example.Criteria criteria =example.createCriteria();
+//
+//			criteria.andWtidEqualTo(wtId);
+//			criteria.andYearEqualTo(year);
+//			criteria.andMonthEqualTo(month);
+//			list= monthlygradeassessmentmain2Mapper.selectByExample(example);
+//
+//		}
+//		return list;
+//
+//	}
+//}

+ 275 - 230
web/health-hb/src/main/java/com/gyee/frame/service/ShutdowneventService.java

@@ -103,173 +103,208 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 
 	public List<ShutdowneventVo> queryEvents(String wpId, String wtId, Date beginDate, Date endDate, String type) {
 
-		List<Shutdownevent> list=new ArrayList<>();
-
-		ShutdowneventExample example=new ShutdowneventExample();
-		example.setOrderByClause("windPowerStationId ASC");
-
-		ShutdowneventExample.Criteria criteria =example.createCriteria();
-
-		if(StringUtils.isNotEmpty(wpId))
-		{
-			criteria.andWindpowerstationidEqualTo(wpId);
-		}
-		if(StringUtils.isNotEmpty(wtId))
-		{
-			criteria.andWindturbineidEqualTo(wtId);
-		}
-
-		if(StringUtils.isNotEmpty(type))
-		{
-			criteria.andStatuscodeEqualTo(Integer.valueOf(type));
-		}
-		if(beginDate!=null && endDate!=null ){
-			criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThanOrEqualTo(endDate);
-		}
-
-		list= shutdowneventMapper.selectByExample(example);
-		List<ShutdowneventVo> sdelist=new ArrayList<>();
-
-		if(null!=list && !list.isEmpty())
-		{
-			for(Shutdownevent sde:list)
-			{
-				ShutdowneventVo event = new ShutdowneventVo();
-				event.setId(sde.getId());
-
-				event.setWindPowerStationId(sde.getWindpowerstationid());
-				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
-				event.setWindTurbineId(sde.getWindturbineid());
-				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
-				event.setWarningId(sde.getWarningid());
-
-				event.setStartTime(sde.getStarttime());
-				event.setStopTime(sde.getStoptime());
-				event.setStopHours(sde.getStophours());
-				event.setStopTypeId(sde.getStoptypeid());
-				event.setStatusCode(sde.getStatuscode());
-				sdelist.add(event);
-			}
-		}
-
-		return sdelist;
-
+//		List<Shutdownevent> list=new ArrayList<>();
+//
+//		ShutdowneventExample example=new ShutdowneventExample();
+//		example.setOrderByClause("windPowerStationId ASC");
+//
+//		ShutdowneventExample.Criteria criteria =example.createCriteria();
+//
+//		if(StringUtils.isNotEmpty(wpId))
+//		{
+//			criteria.andWindpowerstationidEqualTo(wpId);
+//		}
+//		if(StringUtils.isNotEmpty(wtId))
+//		{
+//			criteria.andWindturbineidEqualTo(wtId);
+//		}
+//
+//		if(StringUtils.isNotEmpty(type))
+//		{
+//			criteria.andStatuscodeEqualTo(Integer.valueOf(type));
+//		}
+//		if(beginDate!=null && endDate!=null ){
+//			criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThanOrEqualTo(endDate);
+//		}
+//
+//		list= shutdowneventMapper.selectByExample(example);
+//		List<ShutdowneventVo> sdelist=new ArrayList<>();
+//
+//		if(null!=list && !list.isEmpty())
+//		{
+//			for(Shutdownevent sde:list)
+//			{
+//				ShutdowneventVo event = new ShutdowneventVo();
+//				event.setId(sde.getId());
+//
+//				event.setWindPowerStationId(sde.getWindpowerstationid());
+//				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
+//				event.setWindTurbineId(sde.getWindturbineid());
+//				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
+//				event.setWarningId(sde.getWarningid());
+//
+//				event.setStartTime(sde.getStarttime());
+//				event.setStopTime(sde.getStoptime());
+//				event.setStopHours(sde.getStophours());
+//				event.setStopTypeId(sde.getStoptypeid());
+//				event.setStatusCode(sde.getStatuscode());
+//				sdelist.add(event);
+//			}
+//		}
+//
+//		return sdelist;
+        List<ShutdowneventVo> sdelist=new ArrayList<>();
+        sdelist=shutdowneventMapper.queryEvents(wpId, wtId, beginDate, endDate, type);
+        return sdelist;
 	}
 
 	public List<ShutdowneventVo> queryStopTop10(String wtId) {
 
-		List<Shutdownevent> list=new ArrayList<>();
-
-		ShutdowneventExample example=new ShutdowneventExample();
-		example.setOrderByClause(" StopTime ASC");
-
-		ShutdowneventExample.Criteria criteria =example.createCriteria();
-
-		if(StringUtils.isNotEmpty(wtId))
-		{
-			criteria.andWindturbineidEqualTo(wtId);
-		}
-		criteria.andStophoursIsNotNull();
-		criteria.andStoptypeidNotEqualTo("wh");
-		criteria.andStoptypeidNotEqualTo("gzbmq");
-		criteria.andStoptypeidNotEqualTo("other");
-		PageHelper.startPage(0, 10);
-
-
-		list= shutdowneventMapper.selectByExample(example);
-
-		PageInfo<Shutdownevent> pageInfo = new PageInfo<Shutdownevent>(list);
-
-		List<ShutdowneventVo> sdelist=new ArrayList<>();
-
-		if(null!=list && !list.isEmpty())
-		{
-			for(Shutdownevent sde:list)
-			{
-				ShutdowneventVo event = new ShutdowneventVo();
-				event.setId(sde.getId());
-
-				event.setWindPowerStationId(sde.getWindpowerstationid());
-				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
-				event.setWindTurbineId(sde.getWindturbineid());
-				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
-				event.setWarningId(sde.getWarningid());
-
-				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
-				{
-					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
-					event.setWarnDesc(stoptype.getName());
-				}
-				event.setStartTime(sde.getStarttime());
-				event.setStopTime(sde.getStoptime());
-				event.setStopHours(sde.getStophours());
-				event.setStopTypeId(sde.getStoptypeid());
-				event.setStatusCode(sde.getStatuscode());
-				sdelist.add(event);
-			}
-		}
-
-		return sdelist;
+//		List<Shutdownevent> list=new ArrayList<>();
+//
+//		ShutdowneventExample example=new ShutdowneventExample();
+//		example.setOrderByClause(" StopTime ASC");
+//
+//		ShutdowneventExample.Criteria criteria =example.createCriteria();
+//
+//		if(StringUtils.isNotEmpty(wtId))
+//		{
+//			criteria.andWindturbineidEqualTo(wtId);
+//		}
+//		criteria.andStophoursIsNotNull();
+//		criteria.andStoptypeidNotEqualTo("wh");
+//		criteria.andStoptypeidNotEqualTo("gzbmq");
+//		criteria.andStoptypeidNotEqualTo("other");
+//		PageHelper.startPage(0, 10);
+//
+//
+//		list= shutdowneventMapper.selectByExample(example);
+//
+//		PageInfo<Shutdownevent> pageInfo = new PageInfo<Shutdownevent>(list);
+//
+//		List<ShutdowneventVo> sdelist=new ArrayList<>();
+//
+//		if(null!=list && !list.isEmpty())
+//		{
+//			for(Shutdownevent sde:list)
+//			{
+//				ShutdowneventVo event = new ShutdowneventVo();
+//				event.setId(sde.getId());
+//
+//				event.setWindPowerStationId(sde.getWindpowerstationid());
+//				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
+//				event.setWindTurbineId(sde.getWindturbineid());
+//				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
+//				event.setWarningId(sde.getWarningid());
+//
+//				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
+//				{
+//					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
+//					event.setWarnDesc(stoptype.getName());
+//				}
+//				event.setStartTime(sde.getStarttime());
+//				event.setStopTime(sde.getStoptime());
+//				event.setStopHours(sde.getStophours());
+//				event.setStopTypeId(sde.getStoptypeid());
+//				event.setStatusCode(sde.getStatuscode());
+//				sdelist.add(event);
+//			}
+//		}
+//
+//		return sdelist;
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 0);
+        Date endDate=c.getTime();
+        c.add(Calendar.DAY_OF_MONTH, -10);
+        Date beginDate=c.getTime();
+
+        List<ShutdowneventVo> sdelist=new ArrayList<>();
+
+        PageHelper.startPage(0, 10);
+        sdelist=shutdowneventMapper.queryEvents(null, wtId, beginDate, endDate, null);
+        PageInfo<ShutdowneventVo> pageInfo = new PageInfo<ShutdowneventVo>(sdelist);
+
+        return pageInfo.getList();
 
 	}
 
 
 	public List<ShutdowneventVo> queryWpStopTop5(String wpId) {
 
-		List<Shutdownevent> list=new ArrayList<>();
-
-		ShutdowneventExample example=new ShutdowneventExample();
-		example.setOrderByClause(" StopTime deSC");
-
-		ShutdowneventExample.Criteria criteria =example.createCriteria();
-
-		if(StringUtils.isNotEmpty(wpId))
-		{
-			criteria.andWindpowerstationidEqualTo(wpId);
-		}
-		criteria.andStophoursIsNotNull();
-		criteria.andStoptypeidNotEqualTo("wh");
-		criteria.andStoptypeidNotEqualTo("gzbmq");
-		criteria.andStoptypeidNotEqualTo("other");
-		criteria.andStophoursLessThan(Double.valueOf(24*7));
-		PageHelper.startPage(0, 5);
-
-
-		list= shutdowneventMapper.selectByExample(example);
-
-		PageInfo<Shutdownevent> pageInfo = new PageInfo<Shutdownevent>(list);
-
-		List<ShutdowneventVo> sdelist=new ArrayList<>();
-
-		if(null!=list && !list.isEmpty())
-		{
-			for(Shutdownevent sde:list)
-			{
-				ShutdowneventVo event = new ShutdowneventVo();
-				event.setId(sde.getId());
-
-				event.setWindPowerStationId(sde.getWindpowerstationid());
-				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
-				event.setWindTurbineId(sde.getWindturbineid());
-				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
-				event.setWarningId(sde.getWarningid());
-
-				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
-				{
-					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
-					event.setWarnDesc(stoptype.getName());
-				}
-				event.setStartTime(sde.getStarttime());
-				event.setStopTime(sde.getStoptime());
-				event.setStopHours(sde.getStophours());
-				event.setStopTypeId(sde.getStoptypeid());
-				event.setStatusCode(sde.getStatuscode());
-				sdelist.add(event);
-			}
-		}
-
-		return sdelist;
-
+//		List<Shutdownevent> list=new ArrayList<>();
+//
+//		ShutdowneventExample example=new ShutdowneventExample();
+//		example.setOrderByClause(" StopTime deSC");
+//
+//		ShutdowneventExample.Criteria criteria =example.createCriteria();
+//
+//		if(StringUtils.isNotEmpty(wpId))
+//		{
+//			criteria.andWindpowerstationidEqualTo(wpId);
+//		}
+//		criteria.andStophoursIsNotNull();
+//		criteria.andStoptypeidNotEqualTo("wh");
+//		criteria.andStoptypeidNotEqualTo("gzbmq");
+//		criteria.andStoptypeidNotEqualTo("other");
+//		criteria.andStophoursLessThan(Double.valueOf(24*7));
+//		PageHelper.startPage(0, 5);
+//
+//
+//		list= shutdowneventMapper.selectByExample(example);
+//
+//		PageInfo<Shutdownevent> pageInfo = new PageInfo<Shutdownevent>(list);
+//
+//		List<ShutdowneventVo> sdelist=new ArrayList<>();
+//
+//		if(null!=list && !list.isEmpty())
+//		{
+//			for(Shutdownevent sde:list)
+//			{
+//				ShutdowneventVo event = new ShutdowneventVo();
+//				event.setId(sde.getId());
+//
+//				event.setWindPowerStationId(sde.getWindpowerstationid());
+//				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
+//				event.setWindTurbineId(sde.getWindturbineid());
+//				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
+//				event.setWarningId(sde.getWarningid());
+//
+//				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
+//				{
+//					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
+//					event.setWarnDesc(stoptype.getName());
+//				}
+//				event.setStartTime(sde.getStarttime());
+//				event.setStopTime(sde.getStoptime());
+//				event.setStopHours(sde.getStophours());
+//				event.setStopTypeId(sde.getStoptypeid());
+//				event.setStatusCode(sde.getStatuscode());
+//				sdelist.add(event);
+//			}
+//		}
+//
+//		return sdelist;
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.set(Calendar.MILLISECOND, 0);
+        Date endDate=c.getTime();
+        c.add(Calendar.DAY_OF_MONTH, -10);
+        Date beginDate=c.getTime();
+
+        List<ShutdowneventVo> sdelist=new ArrayList<>();
+
+        PageHelper.startPage(0, 5);
+        sdelist=shutdowneventMapper.queryEvents(wpId, null, beginDate, endDate, null);
+        PageInfo<ShutdowneventVo> pageInfo = new PageInfo<ShutdowneventVo>(sdelist);
+
+        return pageInfo.getList();
 	}
 	/**
 	 * 获取MTTR和MTBF
@@ -470,79 +505,89 @@ public class ShutdowneventService implements BaseService<Shutdownevent, Shutdown
 
 	public PageInfo<ShutdowneventVo> getShutdownevent(Tablepar tablepar,String wpId,String wtId, Date beginDate, Date endDate,String type)  {
 
-		PageInfo<ShutdowneventVo> pageInfo=new PageInfo<>();
-		List<Shutdownevent> list =new ArrayList<>();
-		ShutdowneventExample example=new ShutdowneventExample();
-		String order =null;
-		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
-		{
-			StringBuilder sb=new StringBuilder();
-			sb.append(" ").append(tablepar.getOrderByColumn());
-			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
-			{
-				sb.append(" ").append(tablepar.getIsAsc());
-			}else
-			{
-				sb.append(" asc ");
-			}
-			order=String.valueOf(sb);
-		}else {
-			order=" stoptime desc";
-		}
-
-		ShutdowneventExample.Criteria criteria =example.createCriteria();
-
-		if(StringUtils.isNotEmpty(wpId))
-		{
-			criteria.andWindpowerstationidEqualTo(wpId);
-		}
-		if(StringUtils.isNotEmpty(wtId))
-		{
-			criteria.andWindturbineidEqualTo(wtId);
-		}
-
-		if(StringUtils.isNotEmpty(type))
-		{
-			criteria.andStatuscodeEqualTo(Integer.valueOf(type));
-		}
-		criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThanOrEqualTo(endDate);
-
-
-		PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-		list= shutdowneventMapper.selectByExample(example);
-		List<ShutdowneventVo> sdelist=new ArrayList<>();
-
-
-		if(null!=list && !list.isEmpty())
-		{
-			for(Shutdownevent sde:list)
-			{
-				ShutdowneventVo event = new ShutdowneventVo();
-				event.setId(sde.getId());
-
-				event.setWindPowerStationId(sde.getWindpowerstationid());
-				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
-				event.setWindTurbineId(sde.getWindturbineid());
-				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
-				event.setWarningId(sde.getWarningid());
-
-				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
-				{
-					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
-					event.setWarnDesc(stoptype.getName());
-				}
-				event.setStartTime(sde.getStarttime());
-				event.setStopTime(sde.getStoptime());
-				event.setStopHours(sde.getStophours());
-				event.setStopTypeId(sde.getStoptypeid());
-				event.setStatusCode(sde.getStatuscode());
-				sdelist.add(event);
-			}
-
-			pageInfo = new PageInfo<ShutdowneventVo>(sdelist);
-
-		}
-		return pageInfo;
+//		PageInfo<ShutdowneventVo> pageInfo=new PageInfo<>();
+//		List<Shutdownevent> list =new ArrayList<>();
+//		ShutdowneventExample example=new ShutdowneventExample();
+//		String order =null;
+//		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
+//		{
+//			StringBuilder sb=new StringBuilder();
+//			sb.append(" ").append(tablepar.getOrderByColumn());
+//			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
+//			{
+//				sb.append(" ").append(tablepar.getIsAsc());
+//			}else
+//			{
+//				sb.append(" asc ");
+//			}
+//			order=String.valueOf(sb);
+//		}else {
+//			order=" stoptime desc";
+//		}
+//
+//		ShutdowneventExample.Criteria criteria =example.createCriteria();
+//
+//		if(StringUtils.isNotEmpty(wpId))
+//		{
+//			criteria.andWindpowerstationidEqualTo(wpId);
+//		}
+//		if(StringUtils.isNotEmpty(wtId))
+//		{
+//			criteria.andWindturbineidEqualTo(wtId);
+//		}
+//
+//		if(StringUtils.isNotEmpty(type))
+//		{
+//			criteria.andStatuscodeEqualTo(Integer.valueOf(type));
+//		}
+//		criteria.andStoptimeGreaterThanOrEqualTo(beginDate).andStoptimeLessThanOrEqualTo(endDate);
+//
+//
+//		PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+//		list= shutdowneventMapper.selectByExample(example);
+//		List<ShutdowneventVo> sdelist=new ArrayList<>();
+//
+//
+//		if(null!=list && !list.isEmpty())
+//		{
+//			for(Shutdownevent sde:list)
+//			{
+//				ShutdowneventVo event = new ShutdowneventVo();
+//				event.setId(sde.getId());
+//
+//				event.setWindPowerStationId(sde.getWindpowerstationid());
+//				event.setWpName(InitialRunner.wpmap.get(sde.getWindpowerstationid()).getName());
+//				event.setWindTurbineId(sde.getWindturbineid());
+//				event.setWtName(InitialRunner.wtmap.get(sde.getWindturbineid()).getCode());
+//				event.setWarningId(sde.getWarningid());
+//
+//				if(InitialRunner.stoptypemap.containsKey(sde.getStoptypeid()))
+//				{
+//					Stoptype stoptype=InitialRunner.stoptypemap.get(sde.getStoptypeid());
+//					event.setWarnDesc(stoptype.getName());
+//				}
+//				event.setStartTime(sde.getStarttime());
+//				event.setStopTime(sde.getStoptime());
+//				event.setStopHours(sde.getStophours());
+//				event.setStopTypeId(sde.getStoptypeid());
+//				event.setStatusCode(sde.getStatuscode());
+//				sdelist.add(event);
+//			}
+//
+//			pageInfo = new PageInfo<ShutdowneventVo>(sdelist);
+//
+//		}
+//		return pageInfo;
+
+
+
+        List<ShutdowneventVo> sdelist=new ArrayList<>();
+
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        sdelist=shutdowneventMapper.queryEvents(wpId, wtId, beginDate, endDate, type);
+        PageInfo<ShutdowneventVo> pageInfo = new PageInfo<ShutdowneventVo>(sdelist);
+
+        return pageInfo;
 
 	}
 

+ 2 - 2
web/health-hb/src/main/java/com/gyee/frame/service/WindturbineSqlService.java

@@ -104,8 +104,8 @@ public class WindturbineSqlService implements BaseService<WindturbineSql, Windtu
 
 			WindturbineSqlExample.Criteria criteria =example.createCriteria();
 
-			criteria.andWtidEqualTo(wtnum);
-
+//			criteria.andWtnumEqualTo(Double.valueOf(wtnum));
+            criteria.andWtidEqualTo(wtnum);
 			List<WindturbineSql> list= windturbineSqlMapper.selectByExample(example);
 
 			if(!list.isEmpty())

+ 63 - 0
web/health-hb/src/main/java/com/gyee/frame/service/Windturbineinfodaytop2Service.java

@@ -263,6 +263,69 @@ public class Windturbineinfodaytop2Service implements BaseService<Windturbineinf
 		return list;
 	}
 
+
+    public List<Windturbineinfodaytop2> gadaytop5(String wtId,Date beginDate,Date endDate)  {
+        List<Windturbineinfodaytop2> list=null;
+
+
+        if(StringUtils.notEmp(beginDate) &&  StringUtils.notEmp(endDate) &&  StringUtils.isNotEmpty(wtId)){
+
+            List<Windturbineinfodaytop2> templs=  windturbineinfodaytop2Mapper.findXnfxDay(wtId,beginDate,endDate);
+
+            if(!templs.isEmpty())
+            {
+                PageHelper.startPage(0, 5);
+
+
+                PageInfo<Windturbineinfodaytop2> pageInfo = new PageInfo<Windturbineinfodaytop2>(templs);
+                list=pageInfo.getList();
+            }
+
+        }else
+        {
+            list=new ArrayList<>();
+        }
+
+
+        return list;
+    }
+
+
+    public List<Windturbineinfodaytop2> gaDaytopList(String wtId,Date beginDate,Date endDate)  {
+        List<Windturbineinfodaytop2> list=null;
+
+
+        if(StringUtils.notEmp(beginDate) &&  StringUtils.notEmp(endDate) &&  StringUtils.isNotEmpty(wtId)){
+
+          list=  windturbineinfodaytop2Mapper.findXnfxDay(wtId,beginDate,endDate);
+
+
+        }else
+        {
+            list=new ArrayList<>();
+        }
+
+
+        return list;
+    }
+    public List<Windturbineinfodaytop2> gaMonthList(String wtId,String year,String month)  {
+        List<Windturbineinfodaytop2> list=null;
+
+
+        if(StringUtils.notEmp(year) &&  StringUtils.notEmp(month) &&  StringUtils.isNotEmpty(wtId)){
+
+            list=  windturbineinfodaytop2Mapper.findXnfxMonth(wtId,year,month);
+
+
+        }else
+        {
+            list=new ArrayList<>();
+        }
+
+
+        return list;
+    }
+
 	public List<Windturbineinfodaytop2> gamonthlist(String wpId, String year,String month)  {
 		List<Windturbineinfodaytop2> list=null;
 

+ 4 - 0
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthMainService.java

@@ -1099,6 +1099,10 @@ public class HealthMainService {
 
                     double fjzt = MathUtil.twoBit(fjzblist.get(i).getPointValueInDouble());
 
+                    if(fjzt==0)
+                    {
+                        fjzt=1;
+                    }
                     vo.setFjzt(fjzt);
                     vo.setWtCode(wt.getCode());
                     vo.setWpId(wt.getWindpowerstationid());

+ 72 - 152
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthOperationService.java

@@ -95,26 +95,35 @@ public class HealthOperationService {
         if ("1".equals(type)) {
             List<Windpowerstation> wpList = InitialRunner.wpls;
             for (int i = 0; i < wpList.size(); i++) {
-                if (wpList.get(i).getCode().indexOf("_FDC") > 0) {
+
                     List<String> idls=new ArrayList<>();
 
                     Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZCSL);
                     idls.add(point.getCode());// 合格(正常)
+               // System.out.println("测点编号" +point.getCode());
                     point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJLHSL);
                     idls.add(point.getCode());// 良好
+               // System.out.println("测点编号" +point.getCode());
                     point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZYSL);
                     idls.add(point.getCode());// 注意
+               // System.out.println("测点编号" +point.getCode());
                     point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJYZSL);
                     idls.add(point.getCode());// 严重
 
+                //System.out.println("测点编号" +point.getCode());
                     List<PointData> pols=realApiUtil.getRealData(idls);
 
                     if(!pols.isEmpty() && pols.size()==idls.size())
                     {
+                     //   System.out.println("取实时数据");
                         Integer zc = ((Double) pols.get(0).getPointValueInDouble()).intValue();
+                    //    System.out.println("ZC---"+zc);
                         Integer lh = ((Double) pols.get(1).getPointValueInDouble()).intValue();
+                     //   System.out.println("lh---"+lh);
                         Integer zy = ((Double) pols.get(2).getPointValueInDouble()).intValue();
+                       // System.out.println("zy---"+zy);
                         Integer yz = ((Double) pols.get(3).getPointValueInDouble()).intValue();
+                      //  System.out.println("yz---"+yz);
 
                         hgList.add(zc);
                         lhList.add(lh);
@@ -125,7 +134,7 @@ public class HealthOperationService {
 
                     name.add(wpList.get(i).getName());
                 }
-            }
+
             mapstatus.put("hgList", hgList);
             mapstatus.put("lhList", lhList);
             mapstatus.put("zyList", zyList);
@@ -135,7 +144,7 @@ public class HealthOperationService {
         } else if ("2".equals(type)) {
             List<Project> pList = InitialRunner.pjls;
             for (int i = 0; i < pList.size(); i++) {
-                if (pList.get(i).getWindpowerstationid().indexOf("_FDC") > 0) {
+
                     List<String> idls=new ArrayList<>();
 
                     Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(pList.get(i).getId(), Constant.FJZCSL);
@@ -164,7 +173,7 @@ public class HealthOperationService {
                     }
                     name.add(pList.get(i).getName());
                 }
-            }
+
             mapstatus.put("hgList", hgList);
             mapstatus.put("lhList", lhList);
             mapstatus.put("zyList", zyList);
@@ -197,120 +206,73 @@ public class HealthOperationService {
                 List<Integer> hgList = new ArrayList<Integer>();
                 List<String> tList = new ArrayList<String>();
 
-                if (wpList.get(i).getCode().indexOf("_FDC") > 0) {
-                    if ("1".equals(status)) {
-                        Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZCSL);
-                        String hgCode = point.getCode();// 合格(正常)
-                         point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJLHSL);
-                        String lhCode = point.getCode();// 良好
-                        List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, 1L,
-                                15 * 60L);
-                        List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, 1L,
-                                15 * 60L);
-
-                        if (phgList.size() >= plhList.size()) {
-                            for (int ii = 0; ii < phgList.size(); ii++) {
-                                if (plhList.get(ii) == null) {
-                                    Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
-
-
-                            }
-
-                            mapstatus.put(wpList.get(i).getCode(), hgList);
-                            mapstatus.put("time", tList);
-
-                        } else {
-                            for (int ii = 0; ii < plhList.size(); ii++) {
-                                if (phgList.get(ii) == null) {
-                                    Integer total = ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(plhList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) plhList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(plhList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
-
+                if ("1".equals(status)) {
+                    Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZCSL);
+                    String hgCode = point.getCode();// 合格(正常)
+                    point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJLHSL);
+                    String lhCode = point.getCode();// 良好
+                    List<PointData> phgList = realApiUtil.getHistoryDatasSnap(hgCode, start / 1000, end / 1000, 1L,
+                            15 * 60L);
+                    List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, 1L,
+                            15 * 60L);
+
+                    if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() >= plhList.size()) {
+                        for (int ii = 0; ii < phgList.size(); ii++) {
+                            if (plhList.get(ii) == null) {
+                                Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
+                                String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
+                                time = time.substring(time.length() - 5);
+                                hgList.add(total);
+                                tList.add(time);
+                            } else {
+                                Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue()
+                                        + ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
+                                String time = sdf.format(new Date(phgList.get(ii).getPointTime() * 1000));
+                                time = time.substring(time.length() - 5);
+                                hgList.add(total);
+                                tList.add(time);
                             }
 
-                            mapstatus.put(wpList.get(i).getCode(), hgList);
-                            mapstatus.put("time", tList);
 
                         }
 
-                    } else {
-
-                        Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZYSL);
-                        String zyCode = point.getCode();// 注意
-                        point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJYZSL);
-                        String yzCode = point.getCode();// 严重
-                        List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, 0L,
-                                15 * 60L);
-                        List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
-                                15 * 60L);
-
-                        if (pzyList.size() >= pyzList.size()) {
-                            for (int ii = 0; ii < pzyList.size(); ii++) {
-                                if (pyzList.get(ii) == null) {
-                                    Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
+                        mapstatus.put(wpList.get(i).getId(), hgList);
+                        mapstatus.put("time", tList);
 
-                                mapstatus.put(wpList.get(i).getCode(), hgList);
-                                mapstatus.put("time", tList);
+                    }
 
-                            }
-                        } else {
-                            for (int ii = 0; ii < pyzList.size(); ii++) {
-                                if (pzyList.get(ii) == null) {
-                                    Integer total = ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) pyzList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
+                } else {
 
+                    Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJZYSL);
+                    String zyCode = point.getCode();// 注意
+                    point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wpList.get(i).getId(), Constant.FJYZSL);
+                    String yzCode = point.getCode();// 严重
+                    List<PointData> pzyList = realApiUtil.getHistoryDatasSnap(zyCode, start / 1000, end / 1000, 0L,
+                            15 * 60L);
+                    List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
+                            15 * 60L);
+
+                    if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() >= pyzList.size()) {
+                        for (int ii = 0; ii < pzyList.size(); ii++) {
+                            if (pyzList.get(ii) == null) {
+                                Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
+                                String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
+                                time = time.substring(time.length() - 5);
+                                hgList.add(total);
+                                tList.add(time);
+                            } else {
+                                Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue()
+                                        + ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
+                                String time = sdf.format(new Date(pzyList.get(ii).getPointTime() * 1000));
+                                time = time.substring(time.length() - 5);
+                                hgList.add(total);
+                                tList.add(time);
                             }
 
-                            mapstatus.put(wpList.get(i).getCode(), hgList);
+                            mapstatus.put(wpList.get(i).getId(), hgList);
                             mapstatus.put("time", tList);
 
                         }
-
                     }
 
                 }
@@ -328,7 +290,7 @@ public class HealthOperationService {
                 List<Integer> hgList = new ArrayList<Integer>();
                 List<String> tList = new ArrayList<String>();
 
-                if (pList.get(i).getWindpowerstationid().indexOf("_FDC") > 0) {
+
                     if ("1".equals(status)) {
                         Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(pList.get(i).getId(), Constant.FJZCSL);
                         String hgCode = point.getCode();// 合格(正常)
@@ -339,7 +301,7 @@ public class HealthOperationService {
                         List<PointData> plhList = realApiUtil.getHistoryDatasSnap(lhCode, start / 1000, end / 1000, 0L,
                                 15 * 60L);
 
-                        if (phgList.size() >= plhList.size()) {
+                        if (!phgList.isEmpty() && !plhList.isEmpty() && phgList.size() >= plhList.size()) {
                             for (int ii = 0; ii < phgList.size(); ii++) {
                                 if (plhList.get(ii) == null) {
                                     Integer total = ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
@@ -361,28 +323,6 @@ public class HealthOperationService {
                             mapstatus.put(pList.get(i).getCode(), hgList);
                             mapstatus.put("time", tList);
 
-                        } else {
-                            for (int ii = 0; ii < plhList.size(); ii++) {
-                                if (phgList.get(ii) == null) {
-                                    Integer total = ((Double) plhList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(plhList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) plhList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) phgList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(plhList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
-
-                            }
-
-                            mapstatus.put(pList.get(i).getCode(), hgList);
-                            mapstatus.put("time", tList);
-
                         }
 
                     } else {
@@ -395,7 +335,7 @@ public class HealthOperationService {
                         List<PointData> pyzList = realApiUtil.getHistoryDatasSnap(yzCode, start / 1000, end / 1000, 0L,
                                 15 * 60L);
 
-                        if (pzyList.size() >= pyzList.size()) {
+                        if (!pzyList.isEmpty() && !pyzList.isEmpty() && pzyList.size() >= pyzList.size()) {
                             for (int ii = 0; ii < pzyList.size(); ii++) {
                                 if (pyzList.get(ii) == null) {
                                     Integer total = ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
@@ -416,32 +356,11 @@ public class HealthOperationService {
                             mapstatus.put(pList.get(i).getCode(), hgList);
                             mapstatus.put("time", tList);
 
-                        } else {
-                            for (int ii = 0; ii < pyzList.size(); ii++) {
-                                if (pzyList.get(ii) == null) {
-                                    Integer total = ((Double) pyzList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pyzList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                } else {
-                                    Integer total = ((Double) pyzList.get(ii).getPointValueInDouble()).intValue()
-                                            + ((Double) pzyList.get(ii).getPointValueInDouble()).intValue();
-                                    String time = sdf.format(new Date(pyzList.get(ii).getPointTime() * 1000));
-                                    time = time.substring(time.length() - 5);
-                                    hgList.add(total);
-                                    tList.add(time);
-                                }
-                            }
-
-                            mapstatus.put(pList.get(i).getCode(), hgList);
-                            mapstatus.put("time", tList);
-
                         }
 
                     }
 
-                }
+
                 map.put(pList.get(i).getId(),pList.get(i).getName());
 
 
@@ -452,4 +371,5 @@ public class HealthOperationService {
         return mapstatus;
     }
 
+
 }

+ 130 - 30
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthSubService.java

@@ -25,10 +25,10 @@ public class HealthSubService {
     private EarlywarningmainService earlywarningmainService;
     @Resource
     private PartstatisticsmainService partstatisticsmainService;
-    @Resource
-    private Daylygradeassessmentmain2Service daylygradeassessmentmain2Service;
-    @Resource
-    private Monthlygradeassessmentmain2Service monthlygradeassessmentmain2Service;
+//    @Resource
+//    private Daylygradeassessmentmain2Service daylygradeassessmentmain2Service;
+//    @Resource
+//    private Monthlygradeassessmentmain2Service monthlygradeassessmentmain2Service;
     @Resource
     private ShutdowneventService shutdowneventService;
     @Resource
@@ -39,10 +39,10 @@ public class HealthSubService {
     private ParttemperaturesubService parttemperaturesubService;
     @Resource
     private Statejudgmentrecord2Service statejudgmentrecord2Service;
+//    @Resource
+//    private DailyratingmainService dailyratingmainService;
     @Resource
-    private DailyratingmainService dailyratingmainService;
-
-
+    private Windturbineinfodaytop2Service windturbineinfodaytop2Service;
     private final int digit = 2;
     private final double NUM = 3.6;
     private final double XZNUM = 1.25;
@@ -387,43 +387,83 @@ public class HealthSubService {
      * @param wtId
      * @return
      */
+//    public List<XnfxVo> initalXnfx(String wtId, Calendar cal) {
+//
+//        List<XnfxVo> ls = new ArrayList<XnfxVo>();
+//
+//
+//        cal.add(Calendar.DAY_OF_MONTH, -1);
+//
+//        List<Dailyratingmain> day1ls = dailyratingmainService.getDaylygradeassessmentmain2ListBywtId(wtId, DateUtils.truncate(cal.getTime()));
+//        if (!day1ls.isEmpty()) {
+//            Dailyratingmain top = day1ls.get(0);
+//            XnfxVo vo = new XnfxVo();
+//            vo.setName("日等级评估数据分析");
+//            vo.setLevelname(top.getGrade());
+//            vo.setTopnum(top.getScore().intValue());
+//            ls.add(vo);
+//        }
+//
+//
+//        String year = String.valueOf(cal.get(Calendar.YEAR));
+//        int m = cal.get(Calendar.MONTH);
+//        String month = null;
+//        if ((m + 1) < 10) {
+//            StringBuilder sb = new StringBuilder();
+//            sb.append("0").append(m + 1);
+//            month = String.valueOf(sb);
+//        } else {
+//            month = String.valueOf(m + 1);
+//        }
+//
+//
+//        List<Monthlygradeassessmentmain2> day3ls = monthlygradeassessmentmain2Service.getMonthlygradeassessmentmain2ListBywtId(wtId, year, month);
+//        if (!day3ls.isEmpty()) {
+//            Monthlygradeassessmentmain2 top = day3ls.get(0);
+//            XnfxVo vo = new XnfxVo();
+//            vo.setName("月等级评估数据分析");
+//            vo.setLevelname(top.getModlevel());
+//            vo.setTopnum(top.getModscore().intValue());
+//            ls.add(vo);
+//        }
+//        return ls;
+//    }
     public List<XnfxVo> initalXnfx(String wtId, Calendar cal) {
 
         List<XnfxVo> ls = new ArrayList<XnfxVo>();
 
 
-        cal.add(Calendar.DAY_OF_MONTH, -1);
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        Date beginDate = cal.getTime();
+        cal.add(Calendar.DAY_OF_MONTH, 1);
+        Date  endDate= cal.getTime();
 
-        List<Dailyratingmain> day1ls = dailyratingmainService.getDaylygradeassessmentmain2ListBywtId(wtId, DateUtils.truncate(cal.getTime()));
+       List<Windturbineinfodaytop2> day1ls = windturbineinfodaytop2Service.gaDaytopList(wtId, beginDate, endDate);
         if (!day1ls.isEmpty()) {
-            Dailyratingmain top = day1ls.get(0);
+            Windturbineinfodaytop2 top = day1ls.get(0);
             XnfxVo vo = new XnfxVo();
             vo.setName("日等级评估数据分析");
-            vo.setLevelname(top.getGrade());
-            vo.setTopnum(top.getScore().intValue());
+            vo.setLevelname(top.getLevel());
+            vo.setTopnum(top.getRank());
             ls.add(vo);
         }
 
 
         String year = String.valueOf(cal.get(Calendar.YEAR));
         int m = cal.get(Calendar.MONTH);
-        String month = null;
-        if ((m + 1) < 10) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("0").append(m + 1);
-            month = String.valueOf(sb);
-        } else {
-            month = String.valueOf(m + 1);
-        }
+        String month = String.valueOf(m + 1);
+
 
 
-        List<Monthlygradeassessmentmain2> day3ls = monthlygradeassessmentmain2Service.getMonthlygradeassessmentmain2ListBywtId(wtId, year, month);
+        List<Windturbineinfodaytop2> day3ls = windturbineinfodaytop2Service.gaMonthList(wtId, year, month);
         if (!day3ls.isEmpty()) {
-            Monthlygradeassessmentmain2 top = day3ls.get(0);
+            Windturbineinfodaytop2 top = day3ls.get(0);
             XnfxVo vo = new XnfxVo();
             vo.setName("月等级评估数据分析");
-            vo.setLevelname(top.getModlevel());
-            vo.setTopnum(top.getModscore().intValue());
+            vo.setLevelname(top.getLevel());
+            vo.setTopnum(top.getRank());
             ls.add(vo);
         }
         return ls;
@@ -576,6 +616,40 @@ public class HealthSubService {
      * @return
      * @throws Exception
      */
+//    public Map<String, Object> gadaytop5(String wtId) throws Exception {
+//
+//
+//        Calendar cal = Calendar.getInstance();
+//        cal.set(Calendar.HOUR_OF_DAY, 0);
+//        cal.set(Calendar.MINUTE, 0);
+//        cal.set(Calendar.SECOND, 0);
+//        Date endDate = cal.getTime();
+//        cal.add(Calendar.MONTH, -1);
+//        Date beginDate = cal.getTime();
+//
+//
+//        List<Dailyratingmain> ls = dailyratingmainService.getDaylygradeassessmentmain2ListBywtId(wtId, beginDate, endDate);
+//        Map<String, Object> map = new HashMap<String, Object>();
+//        int num = 1;
+//        for (Dailyratingmain top : ls) {
+//            if (num <= 5) {
+//                String[] str = new String[5];
+//                str[0] = String.valueOf(top.getId());
+//                str[1] = DateUtils.format(top.getRecorddate());
+//                str[2] = String.valueOf(top.getGrade());
+//                str[3] = String.valueOf(top.getWpid());
+//                str[4] = String.valueOf(top.getWtid());
+//                map.put(String.valueOf(num), str);
+//                num++;
+//            } else {
+//                break;
+//            }
+//        }
+//
+//
+//        return map;
+//    }
+
     public Map<String, Object> gadaytop5(String wtId) throws Exception {
 
 
@@ -588,17 +662,17 @@ public class HealthSubService {
         Date beginDate = cal.getTime();
 
 
-        List<Dailyratingmain> ls = dailyratingmainService.getDaylygradeassessmentmain2ListBywtId(wtId, beginDate, endDate);
+        List<Windturbineinfodaytop2> ls = windturbineinfodaytop2Service.gadaytop5(wtId, beginDate, endDate);
         Map<String, Object> map = new HashMap<String, Object>();
         int num = 1;
-        for (Dailyratingmain top : ls) {
+        for (Windturbineinfodaytop2 top : ls) {
             if (num <= 5) {
                 String[] str = new String[5];
-                str[0] = String.valueOf(top.getId());
+                str[0] = String.valueOf(top.getLevel());
                 str[1] = DateUtils.format(top.getRecorddate());
-                str[2] = String.valueOf(top.getGrade());
-                str[3] = String.valueOf(top.getWpid());
-                str[4] = String.valueOf(top.getWtid());
+                str[2] = String.valueOf(getScore(top));
+                str[3] = String.valueOf(top.getWindpowerstationid());
+                str[4] = String.valueOf(top.getWindturbineid());
                 map.put(String.valueOf(num), str);
                 num++;
             } else {
@@ -2019,4 +2093,30 @@ public class HealthSubService {
         }
         return 0.0;
     }
+
+    private double getScore(Windturbineinfodaytop2 po) {
+        double score = 0.0;
+        if (po.getLevel().equals("AAA")) {
+            score = 100.0;
+        } else if (po.getLevel().equals("AA")) {
+            score = 90.0;
+        } else if (po.getLevel().equals("A")) {
+            score = 80.0;
+        } else if (po.getLevel().equals("BBB")) {
+            score = 75.0;
+
+        } else if (po.getLevel().equals("BB")) {
+            score = 65.0;
+
+        } else if (po.getLevel().equals("B")) {
+            score = 60.0;
+        } else if (po.getLevel().equals("C")) {
+            score = 40.0;
+
+        } else if (po.getLevel().equals("C-")) {
+            score = 0.0;
+        }
+
+        return score;
+    }
 }

+ 35 - 19
web/health-hb/src/main/java/com/gyee/frame/service/stopanalysis/StopAnalysisStaticService.java

@@ -266,6 +266,7 @@ public class StopAnalysisStaticService {
 
                 Windturbinetestingpointnew ai = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, codels.get(i));
                 points[i] = ai.getCode();
+               // System.out.println(ai.getCode());
             }
 
             // 获得风机健康状态结果数组
@@ -288,14 +289,20 @@ public class StopAnalysisStaticService {
             String bjzt = getJudgeVaue(jkvalues[2].DValue);
             String zkzt = getJudgeVaue(jkvalues[3].DValue);
 
+//            System.out.println("clxzt"+clxzt);
+//            System.out.println("fdjzt"+fdjzt);
+//            System.out.println("bjzt"+bjzt);
+//            System.out.println("zkzt"+zkzt);
+//            MismapSql mis = mismapSqlService.findMismapSqlById(wtId);
+//            String wtNum = mis.getMiskey();
+            WindturbineSql wt = windturbineSqlService.findWindturbineById(wtId);
 
-            MismapSql mis = mismapSqlService.findMismapSqlById(wtId);
-            String wtNum = mis.getMiskey();
-            WindturbineSql wt = windturbineSqlService.findWindturbineById(wtNum);
-
+           // System.out.println("wt.getLocation()"+wt.getLocation());
             if (StringUtils.notEmp(wt) && StringUtils.notEmp(wt.getLocation())) {
 
                 List<EquipmentSql> eqls = equipmentSqlService.getEquipmentListByLocation(wt.getLocation());
+
+               // System.out.println("eqls.size()"+eqls.size());
                 if (!eqls.isEmpty()) {
 
                     for (EquipmentSql eq : eqls) {
@@ -304,18 +311,25 @@ public class StopAnalysisStaticService {
                         node.setPid(eq.getParent());
                         node.setName(eq.getDescription());
                         node.setWtid(wtId);
-                        if (eq.getDescription().indexOf("齿轮箱") != -1) {
-                            node.setJudegvulue(clxzt);
-                        } else if (eq.getDescription().indexOf("发电机") != -1) {
-                            node.setJudegvulue(fdjzt);
-                        } else if (eq.getDescription().indexOf("变桨") != -1) {
-                            node.setJudegvulue(bjzt);
-                        } else if (eq.getDescription().indexOf("塔") != -1) {
-                            node.setJudegvulue(zkzt);
-                        } else {
+                        if(StringUtils.notEmp(eq) && StringUtils.notEmp(eq.getDescription()) )
+                        {
+                            if (eq.getDescription().indexOf("齿轮箱") != -1) {
+                                node.setJudegvulue(clxzt);
+                            } else if (eq.getDescription().indexOf("发电机") != -1) {
+                                node.setJudegvulue(fdjzt);
+                            } else if (eq.getDescription().indexOf("变桨") != -1) {
+                                node.setJudegvulue(bjzt);
+                            } else if (eq.getDescription().indexOf("塔") != -1) {
+                                node.setJudegvulue(zkzt);
+                            } else {
+                                node.setJudegvulue(ZC);
+                            }
+                        }else
+                        {
                             node.setJudegvulue(ZC);
                         }
-                        stopAnalysisDetailVoService.insertSelective(node);
+
+                       // stopAnalysisDetailVoService.insertSelective(node);
                         //	node.setOpen(true);
                         nodes.add(node);
                     }
@@ -340,12 +354,14 @@ public class StopAnalysisStaticService {
         List<StopAnalysisNodeVo> vos = new ArrayList<>();
         if (StringUtils.notEmp(wtId)) {
 
-            List<StopAnalysisDetailVo> list=stopAnalysisDetailVoService.findStopAnalysisDetailVoList(wtId);
-            if(list.isEmpty())
-            {
-                list=saveLocationTreeByWtId(mainId,wtId, values);
+//            List<StopAnalysisDetailVo> list=stopAnalysisDetailVoService.findStopAnalysisDetailVoList(wtId);
+//            if(list.isEmpty())
+//            {
+//                list=saveLocationTreeByWtId(mainId,wtId, values);
+//
+//            }
 
-            }
+            List<StopAnalysisDetailVo> list=saveLocationTreeByWtId(mainId,wtId, values);
 
             List<StopAnalysisNodeVo> nodes = new ArrayList<StopAnalysisNodeVo>();
             for(StopAnalysisDetailVo eq:list)

+ 163 - 135
web/health-hb/src/main/java/com/gyee/frame/util/golden/EdosUtil.java

@@ -95,6 +95,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
 
     @Override
     public List<PointData> getHistoryDatasSnap(Windpowerstationpointnew point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
+
         if(StringUtils.notEmp(point) &&  StringUtils.notEmp(point.getCode()) && !point.getCode().startsWith(JKFC) && !point.getCode().startsWith(JKFJ))
         {
             baseURL = V2Config.getBaseurl();
@@ -110,6 +111,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
             Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
             Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
             Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+            String pointid =tagName.get();
             //通过时间区间和时间间隔获取点数
             Long finalInterval;
             if (pried != null)
@@ -152,52 +154,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(point.getCode(), beginDate, pried, resultList);
                     }else
                     {
-                        resultList=snapList;
-//                        resultList=snapList;
-//                        for (PointData snapItem : snapList) {
-//
-//                            long subTime = snapItem.getPointTime() - pried;
-//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-//                            // 则代表该时间节点快照有效,否则为0
-//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-//                            JSONObject jsonObjectSection = sectionResp.getBody();
-//
-//                            if (jsonObjectSection != null) {
-//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-//                                if (sectionlist.size() > 0) {
-//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-//                                        resultList.add(snapItem);
-//                                    }
-//                                    else{
-//                                        PointData data = new PointData();
-//                                        data.setEdnaId(point.getCode());
-//                                        data.setPointTime(0L);
-//                                        data.setPointValue("0");
-//                                        data.setPointName("1");
-//                                        data.setPointValueInDouble(0.0);
-//                                        resultList.add(data);
-//                                    }
-//                                } else {
-//                                    PointData data = new PointData();
-//                                    data.setEdnaId(point.getCode());
-//                                    data.setPointTime(0l);
-//                                    data.setPointValue("0");
-//                                    data.setPointName("1");
-//                                    data.setPointValueInDouble(0.0);
-//                                    resultList.add(data);
-//                                }
-//                            } else {
-//                                PointData data = new PointData();
-//                                data.setEdnaId(point.getCode());
-//                                data.setPointTime(0l);
-//                                data.setPointValue("0");
-//                                data.setPointName("1");
-//                                data.setPointValueInDouble(0.0);
-//                                resultList.add(data);
-//                            }
-//                        }
+                        if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
+                        {
+                            resultList=snapList;
+                        }else
+                        {
+
+                            for (PointData snapItem : snapList) {
+
+                                long subTime = snapItem.getPointTime() - pried;
+                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                                // 则代表该时间节点快照有效,否则为0
+                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime() + "000";
+                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                                JSONObject jsonObjectSection = sectionResp.getBody();
+
+                                if (jsonObjectSection != null) {
+                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                                    if (sectionlist.size() > 0) {
+                                        if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                            resultList.add(snapItem);
+                                        }
+                                        else{
+                                            PointData data = new PointData();
+                                            data.setEdnaId(pointid);
+                                            data.setPointTime(snapItem.getPointTime());
+                                            data.setPointValue("0");
+                                            data.setPointName("1");
+                                            data.setPointValueInDouble(0.0);
+                                            resultList.add(data);
+                                        }
+                                    } else {
+                                        PointData data = new PointData();
+                                        data.setEdnaId(pointid);
+                                        data.setPointTime(snapItem.getPointTime());
+                                        data.setPointValue("0");
+                                        data.setPointName("1");
+                                        data.setPointValueInDouble(0.0);
+                                        resultList.add(data);
+                                    }
+                                } else {
+                                    PointData data = new PointData();
+                                    data.setEdnaId(pointid);
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            }
+
+                        }
                     }
 
 
@@ -424,6 +432,8 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
             Optional<String> uniformCode = Optional.ofNullable(point.getUniformcode());
             Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
             Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
+
+            String pointid =tagName.get();
             //通过时间区间和时间间隔获取点数
             Long finalInterval;
             if (pried != null)
@@ -467,50 +477,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                     }else
                     {
 
-                        resultList=snapList;
-//                        for (PointData snapItem : snapList) {
-//                            long subTime = snapItem.getPointTime() - pried;
-//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-//                            // 则代表该时间节点快照有效,否则为0
-//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
-//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-//                            JSONObject jsonObjectSection = sectionResp.getBody();
-//
-//                            if (jsonObjectSection != null) {
-//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-//                                if (sectionlist.size() > 0) {
-//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-//                                        resultList.add(snapItem);
-//                                    }
-//                                    else{
-//                                        PointData data = new PointData();
-//                                        data.setEdnaId(point.getCode());
-//                                        data.setPointTime(0L);
-//                                        data.setPointValue("0");
-//                                        data.setPointName("1");
-//                                        data.setPointValueInDouble(0.0);
-//                                        resultList.add(data);
-//                                    }
-//                                } else {
-//                                    PointData data = new PointData();
-//                                    data.setEdnaId(point.getCode());
-//                                    data.setPointTime(0l);
-//                                    data.setPointValue("0");
-//                                    data.setPointName("1");
-//                                    data.setPointValueInDouble(0.0);
-//                                    resultList.add(data);
-//                                }
-//                            } else {
-//                                PointData data = new PointData();
-//                                data.setEdnaId(point.getCode());
-//                                data.setPointTime(0l);
-//                                data.setPointValue("0");
-//                                data.setPointName("1");
-//                                data.setPointValueInDouble(0.0);
-//                                resultList.add(data);
-//                            }
-//                        }
+                        if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
+                        {
+                            resultList=snapList;
+                        }else
+                        {
+
+                            for (PointData snapItem : snapList) {
+
+                                long subTime = snapItem.getPointTime() - pried;
+                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                                // 则代表该时间节点快照有效,否则为0
+                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getCode() + "&ts=" + snapItem.getPointTime() + "000";
+                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                                JSONObject jsonObjectSection = sectionResp.getBody();
+
+                                if (jsonObjectSection != null) {
+                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                                    if (sectionlist.size() > 0) {
+                                        if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                            resultList.add(snapItem);
+                                        }
+                                        else{
+                                            PointData data = new PointData();
+                                            data.setEdnaId(point.getCode());
+                                            data.setPointTime(snapItem.getPointTime());
+                                            data.setPointValue("0");
+                                            data.setPointName("1");
+                                            data.setPointValueInDouble(0.0);
+                                            resultList.add(data);
+                                        }
+                                    } else {
+                                        PointData data = new PointData();
+                                        data.setEdnaId(point.getCode());
+                                        data.setPointTime(snapItem.getPointTime());
+                                        data.setPointValue("0");
+                                        data.setPointName("1");
+                                        data.setPointValueInDouble(0.0);
+                                        resultList.add(data);
+                                    }
+                                } else {
+                                    PointData data = new PointData();
+                                    data.setEdnaId(point.getCode());
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            }
+
+                        }
                     }
 
 
@@ -808,7 +826,7 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
     public List<PointData> getRealData(List<String> pointids) throws Exception {
 
 
-        if(StringUtils.notEmp(pointids) )
+        if(StringUtils.notEmp(pointids) && !pointids.isEmpty() )
         {
 
             if(!pointids.get(0).startsWith(JKFC) && !pointids.get(0).startsWith(JKFJ))
@@ -840,6 +858,8 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                     }
 
                     ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
+
+                  //  System.out.println("数据适配器"+url);
                     JSONObject jsonObject = resp.getBody();
                     if (jsonObject != null) {
 
@@ -1098,50 +1118,58 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                     }else
                     {
 
-                        resultList=list;
-//                        for (PointData snapItem : list) {
-//                            long subTime = snapItem.getPointTime() - pried;
-//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-//                            // 则代表该时间节点快照有效,否则为0
-//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
-//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-//                            JSONObject jsonObjectSection = sectionResp.getBody();
-//
-//                            if (jsonObjectSection != null) {
-//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-//                                if (sectionlist.size() > 0) {
-//                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-//                                        resultList.add(snapItem);
-//                                    }
-//                                    else{
-//                                        PointData data = new PointData();
-//                                        data.setEdnaId(pointid);
-//                                        data.setPointTime(0L);
-//                                        data.setPointValue("0");
-//                                        data.setPointName("1");
-//                                        data.setPointValueInDouble(0.0);
-//                                        resultList.add(data);
-//                                    }
-//                                } else {
-//                                    PointData data = new PointData();
-//                                    data.setEdnaId(pointid);
-//                                    data.setPointTime(0l);
-//                                    data.setPointValue("0");
-//                                    data.setPointName("1");
-//                                    data.setPointValueInDouble(0.0);
-//                                    resultList.add(data);
-//                                }
-//                            } else {
-//                                PointData data = new PointData();
-//                                data.setEdnaId(pointid);
-//                                data.setPointTime(0l);
-//                                data.setPointValue("0");
-//                                data.setPointName("1");
-//                                data.setPointValueInDouble(0.0);
-//                                resultList.add(data);
-//                            }
-//                        }
+                        if(StringUtils.notEmp(pointid) && !pointid.startsWith(JKFC) && !pointid.startsWith(JKFJ))
+                        {
+                            resultList=list;
+                        }else
+                        {
+
+                            for (PointData snapItem : list) {
+
+                                long subTime = snapItem.getPointTime() - pried;
+                                //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+                                // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+                                // 则代表该时间节点快照有效,否则为0
+                                String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + snapItem.getPointTime() + "000";
+                                ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+                                JSONObject jsonObjectSection = sectionResp.getBody();
+
+                                if (jsonObjectSection != null) {
+                                    List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+                                    if (sectionlist.size() > 0) {
+                                        if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                            resultList.add(snapItem);
+                                        }
+                                        else{
+                                            PointData data = new PointData();
+                                            data.setEdnaId(pointid);
+                                            data.setPointTime(snapItem.getPointTime());
+                                            data.setPointValue("0");
+                                            data.setPointName("1");
+                                            data.setPointValueInDouble(0.0);
+                                            resultList.add(data);
+                                        }
+                                    } else {
+                                        PointData data = new PointData();
+                                        data.setEdnaId(pointid);
+                                        data.setPointTime(snapItem.getPointTime());
+                                        data.setPointValue("0");
+                                        data.setPointName("1");
+                                        data.setPointValueInDouble(0.0);
+                                        resultList.add(data);
+                                    }
+                                } else {
+                                    PointData data = new PointData();
+                                    data.setEdnaId(pointid);
+                                    data.setPointTime(snapItem.getPointTime());
+                                    data.setPointValue("0");
+                                    data.setPointName("1");
+                                    data.setPointValueInDouble(0.0);
+                                    resultList.add(data);
+                                }
+                            }
+
+                        }
                     }
 
                     return resultList;

+ 2 - 2
web/health-hb/src/main/resources/application-hb.yml

@@ -27,7 +27,7 @@ gyee:
   rollVerification: true
   #实时数据库Url
   baseurl: http://192.168.2.198:8011/ts
-  healthurl: http://192.168.2.198:8011/ts
+  healthurl: http://192.168.2.198:8012/ts
   adapterUrl: http://192.168.2.198:8011
   alarmUrl: http://192.168.2.198:8176
   #API访问ip
@@ -92,7 +92,7 @@ spring :
 
   redis:
     database: 19
-    host: 192.168.2.194
+    host: 192.168.2.202
     password:
     pool:
       maxTotal: 20

+ 7 - 7
web/health-hb/src/main/resources/application-hf.yml

@@ -26,18 +26,18 @@ gyee:
   #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
   rollVerification: true
   #实时数据库Url
-  baseurl: http://10.0.118.76:8011/ts
-  healthurl: http://10.0.118.76:8011/ts
-  adapterUrl: http://10.0.118.76:8011
-  alarmUrl: http://10.0.118.76:8176
+  baseurl: http://10.0.118.73:8011/ts
+  healthurl: http://10.0.118.73:8011/ts
+  adapterUrl: http://10.0.118.73:8011
+  alarmUrl: http://10.0.118.73:8176
   #API访问ip
   #swaggerip: 49.4.50.80:8082
-  swaggerip: 10.155.32.4:8082
+  swaggerip: 10.0.118.73:8082
   #默认小数位数
   digit: 2
   realtimedataBase: golden #数据查询模式 golden、hwy
   #weatherurl: http://123.60.213.70:7011
-  weatherurl: http://10.0.118.76:7011
+  weatherurl: http://10.0.118.73:7011
   #weatherurl: http://10.83.68.97:7011
   weatherqygs: hb_qygs
   hbmaps: {CL_FDC_KEY: 2003,KB_FDC_KEY: 1460,DX_FDC_KEY: 2186,SY_FDC_KEY: 1366}
@@ -65,7 +65,7 @@ spring :
     cloud:
       nacos:
         discovery:
-          server-addr: 10.0.118.76:8848
+          server-addr: 192.168.56.1:8848
           #指定yaml格式的配置
           file-extension: yaml
           cluster-name: master

+ 13 - 7
web/health-hb/src/main/resources/application-hwy.yml

@@ -91,8 +91,8 @@ spring :
 
   redis:
     database: 1
-    host: 192.168.2.202
-    password: gdnxfd123
+    host: 10.0.118.73
+    password:
     pool:
       maxTotal: 20
       maxIdle: 20
@@ -108,10 +108,13 @@ spring :
     druid:
       #主库数据源
       master:
-        url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
-        username: nxfdprod
-        password: gdnxfd123
+#        url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+#        username: nxfdprod
+#        password: gdnxfd123
         driver-class-name: oracle.jdbc.driver.OracleDriver
+        url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+        username: gdprod
+        password: gd123
 
       #备数据源 #关闭
       slave:
@@ -121,9 +124,12 @@ spring :
         password: root
         #两票数据源
       ticket:
-        url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeamnew
+#        url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeamnew
+#        username: sa
+#        password: Gyee@321#!
+        url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
         username: sa
-        password: Gyee@321#!
+        password: Gd!123456
         driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
         #配置初始化连接数大小
       initial-size: 10

+ 2 - 2
web/health-hb/src/main/resources/mybatis/auto/EquipmentSqlMapper.xml

@@ -1012,9 +1012,9 @@
   </update>
 
   <select id="getEquipmentListByLocation"  resultType="com.gyee.frame.model.auto.EquipmentSql">
-    SELECT 	dbo.LOCATIONS.LOCATION as location,dbo.LOCATIONS.DESCRIPTION as description,dbo.LOCSTRUCT.PARENT as parent FROM dbo.LOCATIONS,dbo.LOCSTRUCT
-    where dbo.LOCSTRUCT.LOCATION=dbo.LOCATIONS.LOCATION and dbo.LOCSTRUCT.LOCATION like '${location}%'
 
+    SELECT 	dbo.EQUIPMENT.LOCATION as location,dbo.EQUIPMENT.DESCRIPTION as description,dbo.EQUIPMENT.PARENT as parent FROM dbo.EQUIPMENT
+    where   dbo.EQUIPMENT.LOCATION like '%${location}%'
   </select>
 
 </mapper>

+ 24 - 0
web/health-hb/src/main/resources/mybatis/auto/ShutdowneventMapper.xml

@@ -515,4 +515,28 @@
     and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
     and t.stoptime &lt;= (select max(stoptime) from shutdownevent) and t.windturbineid = t1.id group by t1.projectid  order by t1.projectid
   </select>
+
+
+    <select id="queryEvents"  resultType="com.gyee.frame.model.custom.ShutdowneventVo">
+        select t.id,t.windPowerStationId,t.windTurbineId,s.warningId,s.alerttext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode
+         from shutdownevent t inner join (select n.alerttext,w.faulttime,n.windturbineid,n.stationid warningId  from faulthistory w
+          inner join faultsnap n on n.id=w.snapid  where w.faulttime >=#{beginDate}
+          and  w.faulttime &lt;=#{endDate} and w.messagetype=1) s on
+           s.windturbineid=t.windturbineid
+          where t.stopTime>=#{beginDate}
+           and t.stopTime&lt;=#{endDate}
+           and t.statusCode=2
+        <if test="type != null">
+           and t.statusCode  = #{type,jdbcType=VARCHAR}
+        </if>
+        <if test="wtId != null">
+            and t.windTurbineId  = #{wtId,jdbcType=VARCHAR}
+        </if>
+        <if test="wpId != null">
+            and t.windPowerStationId  = #{wpId,jdbcType=VARCHAR}
+        </if>
+           order by t.windturbineid,t.starttime desc
+
+
+    </select>
 </mapper>

+ 47 - 0
web/health-hb/src/main/resources/mybatis/auto/Windturbineinfodaytop2Mapper.xml

@@ -1327,4 +1327,51 @@
     </if>
      and year=#{year} and month=#{month} order by "LEVEL" desc
   </select>
+
+
+    <select id="findXnfxDay"  resultMap="BaseResultMap">
+        select  id, windPowerStationId, projectId, lineId, windTurbineId, recordDate, dayfdl, monthfdl,
+        yearfdl, dayllfdl, monthllfdl, yearllfdl, dayfs, monthfs, yearfs, daygl, monthgl,
+        yeargl, daygzssdl, monthgzssdl, yeargzssdl, dayxdssdl, monthxdssdl, yearxdssdl, daywhssdl,
+        monthwhssdl, yearwhssdl, dayxnssdl, monthxnssdl, yearxnssdl, daygzsj, monthgzsj,
+        yeargzsj, daywhsj, monthwhsj, yearwhsj, dayyxsj, monthyxsj, yearyxsj, daytjsj, monthtjsj,
+        yeartjsj, dayLYXS, monthLYXS, yearLYXS, dayNHYD, monthNHYD, yearNHYD, daySBKLYL,
+        monthSBKLYL, yearSBKLYL, dayDXKYXS, monthDXKYXS, yearDXKYXS, dayyxfss, monthyxfss,
+        yearyxfss, dayxfqr, monthxfqr, yearxfqr, dayjfpl, monthjfpl, yearjfpl, dayglyzxxs,
+        monthglyzxxs, yearglyzxxs, type, Rank, "LEVEL", year, month
+        from windturbineinfodaytop2  where  type=1
+        <if test="wtId != null">
+            and windTurbineId = #{wtId}
+        </if>
+        <if test="beginDate != null">
+            and recorddate >= #{beginDate}
+        </if>
+        <if test="endDate != null">
+            and recorddate &lt;= #{endDate}
+        </if>
+         order by Rank
+    </select>
+
+    <select id="findXnfxMonth"  resultMap="BaseResultMap">
+        select  id, windPowerStationId, projectId, lineId, windTurbineId, recordDate, dayfdl, monthfdl,
+        yearfdl, dayllfdl, monthllfdl, yearllfdl, dayfs, monthfs, yearfs, daygl, monthgl,
+        yeargl, daygzssdl, monthgzssdl, yeargzssdl, dayxdssdl, monthxdssdl, yearxdssdl, daywhssdl,
+        monthwhssdl, yearwhssdl, dayxnssdl, monthxnssdl, yearxnssdl, daygzsj, monthgzsj,
+        yeargzsj, daywhsj, monthwhsj, yearwhsj, dayyxsj, monthyxsj, yearyxsj, daytjsj, monthtjsj,
+        yeartjsj, dayLYXS, monthLYXS, yearLYXS, dayNHYD, monthNHYD, yearNHYD, daySBKLYL,
+        monthSBKLYL, yearSBKLYL, dayDXKYXS, monthDXKYXS, yearDXKYXS, dayyxfss, monthyxfss,
+        yearyxfss, dayxfqr, monthxfqr, yearxfqr, dayjfpl, monthjfpl, yearjfpl, dayglyzxxs,
+        monthglyzxxs, yearglyzxxs, type, Rank, "LEVEL", year, month
+        from windturbineinfodaytop2  where  type=2
+        <if test="wtId != null">
+            and windTurbineId = #{wtId}
+        </if>
+        <if test="year != null">
+            and year >= #{year}
+        </if>
+        <if test="month != null">
+            and month &lt;= #{month}
+        </if>
+        order by Rank
+    </select>
 </mapper>