Commit f1fbe2b8 authored by hezhuozhi's avatar hezhuozhi

26972 【智慧能源一体化】大屏监控查询添加场站过滤

parent 2b0041fe
...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "运维数据 ") @ApiOperation(value = "运维数据 ")
@GetMapping("/operationData") @GetMapping("/operationData")
public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<IPage<Map<String, Object>>> operationData(@RequestParam(value = "areaCode", required = false) String areaCode,
@RequestParam(value = "stationId", required = false) String stationId) {
// List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto(); // List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto();
...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController {
// result.setRecords(mapList); // result.setRecords(mapList);
// result.setCurrent(1); // result.setCurrent(1);
// result.setTotal(mapList.size()); // result.setTotal(mapList.size());
return ResponseHelper.buildResponse(monitorService.operationData(areaCode)); return ResponseHelper.buildResponse(monitorService.operationData(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "全国新能源接入情况 ") @ApiOperation(value = "全国新能源接入情况 ")
@GetMapping("/getAccessSituation") @GetMapping("/getAccessSituation")
public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode) { public ResponseModel<Map<String, Object>> getAccessSituation(@RequestParam(value = "areaCode", required = false) String areaCode,
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode)); @RequestParam(value = "stationId", required = false) String stationId) {
return ResponseHelper.buildResponse(monitorService.getAccessSituation(areaCode,stationId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -15,10 +15,11 @@ import java.util.Map; ...@@ -15,10 +15,11 @@ import java.util.Map;
public interface MonitorService { public interface MonitorService {
/** /**
* @param areaCode 区域编码 * @param areaCode 区域编码
* @param stationId 场站id
* @return 全国运维数据 * @return 全国运维数据
* @Description 根据区域编码动态运维数据 * @Description 根据区域编码动态运维数据
*/ */
IPage<Map<String, Object>> operationData(String areaCode); IPage<Map<String, Object>> operationData(String areaCode,String stationId);
/** /**
* @return Map<String, Object> * @return Map<String, Object>
...@@ -122,7 +123,8 @@ public interface MonitorService { ...@@ -122,7 +123,8 @@ public interface MonitorService {
/** /**
* 获取接入情况 * 获取接入情况
* @param areaCode * @param areaCode
* @param stationId
* @return * @return
*/ */
Map<String, Object> getAccessSituation(String areaCode); Map<String, Object> getAccessSituation(String areaCode,String stationId);
} }
...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled; ...@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import java.io.IOException; import java.io.IOException;
...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService {
private Resource overviewGF; private Resource overviewGF;
@Override @Override
public IPage<Map<String, Object>> operationData(String areaCode) { public IPage<Map<String, Object>> operationData(String areaCode,String stationId) {
List<StationCacheInfoDto> list = getListStationCacheInfoDto(); List<StationCacheInfoDto> list = getListStationCacheInfoDto();
if (null != areaCode) { if (null != areaCode) {
list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList()); list = list.stream().filter(e -> e.getAreaCode().toUpperCase(Locale.ROOT).equals(areaCode.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
} }
if (!StringUtils.isEmpty(stationId)) {
list = list.stream().filter(e -> e.getStationId().toUpperCase(Locale.ROOT).equals(stationId.toUpperCase(Locale.ROOT))).collect(Collectors.toList());
}
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList())); Map<String, List<StationCacheInfoDto>> listMap = list.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getStationType, Collectors.toList()));
for (StationType value : StationType.values()) { for (StationType value : StationType.values()) {
...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -944,8 +948,8 @@ public class MonitorServiceImpl implements MonitorService {
} }
@Override @Override
public Map<String, Object> getAccessSituation(String areaCode) { public Map<String, Object> getAccessSituation(String areaCode, String stationId) {
IPage<Map<String, Object>> page = operationData(areaCode); IPage<Map<String, Object>> page = operationData(areaCode,stationId);
List<Map<String, Object>> records = page.getRecords(); List<Map<String, Object>> records = page.getRecords();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (!CollectionUtils.isEmpty(records)) { if (!CollectionUtils.isEmpty(records)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment