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));
|
}
|
}
|