zbj//大屏监测点规模(负荷类型)

This commit is contained in:
zhangbaojian
2023-03-22 09:42:37 +08:00
parent a9e0b7395e
commit e4c0ee727d
3 changed files with 51 additions and 12 deletions

View File

@@ -1,12 +1,10 @@
package com.njcn.device.pq.controller; package com.njcn.device.pq.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.LargeScreenParam; import com.njcn.device.pq.pojo.param.LargeScreenParam;
import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO; import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO;
import com.njcn.device.pq.service.LargeScreenService; import com.njcn.device.pq.service.LargeScreenService;
@@ -22,9 +20,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Objects;
/** /**
* @version 1.0.0 * @version 1.0.0
* @author: zbj * @author: zbj
@@ -44,11 +39,24 @@ public class LargeScreenController extends BaseController {
*/ */
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getMonitoringPointScale") @PostMapping("/getMonitoringPointScale")
@ApiOperation("监测点规模") @ApiOperation("监测点规模(区域)")
@ApiImplicitParam(name = "largeScreenParam", value = "查询终端条件", required = true) @ApiImplicitParam(name = "largeScreenParam", value = "监测点规模(区域)", required = true)
public HttpResult<MonitoringPointScaleVO> getMonitoringPointScale(@RequestBody @Validated LargeScreenParam largeScreenParam) { public HttpResult<MonitoringPointScaleVO> getMonitoringPointScale(@RequestBody @Validated LargeScreenParam largeScreenParam) {
String methodDescribe = getMethodDescribe("getMonitoringPointScale"); String methodDescribe = getMethodDescribe("getMonitoringPointScale");
MonitoringPointScaleVO result = largeScreenService.getMonitoringPointScale(largeScreenParam); MonitoringPointScaleVO result = largeScreenService.getMonitoringPointScale(largeScreenParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
} }
/**
* 监测点规模
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getLoadType")
@ApiOperation("监测点规模(负荷类型)")
@ApiImplicitParam(name = "getLoadType", value = "监测点规模(负荷类型)", required = true)
public HttpResult<MonitoringPointScaleVO> getLoadType(@RequestBody @Validated LargeScreenParam largeScreenParam) {
String methodDescribe = getMethodDescribe("getLoadType");
MonitoringPointScaleVO result = largeScreenService.getLoadType(largeScreenParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
}
} }

View File

@@ -1,10 +1,8 @@
package com.njcn.device.pq.service; package com.njcn.device.pq.service;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.LargeScreenParam; import com.njcn.device.pq.pojo.param.LargeScreenParam;
import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO; import com.njcn.device.pq.pojo.vo.MonitoringPointScaleVO;
import java.util.List;
/** /**
* @version 1.0.0 * @version 1.0.0
@@ -15,4 +13,5 @@ public interface LargeScreenService {
MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam); MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam);
MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam);
} }

View File

@@ -2,7 +2,6 @@ package com.njcn.device.pq.service.impl;
import com.njcn.common.pojo.dto.SimpleDTO; import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.pq.mapper.LargeScreenMapper; import com.njcn.device.pq.mapper.LargeScreenMapper;
import com.njcn.device.pq.mapper.LineIntegrityDataMapper;
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO; import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
import com.njcn.device.pq.pojo.param.DeviceInfoParam; import com.njcn.device.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.param.LargeScreenParam; import com.njcn.device.pq.pojo.param.LargeScreenParam;
@@ -37,7 +36,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
private final LargeScreenMapper largeScreenMapper; private final LargeScreenMapper largeScreenMapper;
/** /**
* 监测点规模 * 监测点规模(区域)
*/ */
@Override @Override
public MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam) { public MonitoringPointScaleVO getMonitoringPointScale(LargeScreenParam largeScreenParam) {
@@ -49,7 +48,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex()); deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex());
//统计类型 //统计类型
SimpleDTO simpleDTO = new SimpleDTO(); SimpleDTO simpleDTO = new SimpleDTO();
simpleDTO.setName(String.valueOf(StatisticsEnum.POWER_NETWORK)); simpleDTO.setCode(String.valueOf(StatisticsEnum.POWER_NETWORK));
deviceInfoParam.setStatisticalType(simpleDTO); deviceInfoParam.setStatisticalType(simpleDTO);
//添加时间 //添加时间
deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime()); deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime());
@@ -72,4 +71,37 @@ public class LargeScreenServiceImpl implements LargeScreenService {
result.setMonitorAddCount(count.get("count").toString()); result.setMonitorAddCount(count.get("count").toString());
return result; return result;
} }
/**
* 监测点规模(负荷类型)
*/
@Override
public MonitoringPointScaleVO getLoadType(LargeScreenParam largeScreenParam) {
//创建返回VO
MonitoringPointScaleVO result = new MonitoringPointScaleVO();
ArrayList<MonitoringPointScaleParam> list = new ArrayList<>();
DeviceInfoParam.BusinessParam deviceInfoParam = new DeviceInfoParam.BusinessParam();
//部门索引
deviceInfoParam.setDeptIndex(largeScreenParam.getDeptIndex());
//统计类型
SimpleDTO simpleDTO = new SimpleDTO();
simpleDTO.setCode(String.valueOf(StatisticsEnum.LOAD_TYPE));
deviceInfoParam.setStatisticalType(simpleDTO);
//添加时间
deviceInfoParam.setSearchBeginTime(largeScreenParam.getSearchBeginTime());
deviceInfoParam.setSearchEndTime(largeScreenParam.getSearchEndTime());
// 获取所有数据
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
MonitoringPointScaleParam param = new MonitoringPointScaleParam();
param.setIndex(generalDeviceDTO.getIndex());
param.setName(generalDeviceDTO.getName());
param.setCount(generalDeviceDTO.getLineIndexes().size());
list.add(param);
}
result.setParam(list);
return result;
}
} }