Sfoglia il codice sorgente

曲线偏差率功能修改

shilin 1 anno fa
parent
commit
d72de8ab27

+ 2 - 2
web/health/src/main/java/com/gyee/health/mapper/auto/AlarmsnapMapper.java

@@ -31,8 +31,8 @@ public interface AlarmsnapMapper extends BaseMapper<Alarmsnap> {
             "    and a.alerttime>= '${beginDate}' and a.alerttime < '${endDate}'")
     List<TotalNumsVo> getAlarmhistoryList(@Param("tname") String tname, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
     @DS("slave")
-    @Select(" select t.altype typeId,r.ednavalue numbers,r.id,t.name from alertrule2 r,alertrulefailuresub t where t.tid=r.id and t.altype is not null ")
-    List<TotalNumVo> findAlertrulefailuresubMap();
+    @Select(" select components typeId,count(alarmid) numbers from alarmWt where stationid = '${wpId}' and ts >= #{begin} and ts <= #{end}  group by components ")
+    List<TotalNumVo> findAlertrulefailuresubMap( @Param(value = "wpId")String wpId,@Param("begin")long begin,@Param("end")long end);
 
 
 }

+ 3 - 3
web/health/src/main/java/com/gyee/health/model/custom/TotalNumVo.java

@@ -11,17 +11,17 @@ public class TotalNumVo  implements Serializable{
 	
 	private String wtId;
 	private String typeId;
-	private Integer numbers;
+	private String numbers;
 	public String getWtId() {
 		return wtId;
 	}
 	public void setWtId(String wtId) {
 		this.wtId = wtId;
 	}
-	public Integer getNumbers() {
+	public String getNumbers() {
 		return numbers;
 	}
-	public void setNumbers(Integer numbers) {
+	public void setNumbers(String numbers) {
 		this.numbers = numbers;
 	}
 	public String getTypeId() {

+ 1 - 1
web/health/src/main/java/com/gyee/health/service/auto/impl/ProEconAlarmRuleFailureServiceImpl.java

@@ -29,7 +29,7 @@ public class ProEconAlarmRuleFailureServiceImpl extends ServiceImpl<ProEconAlarm
     public List<ProEconAlarmRuleFailure> queryObject(String name, String wpId,String modelId) {
         List<ProEconAlarmRuleFailure> ls = new ArrayList<>();
 
-        if (StringUtils.notEmp(name) && StringUtils.notEmp(modelId) && StringUtils.notEmp(wpId)) {
+        if (StringUtils.notEmp(name)) {
             ls = proEconAlarmRuleFailureMapper.queryObject(name,wpId,modelId);
         }
         return ls;

+ 10 - 1
web/health/src/main/java/com/gyee/health/service/health/HealthReportService.java

@@ -235,9 +235,18 @@ public class HealthReportService {
                                     String gz1=gzarr[0];
                                     String gz2=gzarr[1];
                                     String gz3=gzarr[2];
+                                    List<ProEconAlarmRuleFailure> afls=null;
 
+                                    if(gz1.equals("风速突变"))
+                                    {
+                                       afls=proEconAlarmRuleFailureService.queryObject(gz1,null,null);
+
+                                    }else
+                                    {
+                                         afls=proEconAlarmRuleFailureService.queryObject(gz1,wt.getWindpowerstationId(),wt.getModelId());
+
+                                    }
 
-                                    List<ProEconAlarmRuleFailure> afls=proEconAlarmRuleFailureService.queryObject(gz1,wt.getWindpowerstationId(),wt.getModelId());
                                     if(!afls.isEmpty())
                                     {
 

+ 8 - 4
web/health/src/main/java/com/gyee/health/service/health/LossPowerRateHealthService.java

@@ -13,6 +13,7 @@ import com.gyee.health.model.custom.TotalNumVo;
 import com.gyee.health.model.custom.TotalNumsVo;
 import com.gyee.health.service.TokenService;
 import com.gyee.health.service.auto.IProBasicEquipmentPointService;
+import com.gyee.health.util.DateUtils;
 import com.gyee.health.util.IRealTimeDataBaseUtil;
 import com.gyee.health.util.RealTimeDataBaseFactory;
 import com.gyee.health.util.StringUtils;
@@ -60,7 +61,7 @@ public class LossPowerRateHealthService {
 
         Map<String, List<String>> ahmap =getAlarmhistoryLMap();
 
-        Map<String, String> altypemap = findAlertrulefailuresubMap();
+        Map<String, String> altypemap = findAlertrulefailuresubMap(wpId);
 
         List<HealthmodelrecordsVo> vos = new ArrayList<HealthmodelrecordsVo>();
         int id = 0;
@@ -241,11 +242,14 @@ public class LossPowerRateHealthService {
         return map;
     }
 
-    private Map<String, String> findAlertrulefailuresubMap() {
+    private Map<String, String> findAlertrulefailuresubMap(String wpId) {
 
         Map<String, String> map = new HashMap<String, String>();
-
-        List<TotalNumVo> list =alarmsnapMapper.findAlertrulefailuresubMap();
+        Calendar c=Calendar.getInstance();
+        Date end=c.getTime();
+        c.setTime(DateUtils.truncate(c.getTime()));
+        Date begin=c.getTime();
+        List<TotalNumVo> list =alarmsnapMapper.findAlertrulefailuresubMap(wpId,begin.getTime(),end.getTime());
 
         if (!list.isEmpty()) {
             for (TotalNumVo vo : list) {

+ 8 - 3
web/health/src/main/java/com/gyee/health/service/health/WindTurbineHealthListService.java

@@ -11,6 +11,7 @@ import com.gyee.health.model.custom.HealthmodelrecordsVo;
 import com.gyee.health.model.custom.TotalNumVo;
 import com.gyee.health.model.custom.TotalNumsVo;
 import com.gyee.health.service.auto.IProBasicEquipmentPointService;
+import com.gyee.health.util.DateUtils;
 import com.gyee.health.util.IRealTimeDataBaseUtil;
 import com.gyee.health.util.RealTimeDataBaseFactory;
 import com.gyee.health.util.StringUtils;
@@ -54,7 +55,7 @@ public class WindTurbineHealthListService {
 
         Map<String, List<String>> ahmap =getAlarmhistoryLMap(wpId);
 
-        Map<String, String> altypemap = findAlertrulefailuresubMap();
+        Map<String, String> altypemap = findAlertrulefailuresubMap(wpId);
 
         List<HealthmodelrecordsVo> vos = new ArrayList<>();
         if(CacheContext.wpwtmap.containsKey(wpId))
@@ -255,11 +256,15 @@ public class WindTurbineHealthListService {
         return map;
     }
 
-    private Map<String, String> findAlertrulefailuresubMap() {
+    private Map<String, String> findAlertrulefailuresubMap(String wpId) {
 
         Map<String, String> map = new HashMap<String, String>();
 
-        List<TotalNumVo> list =alarmsnapMapper.findAlertrulefailuresubMap();
+        Calendar c=Calendar.getInstance();
+        Date end=c.getTime();
+        c.setTime(DateUtils.truncate(c.getTime()));
+        Date begin=c.getTime();
+        List<TotalNumVo> list =alarmsnapMapper.findAlertrulefailuresubMap(wpId,begin.getTime(),end.getTime());
 
         if (!list.isEmpty()) {
             for (TotalNumVo vo : list) {

+ 9 - 9
web/health/src/main/java/com/gyee/health/service/leaderboard/LeaderboardService.java

@@ -91,8 +91,8 @@ public class LeaderboardService {
                     if (c == wc.getSpeed()) {
                         vo.setValue1(wc.getSpeed());
                         if (StringUtils.notEmp(type) && type.equals(SJBZ) && null != modelmap) {
-                            if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
-                                ProBasicModelPowerRd mp = modelmap.get(String.valueOf(wc.getSpeed()));
+                            if (modelmap.containsKey(wc.getSpeed())) {
+                                ProBasicModelPowerRd mp = modelmap.get(wc.getSpeed());
                                 vo.setValue3(mp.getEnsurePower());
                             } else {
                                 vo.setValue3(0.0);
@@ -104,8 +104,8 @@ public class LeaderboardService {
                             vo.setValue3(wc.getOptimalPower());
 
                         } else if (StringUtils.notEmp(type) && type.equals(ZYBZ) && null != modelmap) {
-                            if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
-                                ProBasicModelPowerRd mp = modelmap.get(String.valueOf(wc.getSpeed()));
+                            if (modelmap.containsKey(wc.getSpeed())) {
+                                ProBasicModelPowerRd mp = modelmap.get(wc.getSpeed());
                                 vo.setValue3(mp.getEnsurePower());
                             } else {
                                 vo.setValue3(0.0);
@@ -264,7 +264,7 @@ public class LeaderboardService {
 
             if(StringUtils.notEmp(stid))
             {
-                List<ProEconWtCurveFitting> stmonthls = proEconWtCurveFittingService.comparechatAjax(wtId,recorddate);
+                List<ProEconWtCurveFitting> stmonthls = proEconWtCurveFittingService.comparechatAjax(stid,recorddate);
 
                 if (null != stmonthls && !stmonthls.isEmpty()) {
 
@@ -399,8 +399,8 @@ public class LeaderboardService {
                     if (c == wc.getSpeed()) {
                         vo.setValue1(wc.getSpeed());
                         if (StringUtils.notEmp(type) && type.equals(SJBZ) && null != modelmap) {
-                            if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
-                                ProBasicModelPowerRd mp = modelmap.get(String.valueOf(wc.getSpeed()));
+                            if (modelmap.containsKey(wc.getSpeed())) {
+                                ProBasicModelPowerRd mp = modelmap.get(wc.getSpeed());
                                 vo.setValue3(mp.getEnsurePower());
                             } else {
                                 vo.setValue3(0.0);
@@ -415,8 +415,8 @@ public class LeaderboardService {
                             name1 = "实际功率";
                             name2 = "最优功率";
                         } else if (StringUtils.notEmp(type) && type.equals(ZYBZ) && null != modelmap) {
-                            if (modelmap.containsKey(String.valueOf(wc.getSpeed()))) {
-                                ProBasicModelPowerRd mp = modelmap.get(String.valueOf(wc.getSpeed()));
+                            if (modelmap.containsKey(wc.getSpeed())) {
+                                ProBasicModelPowerRd mp = modelmap.get(wc.getSpeed());
                                 vo.setValue3(mp.getEnsurePower());
                             } else {
                                 vo.setValue3(0.0);