Parcourir la source

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

shilin il y a 2 ans
Parent
commit
a11e061d69

+ 5 - 0
web/monitor-hb/src/main/java/com/gyee/frame/mapper/auto/AlarmsnapMapper.java

@@ -2,6 +2,7 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Alarmsnap;
 import com.gyee.frame.model.auto.AlarmsnapExample;
+import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.TotalNumVo;
 import com.gyee.frame.model.custom.TotalNumsVo;
 import org.apache.ibatis.annotations.Param;
@@ -102,4 +103,8 @@ public interface AlarmsnapMapper {
     List<TotalNumVo> findAlertrulefailuresubMap();
 
 
+    List<SawVo> getWarningRecordsTop(@Param("wtId") String wtId, @Param("tname") String tname, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
+
+
+    List<SawVo> getWarningRecordsList(@Param("wtId") String wtId,@Param("tname") String tname);
 }

+ 13 - 4
web/monitor-hb/src/main/java/com/gyee/frame/model/custom/SawVo.java

@@ -1,5 +1,7 @@
 package com.gyee.frame.model.custom;
 
+import java.util.Date;
+
 public class SawVo implements java.io.Serializable {
 
 	// Fields
@@ -11,10 +13,17 @@ public class SawVo implements java.io.Serializable {
 	private Integer frequency;
 	private Integer frequencyday;
 	private Double totalhours;
-	
-	
-	
-	public Integer getFrequencyday() {
+	private Date time;
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Integer getFrequencyday() {
 		return frequencyday;
 	}
 	public void setFrequencyday(Integer frequencyday) {

+ 154 - 75
web/monitor-hb/src/main/java/com/gyee/frame/service/AlarmsnapService.java

@@ -1,92 +1,171 @@
 package com.gyee.frame.service;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.AlarmsnapMapper;
 import com.gyee.frame.model.auto.Alarmsnap;
 import com.gyee.frame.model.auto.AlarmsnapExample;
+import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.SawVo;
+import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 
 @Service
 public class AlarmsnapService implements BaseService<Alarmsnap, AlarmsnapExample> {
-	@Resource
-	private AlarmsnapMapper alarmsnapMapper;
-	
-
-	@Override
-	public int deleteByPrimaryKey(String ids) {
-				
-			List<Integer> lista=Convert.toIntArrayList(ids);
-			AlarmsnapExample example=new AlarmsnapExample();
-			example.createCriteria().andIdIn(lista);
-			return alarmsnapMapper.deleteByExample(example);
-			
-				
-	}
-	
-	
-	@Override
-	public Alarmsnap selectByPrimaryKey(String id) {
-				
-			return alarmsnapMapper.selectByPrimaryKey(Integer.valueOf(id));
-				
-	}
-
-	
-	@Override
-	public int updateByPrimaryKeySelective(Alarmsnap record) {
-		return alarmsnapMapper.updateByPrimaryKeySelective(record);
-	}
-	
-	
-	/**
-	 * 添加
-	 */
-	@Override
-	public int insertSelective(Alarmsnap record) {
-				
-
-				
-		return alarmsnapMapper.insertSelective(record);
-	}
-	
-	
-	@Override
-	public int updateByExampleSelective(Alarmsnap record, AlarmsnapExample example) {
-		
-		return alarmsnapMapper.updateByExampleSelective(record, example);
-	}
-
-	
-	@Override
-	public int updateByExample(Alarmsnap record, AlarmsnapExample example) {
-		
-		return alarmsnapMapper.updateByExample(record, example);
-	}
-
-	@Override
-	public List<Alarmsnap> selectByExample(AlarmsnapExample example) {
-		
-		return alarmsnapMapper.selectByExample(example);
-	}
-
-	
-	@Override
-	public long countByExample(AlarmsnapExample example) {
-		
-		return alarmsnapMapper.countByExample(example);
-	}
-
-	
-	@Override
-	public int deleteByExample(AlarmsnapExample example) {
-		
-		return alarmsnapMapper.deleteByExample(example);
-	}
-	
+    @Resource
+    private AlarmsnapMapper alarmsnapMapper;
+    private final String  ALARMHISTORY="ALARMHISTORY";
+    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    @Override
+    public int deleteByPrimaryKey(String ids) {
+
+        List<Integer> lista=Convert.toIntArrayList(ids);
+        AlarmsnapExample example=new AlarmsnapExample();
+        example.createCriteria().andIdIn(lista);
+        return alarmsnapMapper.deleteByExample(example);
+
+
+    }
+
+
+    @Override
+    public Alarmsnap selectByPrimaryKey(String id) {
+
+        return alarmsnapMapper.selectByPrimaryKey(Integer.valueOf(id));
+
+    }
+
+
+    @Override
+    public int updateByPrimaryKeySelective(Alarmsnap record) {
+        return alarmsnapMapper.updateByPrimaryKeySelective(record);
+    }
+
+
+    /**
+     * 添加
+     */
+    @Override
+    public int insertSelective(Alarmsnap record) {
+
+
+
+        return alarmsnapMapper.insertSelective(record);
+    }
+
+
+    @Override
+    public int updateByExampleSelective(Alarmsnap record, AlarmsnapExample example) {
+
+        return alarmsnapMapper.updateByExampleSelective(record, example);
+    }
+
+
+    @Override
+    public int updateByExample(Alarmsnap record, AlarmsnapExample example) {
+
+        return alarmsnapMapper.updateByExample(record, example);
+    }
+
+    @Override
+    public List<Alarmsnap> selectByExample(AlarmsnapExample example) {
+
+        return alarmsnapMapper.selectByExample(example);
+    }
+
+
+    @Override
+    public long countByExample(AlarmsnapExample example) {
+
+        return alarmsnapMapper.countByExample(example);
+    }
+
+
+    @Override
+    public int deleteByExample(AlarmsnapExample example) {
+
+        return alarmsnapMapper.deleteByExample(example);
+    }
+
+    public List<SawVo> getWarningRecordsTop(Tablepar tablepar, String wtId, Date beginDate, Date endDate) {
+
+
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        PageInfo<SawVo> pageInfo = new PageInfo<SawVo>();
+
+        if (StringUtils.notEmp(wtId) && InitialRunner.wtmap.containsKey(wtId)) {
+            Windturbine wt=InitialRunner.wtmap.get(wtId);
+            String wpname=wt.getWindpowerstationid().substring(0,wt.getWindpowerstationid().indexOf("_"));
+            StringBuilder alerthistory=new StringBuilder(ALARMHISTORY).append("_").append(wpname).append("_");
+            Calendar cal = Calendar.getInstance();
+            cal.setTime(beginDate);
+            int year=cal.get(Calendar.YEAR);
+            int month=cal.get(Calendar.MONTH)+1;
+
+            alerthistory.append(year);
+            if(month<10)
+            {
+                alerthistory.append("0").append(month);
+            }else
+            {
+                alerthistory.append(month);
+            }
+
+            List<SawVo> list=alarmsnapMapper.getWarningRecordsTop(wtId,String.valueOf(alerthistory),dateFormat.format(beginDate),dateFormat.format(endDate));
+            pageInfo = new PageInfo<SawVo>(list);
+        }
+
+
+
+
+        return pageInfo.getList();
+
+    }
+
+
+    public List<SawVo> getWarningRecordsList(String wtId) {
+
+
+        PageHelper.startPage(0, 1);
+        PageInfo<SawVo> pageInfo = new PageInfo<SawVo>();
+
+        if (StringUtils.notEmp(wtId) && InitialRunner.wtmap.containsKey(wtId)) {
+            Windturbine wt=InitialRunner.wtmap.get(wtId);
+            String wpname=wt.getWindpowerstationid().substring(0,wt.getWindpowerstationid().indexOf("_"));
+            StringBuilder alerthistory=new StringBuilder(ALARMHISTORY).append("_").append(wpname).append("_");
+            Calendar cal = Calendar.getInstance();
+            int year=cal.get(Calendar.YEAR);
+            int month=cal.get(Calendar.MONTH)+1;
+
+            alerthistory.append(year);
+            if(month<10)
+            {
+                alerthistory.append("0").append(month);
+            }else
+            {
+                alerthistory.append(month);
+            }
+
+            List<SawVo> list=alarmsnapMapper.getWarningRecordsList(wtId,String.valueOf(alerthistory));
+            pageInfo = new PageInfo<SawVo>(list);
+        }
+
+
+
+
+        return pageInfo.getList();
+
+    }
 
 }

+ 187 - 182
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -1,19 +1,15 @@
 package com.gyee.frame.service.websocket;
 
 
+import cn.hutool.core.date.DateUtil;
 import com.google.common.collect.Maps;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.PointData;
-import com.gyee.frame.service.WarningRecordsService;
-import com.gyee.frame.service.WindTurbineTestingPointAiService;
-import com.gyee.frame.service.WindTurbineTestingPointDiService;
-import com.gyee.frame.service.WindturbineinfodayService;
+import com.gyee.frame.model.custom.SawVo;
+import com.gyee.frame.service.*;
 import com.gyee.frame.util.*;
-
-import cn.hutool.core.date.DateUtil;
-
 import org.apache.commons.compress.utils.Lists;
 import org.springframework.stereotype.Service;
 
@@ -32,6 +28,8 @@ public class WtInfoPushService {
     private WindturbineinfodayService windturbineinfodayService;
     @Resource
     private WarningRecordsService warningRecordsService;
+    @Resource
+    private AlarmsnapService alarmsnapService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
     String QS_FDC = "QS_FDC";
@@ -105,8 +103,8 @@ public class WtInfoPushService {
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getCode());// 风机日检修损失电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getCode());// 风机日欠发损失电量
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getCode());// 风机日限电损失电量
-                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RGZSSDL).getCode());// 日场内受累检修
-                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RJXSSDL).getCode());// 日场内受累故障
+                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RLZSSDL).getCode());// 日场内受累检修
+                zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RSZSSDL).getCode());// 日场内受累故障
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getCode());// 日场外受累电网
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getCode());// 日场外受累天气
 
