|
@@ -3,7 +3,11 @@ package com.gyee.frame.controller.monitor;
|
|
|
import com.gyee.frame.common.conf.AjaxStatus;
|
|
|
import com.gyee.frame.common.domain.AjaxResult;
|
|
|
import com.gyee.frame.model.custom.DataVo;
|
|
|
-import com.gyee.frame.service.websocket.*;
|
|
|
+import com.gyee.frame.model.custom.SimpleVo;
|
|
|
+import com.gyee.frame.service.websocket.CftInfoPushService;
|
|
|
+import com.gyee.frame.service.websocket.MatrixPushByWpService;
|
|
|
+import com.gyee.frame.service.websocket.PowerFirstPushService;
|
|
|
+import com.gyee.frame.service.websocket.WpInfoPushService;
|
|
|
import com.gyee.frame.util.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -11,7 +15,6 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
@@ -38,26 +41,26 @@ public class MonitorPushController {
|
|
|
@GetMapping("/findCftInfo")
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "获取测风塔信息", notes = "获取测风塔信息")
|
|
|
- @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")})
|
|
|
|
|
|
public AjaxResult findCftInfo(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- map =cftInfoPushService.findCftInfo(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ map = cftInfoPushService.findCftInfo(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=map ){
|
|
|
- return AjaxResult.successData(AjaxStatus.success.code, map );
|
|
|
+ if (null != map) {
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
} else {
|
|
|
- return AjaxResult.successData(AjaxStatus.error.code, map );
|
|
|
+ return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/monitor")
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "状态监视", notes = "状态监视")
|
|
@@ -65,12 +68,12 @@ public class MonitorPushController {
|
|
|
public AjaxResult monitor() throws Exception {
|
|
|
|
|
|
|
|
|
- Map<String, Object> map= new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
- map=wpInfoPushService.findWpInfo();
|
|
|
+ map = wpInfoPushService.findWpInfo();
|
|
|
|
|
|
- if (null!=map) {
|
|
|
+ if (null != map) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
@@ -86,15 +89,14 @@ public class MonitorPushController {
|
|
|
public AjaxResult findWpInfoBywpId(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- Map<String, Object> map= new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- map=wpInfoPushService.findWpInfoBy(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ map = wpInfoPushService.findWpInfoBy(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=map) {
|
|
|
+ if (null != map) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
@@ -110,15 +112,14 @@ public class MonitorPushController {
|
|
|
public AjaxResult findLossWpBar(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- List<DataVo> vos= new ArrayList<>();
|
|
|
+ List<DataVo> vos = new ArrayList<>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- vos=wpInfoPushService.findLossWpBar(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ vos = wpInfoPushService.findLossWpBar(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=vos) {
|
|
|
+ if (null != vos) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, vos);
|
|
@@ -134,15 +135,14 @@ public class MonitorPushController {
|
|
|
public AjaxResult findPowerWpBar(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- List<DataVo> vos= new ArrayList<>();
|
|
|
+ List<DataVo> vos = new ArrayList<>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- vos=wpInfoPushService.findPowerWpBar(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ vos = wpInfoPushService.findPowerWpBar(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=vos) {
|
|
|
+ if (null != vos) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, vos);
|
|
@@ -158,15 +158,14 @@ public class MonitorPushController {
|
|
|
public AjaxResult findMonthPowerWpBar(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- List<DataVo> vos= new ArrayList<>();
|
|
|
+ List<DataVo> vos = new ArrayList<>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- vos=wpInfoPushService.findMonthPowerWpBar(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ vos = wpInfoPushService.findMonthPowerWpBar(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=vos) {
|
|
|
+ if (null != vos) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, vos);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, vos);
|
|
@@ -183,15 +182,14 @@ public class MonitorPushController {
|
|
|
public AjaxResult findPowerFirst(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- Map<String, Object> map= new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- map=powerFirstPushService.findPowerFirst(wpId);
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ map = powerFirstPushService.findPowerFirst(wpId);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=map) {
|
|
|
+ if (null != map) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
@@ -207,19 +205,66 @@ public class MonitorPushController {
|
|
|
public AjaxResult findGeneralAppearance(String wpId) throws Exception {
|
|
|
|
|
|
|
|
|
- Map<String, Object> map= new HashMap<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ map = matrixPushByWpService.findGeneralAppearance(wpId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (null != map) {
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/findSameIndexList")
|
|
|
+ @ResponseBody
|
|
|
+ @ApiOperation(value = "获得风机共同指标", notes = "获得风机共同指标")
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query")
|
|
|
+ })
|
|
|
+ public AjaxResult findSameIndexList(String wtId) throws Exception {
|
|
|
+
|
|
|
+
|
|
|
+ List<SimpleVo> list = new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtId)) {
|
|
|
+ list = matrixPushByWpService.findSameIndexList(wtId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (null != list) {
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code, list);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.successData(AjaxStatus.error.code, list);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/findSameIndexValueList")
|
|
|
+ @ResponseBody
|
|
|
+ @ApiOperation(value = "获得对应风机相关指标Map集合", notes = "获得对应风机相关指标Map集合")
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "wtId", value = "风机编号", required = true, dataType = "string", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "code", value = "指标编号", required = true, dataType = "string", paramType = "query")
|
|
|
+ })
|
|
|
+ public AjaxResult findSameIndexValueList(String wtId, String code) throws Exception {
|
|
|
+
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
- map=matrixPushByWpService.findGeneralAppearance(wpId);
|
|
|
+ Map<String, List<SimpleVo>> map = new HashMap<>();
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtId) && StringUtils.notEmp(code)) {
|
|
|
+ map = matrixPushByWpService.findSameIndexValueList(wtId, code);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (null!=map) {
|
|
|
+ if (null != map) {
|
|
|
return AjaxResult.successData(AjaxStatus.success.code, map);
|
|
|
} else {
|
|
|
return AjaxResult.successData(AjaxStatus.error.code, map);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+}
|