|
@@ -1,12 +1,23 @@
|
|
|
package com.gyee.alarm.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.gyee.alarm.model.auto.ProBasicEquipment;
|
|
|
+import com.gyee.alarm.model.auto.ProBasicEquipmentPoint;
|
|
|
+import com.gyee.alarm.model.auto.ProBasicPowerstation;
|
|
|
+import com.gyee.alarm.model.auto.ProBasicWindturbinePower;
|
|
|
import com.gyee.alarm.service.DeviceService;
|
|
|
+import com.gyee.alarm.service.auto.IProBasicEquipmentPointService;
|
|
|
+import com.gyee.alarm.service.auto.IProBasicEquipmentService;
|
|
|
+import com.gyee.alarm.service.auto.IProBasicPowerstationService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
|
@RestController
|
|
@@ -17,6 +28,15 @@ public class InfoController {
|
|
|
@Resource
|
|
|
private DeviceService deviceService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IProBasicPowerstationService proBasicPowerstationService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentService proBasicEquipmentService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
+
|
|
|
@GetMapping(value = "/point")
|
|
|
@ResponseBody
|
|
|
public JSONObject getPointList(@RequestParam(value = "deviceId", required = true) String deviceid,
|
|
@@ -34,4 +54,77 @@ public class InfoController {
|
|
|
JSONObject testingPoint = deviceService.getTestingPointByStructCode(deviceid, structCode, windturbineId, pageSize, pageNum);
|
|
|
return testingPoint;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取风场
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/station")
|
|
|
+ @ResponseBody
|
|
|
+ public List<ProBasicPowerstation> getAllWindStation(@RequestParam(value = "id", required = false) String id) {
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ id = "_FDC";
|
|
|
+ }
|
|
|
+ List<ProBasicPowerstation> lst = proBasicPowerstationService.getStationAll(id);
|
|
|
+ return lst;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取风场和光电场
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/station/all")
|
|
|
+ @ResponseBody
|
|
|
+ public List<ProBasicPowerstation> getAllStation(@RequestParam(value = "id", required = false) String id) {
|
|
|
+ List<ProBasicPowerstation> lst = proBasicPowerstationService.getStationAll(id);
|
|
|
+ return lst;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据场站名称查询所有风机编号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/windturbine")
|
|
|
+ @ResponseBody
|
|
|
+ public List<ProBasicEquipment> getWindturbineByStation( @RequestParam(value = "stationId", required = false) String stationId) {
|
|
|
+ List<ProBasicEquipment> lst = proBasicEquipmentService.selectWindturbineByStationid(stationId);
|
|
|
+ lst = lst.stream().filter(s -> s.getWindpowerstationId().contains("_FDC")).collect(Collectors.toList());
|
|
|
+ return lst;
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/testing_point_ai")
|
|
|
+ @ResponseBody
|
|
|
+ public List<ProBasicEquipmentPoint> getTestingPointAIByStationIdAndModelId(
|
|
|
+ @RequestParam(value = "stationId") String stationId,
|
|
|
+ @RequestParam(value = "modelId") String modelId
|
|
|
+ ) {
|
|
|
+
|
|
|
+ List<ProBasicEquipmentPoint> lst = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(stationId) && StringUtils.isNotBlank(modelId)) {
|
|
|
+ String stationStr = stationId.replace("_FDC", "").replace("_GDC", "").trim();
|
|
|
+ lst = proBasicEquipmentPointService.selectByStationAndModel(stationStr, modelId);
|
|
|
+ }
|
|
|
+ return lst;
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/testing_point_di")
|
|
|
+ @ResponseBody
|
|
|
+ public List<ProBasicEquipmentPoint> getTestingPointDIByStationIdAndModelId(
|
|
|
+ @RequestParam(value = "stationId", required = false) String stationId,
|
|
|
+ @RequestParam(value = "modelId", required = false) String modelId
|
|
|
+ ) {
|
|
|
+ List<ProBasicEquipmentPoint> lst = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(stationId) || StringUtils.isNotBlank(modelId)) {
|
|
|
+ String stationStr = "";
|
|
|
+ if (StringUtils.isNotBlank(stationId))
|
|
|
+ stationStr = stationId.replace("_FDC", "").replace("_GDC", "").trim();
|
|
|
+ lst = proBasicEquipmentPointService.selectByStationAndModel(stationStr, modelId);
|
|
|
+ }
|
|
|
+ return lst;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|