@@ -689,7 +687,7 @@ public class WtInfoPushService {
 
 /*******************************************************************************************************************************************************/
 
-                  Map<String, Object> jczbmap = new HashMap<>();
+                Map<String, Object> jczbmap = new HashMap<>();
 //                    Map<String, Object> bjmap = new HashMap<>();
 //                    Map<String, Object> clxmap = new HashMap<>();
 //                    Map<String, Object> fdjmap = new HashMap<>();
@@ -761,7 +759,7 @@ public class WtInfoPushService {
                             {
                                 String[] temparr=namemap.get(keyls.get(i));
                                 temparr[3]=String.valueOf(MathUtil.twoBit(zblist.get(num).getPointValueInDouble()));
-                               // bjmap.put(keyls.get(i),temparr);//
+                                // bjmap.put(keyls.get(i),temparr);//
                                 bjls.add(temparr);
                             }
 
@@ -775,7 +773,7 @@ public class WtInfoPushService {
                             {
                                 String[] temparr=namemap.get(keyls.get(i));
                                 temparr[3]=String.valueOf(MathUtil.twoBit(zblist.get(num).getPointValueInDouble()));
-                               // clxmap.put(keyls.get(i),temparr);//
+                                // clxmap.put(keyls.get(i),temparr);//
                                 clxls.add(temparr);
                             }
                         }
@@ -867,14 +865,14 @@ public class WtInfoPushService {
 
 
 
- /**************************************************************基础指标***********************************************************************************/
+                    /**************************************************************基础指标***********************************************************************************/
                 }
 
                 if(InitialRunner.mlmap.containsKey(wt.getModelid()))
                 {
                     Equipmentmodel model=InitialRunner.mlmap.get(wt.getModelid());
                     jczbmap.put("zjrl",model.getPowerproduction());
-                  //  jczbmap.add(new String[]{"装机容量","","ai",String.valueOf(model.getPowerproduction())});
+                    //  jczbmap.add(new String[]{"装机容量","","ai",String.valueOf(model.getPowerproduction())});
                 }
 
                 map.put("jczbmap", jczbmap);
@@ -926,13 +924,20 @@ public class WtInfoPushService {
                 gxkmap.put("ytjxs", 0.0);
             }
 
-            WarningRecords warningRecords= warningRecordsService.getWarningRecords(id);
+//            WarningRecords warningRecords= warningRecordsService.getWarningRecords(id);
+//
+//            if(null !=warningRecords && null !=warningRecords.getWarningid() && InitialRunner.warningmap.containsKey(warningRecords.getWarningid()))
+//            {
+//                Warning2 warning2=InitialRunner.warningmap.get(warningRecords.getWarningid());
+//                gxkmap.put("bjmc", warning2.getChinesetext());
+//                gxkmap.put("bjsj", DateUtils.formatDateTime(warningRecords.getWarningtime()));
+//            }
 
-            if(null !=warningRecords && null !=warningRecords.getWarningid() && InitialRunner.warningmap.containsKey(warningRecords.getWarningid()))
+            List<SawVo> ls=alarmsnapService.getWarningRecordsList(id);
+            if(!ls.isEmpty())
             {
-                Warning2 warning2=InitialRunner.warningmap.get(warningRecords.getWarningid());
-                gxkmap.put("bjmc", warning2.getChinesetext());
-                gxkmap.put("bjsj", DateUtils.formatDateTime(warningRecords.getWarningtime()));
+                gxkmap.put("bjmc", ls.get(0).getName());
+                gxkmap.put("bjsj", DateUtils.formatDateTime(ls.get(0).getTime()));
             }
             map.put("gxkmap", gxkmap);
 
@@ -1083,8 +1088,8 @@ public class WtInfoPushService {
                     msls.add("JCWD");//机舱温度
                     msls.add("JCWWD");//机舱外温度
                     msls.add("FDJHHWD");//发电机滑环温度
-                    
-                    
+
+
                     initialpoint(id, zbls, keyls, namemap,uids,msls);
 /*******************************************************************************************************************************************************/
 
@@ -1140,168 +1145,168 @@ public class WtInfoPushService {
         return vos;
     }
 
-	public List<Map<String, Object>> findInverterInfoList(String wpId) throws Exception {
-		List<Map<String, Object>> vos = new ArrayList<>();
-		if (StringUtils.notEmp(wpId) && InitialRunner.wp_wtmap.containsKey(wpId)) {
-			List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wpId);
-			for (Windturbine wt : wtls) {
-				Map<String, Object> map = new HashMap<String, Object>();
-				map.put("model", wt.getModelid());
-				map.put("wpid", wt.getWindpowerstationid());
-				map.put("pjid", wt.getProjectid());
-				map.put("lnid", wt.getLineid());
-				map.put("code", wt.getCode());
-				map.put("wtId", wt.getId());
-				
-				Line ln = InitialRunner.lnmap.get(wt.getLineid());
-				map.put("lnname", ln.getName());
-				List<String> zbls = new ArrayList<>();
-				
-				String[] codeName[] = { 
-						{ "JSSSFS", "光照强度"}, 
-						{ "AI130", "有功功率"}, 
-						{ "AI067", "功率因数"}, 
-						{ "AIG071", "机内温度"}, 
-						{ "AIG072", "逆变效率" }, 
-						{ "AI130", "功率"},
-						{ "AIG104", "功率因数" }, 
-						{ "RFDL", "日发电量" }, 
-						{ "YFDL", "月发电量" }, 
-						{ "NFDL", "年发电量" }, 
-						{ "AIG064", "累计发电量" }
-				};
-				// 遍历定义码,获取测点Id集合
-				Map<String, String> pointUniformMap = Maps.newHashMap();
-				for (String[] str1 : codeName) {
-					String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), str1[0]).getCode();
-					zbls.add(pointid);
-					pointUniformMap.put(pointid, str1[0]);
-				}
-				// 获取测点值,与定义码绑定
-				List<PointData> zblist = realApiUtil.getRealData(zbls);
+    public List<Map<String, Object>> findInverterInfoList(String wpId) throws Exception {
+        List<Map<String, Object>> vos = new ArrayList<>();
+        if (StringUtils.notEmp(wpId) && InitialRunner.wp_wtmap.containsKey(wpId)) {
+            List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wpId);
+            for (Windturbine wt : wtls) {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("model", wt.getModelid());
+                map.put("wpid", wt.getWindpowerstationid());
+                map.put("pjid", wt.getProjectid());
+                map.put("lnid", wt.getLineid());
+                map.put("code", wt.getCode());
+                map.put("wtId", wt.getId());
+
+                Line ln = InitialRunner.lnmap.get(wt.getLineid());
+                map.put("lnname", ln.getName());
+                List<String> zbls = new ArrayList<>();
+
+                String[] codeName[] = {
+                        { "JSSSFS", "光照强度"},
+                        { "AI130", "有功功率"},
+                        { "AI067", "功率因数"},
+                        { "AIG071", "机内温度"},
+                        { "AIG072", "逆变效率" },
+                        { "AI130", "功率"},
+                        { "AIG104", "功率因数" },
+                        { "RFDL", "日发电量" },
+                        { "YFDL", "月发电量" },
+                        { "NFDL", "年发电量" },
+                        { "AIG064", "累计发电量" }
+                };
+                // 遍历定义码,获取测点Id集合
+                Map<String, String> pointUniformMap = Maps.newHashMap();
+                for (String[] str1 : codeName) {
+                    String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), str1[0]).getCode();
+                    zbls.add(pointid);
+                    pointUniformMap.put(pointid, str1[0]);
+                }
+                // 获取测点值,与定义码绑定
+                List<PointData> zblist = realApiUtil.getRealData(zbls);
 //				Map<String, Object> uniformValueMap = Maps.newHashMap();
 //				uniformValueMap.put("定义码对照", codeName);
-				for (PointData p : zblist) {
-					String ednaId = p.getEdnaId();
-					Double val = MathUtil.twoBit(p.getPointValueInDouble());
-					String uniformCode = pointUniformMap.get(ednaId);
-					map.put(uniformCode, val);
-				}
-				vos.add(map);
-			}
-		}
-		return vos;
-	}
-
-	public Object findInverterDI(String id) throws Exception {
-		List<Windturbinetestingpointnew> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
-		Map<String, String> idName = Maps.newHashMap();
-		List<String> pointids = Lists.newArrayList();
-		for (Windturbinetestingpointnew point : pointList) {
-			idName.put(point.getCode(), point.getName());
-			pointids.add(point.getCode());
-		}
-		List<PointData> realData = realApiUtil.getRealData(pointids);
-		List<Object> onList = Lists.newArrayList();
-		List<Object> allList = Lists.newArrayList();
-		for (PointData p : realData) {
-			Map<String, Object> row = Maps.newHashMap();
-			row.put("id", p.getEdnaId());
-			row.put("name", idName.get(p.getEdnaId()));
-			row.put("value", p.getPointValueInDouble());
-			allList.add(row);
-			if (1 == p.getPointValueInDouble()) {
-				onList.add(row);
-			}
-		}
-		Map<String, Object> map = Maps.newHashMap();
-		map.put("allList", allList);
-		map.put("onList", onList);
-		return map;
-	}
-
-	public List<Object> findInverterPowerCurve(String id) throws Exception {
-		List<Object> list = Lists.newArrayList();
-		Date now = new Date();
-		Date date = DateUtil.beginOfDay(now);
-		String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, "AI130").getCode();
-		while (date.before(now)) {
-			Date begin = DateUtils.addMinutes(date, -30);
-			List<PointData> histStat = realApiUtil.getHistStat(pointid, begin.getTime() / 1000, date.getTime() / 1000, 1L, 30L * 60, 0);
-			Double val = 0D;
-			if (histStat != null && !histStat.isEmpty() && histStat.get(0) != null) {
-				val = histStat.get(0).getPointValueInDouble();
-				val = MathUtil.twoBit(val);
-			}
-			list.add(val);
-			date = DateUtils.addMinutes(date, 30);
-		}
-		return list;
-	}
-
-	public List<Object> findInverterInfo(String id) throws Exception {
-		Map<String, Object> map = new HashMap<String, Object>();
-		if (StringUtils.notEmp(id)) {
-			if (InitialRunner.wtmap.containsKey(id)) {
-				Windturbine wt = InitialRunner.wtmap.get(id);
-				map.put("model", wt.getModelid());
-				map.put("wpid", wt.getWindpowerstationid());
-				map.put("pjid", wt.getProjectid());
-				map.put("lnid", wt.getLineid());
-				map.put("code", wt.getCode());
-				Line ln = InitialRunner.lnmap.get(wt.getLineid());
-				map.put("lnname", ln.getName());
-				List<String> zbls = new ArrayList<>();
-				String[] codeName[] = {
-						{"AIG061", "交流电压","V"},
-						{"AIG081", "直流电压","V"},
-						{"AIG060", "交流电流","A"},
-						{"AIG078", "直流电流","A"},
-						{"AIG073", "电网频率","Hz"},
-						{"AI130", "功率","W"},
-						{"AIG104", "功率因数",""},
-						{"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
-						{"YFDL", "月发电量","kwh"},
-						{"NFDL", "年发电量","kwh"},
-						{"AIG064", "累计发电量","kwh"},
-						{"AIG071", "逆变器温度","℃"},
-						{"AIG072", "效率",""},
-						{"eyht", "累计二氧化碳减排量","kg"}
-				};
-				// 遍历定义码,获取测点Id集合
-				Map<String, String> pointUniformMap = Maps.newHashMap();
-				for (String[] str1 : codeName) {
-					String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, str1[0]).getCode();
-					zbls.add(pointid);
-					pointUniformMap.put(pointid, str1[0]);
-				}
-				// 获取测点值,与定义码绑定
-				List<PointData> zblist = realApiUtil.getRealData(zbls);
-				Map<String, Object> uniformValueMap = Maps.newHashMap();
-				for (PointData p : zblist) {
-					String ednaId = p.getEdnaId();
-					Double val = MathUtil.twoBit(p.getPointValueInDouble());
-					String uniformCode = pointUniformMap.get(ednaId);
-					uniformValueMap.put(uniformCode, val);
-				}
-				// 遍历定义码,添加测点值、单位、名称
-				List<Object> list = Lists.newArrayList();
-				for (String[] str1 : codeName) {
-					list.add(buildResult(str1[0], str1[1], uniformValueMap.get(str1[0]), str1[2]));
-				}
-				return list;
-			}
-		}
-		return Lists.newArrayList();
-	}
-
-	private Map<String, Object> buildResult(String uniCode, String name, Object value, String unit) {
-		Map<String, Object> map = Maps.newHashMap();
-		map.put("uniCode", uniCode);
-		map.put("name", name);
-		map.put("value", value);
-		map.put("unit", unit);
-		return map;
-	}
+                for (PointData p : zblist) {
+                    String ednaId = p.getEdnaId();
+                    Double val = MathUtil.twoBit(p.getPointValueInDouble());
+                    String uniformCode = pointUniformMap.get(ednaId);
+                    map.put(uniformCode, val);
+                }
+                vos.add(map);
+            }
+        }
+        return vos;
+    }
+
+    public Object findInverterDI(String id) throws Exception {
+        List<Windturbinetestingpointnew> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
+        Map<String, String> idName = Maps.newHashMap();
+        List<String> pointids = Lists.newArrayList();
+        for (Windturbinetestingpointnew point : pointList) {
+            idName.put(point.getCode(), point.getName());
+            pointids.add(point.getCode());
+        }
+        List<PointData> realData = realApiUtil.getRealData(pointids);
+        List<Object> onList = Lists.newArrayList();
+        List<Object> allList = Lists.newArrayList();
+        for (PointData p : realData) {
+            Map<String, Object> row = Maps.newHashMap();
+            row.put("id", p.getEdnaId());
+            row.put("name", idName.get(p.getEdnaId()));
+            row.put("value", p.getPointValueInDouble());
+            allList.add(row);
+            if (1 == p.getPointValueInDouble()) {
+                onList.add(row);
+            }
+        }
+        Map<String, Object> map = Maps.newHashMap();
+        map.put("allList", allList);
+        map.put("onList", onList);
+        return map;
+    }
+
+    public List<Object> findInverterPowerCurve(String id) throws Exception {
+        List<Object> list = Lists.newArrayList();
+        Date now = new Date();
+        Date date = DateUtil.beginOfDay(now);
+        String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, "AI130").getCode();
+        while (date.before(now)) {
+            Date begin = DateUtils.addMinutes(date, -30);
+            List<PointData> histStat = realApiUtil.getHistStat(pointid, begin.getTime() / 1000, date.getTime() / 1000, 1L, 30L * 60, 0);
+            Double val = 0D;
+            if (histStat != null && !histStat.isEmpty() && histStat.get(0) != null) {
+                val = histStat.get(0).getPointValueInDouble();
+                val = MathUtil.twoBit(val);
+            }
+            list.add(val);
+            date = DateUtils.addMinutes(date, 30);
+        }
+        return list;
+    }
+
+    public List<Object> findInverterInfo(String id) throws Exception {
+        Map<String, Object> map = new HashMap<String, Object>();
+        if (StringUtils.notEmp(id)) {
+            if (InitialRunner.wtmap.containsKey(id)) {
+                Windturbine wt = InitialRunner.wtmap.get(id);
+                map.put("model", wt.getModelid());
+                map.put("wpid", wt.getWindpowerstationid());
+                map.put("pjid", wt.getProjectid());
+                map.put("lnid", wt.getLineid());
+                map.put("code", wt.getCode());
+                Line ln = InitialRunner.lnmap.get(wt.getLineid());
+                map.put("lnname", ln.getName());
+                List<String> zbls = new ArrayList<>();
+                String[] codeName[] = {
+                        {"AIG061", "交流电压","V"},
+                        {"AIG081", "直流电压","V"},
+                        {"AIG060", "交流电流","A"},
+                        {"AIG078", "直流电流","A"},
+                        {"AIG073", "电网频率","Hz"},
+                        {"AI130", "功率","W"},
+                        {"AIG104", "功率因数",""},
+                        {"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
+                        {"YFDL", "月发电量","kwh"},
+                        {"NFDL", "年发电量","kwh"},
+                        {"AIG064", "累计发电量","kwh"},
+                        {"AIG071", "逆变器温度","℃"},
+                        {"AIG072", "效率",""},
+                        {"eyht", "累计二氧化碳减排量","kg"}
+                };
+                // 遍历定义码,获取测点Id集合
+                Map<String, String> pointUniformMap = Maps.newHashMap();
+                for (String[] str1 : codeName) {
+                    String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, str1[0]).getCode();
+                    zbls.add(pointid);
+                    pointUniformMap.put(pointid, str1[0]);
+                }
+                // 获取测点值,与定义码绑定
+                List<PointData> zblist = realApiUtil.getRealData(zbls);
+                Map<String, Object> uniformValueMap = Maps.newHashMap();
+                for (PointData p : zblist) {
+                    String ednaId = p.getEdnaId();
+                    Double val = MathUtil.twoBit(p.getPointValueInDouble());
+                    String uniformCode = pointUniformMap.get(ednaId);
+                    uniformValueMap.put(uniformCode, val);
+                }
+                // 遍历定义码,添加测点值、单位、名称
+                List<Object> list = Lists.newArrayList();
+                for (String[] str1 : codeName) {
+                    list.add(buildResult(str1[0], str1[1], uniformValueMap.get(str1[0]), str1[2]));
+                }
+                return list;
+            }
+        }
+        return Lists.newArrayList();
+    }
+
+    private Map<String, Object> buildResult(String uniCode, String name, Object value, String unit) {
+        Map<String, Object> map = Maps.newHashMap();
+        map.put("uniCode", uniCode);
+        map.put("name", name);
+        map.put("value", value);
+        map.put("unit", unit);
+        return map;
+    }
 
 }

