| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.yykj.sjnmtybt.controller;
- import com.yykj.sjnmtybt.common.ApiResponse;
- import com.yykj.sjnmtybt.common.PageResult;
- import com.yykj.sjnmtybt.dto.request.AlertHandleRequest;
- import com.yykj.sjnmtybt.dto.request.AlertQueryRequest;
- import com.yykj.sjnmtybt.dto.response.AlertVO;
- import com.yykj.sjnmtybt.service.BizDataService;
- import com.yykj.sjnmtybt.service.BizFlowService;
- import io.swagger.v3.oas.annotations.Operation;
- import io.swagger.v3.oas.annotations.Parameter;
- import io.swagger.v3.oas.annotations.tags.Tag;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
- @Tag(name = "11-告警处置", description = "流程图红色系统预警(如死亡停发)及回盘/匹配异常;DMS sjnmtybt_alart")
- @RestController
- @RequestMapping("/api/alerts")
- public class AlertController {
- private final BizDataService biz;
- private final BizFlowService flow;
- public AlertController(BizDataService biz, BizFlowService flow) {
- this.biz = biz;
- this.flow = flow;
- }
- @Operation(summary = "分页查询告警",
- description = "按街镇/类型/处理状态/人员等筛选;含死亡停发、回盘失败、居保匹配异常等。")
- @PostMapping("/page")
- public ApiResponse<PageResult<AlertVO>> page(@RequestBody AlertQueryRequest req) {
- return ApiResponse.ok(biz.pageAlerts(req));
- }
- @Operation(summary = "告警详情", description = "含处理状态、生命周期节点与附件。")
- @GetMapping("/{id}")
- public ApiResponse<AlertVO> detail(
- @Parameter(description = "告警ID", required = true) @PathVariable String id) {
- AlertVO vo = biz.getAlert(id);
- if (vo == null) {
- return ApiResponse.fail(404, "告警不存在: " + id);
- }
- return ApiResponse.ok(vo);
- }
- @Operation(summary = "处置告警",
- description = "处理结果示例:恢复发放、纳入下月补发、更新银行卡、人工确认居保状态、关闭。")
- @PostMapping("/handle")
- public ApiResponse<AlertVO> handle(@Validated @RequestBody AlertHandleRequest req) {
- return ApiResponse.ok("告警已处置", flow.handleAlert(req));
- }
- }
|