远程通知反馈接口
This commit is contained in:
@@ -42,9 +42,6 @@ public class EventGateController extends BaseController {
|
||||
@ApiImplicitParam(name = "eventMsg", value = "暂态事件json字符", required = true)
|
||||
public HttpResult<Object> eventMsg(@RequestParam("msg") String msg) {
|
||||
String methodDescribe = getMethodDescribe("eventMsg");
|
||||
log.info("接收到暂降事件:{}",msg);
|
||||
|
||||
//JSONObject jsonObject = new JSONObject(msg);
|
||||
webSocketServer.sendMessageToAll(msg);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
@@ -55,6 +52,7 @@ public class EventGateController extends BaseController {
|
||||
private void sendMessage(JSONObject jsonObject){
|
||||
Integer lineId = Integer.valueOf(jsonObject.get("lineid").toString());
|
||||
|
||||
|
||||
pqsDeptslineService.lambdaQuery().eq(PqsDeptsline::getLineIndex,lineId).eq(PqsDeptsline::getSystype,sysTypeZt);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.gather.event.transientes.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventConfig;
|
||||
import com.njcn.gather.event.transientes.service.MsgEventConfigService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-27
|
||||
* @Description:
|
||||
*/
|
||||
@Api(tags = "暂降平台配置")
|
||||
@RequestMapping("config")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class MsgEventConfigController extends BaseController {
|
||||
|
||||
private final MsgEventConfigService msgEventConfigService;
|
||||
|
||||
@OperateInfo(operateType = OperateType.ADD)
|
||||
@PostMapping("/eventConfig")
|
||||
@ApiOperation("暂降平台配置")
|
||||
@ApiImplicitParam(name = "msgEventConfig", value = "实体", required = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public HttpResult<Object> eventConfig(@RequestBody @Validated MsgEventConfig msgEventConfig) {
|
||||
String methodDescribe = getMethodDescribe("eventConfig");
|
||||
msgEventConfigService.remove(new LambdaQueryWrapper<>());
|
||||
msgEventConfig.setId(IdUtil.simpleUUID());
|
||||
msgEventConfigService.save(msgEventConfig);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@GetMapping("/queryConfig")
|
||||
@ApiOperation("接收远程推送的暂态事件")
|
||||
public HttpResult<MsgEventConfig> queryConfig() {
|
||||
String methodDescribe = getMethodDescribe("queryConfig");
|
||||
MsgEventConfig msgEventConfig = msgEventConfigService.getOne(new LambdaQueryWrapper<>());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, msgEventConfig, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* MSG_EVENT_CONFIG表Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface MsgEventConfigMapper extends BaseMapper<MsgEventConfig> {
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-27
|
||||
* @Description:
|
||||
*/
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* MSG_EVENT_CONFIG表实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("MSG_EVENT_CONFIG")
|
||||
public class MsgEventConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 严重通知标识
|
||||
*/
|
||||
@TableField("SERIOUS_NOTICE")
|
||||
@NotNull(message = "严重通知标识不可为空")
|
||||
private Integer seriousNotice;
|
||||
|
||||
/**
|
||||
* 普通通知标识
|
||||
*/
|
||||
@TableField("NORMAL_NOTIC")
|
||||
@NotNull(message = "普通通知标识不可为空")
|
||||
private Integer normalNotic;
|
||||
|
||||
/**
|
||||
* 语音类型
|
||||
*/
|
||||
@TableField("VOICE_TYPE")
|
||||
@NotNull(message = "语音类型不可为空")
|
||||
private Integer voiceType;
|
||||
|
||||
/**
|
||||
* 屏幕通知标识
|
||||
*/
|
||||
@TableField("SCREEN_NOTIC")
|
||||
@NotNull(message = "屏幕通知标识不可为空")
|
||||
private Integer screenNotic;
|
||||
}
|
||||
@@ -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.MsgEventConfig;
|
||||
|
||||
public interface MsgEventConfigService extends IService<MsgEventConfig> {
|
||||
}
|
||||
@@ -615,8 +615,11 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
|
||||
@Override
|
||||
public Page<MsgEventInfo> hasSendMsgPage(LargeScreenCountParam largeScreenCountParam) {
|
||||
DateTime start = DateUtil.beginOfDay(DateUtil.parse(largeScreenCountParam.getSearchBeginTime()));
|
||||
DateTime end = DateUtil.endOfDay(DateUtil.parse(largeScreenCountParam.getSearchEndTime()));
|
||||
|
||||
LambdaQueryWrapper<MsgEventInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByDesc(MsgEventInfo::getSendTime);
|
||||
lambdaQueryWrapper.orderByDesc(MsgEventInfo::getSendTime).between(MsgEventInfo::getSendTime,start,end);
|
||||
return msgEventInfoService.page(new Page<>(PageFactory.getPageNum(largeScreenCountParam),PageFactory.getPageSize(largeScreenCountParam)),lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -632,6 +635,7 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
po.setId(IdUtil.simpleUUID());
|
||||
messageEventFeedbackService.save(po);
|
||||
pqsEventdetailService.lambdaUpdate().set(PqsEventdetail::getNoticeFlag,DataStateEnum.ENABLE.getCode()).eq(PqsEventdetail::getEventdetailIndex,messageEventFeedbackParam.getEventIndex()).update();
|
||||
msgEventInfoService.lambdaUpdate().set(MsgEventInfo::getIsHandle,DataStateEnum.ENABLE.getCode()).eq(MsgEventInfo::getEventIndex,messageEventFeedbackParam.getEventIndex());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.mapper.MsgEventConfigMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventConfig;
|
||||
import com.njcn.gather.event.transientes.service.MsgEventConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-06-27
|
||||
* @Description:
|
||||
*/
|
||||
@Service
|
||||
public class MsgEventConfigServiceImpl extends ServiceImpl<MsgEventConfigMapper, MsgEventConfig> implements MsgEventConfigService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user