소스 검색

逆变器列表实时信息接口

630 3 년 전
부모
커밋
d55abc7aac

+ 16 - 8
src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java

@@ -1,5 +1,6 @@
 package com.gyee.frame.controller.monitor;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -48,14 +49,21 @@ public class MonitorInverterPushController {
 		return AjaxResult.successData(AjaxStatus.success.code, map);
 	}
 
-//	@PostMapping("/findInverterDI")
-//	@ResponseBody
-//	@ApiOperation(value = "逆变器信息", notes = "逆变器AI点、报警点")
-//	@ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
-//	public AjaxResult findInverterDI(String wtId) throws Exception {
-//		Object list = wtInfoPushService.findInverterDI(wtId);
-//		return AjaxResult.successData(AjaxStatus.success.code, list);
-//	}
+    @PostMapping("/findInverterInfoList")
+    @ResponseBody
+    @ApiOperation(value = "逆变器信息列表", notes = "逆变器信息列表")
+    @ApiImplicitParams({@ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")
+    })
+
+	public AjaxResult findWtInfoList(String wpId) throws Exception {
+		List<Map<String, Object>> vos = new ArrayList<>();
+		vos = wtInfoPushService.findInverterInfoList(wpId);
+		if (null != vos) {
+			return AjaxResult.successData(AjaxStatus.success.code, vos);
+		} else {
+			return AjaxResult.successData(AjaxStatus.error.code, vos);
+		}
+	}
 
 	@PostMapping("/findInverterPowerLine")
 	@ResponseBody

+ 54 - 1
src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -1141,6 +1141,59 @@ 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]).getId();
+					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<WindTurbineTestingPointDi2> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
 		Map<String, String> idName = Maps.newHashMap();
@@ -1208,7 +1261,7 @@ public class WtInfoPushService {
 						{"AIG073", "电网频率","Hz"},
 						{"AI130", "功率","W"},
 						{"AIG104", "功率因数",""},
-						{"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不同意
+						{"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
 						{"YFDL", "月发电量","kwh"},
 						{"NFDL", "年发电量","kwh"},
 						{"AIG064", "累计发电量","kwh"},