|
|
@@ -0,0 +1,75 @@
|
|
|
+package cn.iocoder.yudao.module.iscs.controller.admin.sop;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopPointsPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopPointsRespVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopPointsSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.dal.dataobject.sop.SopPointsDO;
|
|
|
+import cn.iocoder.yudao.module.iscs.service.sop.SopPointsService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - SOP隔离点")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iscs/sop-points")
|
|
|
+@Validated
|
|
|
+public class SopPointsController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SopPointsService sopPointsService;
|
|
|
+
|
|
|
+ @PostMapping("/insertSopPoints")
|
|
|
+ @Operation(summary = "创建SOP隔离点")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:sop-points:create')")
|
|
|
+ public CommonResult<Boolean> insertSopPoints(@Valid @RequestBody List<SopPointsSaveReqVO> list) {
|
|
|
+ return success(sopPointsService.createSopPoints(list));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/updateSopPoints")
|
|
|
+ @Operation(summary = "更新SOP隔离点")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:sop-points:update')")
|
|
|
+ public CommonResult<Boolean> updateSopPoints(@Valid @RequestBody SopPointsSaveReqVO updateReqVO) {
|
|
|
+ sopPointsService.updateSopPoints(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deleteSopPointsList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除SOP隔离点")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:sop-points:delete')")
|
|
|
+ public CommonResult<Boolean> deleteSopPointsList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ sopPointsService.deleteSopPointsListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/selectSopPointsById")
|
|
|
+ @Operation(summary = "获得SOP隔离点")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:sop-points:query')")
|
|
|
+ public CommonResult<SopPointsRespVO> selectSopPointsById(@RequestParam("id") Long id) {
|
|
|
+ SopPointsDO sopPoints = sopPointsService.getSopPoints(id);
|
|
|
+ return success(BeanUtils.toBean(sopPoints, SopPointsRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getSopPointsPage")
|
|
|
+ @Operation(summary = "获得SOP隔离点分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:sop-points:query')")
|
|
|
+ public CommonResult<PageResult<SopPointsRespVO>> getSopPointsPage(@Valid SopPointsPageReqVO pageReqVO) {
|
|
|
+ PageResult<SopPointsDO> pageResult = sopPointsService.getSopPointsPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, SopPointsRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|