1.暂态明细修改
This commit is contained in:
@@ -51,9 +51,9 @@ public class RmpEventDetailController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@ApiOperation("获取暂态事件明细")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<RmpEventDetailVO>> getRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
|
||||
public HttpResult<Page<RmpEventDetailVO>> getRmpEventDetail(@RequestBody UniversalFrontEndParam param) {
|
||||
String methodDescribe = getMethodDescribe("getRmpEventDetail");
|
||||
List<RmpEventDetailVO> list = rmpEventDetailService.getRmpEventDetail(param);
|
||||
Page<RmpEventDetailVO> list = rmpEventDetailService.getRmpEventDetail(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.njcn.event.service.majornetwork.Impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -23,10 +25,7 @@ import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
|
||||
import com.njcn.event.pojo.param.UniversalFrontEndParam;
|
||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||
import com.njcn.event.pojo.vo.AdvanceEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.AreaLineVO;
|
||||
import com.njcn.event.pojo.vo.RmpEventDetailVO;
|
||||
import com.njcn.event.pojo.vo.TransientVO;
|
||||
import com.njcn.event.pojo.vo.*;
|
||||
import com.njcn.event.service.majornetwork.RmpEventDetailService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -81,7 +80,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
@Override
|
||||
public List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param) {
|
||||
public Page<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
|
||||
pmsDeviceInfoParam.setDeptIndex(param.getId());
|
||||
@@ -89,7 +88,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
List<PmsGeneralDeviceDTO> data = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(pmsDeviceInfoParam).getData();
|
||||
|
||||
if (CollectionUtil.isEmpty(data)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
|
||||
// 查询事件类型字典表
|
||||
@@ -101,7 +100,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
// 取出所有监测点
|
||||
List<String> monitorIds = data.stream().flatMap(pmsGeneralDeviceDTO -> pmsGeneralDeviceDTO.getMonitorIdList().stream()).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(monitorIds)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 查询监测点信息
|
||||
PmsMonitorParam pmsMonitorParam = new PmsMonitorParam();
|
||||
@@ -111,14 +110,21 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
pmsMonitorParam.setMonitorIds(monitorIds);
|
||||
List<PmsMonitorDTO> monitorInfo = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData();
|
||||
if (CollectionUtil.isEmpty(monitorInfo)) {
|
||||
return Collections.emptyList();
|
||||
return new Page<>();
|
||||
}
|
||||
// 取出所有监测点
|
||||
List<String> monitorList = monitorInfo.stream().map(PmsMonitorDTO::getId).collect(Collectors.toList());
|
||||
// 获取暂态事件明细
|
||||
List<RmpEventDetailPO> detailsOfTransientEvents = rmpEventDetailMapper.getDetailsOfTransientEvents(monitorList, param.getEventType(), param.getStartTime(), param.getEndTime());
|
||||
if (CollectionUtil.isEmpty(detailsOfTransientEvents)) {
|
||||
return Collections.emptyList();
|
||||
Page<RmpEventDetailPO> rmpEventDetailPOPage = rmpEventDetailMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(CollUtil.isNotEmpty(monitorList), RmpEventDetailPO::getMeasurementPointId, monitorList)
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(param.getEndTime())))
|
||||
.orderByDesc(RmpEventDetailPO::getStartTime)
|
||||
);
|
||||
|
||||
|
||||
if (CollectionUtil.isEmpty(rmpEventDetailPOPage.getRecords())) {
|
||||
return new Page<>();
|
||||
}
|
||||
|
||||
// 蒋监测点信息转换成map集合
|
||||
@@ -127,7 +133,7 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
Map<String, String> eventStatisDataMap = eventStatisData.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
// 属性赋值
|
||||
return detailsOfTransientEvents.stream().map(po -> {
|
||||
List<RmpEventDetailVO> collect = rmpEventDetailPOPage.getRecords().stream().map(po -> {
|
||||
RmpEventDetailVO vo = new RmpEventDetailVO();
|
||||
BeanUtils.copyProperties(po, vo);
|
||||
for (PmsMonitorDTO dto : monitorInfo) {
|
||||
@@ -141,6 +147,9 @@ public class RmpEventDetailServiceImpl extends ServiceImpl<RmpEventDetailMapper,
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
Page<RmpEventDetailVO> page = BeanUtil.copyProperties(rmpEventDetailPOPage, Page.class);
|
||||
page.setRecords(collect);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface RmpEventDetailService extends IService<RmpEventDetailPO> {
|
||||
* @param param 条件参数
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
List<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param);
|
||||
Page<RmpEventDetailVO> getRmpEventDetail(UniversalFrontEndParam param);
|
||||
|
||||
/**
|
||||
* 获取暂态指标类型列表
|
||||
|
||||
Reference in New Issue
Block a user