Prechádzať zdrojové kódy

逆变器DI点列表

wsy 3 rokov pred
rodič
commit
c0030f0e16

+ 9 - 0
src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java

@@ -38,6 +38,15 @@ public class MonitorInverterPushController {
 		return AjaxResult.successData(AjaxStatus.success.code, list);
 	}
 
+	@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("/findInverterPowerLine")
 	@ResponseBody
 	@ApiOperation(value = "逆变器开网频率", notes = "逆变器当日0点至今功率,间隔30分钟")

+ 27 - 4
src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -1141,10 +1141,33 @@ public class WtInfoPushService {
         return vos;
     }
 
-    public List<Object> findInverterDI(String id) throws Exception {
-		return null;
-    }
-    
+	public Object findInverterDI(String id) throws Exception {
+		List<WindTurbineTestingPointDi2> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
+		Map<String, String> idName = Maps.newHashMap();
+		List<String> pointids = Lists.newArrayList();
+		for (WindTurbineTestingPointDi2 point : pointList) {
+			idName.put(point.getId(), point.getName());
+			pointids.add(point.getId());
+		}
+		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();