huminmin
2026-06-29 9f1ec3d21f02d38d1a54876fface13301cc65fad
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
package com.ruoyi.safe.controller;
 
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.SafeLineInspectionRecord;
import com.ruoyi.safe.service.SafeLineInspectionRecordService;
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("/safeLineInspectionRecord")
@AllArgsConstructor
@Tag(name = "安全生产--线路巡检记录")
public class SafeLineInspectionRecordController {
 
    private SafeLineInspectionRecordService safeLineInspectionRecordService;
 
    @GetMapping("/list/{inspectionId}")
    @Operation(summary = "根据巡检任务ID查询记录")
    public R listByInspectionId(@PathVariable Integer inspectionId) {
        return R.ok(safeLineInspectionRecordService.listByInspectionId(inspectionId));
    }
 
    @Operation(summary = "新增线路巡检记录")
    @Log(title = "线路巡检记录", businessType = BusinessType.INSERT)
    @PostMapping()
    public R add(@RequestBody SafeLineInspectionRecord safeLineInspectionRecord) {
        return R.ok(safeLineInspectionRecordService.save(safeLineInspectionRecord));
    }
 
    @Operation(summary = "批量新增线路巡检记录")
    @Log(title = "线路巡检记录", businessType = BusinessType.INSERT)
    @PostMapping("/batch")
    public R addBatch(@RequestBody List<SafeLineInspectionRecord> records) {
        return R.ok(safeLineInspectionRecordService.saveBatch(records));
    }
 
    @Operation(summary = "修改线路巡检记录")
    @Log(title = "线路巡检记录", businessType = BusinessType.UPDATE)
    @PutMapping()
    public R update(@RequestBody SafeLineInspectionRecord safeLineInspectionRecord) {
        return R.ok(safeLineInspectionRecordService.updateById(safeLineInspectionRecord));
    }
 
    @Operation(summary = "删除线路巡检记录")
    @Log(title = "线路巡检记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public R delSafeLineInspectionRecord(@RequestBody List<Integer> ids) {
        return R.ok(safeLineInspectionRecordService.removeBatchByIds(ids));
    }
}