|
@@ -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;
|
|
|
+ }
|
|
|
|
|
|
}
|