预警单/告警单业务提交
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package com.njcn.process.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.process.pojo.param.StrategyParam;
|
||||
import com.njcn.process.pojo.po.ThsWarnStrategy;
|
||||
import com.njcn.process.service.ThsWarnStrategyService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-03-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/process/thsWarnStrategy")
|
||||
@Api(tags = "(预警单-告警单)策略")
|
||||
@RequiredArgsConstructor
|
||||
public class ThsWarnStrategyController extends BaseController {
|
||||
|
||||
private final ThsWarnStrategyService thsWarnStrategyService;
|
||||
|
||||
@PostMapping("/getStrategyPage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("预警单/告警单策略分页查询")
|
||||
public HttpResult<Page<ThsWarnStrategy>> getStrategyPage(@RequestBody @Validated StrategyParam.StrategyPageParam param) {
|
||||
String methodDescribe = getMethodDescribe("getStrategyPage");
|
||||
Page<ThsWarnStrategy> page = thsWarnStrategyService.strategyPage(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/insertStrategy")
|
||||
@ApiOperation(value = "预警单/告警单单条新增")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Boolean> insertStrategy(@RequestBody @Validated StrategyParam.StrategyInsertParam param) {
|
||||
String methodDescribe = getMethodDescribe("insertStrategy");
|
||||
Boolean flag = thsWarnStrategyService.insertStrategy(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/bindStrategy")
|
||||
@ApiOperation(value = "预警单/告警单信息绑定")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Boolean> bindStrategy(@RequestBody @Validated StrategyParam.BindParam param) {
|
||||
String methodDescribe = getMethodDescribe("bindStrategy");
|
||||
Boolean flag = thsWarnStrategyService.bindStrategy(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getUpdateStrategy")
|
||||
@ApiOperation(value = "预警单/告警单修改详细查询")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<StrategyParam.StrategyUpdateParam> getUpdateStrategy(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getUpdateStrategy");
|
||||
StrategyParam.StrategyUpdateParam updateStrategy = thsWarnStrategyService.getUpdateStrategy(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, updateStrategy, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateStrategy")
|
||||
@ApiOperation(value = "预警单/告警单修改")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Boolean> updateStrategy(@RequestBody @Validated StrategyParam.StrategyUpdateParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateStrategy");
|
||||
Boolean flag = thsWarnStrategyService.updateStrategy(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateStrategyState")
|
||||
@ApiOperation(value = "预警单/告警单修改状态")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<Boolean> updateStrategyState(@RequestBody @Validated StrategyParam.StrategyStateParam param) {
|
||||
String methodDescribe = getMethodDescribe("updateStrategyState");
|
||||
Boolean flag = thsWarnStrategyService.updateStrategyState(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getMonitor")
|
||||
@ApiOperation(value = "监测点查询接口")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
public HttpResult<List<StrategyParam.MonitorTree>> getMonitor(@Param("monitorTag") String monitorTag,@Param("orgId") String orgId) {
|
||||
String methodDescribe = getMethodDescribe("getMonitor");
|
||||
List<StrategyParam.MonitorTree> monitor = thsWarnStrategyService.getMonitor(monitorTag, orgId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user