预警信息处理完成/qxwarning/ConfirmHandle接口和预警叫应添加/warnmsgfb/add接口。
parent
7c8978c27b
commit
7440532d64
|
|
@ -116,6 +116,28 @@ public class QXWarnController {
|
||||||
return ResultJson.ok(warnDpples);
|
return ResultJson.ok(warnDpples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认处理完成
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "确认处理完成")
|
||||||
|
@PostMapping("/confirmHandle")
|
||||||
|
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
||||||
|
public ResultJson<List<WarnDppleVO>> confirmHandle(
|
||||||
|
@RequestBody WarnMsgFB dto) {
|
||||||
|
//根据warnid和phone判断是否重复
|
||||||
|
if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(
|
||||||
|
warnMsgFBService.lambdaQuery()
|
||||||
|
.eq(WarnMsgFB::getWarnid,dto.getWarnid())
|
||||||
|
.eq(WarnMsgFB::getCalledPhone,String.valueOf(dto.getCalledPhone())).list()
|
||||||
|
)
|
||||||
|
){
|
||||||
|
return ResultJson.error("该名称或编码重复");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean save = warnMsgFBService.save(dto);
|
||||||
|
return ResultJson.ok(save);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 历史气象预警统计
|
* 历史气象预警统计
|
||||||
*
|
*
|
||||||
|
|
@ -275,7 +297,7 @@ public class QXWarnController {
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "历史气象预警统计")
|
@ApiOperation(value = "历史气象预警查询")
|
||||||
@PostMapping("/getHistoryWarning")
|
@PostMapping("/getHistoryWarning")
|
||||||
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
@Cacheable(value = THIS_REDIS_KEY, key = "#root.method.name+':'+#dto.toString()")
|
||||||
public ResultJson<QXWarningVO> getHistoryGroupWarning(@RequestBody GroupWarningDto dto) {
|
public ResultJson<QXWarningVO> getHistoryGroupWarning(@RequestBody GroupWarningDto dto) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.whdc.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.whdc.model.entity.WarnMsgFB;
|
||||||
|
import com.whdc.service.IWarnMsgFBService;
|
||||||
|
import com.whdc.utils.ResultJson;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "预警叫应 - Controller")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/warnmsgfb")
|
||||||
|
public class WarnMsgFBController {
|
||||||
|
@Autowired
|
||||||
|
private IWarnMsgFBService service;
|
||||||
|
//增
|
||||||
|
@ApiOperation(value = "新增")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public ResultJson<String> insert(@RequestBody @Validated WarnMsgFB dto) {
|
||||||
|
|
||||||
|
//根据warnid和phone判断是否重复
|
||||||
|
if (CollectionUtils.isNotEmpty(
|
||||||
|
service.lambdaQuery()
|
||||||
|
.eq(WarnMsgFB::getWarnid,dto.getWarnid())
|
||||||
|
.eq(WarnMsgFB::getCalledPhone,String.valueOf(dto.getCalledPhone())).list()
|
||||||
|
)
|
||||||
|
){
|
||||||
|
return ResultJson.error("该名称或编码重复");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean save = service.save(dto);
|
||||||
|
return ResultJson.ok(save);
|
||||||
|
}
|
||||||
|
//删
|
||||||
|
//改
|
||||||
|
//查
|
||||||
|
@ApiOperation(value = "查询所有")
|
||||||
|
@PostMapping(value = "/find")
|
||||||
|
public ResultJson<WarnMsgFB> find(@RequestBody WarnMsgFB dto) {
|
||||||
|
|
||||||
|
return ResultJson.ok(service.find(dto));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue