Browse Source

新增sop状态修改

小车车 3 months ago
parent
commit
c10a1b091c

+ 16 - 0
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/sop/SopController.java

@@ -77,5 +77,21 @@ public class SopController {
         return success(true);
         return success(true);
     }
     }
 
 
+    @PutMapping("/updateSopEnableNotification")
+    @Operation(summary = "更新SOP启用通知开关")
+    @PreAuthorize("@ss.hasPermission('iscs:sop:update')")
+    public CommonResult<Boolean> updateSopEnableNotification(@Valid @RequestBody SopSaveReqVO updateReqVO) {
+        sopService.updateSopEnableNotification(updateReqVO);
+        return success(true);
+    }
+
+    @PutMapping("/updateSopEnableExecutionPlan")
+    @Operation(summary = "更新SOP启用执行计划")
+    @PreAuthorize("@ss.hasPermission('iscs:sop:update')")
+    public CommonResult<Boolean> updateSopEnableExecutionPlan(@Valid @RequestBody SopSaveReqVO updateReqVO) {
+        sopService.updateSopEnableExecutionPlan(updateReqVO);
+        return success(true);
+    }
+
 
 
 }
 }

+ 5 - 0
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/sop/SopService.java

@@ -61,4 +61,9 @@ public interface SopService extends IService<SopDO> {
 
 
     SopRespVO getSopDetailById(Long id);
     SopRespVO getSopDetailById(Long id);
 
 
+    Boolean updateSopEnableNotification(SopSaveReqVO updateReqVO);
+
+    Boolean updateSopEnableExecutionPlan(SopSaveReqVO updateReqVO);
+
+
 }
 }

+ 20 - 0
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/sop/SopServiceImpl.java

@@ -267,4 +267,24 @@ public class SopServiceImpl extends ServiceImpl<SopMapper, SopDO> implements Sop
         return sopMapper.getSopDetailById(id);
         return sopMapper.getSopDetailById(id);
     }
     }
 
 
+    @Override
+    public Boolean updateSopEnableNotification(SopSaveReqVO updateReqVO) {
+        Assert.notNull(updateReqVO.getId(), "id不能为空!");
+        Assert.notNull(updateReqVO.getEnableNotifications(), "enableNotifications不能为空!");
+        update(Wrappers.<SopDO>lambdaUpdate()
+                .eq(SopDO::getId, updateReqVO.getId())
+                .set(SopDO::getEnableNotifications, updateReqVO.getEnableNotifications()));
+        return true;
+    }
+
+    @Override
+    public Boolean updateSopEnableExecutionPlan(SopSaveReqVO updateReqVO) {
+        Assert.notNull(updateReqVO.getId(), "id不能为空!");
+        Assert.notNull(updateReqVO.getEnableExecutionPlan(), "enableExecutionPlan不能为空!");
+        update(Wrappers.<SopDO>lambdaUpdate()
+                .eq(SopDO::getId, updateReqVO.getId())
+                .set(SopDO::getEnableExecutionPlan, updateReqVO.getEnableExecutionPlan()));
+        return true;
+    }
+
 }
 }