暂降事件详情提交
This commit is contained in:
@@ -6,7 +6,7 @@ import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -16,10 +16,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -108,9 +105,25 @@ public class LargeScreenCountController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/eventMsgDetail")
|
||||
@ApiOperation("暂降事件列表详情按钮")
|
||||
@ApiImplicitParam(name = "eventId", value = "暂降事件id", required = true)
|
||||
public HttpResult<EventMsgDetailVO> eventMsgDetail(@RequestParam("eventId")String eventId) {
|
||||
String methodDescribe = getMethodDescribe("eventMsgDetail");
|
||||
EventMsgDetailVO result = largeScreenCountService.eventMsgDetail(eventId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@OperateInfo
|
||||
@PostMapping("/msgSendList")
|
||||
@ApiOperation("远程通知列表")
|
||||
@ApiImplicitParam(name = "eventId", value = "暂降事件id", required = true)
|
||||
public HttpResult<List<MsgEventInfo>> msgSendList(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||
String methodDescribe = getMethodDescribe("msgSendList");
|
||||
List<MsgEventInfo> result = largeScreenCountService.msgSendList(largeScreenCountParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MessageEventFeedback;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-26
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
public interface MessageEventFeedbackMapper extends BaseMapper<MessageEventFeedback> {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-26
|
||||
* @Description: 暂降远程通知反馈
|
||||
*/
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("MSG_EVENT_FEEDBACK")
|
||||
public class MessageEventFeedback {
|
||||
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
|
||||
private String eventIndex;
|
||||
|
||||
private Integer isSensitive;
|
||||
|
||||
private String influenceFactors;
|
||||
|
||||
private Date dealDate;
|
||||
|
||||
private String dealScheme;
|
||||
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ package com.njcn.gather.event.transientes.pojo.po;
|
||||
*/
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -35,6 +36,7 @@ public class MsgEventInfo implements Serializable {
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-26
|
||||
* @Description: 暂降远程通知详情
|
||||
*/
|
||||
@Data
|
||||
public class EventMsgDetailVO {
|
||||
|
||||
private String eventIndex;
|
||||
|
||||
private Integer isSensitive;
|
||||
|
||||
private String influenceFactors;
|
||||
|
||||
private Date dealDate;
|
||||
|
||||
private String dealScheme;
|
||||
|
||||
private String remark;
|
||||
|
||||
private List<MsgEventInfo> msgList;
|
||||
|
||||
}
|
||||
@@ -25,6 +25,11 @@ public class CommGeneralService {
|
||||
private final PqsDeptsService pqsDeptsService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据部门id获取部门所拥有的监测点
|
||||
* @param largeScreenCountParam
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getLineIdsByDept(LargeScreenCountParam largeScreenCountParam){
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||
List<PqsDeptsline> deptslines = pqsDeptslineService.lambdaQuery().in(PqsDeptsline::getDeptsIndex, deptAndChildren).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||
|
||||
@@ -29,4 +30,11 @@ public interface LargeScreenCountService {
|
||||
boolean lookEvent(List<String> ids);
|
||||
|
||||
List<MapCountVO> mapCount(LargeScreenCountParam largeScreenCountParam);
|
||||
|
||||
EventMsgDetailVO eventMsgDetail(String eventId);
|
||||
|
||||
List<MsgEventInfo> msgSendList(LargeScreenCountParam largeScreenCountParam);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MessageEventFeedback;
|
||||
|
||||
public interface MessageEventFeedbackService extends IService<MessageEventFeedback> {
|
||||
}
|
||||
@@ -22,14 +22,15 @@ import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MessageEventFeedback;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.*;
|
||||
import com.njcn.gather.event.devcie.service.*;
|
||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||
import com.njcn.gather.event.transientes.service.PqsDeptsService;
|
||||
import com.njcn.gather.event.transientes.service.*;
|
||||
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||
import com.njcn.gather.event.transientes.service.PqsEventdetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -50,6 +51,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
|
||||
private final PqsDeptslineService pqsDeptslineService;
|
||||
@@ -58,6 +60,9 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
private final PqDeviceService pqDeviceService;
|
||||
private final PqsEventdetailService pqsEventdetailService;
|
||||
private final PqLineMapper pqLineMapper;
|
||||
private final MsgEventInfoService msgEventInfoService;
|
||||
private final MessageEventFeedbackService messageEventFeedbackService;
|
||||
private final CommGeneralService commGeneralService;
|
||||
@Value("${SYS_TYPE_ZT}")
|
||||
private String sysTypeZt;
|
||||
@Override
|
||||
@@ -346,5 +351,64 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventMsgDetailVO eventMsgDetail(String eventId) {
|
||||
EventMsgDetailVO eventMsgDetailVO = new EventMsgDetailVO();
|
||||
|
||||
LambdaQueryWrapper<MessageEventFeedback> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(MessageEventFeedback::getEventIndex,eventId);
|
||||
MessageEventFeedback messageEventFeedback = messageEventFeedbackService.getOne(lambdaQueryWrapper);
|
||||
if(Objects.nonNull(messageEventFeedback)){
|
||||
BeanUtil.copyProperties(messageEventFeedback,eventMsgDetailVO);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<MsgEventInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MsgEventInfo::getEventIndex,eventId);
|
||||
List<MsgEventInfo> msgEventInfoList = msgEventInfoService.list(queryWrapper);
|
||||
eventMsgDetailVO.setMsgList(msgEventInfoList);
|
||||
|
||||
return eventMsgDetailVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MsgEventInfo> msgSendList(LargeScreenCountParam largeScreenCountParam) {
|
||||
List<MsgEventInfo> result = new ArrayList<>();
|
||||
List<Integer> ids = commGeneralService.getLineIdsByDept(largeScreenCountParam);
|
||||
if(CollUtil.isEmpty(ids)){
|
||||
return result;
|
||||
}
|
||||
List<PqsEventdetail> allEventList = new ArrayList<>();
|
||||
if(ids.size()>1000){
|
||||
List<List<Integer>> listIds = CollUtil.split(ids,1000);
|
||||
for(List<Integer> itemIds : listIds){
|
||||
List<PqsEventdetail> pqsEventdetailList = pqsEventdetailService.lambdaQuery().in(PqsEventdetail::getLineid,itemIds).select(PqsEventdetail::getEventdetailIndex).list();
|
||||
allEventList.addAll(pqsEventdetailList);
|
||||
}
|
||||
}else {
|
||||
List<PqsEventdetail> pqsEventdetailList = pqsEventdetailService.lambdaQuery().in(PqsEventdetail::getLineid,ids).select(PqsEventdetail::getEventdetailIndex).list();
|
||||
allEventList.addAll(pqsEventdetailList);
|
||||
}
|
||||
if(CollUtil.isEmpty(allEventList)){
|
||||
return result;
|
||||
}
|
||||
|
||||
List<String> eventIds = allEventList.stream().map(PqsEventdetail::getEventdetailIndex).collect(Collectors.toList());
|
||||
if(eventIds.size()>1000){
|
||||
List<List<String>> listEven = CollUtil.split(eventIds,1000);
|
||||
for(List<String> pList: listEven){
|
||||
List<MsgEventInfo> msgEventInfoList = msgEventInfoService.lambdaQuery().in(MsgEventInfo::getEventIndex,pList).list();
|
||||
result.addAll(msgEventInfoList);
|
||||
}
|
||||
}else {
|
||||
List<MsgEventInfo> msgEventInfoList = msgEventInfoService.lambdaQuery().in(MsgEventInfo::getEventIndex,eventIds).list();
|
||||
result.addAll(msgEventInfoList);
|
||||
}
|
||||
result = result.stream().sorted(Comparator.comparing(MsgEventInfo::getSendTime,Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
if (result.size() > 200) {
|
||||
result = result.subList(0, 200);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.mapper.MessageEventFeedbackMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MessageEventFeedback;
|
||||
import com.njcn.gather.event.transientes.service.MessageEventFeedbackService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-26
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class MessageEventFeedbackServiceImpl extends ServiceImpl<MessageEventFeedbackMapper, MessageEventFeedback> implements MessageEventFeedbackService {
|
||||
}
|
||||
@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.mapper.MsgEventInfoMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||
import com.njcn.gather.event.transientes.service.MsgEventInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-25
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class MsgEventInfoServiceImpl extends ServiceImpl<MsgEventInfoMapper, MsgEventInfo> implements MsgEventInfoService {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user