海南大屏bug修改,暂态事件列表功能新增两个字段

This commit is contained in:
hzj
2024-11-22 09:21:31 +08:00
parent 8fc1645b04
commit 04ce3eb97d
11 changed files with 120 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
package com.njcn.event.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Description:
* Date: 2024/11/21 14:57【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class EventVerifyReasonParam {
@ApiModelProperty(value = "暂时事件ID")
private String eventId;
@ApiModelProperty(value = "暂降核实原因")
private String verifyReason;
@ApiModelProperty(value = "暂降核实原因详情")
private String verifyReasonDetail;
}

View File

@@ -56,6 +56,15 @@ public class TransientParam extends DeviceInfoParam.BusinessParam {
@ApiModelProperty("暂降类型")
private List<String> eventType;
@ApiModelProperty("变电站")
private List<String> substationIds;
@ApiModelProperty("线路")
private List<String> lineIds;
@ApiModelProperty("暂降核实原因")
private List<String> verifyReason;
@ApiModelProperty("波形文件")
private Integer fileFlag;

View File

@@ -1,5 +1,6 @@
package com.njcn.event.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -109,6 +110,12 @@ public class EventDetailNew {
@ApiModelProperty(value = "暂时事件ID")
private String eventId;
@ApiModelProperty(value = "暂降核实原因")
private String verifyReason;
@ApiModelProperty(value = "暂降核实原因详情")
private String verifyReasonDetail;
public String getStartTime() {
return startTime;

View File

@@ -108,6 +108,14 @@ public class RmpEventDetailPO implements Serializable {
@ApiModelProperty(value = "波形路径")
private String wavePath;
@ApiModelProperty(value = "暂降核实原因")
@TableField("verify_reason")
private String verifyReason;
@ApiModelProperty(value = "暂降核实原因详情")
@TableField("verify_reason_detail")
private String verifyReasonDetail;
private Double transientValue;
private LocalDateTime createTime;

View File

@@ -9,6 +9,7 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.event.file.pojo.dto.WaveDataDTO;
import com.njcn.event.pojo.param.EventVerifyReasonParam;
import com.njcn.event.pojo.param.TransientParam;
import com.njcn.event.pojo.po.EventDetailNew;
import com.njcn.event.pojo.vo.TransientVO;
@@ -100,6 +101,15 @@ public class TransientController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DOWNLOAD)
@PostMapping("/updateEventReason")
@ApiOperation("更新暂降核实原因")
public HttpResult<String> updateEventReason(@RequestBody EventVerifyReasonParam eventVerifyReasonParam) {
String methodDescribe = getMethodDescribe("updateEventReason");
transientService.updateEventReason(eventVerifyReasonParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
}

View File

@@ -13,11 +13,14 @@ import com.njcn.common.utils.PubUtils;
import com.njcn.device.pms.api.MonitorClient;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.device.pms.pojo.vo.MonitorVO;
import com.njcn.device.pq.api.DeviceTreeClient;
import com.njcn.device.pq.pojo.vo.TerminalTree;
import com.njcn.event.file.pojo.dto.WaveDataDTO;
import com.njcn.event.file.component.WaveFileComponent;
import com.njcn.event.file.pojo.enums.WaveFileResponseEnum;
import com.njcn.event.mapper.distribution.PwRmpEventDetailMapper;
import com.njcn.event.mapper.majornetwork.RmpEventDetailMapper;
import com.njcn.event.pojo.param.EventVerifyReasonParam;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.oss.constant.GeneralConstant;
import com.njcn.oss.constant.OssPath;
@@ -52,6 +55,7 @@ import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -90,6 +94,10 @@ public class TransientServiceImpl implements TransientService {
private final FileStorageUtil fileStorageUtil;
private final DeviceTreeClient deviceTreeClient;
@Override
public Page<TransientVO> getTransientData(TransientParam transientParam) {
Page<TransientVO> page = new Page<>();
@@ -286,6 +294,32 @@ public class TransientServiceImpl implements TransientService {
}
// 获取按终端分类的监测点索引集合
List<String> lineList = generalDeviceDTOList.stream().flatMap(dto -> dto.getLineIndexes().stream()).collect(Collectors.toList());
List<TerminalTree> data = deviceTreeClient.getTerminalTree().getData();
if(CollectionUtils.isEmpty(transientParam.getSubstationIds())){
List<TerminalTree> collect = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.filter(temp->transientParam.getSubstationIds().contains(temp.getId()))
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.collect(Collectors.toList());
lineList.retainAll(collect);
}
if(CollectionUtils.isEmpty(transientParam.getLineIds())){
List<TerminalTree> collect1 = data.stream().map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.map(TerminalTree::getChildren).flatMap(Collection::stream)
.filter(temp->transientParam.getLineIds().contains(temp.getId()))
.collect(Collectors.toList());
lineList.retainAll(collect1);
}
if(CollUtil.isEmpty(lineList)){
return new Page<>();
}
@@ -336,6 +370,7 @@ public class TransientServiceImpl implements TransientService {
if (Objects.nonNull(transientParam.getFileFlag())) {
wrapper.eq(Objects.nonNull(transientParam.getFileFlag()), RmpEventDetailPO::getFileFlag, transientParam.getFileFlag());
}
wrapper.in(!CollectionUtils.isEmpty(transientParam.getVerifyReason()),RmpEventDetailPO::getVerifyReason,transientParam.getVerifyReason());
// Page<RmpEventDetailPO> pageInfo = eventDetailService.page(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()),wrapper);
Page<RmpEventDetailPO> pageInfo = pwRmpEventDetailMapper.selectPage(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()), wrapper);
List<EventDetailNew> eventDetailData = BeanUtil.copyToList(pageInfo.getRecords(), EventDetailNew.class);
@@ -389,6 +424,15 @@ public class TransientServiceImpl implements TransientService {
return page;
}
@Override
public void updateEventReason(EventVerifyReasonParam eventVerifyReasonParam) {
eventDetailService.lambdaUpdate()
.eq(RmpEventDetailPO::getEventId,eventVerifyReasonParam.getEventId())
.set(RmpEventDetailPO::getVerifyReason,eventVerifyReasonParam.getVerifyReason())
.set(RmpEventDetailPO::getVerifyReasonDetail,eventVerifyReasonParam.getVerifyReasonDetail())
.update();
}
private boolean filterSearchValue(AreaLineInfoVO item, String searchValue) {
if (StringUtils.isBlank(searchValue)) {

View File

@@ -3,6 +3,7 @@ package com.njcn.event.service.majornetwork;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
import com.njcn.event.file.pojo.dto.WaveDataDTO;
import com.njcn.event.pojo.param.EventVerifyReasonParam;
import com.njcn.event.pojo.param.TransientParam;
import com.njcn.event.pojo.po.EventDetailNew;
import com.njcn.event.pojo.vo.TransientVO;
@@ -43,6 +44,5 @@ public interface TransientService {
Page<EventDetailNew> getTransientValue(TransientParam transientParam);
void updateEventReason(EventVerifyReasonParam eventVerifyReasonParam);
}