+ 210 - 0
web/monitor-hb/src/main/resources/application-hb.yml

@@ -0,0 +1,210 @@
+# 项目相关配置
+gyee:
+  #名称
+  name: v2
+  #版本
+  version: 3.9
+  #版权年份
+  copyrightYear: 2020
+  #文件上传路径
+  defaultBaseDir: D:/v2file/
+  #地址是否放入项目static目录,如果未Y 放入项目得static。 profile配置失效。  为N存放在D:/v2file/ 前端读取相同,不受影响
+  isstatic: Y
+  #开启存放静态文件夹后目录
+  isroot_dir: static/file_upload/
+  #邮件功能
+  #邮箱发送smtp
+  email_smtp: smtp.sina.com
+  #邮箱发送端口
+  email_port: 465
+  #发送邮箱登录账号
+  email_account: gyee@163.com
+  #发送邮箱登录密码
+  email_password: 1
+  #实例演示开关 启动该模式删除增加修改会弹出演示模式提示框
+  demoEnabled: false
+  #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
+  rollVerification: true
+  #实时数据库Url
+  baseurl: http://192.168.2.198:8011/ts
+
+  #API访问ip
+  #swaggerip: 49.4.50.80:8082
+  swaggerip: 192.168.2.198:8082
+  #默认小数位数
+  digit: 2
+  realtimedataBase: golden #数据查询模式 golden、hwy
+  weatherurl: http://192.168.2.198:7011
+  weatherqygs: hb_qygs
+  hbmaps: {CL_FDC_KEY: 2003,KB_FDC_KEY: 1460,DX_FDC_KEY: 2186,SY_FDC_KEY: 1366}
+  initialcode: INITIAL
+#tomcat config
+server :
+  port : 8171
+  session:
+    timeout: 7200
+  ##项目名字配置
+  #servlet :
+  #  context-path : /demo
+  tomcat :
+    maxHttpHeaderSize : 8192
+    max-threads : 128
+    min-spare-threads : 5
+    uri-encoding : UTF-8
+    #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-form-post-size: 9000000
+#dev环境  mysql7.0
+spring :
+  application:
+    name: monitor-hb-provider
+    cloud:
+      nacos:
+        discovery:
+          server-addr: 192.168.2.198:8848
+          #指定yaml格式的配置
+          file-extension: yaml
+          cluster-name: master
+        username: nacos
+        password: nacos
+    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
+    #include: ftpHX,ftpCloud
+  servlet:
+    multipart:
+      #设置总上传的数据大小
+      max-request-size: 100MB
+      #单个文件大小
+      maxFileSize : 30MB
+      #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-post-size: 9000000
+  #热部署模块
+  devtools:
+    restart:
+      #热部署开关
+      enabled: true
+      #指定热部署的目录
+      additional-paths: src/main/java
+      #指定目录不更新
+      exclude: test/**
+
+  redis:
+    database: 19
+    host: 192.168.2.194
+    password:
+    pool:
+      maxTotal: 20
+      maxIdle: 20
+      maxwait: 600000
+      minIdle: 10
+    port: 6379
+    timeout: 600000
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.jdbc.Driver
+    #druid连接池配置
+    druid:
+      #主库数据源
+      master:
+        url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+        username: gdprod
+        password: gd123
+        driver-class-name: oracle.jdbc.driver.OracleDriver
+      #备数据源 #关闭
+      slave:
+        enabled: false
+        url: jdbc:mysql://localhost:3306/springbootv3?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
+        username: root
+        password: root
+        #两票数据源
+      ticket:
+        url: jdbc:sqlserver://192.168.2.200:1434;DatabaseName=fdeamnew
+
+        username: sa
+        password: ibs
+        driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #配置初始化连接数大小
+      initial-size: 10
+      # 最大连接数
+      max-active: 50
+      #最小连接数
+      min-idle: 10
+      #获取连接等待超时时间
+      max-wait: 5000
+      pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+      max-pool-prepared-statement-per-connection-size: 20
+      validation-query: SELECT 1 FROM DUAL
+      validation-query-timeout: 20000
+      test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+      time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+      #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #可以增加访问账号密码【去掉注释就可以】
+        #login-username: admin
+        #login-password: admin
+      filter:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+
+#mysql 8.0
+
+#spring:
+#  datasource:
+#    type: com.alibaba.druid.pool.DruidDataSource
+#    driverClassName: com.mysql.cj.jdbc.Driver
+#    #druid连接池配置
+#    druid:
+#     # 主库数据源
+#     master:
+#        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #树熊数据源
+#     slave:
+#        enabled : false
+#        url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #配置初始化连接数大小
+#     initial-size: 10
+#     # 最大连接数
+#     max-active: 50
+#     #最小连接数
+#     min-idle: 10
+#     #获取连接等待超时时间
+#     max-wait: 5000
+#     pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+#     max-pool-prepared-statement-per-connection-size: 20
+#     validation-query: SELECT 1 FROM DUAL
+#     validation-query-timeout: 20000
+#     test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+#     time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+#     min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+#     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+#     stat-view-servlet:
+#      enabled: true
+#      url-pattern: /druid/*
+#      #可以增加访问账号密码【去掉注释就可以】
+#      #login-username: admin
+#      #login-password: admin
+#     filter:
+#      stat:
+#        log-slow-sql: true
+#        slow-sql-millis: 1000
+#        merge-sql: true
+#      wall:
+#        config:
+#          multi-statement-allow: true

+ 212 - 0
web/monitor-hb/src/main/resources/application-hf.yml

@@ -0,0 +1,212 @@
+# 项目相关配置
+gyee:
+  #名称
+  name: v2
+  #版本
+  version: 3.9
+  #版权年份
+  copyrightYear: 2020
+  #文件上传路径
+  defaultBaseDir: D:/v2file/
+  #地址是否放入项目static目录,如果未Y 放入项目得static。 profile配置失效。  为N存放在D:/v2file/ 前端读取相同,不受影响
+  isstatic: Y
+  #开启存放静态文件夹后目录
+  isroot_dir: static/file_upload/
+  #邮件功能
+  #邮箱发送smtp
+  email_smtp: smtp.sina.com
+  #邮箱发送端口
+  email_port: 465
+  #发送邮箱登录账号
+  email_account: gyee@163.com
+  #发送邮箱登录密码
+  email_password: 1
+  #实例演示开关 启动该模式删除增加修改会弹出演示模式提示框
+  demoEnabled: false
+  #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
+  rollVerification: true
+  #实时数据库Url
+  baseurl: http://10.0.118.76:8011/ts
+
+  #API访问ip
+  #swaggerip: 49.4.50.80:8082
+  swaggerip: 10.155.32.4:8082
+  #默认小数位数
+  digit: 2
+  realtimedataBase: golden #数据查询模式 golden、hwy
+  #weatherurl: http://123.60.213.70:7011
+  weatherurl: http://10.0.118.76: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}
+  initialcode: INITIAL
+#tomcat config
+server :
+  port : 8171
+  session:
+    timeout: 7200
+  ##项目名字配置
+  #servlet :
+  #  context-path : /demo
+  tomcat :
+    maxHttpHeaderSize : 8192
+    max-threads : 128
+    min-spare-threads : 5
+    uri-encoding : UTF-8
+    #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-form-post-size: 9000000
+#dev环境  mysql7.0
+spring :
+  application:
+    name: monitor-hb-provider
+    cloud:
+      nacos:
+        discovery:
+          server-addr: 10.0.118.76:8848
+          #指定yaml格式的配置
+          file-extension: yaml
+          cluster-name: master
+        username: nacos
+        password: nacos
+    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
+    #include: ftpHX,ftpCloud
+  servlet:
+    multipart:
+      #设置总上传的数据大小
+      max-request-size: 100MB
+      #单个文件大小
+      maxFileSize : 30MB
+      #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-post-size: 9000000
+  #热部署模块
+  devtools:
+    restart:
+      #热部署开关
+      enabled: true
+      #指定热部署的目录
+      additional-paths: src/main/java
+      #指定目录不更新
+      exclude: test/**
+
+  redis:
+    database: 1
+    host: 10.0.118.73
+    password:
+    pool:
+      maxTotal: 20
+      maxIdle: 20
+      maxwait: 600000
+      minIdle: 10
+    port: 6379
+    timeout: 600000
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.jdbc.Driver
+    #druid连接池配置
+    druid:
+      #主库数据源
+      master:
+        url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+        username: gdprod
+        password: gd123
+        driver-class-name: oracle.jdbc.driver.OracleDriver
+
+      #备数据源 #关闭
+      slave:
+        enabled: false
+        url: jdbc:mysql://localhost:3306/springbootv3?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
+        username: root
+        password: root
+        #两票数据源
+      ticket:
+        url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
+        username: sa
+        password: Gd!123456
+        driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #配置初始化连接数大小
+      initial-size: 10
+      # 最大连接数
+      max-active: 50
+      #最小连接数
+      min-idle: 10
+      #获取连接等待超时时间
+      max-wait: 5000
+      pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+      max-pool-prepared-statement-per-connection-size: 20
+      validation-query: SELECT 1 FROM DUAL
+      validation-query-timeout: 20000
+      test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+      time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+      #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #可以增加访问账号密码【去掉注释就可以】
+        #login-username: admin
+        #login-password: admin
+      filter:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+
+#mysql 8.0
+
+#spring:
+#  datasource:
+#    type: com.alibaba.druid.pool.DruidDataSource
+#    driverClassName: com.mysql.cj.jdbc.Driver
+#    #druid连接池配置
+#    druid:
+#     # 主库数据源
+#     master:
+#        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #树熊数据源
+#     slave:
+#        enabled : false
+#        url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #配置初始化连接数大小
+#     initial-size: 10
+#     # 最大连接数
+#     max-active: 50
+#     #最小连接数
+#     min-idle: 10
+#     #获取连接等待超时时间
+#     max-wait: 5000
+#     pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+#     max-pool-prepared-statement-per-connection-size: 20
+#     validation-query: SELECT 1 FROM DUAL
+#     validation-query-timeout: 20000
+#     test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+#     time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+#     min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+#     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+#     stat-view-servlet:
+#      enabled: true
+#      url-pattern: /druid/*
+#      #可以增加访问账号密码【去掉注释就可以】
+#      #login-username: admin
+#      #login-password: admin
+#     filter:
+#      stat:
+#        log-slow-sql: true
+#        slow-sql-millis: 1000
+#        merge-sql: true
+#      wall:
+#        config:
+#          multi-statement-allow: true

+ 209 - 0
web/monitor-hb/src/main/resources/application-hwy.yml

@@ -0,0 +1,209 @@
+# 项目相关配置
+gyee:
+  #名称
+  name: v2
+  #版本
+  version: 3.9
+  #版权年份
+  copyrightYear: 2020
+  #文件上传路径
+  defaultBaseDir: D:/v2file/
+  #地址是否放入项目static目录,如果未Y 放入项目得static。 profile配置失效。  为N存放在D:/v2file/ 前端读取相同,不受影响
+  isstatic: Y
+  #开启存放静态文件夹后目录
+  isroot_dir: static/file_upload/
+  #邮件功能
+  #邮箱发送smtp
+  email_smtp: smtp.sina.com
+  #邮箱发送端口
+  email_port: 465
+  #发送邮箱登录账号
+  email_account: gyee@163.com
+  #发送邮箱登录密码
+  email_password: 1
+  #实例演示开关 启动该模式删除增加修改会弹出演示模式提示框
+  demoEnabled: false
+  #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
+  rollVerification: true
+  #实时数据库Url
+  baseurl: http://123.60.213.70:8011/ts
+
+  #API访问ip
+  swaggerip: 123.60.213.70:8082
+  #默认小数位数
+  digit: 2
+  realtimedataBase: golden #数据查询模式 golden、hwy
+  weatherurl: http://123.60.213.70:7011
+  weatherqygs: hb_qygs
+  hbmaps: {CL_FDC_KEY: 2003,KB_FDC_KEY: 1460,DX_FDC_KEY: 2186,SY_FDC_KEY: 1366}
+  initialcode: INITIAL
+#tomcat config
+server :
+  port : 8171
+  session:
+    timeout: 7200
+  ##项目名字配置
+  #servlet :
+  #  context-path : /demo
+  tomcat :
+    maxHttpHeaderSize : 8192
+    max-threads : 128
+    min-spare-threads : 5
+    uri-encoding : UTF-8
+    #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-form-post-size: 9000000
+#dev环境  mysql7.0
+spring :
+  application:
+    name: monitor-hb-provider
+    cloud:
+      nacos:
+        discovery:
+          server-addr: 123.60.213.70:8848
+          #指定yaml格式的配置
+          file-extension: yaml
+          cluster-name: master
+        username: nacos
+        password: nacos
+    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
+    #include: ftpHX,ftpCloud
+  servlet:
+    multipart:
+      #设置总上传的数据大小
+      max-request-size: 100MB
+      #单个文件大小
+      maxFileSize : 30MB
+      #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-post-size: 9000000
+  #热部署模块
+  devtools:
+    restart:
+      #热部署开关
+      enabled: true
+      #指定热部署的目录
+      additional-paths: src/main/java
+      #指定目录不更新
+      exclude: test/**
+
+  redis:
+    database: 1
+    host: 192.168.2.202
+    password: gdnxfd123
+    pool:
+      maxTotal: 20
+      maxIdle: 20
+      maxwait: 600000
+      minIdle: 10
+    port: 6379
+    timeout: 600000
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.jdbc.Driver
+    #druid连接池配置
+    druid:
+      #主库数据源
+      master:
+        url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+        username: nxfdprod
+        password: gdnxfd123
+        driver-class-name: oracle.jdbc.driver.OracleDriver
+
+      #备数据源 #关闭
+      slave:
+        enabled: false
+        url: jdbc:mysql://localhost:3306/springbootv3?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
+        username: root
+        password: root
+        #两票数据源
+      ticket:
+        url: jdbc:sqlserver://123.60.213.70:1434;DatabaseName=fdeamnew
+        username: sa
+        password: Gyee@321#!
+        driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #配置初始化连接数大小
+      initial-size: 10
+      # 最大连接数
+      max-active: 50
+      #最小连接数
+      min-idle: 10
+      #获取连接等待超时时间
+      max-wait: 5000
+      pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+      max-pool-prepared-statement-per-connection-size: 20
+      validation-query: SELECT 1 FROM DUAL
+      validation-query-timeout: 20000
+      test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+      time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+      #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #可以增加访问账号密码【去掉注释就可以】
+        #login-username: admin
+        #login-password: admin
+      filter:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+
+#mysql 8.0
+
+#spring:
+#  datasource:
+#    type: com.alibaba.druid.pool.DruidDataSource
+#    driverClassName: com.mysql.cj.jdbc.Driver
+#    #druid连接池配置
+#    druid:
+#     # 主库数据源
+#     master:
+#        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #树熊数据源
+#     slave:
+#        enabled : false
+#        url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #配置初始化连接数大小
+#     initial-size: 10
+#     # 最大连接数
+#     max-active: 50
+#     #最小连接数
+#     min-idle: 10
+#     #获取连接等待超时时间
+#     max-wait: 5000
+#     pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+#     max-pool-prepared-statement-per-connection-size: 20
+#     validation-query: SELECT 1 FROM DUAL
+#     validation-query-timeout: 20000
+#     test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+#     time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+#     min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+#     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+#     stat-view-servlet:
+#      enabled: true
+#      url-pattern: /druid/*
+#      #可以增加访问账号密码【去掉注释就可以】
+#      #login-username: admin
+#      #login-password: admin
+#     filter:
+#      stat:
+#        log-slow-sql: true
+#        slow-sql-millis: 1000
+#        merge-sql: true
+#      wall:
+#        config:
+#          multi-statement-allow: true

+ 212 - 0
web/monitor-hb/src/main/resources/application-jn.yml

@@ -0,0 +1,212 @@
+# 项目相关配置
+gyee:
+  #名称
+  name: v2
+  #版本
+  version: 3.9
+  #版权年份
+  copyrightYear: 2020
+  #文件上传路径
+  defaultBaseDir: D:/v2file/
+  #地址是否放入项目static目录,如果未Y 放入项目得static。 profile配置失效。  为N存放在D:/v2file/ 前端读取相同,不受影响
+  isstatic: Y
+  #开启存放静态文件夹后目录
+  isroot_dir: static/file_upload/
+  #邮件功能
+  #邮箱发送smtp
+  email_smtp: smtp.sina.com
+  #邮箱发送端口
+  email_port: 465
+  #发送邮箱登录账号
+  email_account: gyee@163.com
+  #发送邮箱登录密码
+  email_password: 1
+  #实例演示开关 启动该模式删除增加修改会弹出演示模式提示框
+  demoEnabled: false
+  #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
+  rollVerification: true
+  #实时数据库Url
+  baseurl: http://10.81.3.155:8011/ts
+
+  #API访问ip
+  #swaggerip: 49.4.50.80:8082
+  swaggerip: 10.81.3.155:8082
+  #默认小数位数
+  digit: 2
+  realtimedataBase: golden #数据查询模式 golden、hwy
+  weatherurl: http://10.81.3.155:7011
+  weatherqygs: hb_qygs
+  hbmaps: {CL_FDC_KEY: 2003,KB_FDC_KEY: 1460,DX_FDC_KEY: 2186,SY_FDC_KEY: 1366}
+  initialcode: INITIAL
+#tomcat config
+server :
+  port : 8171
+  session:
+    timeout: 7200
+  ##项目名字配置
+  #servlet :
+  #  context-path : /demo
+  tomcat :
+    maxHttpHeaderSize : 8192
+    max-threads : 128
+    min-spare-threads : 5
+    uri-encoding : UTF-8
+    #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-form-post-size: 9000000
+#dev环境  mysql7.0
+spring :
+  application:
+    name: monitor-hb-provider
+    cloud:
+      nacos:
+        discovery:
+          server-addr: 10.81.3.155:8848
+          #指定yaml格式的配置
+          file-extension: yaml
+          cluster-name: master
+        username: nacos
+        password: nacos
+    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
+    #include: ftpHX,ftpCloud
+  servlet:
+    multipart:
+      #设置总上传的数据大小
+      max-request-size: 100MB
+      #单个文件大小
+      maxFileSize : 30MB
+      #shiro 报错修改的地方
+    max-connections: 200000
+    max-http-post-size: 9000000
+  #热部署模块
+  devtools:
+    restart:
+      #热部署开关
+      enabled: true
+      #指定热部署的目录
+      additional-paths: src/main/java
+      #指定目录不更新
+      exclude: test/**
+
+  redis:
+    database: 0
+    host: 10.81.3.155
+    password:
+    pool:
+      maxTotal: 20
+      maxIdle: 20
+      maxwait: 600000
+      minIdle: 10
+    port: 6379
+    timeout: 600000
+  datasource:
+    #type: com.alibaba.druid.pool.DruidDataSource
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.jdbc.Driver
+    #druid连接池配置
+    druid:
+      #主库数据源
+      master:
+        url: jdbc:postgresql://10.81.3.151:5432/wisdom
+        username: gdprod
+        password: gd123
+        driver-class-name: org.postgresql.Driver
+      #备数据源 #关闭
+      slave:
+#        enabled: false
+#        url: jdbc:mysql://localhost:3306/springbootv3?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=UTC
+#        username: root
+#        password: root
+        #两票数据源
+      ticket:
+#        url: jdbc:sqlserver://192.168.2.200:1434;DatabaseName=fdeamnew
+#        #url: jdbc:sqlserver://10.83.68.98:1434;DatabaseName=fdeamnew
+#        #url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
+#        username: sa
+#        password: ibs
+#        #password: Gd!123456
+#        driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+        #配置初始化连接数大小
+      initial-size: 10
+      # 最大连接数
+      max-active: 50
+      #最小连接数
+      min-idle: 10
+      #获取连接等待超时时间
+      max-wait: 5000
+      pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+      max-pool-prepared-statement-per-connection-size: 20
+      validation-query: SELECT 1 FROM DUAL
+      validation-query-timeout: 20000
+      test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+      test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+      time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+      #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        #可以增加访问账号密码【去掉注释就可以】
+        #login-username: admin
+        #login-password: admin
+      filter:
+        stat:
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: false
+        wall:
+          config:
+            multi-statement-allow: true
+
+#mysql 8.0
+
+#spring:
+#  datasource:
+#    type: com.alibaba.druid.pool.DruidDataSource
+#    driverClassName: com.mysql.cj.jdbc.Driver
+#    #druid连接池配置
+#    druid:
+#     # 主库数据源
+#     master:
+#        url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #树熊数据源
+#     slave:
+#        enabled : false
+#        url: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&autoReconnect=true&useSSL=false
+#        username: root
+#        password: root
+#        #配置初始化连接数大小
+#     initial-size: 10
+#     # 最大连接数
+#     max-active: 50
+#     #最小连接数
+#     min-idle: 10
+#     #获取连接等待超时时间
+#     max-wait: 5000
+#     pool-prepared-statements: true #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
+#     max-pool-prepared-statement-per-connection-size: 20
+#     validation-query: SELECT 1 FROM DUAL
+#     validation-query-timeout: 20000
+#     test-on-borrow: false #申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-on-return: false #归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
+#     test-while-idle: true #建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
+#     time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+#     min-evictable-idle-time-millis: 300000  #一个连接在池中最小生存的时间,单位是毫秒
+#     #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
+#     stat-view-servlet:
+#      enabled: true
+#      url-pattern: /druid/*
+#      #可以增加访问账号密码【去掉注释就可以】
+#      #login-username: admin
+#      #login-password: admin
+#     filter:
+#      stat:
+#        log-slow-sql: true
+#        slow-sql-millis: 1000
+#        merge-sql: true
+#      wall:
+#        config:
+#          multi-statement-allow: true

+ 4 - 128
web/monitor-hb/src/main/resources/application.yml

@@ -1,131 +1,7 @@
-# 项目相关配置
-gyee:
-  #名称
-  name: v2
-  #版本
-  version: 3.9
-  #版权年份
-  copyrightYear: 2020
-  #文件上传路径
-  defaultBaseDir: D:/v2file/
-  #地址是否放入项目static目录,如果未Y 放入项目得static。 profile配置失效。  为N存放在D:/v2file/ 前端读取相同,不受影响
-  isstatic: Y
-  #开启存放静态文件夹后目录
-  isroot_dir: static/file_upload/
-  #邮件功能
-  #邮箱发送smtp
-  email_smtp: smtp.sina.com
-  #邮箱发送端口
-  email_port: 465
-  #发送邮箱登录账号
-  email_account: gyee@163.com
-  #发送邮箱登录密码
-  email_password: 1
-  #实例演示开关 启动该模式删除增加修改会弹出演示模式提示框
-  demoEnabled: false
-  #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
-  rollVerification: true
-  #实时数据库Url
-  #baseurl: http://10.0.118.73:8011/ts
-  #baseurl: http://10.83.68.97:8011/ts
-  baseurl: http://192.168.2.198:8011/ts
-
-  #API访问ip
-  #swaggerip: 49.4.50.80:8082
-  swaggerip: 10.155.32.4:8082
-  #默认小数位数
-  digit: 2
-  realtimedataBase: golden #数据查询模式 golden、hwy
-  #weatherurl: http://123.60.213.70:7011
-  weatherurl: http://192.168.2.198: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}
-  initialcode: INITIAL
-#tomcat config
-server :
-  port : 8171
-  session:
-    timeout: 7200
-  ##项目名字配置
-  #servlet :
-  #  context-path : /demo
-  tomcat :
-    maxHttpHeaderSize : 8192
-    max-threads : 128
-    min-spare-threads : 5
-    uri-encoding : UTF-8
-    #shiro 报错修改的地方
-    max-connections: 200000
-    max-http-form-post-size: 9000000
-spring :
-  # 环境 dev|test|prod
-  profiles :
-    active : dev
-  application:
-    name: monitor-hb-provider
-    cloud:
-      nacos:
-        discovery:
-          #server-addr: 192.168.56.1:8848
-          server-addr: 192.168.2.198:8848
-          #server-addr: 10.83.68.97:8848
-          #指定yaml格式的配置
-          file-extension: yaml
-          cluster-name: master
-        username: nacos
-        password: nacos
-    #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
-    #include: ftpHX,ftpCloud
-  servlet:
-    multipart:
-      #设置总上传的数据大小
-      max-request-size: 100MB
-      #单个文件大小
-      maxFileSize : 30MB
-      #shiro 报错修改的地方
-    max-connections: 200000
-    max-http-post-size: 9000000
-  #热部署模块
-  devtools:
-    restart:
-      #热部署开关
-      enabled: true
-      #指定热部署的目录
-      additional-paths: src/main/java
-      #指定目录不更新
-      exclude: test/**
-
-  redis:
-    database: 19
-    host: 192.168.2.202
-    #host: 10.83.68.94
-    #host: 10.0.118.73
-    password:
-    pool:
-      maxTotal: 20
-      maxIdle: 20
-      maxwait: 600000
-      minIdle: 10
-    port: 6379
-    timeout: 600000
-#mybatis:
-#  #配置mapper的扫描,找到所有的mapper.xml映射文件
-#  mapperLocations : classpath*:mybatis/*/*.xml
-#  #mybatis提供三种sql执行器,分别是SIMPLE、REUSE、BATCH。
-#  executor-type : reuse
-#  #搜索指定包别名
-#  typeAliasesPackage : com.*.model
-#  #该配置项就是指将带有下划线的表字段映射为驼峰格式的实体类属性。
-#  configuration :
-#    map-underscore-to-camel-case : true
-#mybatis:
-#  configuration:
-#    #开启MyBatis的二级缓存
-#    cache-enabled: false
-#pagehelper分页插件
-
-
+spring:
+  profiles:
+    active: hb
+#    active: jn
 asyncThreadPool:
   # 核心线程池大小
   corePoolSize: 15

