|
@@ -8,6 +8,7 @@ import com.gyee.wisdom.alarm.sharding.RSA.RSAService;
|
|
|
import com.gyee.wisdom.alarm.sharding.entity.*;
|
|
|
import com.gyee.wisdom.alarm.sharding.mapper.*;
|
|
|
import com.gyee.wisdom.alarm.sharding.service.DeviceService;
|
|
|
+import com.gyee.wisdom.alarm.sharding.service.StationInfoService;
|
|
|
import com.gyee.wisdom.alarm.sharding.service.WindturbineService;
|
|
|
import com.gyee.wisdom.alarm.sharding.util.ResponseWrapper;
|
|
|
|
|
@@ -36,7 +37,7 @@ import java.util.Map;
|
|
|
@RestController
|
|
|
@RequestMapping("/info")
|
|
|
@CrossOrigin
|
|
|
-@Tag(name="获取基础数据,如风场,风机,测点等")
|
|
|
+@Tag(name = "获取基础数据,如风场,风机,测点等")
|
|
|
public class InfoController {
|
|
|
|
|
|
@Autowired
|
|
@@ -72,7 +73,10 @@ public class InfoController {
|
|
|
@Autowired
|
|
|
private DeviceService deviceService;
|
|
|
|
|
|
- @RequestMapping(value = "/station")
|
|
|
+ @Autowired
|
|
|
+ private StationInfoService stationInfoService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/station")
|
|
|
@ResponseBody
|
|
|
@Operation(description = "获取风场")
|
|
|
public List<WindPowerStation> getAllWindStation(@RequestParam(value = "id", required = false) String id) {
|
|
@@ -84,7 +88,7 @@ public class InfoController {
|
|
|
return lst;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/station/all")
|
|
|
+ @GetMapping(value = "/station/all")
|
|
|
@ResponseBody
|
|
|
@Operation(description = "获取风场和光电场")
|
|
|
public List<WindPowerStation> getAllStation(@RequestParam(value = "id", required = false) String id) {
|
|
@@ -94,14 +98,14 @@ public class InfoController {
|
|
|
|
|
|
|
|
|
@Operation(description = "根据场站名称查询所有风机编号")
|
|
|
- @RequestMapping(value = "/windturbine")
|
|
|
+ @GetMapping(value = "/windturbine")
|
|
|
@ResponseBody
|
|
|
- public List<Windturbine> getWindturbineByStation( @Parameter(name ="stationId",description = "场站名称") @RequestParam(value = "stationId", required = false) String stationId) {
|
|
|
+ public List<Windturbine> getWindturbineByStation(@Parameter(name = "stationId", description = "场站名称") @RequestParam(value = "stationId", required = false) String stationId) {
|
|
|
List<Windturbine> lst = windturbineService.selectWindturbineByStationid(stationId);
|
|
|
return lst;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/testing_point_ai")
|
|
|
+ @GetMapping(value = "/testing_point_ai")
|
|
|
@ResponseBody
|
|
|
public List<TestingPointAI> getTestingPointAIByStationIdAndModelId(
|
|
|
@RequestParam(value = "stationId") String stationId,
|
|
@@ -116,7 +120,7 @@ public class InfoController {
|
|
|
return lst;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/testing_point_di")
|
|
|
+ @GetMapping(value = "/testing_point_di")
|
|
|
@ResponseBody
|
|
|
public List<TestingPointDI> getTestingPointDIByStationIdAndModelId(
|
|
|
@RequestParam(value = "stationId", required = false) String stationId,
|
|
@@ -133,13 +137,13 @@ public class InfoController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/electrical_point_ai")
|
|
|
+ @GetMapping(value = "/electrical_point_ai")
|
|
|
@ResponseBody
|
|
|
public List<ElectricalTestingPointAI> getElectricaTestingPointAIByStationId(@RequestParam(value = "stationId") String stationId) {
|
|
|
return electricalTestingPointAIMapper.selectPointByStation(stationId);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/electrical_point_di")
|
|
|
+ @GetMapping(value = "/electrical_point_di")
|
|
|
@ResponseBody
|
|
|
public List<ElectricalTestingPointDI> getElectricaTestingPointDIByStationId(@RequestParam(value = "stationId") String stationId) {
|
|
|
return electricalTestingPointDIMapper.selectPointByStation(stationId);
|
|
@@ -159,7 +163,7 @@ public class InfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/warning_type")
|
|
|
+ @GetMapping(value = "/warning_type")
|
|
|
public List<WarningType> getWarningType() {
|
|
|
List<WarningType> lst = new ArrayList<>();
|
|
|
try {
|
|
@@ -172,7 +176,7 @@ public class InfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/warning_classify")
|
|
|
+ @GetMapping(value = "/warning_classify")
|
|
|
public List<WarningClassify> getWarningClassify() {
|
|
|
List<WarningClassify> lst = new ArrayList<>();
|
|
|
try {
|
|
@@ -185,7 +189,7 @@ public class InfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/publickey")
|
|
|
+ @GetMapping(value = "/publickey")
|
|
|
public String getPublicKey() throws Exception {
|
|
|
//获得密钥对Map
|
|
|
Map<String, byte[]> keyMap = rsaService.getKeyMap();
|
|
@@ -217,23 +221,32 @@ public class InfoController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/point")
|
|
|
+ @GetMapping(value = "/point")
|
|
|
@ResponseBody
|
|
|
public JSONObject getPointList(@RequestParam(value = "deviceId", required = true) String deviceid,
|
|
|
- @RequestParam(value = "structcode", required = false) String structCode,
|
|
|
- @RequestParam(value = "stationId", required = true) String stationId,
|
|
|
- @RequestParam(value = "windturbineId", required = true) String windturbineId,
|
|
|
- @RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
|
- @RequestParam(value = "pageNum", required = false) Integer pageNum
|
|
|
+ @RequestParam(value = "structcode", required = false) String structCode,
|
|
|
+ @RequestParam(value = "stationId", required = true) String stationId,
|
|
|
+ @RequestParam(value = "windturbineId", required = true) String windturbineId,
|
|
|
+ @RequestParam(value = "pageSize", required = false) Integer pageSize,
|
|
|
+ @RequestParam(value = "pageNum", required = false) Integer pageNum
|
|
|
) {
|
|
|
|
|
|
- if (pageSize==null||pageSize == 0)
|
|
|
+ if (pageSize == null || pageSize == 0)
|
|
|
pageSize = 100;
|
|
|
- if (pageNum==null||pageNum == 0)
|
|
|
+ if (pageNum == null || pageNum == 0)
|
|
|
pageNum = 1;
|
|
|
JSONObject testingPoint = deviceService.getTestingPointByStructCode(deviceid, structCode, windturbineId, pageSize, pageNum);
|
|
|
return testingPoint;
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/stationinfo")
|
|
|
+ public ResponseWrapper getStationInfo(@Parameter(name = "stationId", description = "风场id") @RequestParam(value = "stationId", required = false) String stationId) {
|
|
|
+ List<StationInfo> stationInfoList = stationInfoService.getStationInfo(stationId);
|
|
|
+
|
|
|
+ ResponseWrapper responseWrapper = ResponseWrapper.success("获取成功", stationInfoList);
|
|
|
+ return responseWrapper;
|
|
|
+ }
|
|
|
}
|
|
|
+
|