yuan
7 天以前 21e1f6344369fc0775d1d10642214ab0fd993359
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.ruoyi.safe.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.safe.pojo.SafeLineInspectionHazard;
import com.ruoyi.safe.service.SafeLineInspectionHazardService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * 安全生产--线路巡检隐患 前端控制器
 * </p>
 *
 * @author 芯导软件(江苏)有限公司
 * @since 2026-06-29
 */
@RestController
@RequestMapping("/safeLineInspectionHazard")
@AllArgsConstructor
@Tag(name = "安全生产--线路巡检隐患")
public class SafeLineInspectionHazardController {
 
    private SafeLineInspectionHazardService safeLineInspectionHazardService;
 
    @GetMapping("/page")
    @Operation(summary = "分页查询")
    public R page(Page page, SafeLineInspectionHazard safeLineInspectionHazard) {
        return R.ok(safeLineInspectionHazardService.pageSafeLineInspectionHazard(page, safeLineInspectionHazard));
    }
 
    @GetMapping("/list/{inspectionId}")
    @Operation(summary = "根据巡检任务ID查询隐患")
    public R listByInspectionId(@PathVariable Integer inspectionId) {
        return R.ok(safeLineInspectionHazardService.listByInspectionId(inspectionId));
    }
 
    @GetMapping("/{id}")
    @Operation(summary = "根据ID查询")
    public R getById(@PathVariable Integer id) {
        return R.ok(safeLineInspectionHazardService.getById(id));
    }
 
    @Operation(summary = "新增线路巡检隐患")
    @Log(title = "线路巡检隐患", businessType = BusinessType.INSERT)
    @PostMapping()
    public R add(@RequestBody SafeLineInspectionHazard safeLineInspectionHazard) {
        return R.ok(safeLineInspectionHazardService.save(safeLineInspectionHazard));
    }
 
    @Operation(summary = "修改线路巡检隐患")
    @Log(title = "线路巡检隐患", businessType = BusinessType.UPDATE)
    @PutMapping()
    public R update(@RequestBody SafeLineInspectionHazard safeLineInspectionHazard) {
        return R.ok(safeLineInspectionHazardService.updateById(safeLineInspectionHazard));
    }
 
    @Operation(summary = "删除线路巡检隐患")
    @Log(title = "线路巡检隐患", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public R delSafeLineInspectionHazard(@PathVariable List<Integer> ids) {
        return R.ok(safeLineInspectionHazardService.removeBatchByIds(ids));
    }
}