yeg
2026-09-29 b78295e8da96c3e5e76befeef9582ce5273dbb74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.battery.business.web;
 
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.battery.business.domain.TTestWarningException;
import com.battery.business.service.impl.TestWarningExceptionService;
 
/** 测试预警异常查询与人工关闭接口;归属校验和关闭规则由服务层负责。 */
@RestController
@RequestMapping("/system/test-warning-exceptions")
public class TTestWarningExceptionController extends BaseController {
    @Autowired private TestWarningExceptionService warningExceptionService;
    /** 按测试和状态查询后端异常事实。 */
    @PreAuthorize("@ss.hasPermi('system:exception:query')")
    @GetMapping("/list")
    public TableDataInfo list(@RequestParam(required=false) Long testId, @RequestParam(required=false) String status) {
        startPage();
        List<TTestWarningException> rows = warningExceptionService.list(testId, status);
        return getDataTable(rows);
    }
    /** 关闭异常:处理结果必填且只有测试负责人可操作,通过应用操作日志记录处理动作。 */
    @PreAuthorize("@ss.hasPermi('system:exception:handle')")
    @Log(title = "测试预警异常", businessType = BusinessType.UPDATE)
    @PutMapping("/{exceptionId}/close")
    public AjaxResult close(@PathVariable Long exceptionId, @RequestBody(required=false) CloseRequest request) {
        return success(warningExceptionService.closeByPrincipal(exceptionId, getUserId(), getUsername(),
                request == null ? null : request.handlingNote()));
    }
    public record CloseRequest(String handlingNote) {}
}