+ 24 - 0
web/monitor-hb/src/main/resources/mybatis/auto/AlarmsnapMapper.xml

@@ -525,4 +525,28 @@
 
   </select>
 
+
+    <select id="getWarningRecordsTop" resultType="com.gyee.frame.model.custom.SawVo">
+
+
+
+        select row_number() over (order by count(*) desc) num,b.alerttext name,count(*) frequency from ${tname} a,alarmsnap b
+        where a.snapid = b.id and category1='windturbine'
+
+        and b.windturbineid='${wtId}'
+        and a.alerttime>= to_date('${beginDate}','YYYY-MM-DD HH24:MI:SS') and a.alerttime &lt; to_date('${endDate}','YYYY-MM-DD HH24:MI:SS')
+
+        group by  b.windturbineid,b.alerttext order by c desc
+    </select>
+
+
+    <select id="getWarningRecordsList" resultType="com.gyee.frame.model.custom.SawVo">
+
+ select  b.alerttext name, a.alerttime time from ${tname} a,alarmsnap b
+        where a.snapid = b.id and category1='windturbine'  and b.windturbineid='${wtId}' order by  a.alerttime desc
+
+
+
+
+    </select>
 </mapper>

+ 6 - 6
web/monitor-hb/src/main/resources/application-dev.yml

@@ -12,8 +12,8 @@ spring:
         #        username: root
         #        password: 123456
 
-        url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
-        #url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+        #url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+        url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
         #url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
         username: gdprod
         password: gd123
@@ -30,12 +30,12 @@ spring:
         password: root
         #两票数据源
       ticket:
-        url: jdbc:sqlserver://192.168.2.200:1434;DatabaseName=fdeamnew
+        #url: jdbc:sqlserver://192.168.2.200:1434;DatabaseName=fdeamnew
         #url: jdbc:sqlserver://10.83.68.98:1434;DatabaseName=fdeamnew
-        #url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
+        url: jdbc:sqlserver://10.0.118.71:1433;DatabaseName=fdeamnew
         username: sa
-        password: ibs
-        #password: Gd!123456
+        #password: ibs
+        password: Gd!123456
         driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
         #配置初始化连接数大小
       initial-size: 10

web/monitor-hb/src/main/resources/application-prod.yml → web/monitor-web-hf/src/main/resources/application-prod.yml