ソースを参照

修改下次执行的有效值

小车车 3 ヶ月 前
コミット
8b2a5bbc97

+ 12 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/sop/SopExecutionPlanServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.iscs.service.sop;
 
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Assert;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
@@ -20,10 +21,7 @@ import org.springframework.validation.annotation.Validated;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 /**
  * SOP计划执行 Service 实现类
@@ -57,6 +55,16 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
         // 插入
         sopExecutionPlanMapper.insert(sopExecutionPlan);
 
+        // 进行值插入
+        SopExecutionPlanRespVO sopExecutionPlan1 = getSopExecutionPlan(sopExecutionPlan.getId());
+        if (!sopExecutionPlan1.getPreviewDataList().isEmpty()) {
+            sopExecutionPlanMapper.update(Wrappers.<SopExecutionPlanDO>lambdaUpdate()
+                    .eq(SopExecutionPlanDO::getSopId, sopExecutionPlan.getId())
+                    .set(SopExecutionPlanDO::getNextExecutDate, sopExecutionPlan1.getPreviewDataList().get(0).getPlanDay()));
+            /*if (sopExecutionPlan1.getPreviewDataList().get(0).getPlanDay().equals(DateUtil.format(new Date(), "yyyy-MM-dd"))) {
+                // 如果初始化的
+            }*/
+        }
 
         // 返回
         return sopExecutionPlan.getId();

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

@@ -103,14 +103,14 @@ public class SopServiceImpl extends ServiceImpl<SopMapper, SopDO> implements Sop
             sopWorkflowStepService.createSopWorkflowStep(vo.getSopStepList());
         }*/
         // 新增隔离点
-        if (vo.getMachineryId() != null) {
+        /*if (vo.getMachineryId() != null) {
             List<MachineryPointsDO> machineryPointsDOS = machineryPointsService.list(Wrappers.<MachineryPointsDO>lambdaQuery()
                     .eq(MachineryPointsDO::getMachineryId, vo.getMachineryId()));
             ArrayList<SopPointsSaveReqVO> sopPointsSaveReqVOS = getSopPointsSaveReqVOS(machineryPointsDOS, sop, sopGroupDO);
             if (!sopPointsSaveReqVOS.isEmpty()) {
                 sopPointsService.createSopPoints(sopPointsSaveReqVOS);
             }
-        }
+        }*/
         // 新增流程步骤信息
         if (vo.getModeId() != null) {
             List<WorkflowStepDO> workflowStepDOS = workflowStepService.list(Wrappers.<WorkflowStepDO>lambdaQuery()