小车车 преди 3 месеца
родител
ревизия
420eb584b0

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

@@ -44,6 +44,8 @@ public class SopServiceImpl extends ServiceImpl<SopMapper, SopDO> implements Sop
     private SopGroupService sopGroupService;
     @Resource
     private WorkflowModeService workflowModeService;
+    @Resource
+    private SopExecutionPlanService sopExecutionPlanService;
 
     @Transactional
     @Override
@@ -218,6 +220,13 @@ public class SopServiceImpl extends ServiceImpl<SopMapper, SopDO> implements Sop
         PageResult<SopRespVO> respVOPageResult = new PageResult<>();
         respVOPageResult.setList(pageResult.getRecords());
         respVOPageResult.setTotal(pageResult.getTotal());
+        for (SopRespVO record : pageResult.getRecords()) {
+            SopExecutionPlanDO one = sopExecutionPlanService.getOne(Wrappers.<SopExecutionPlanDO>lambdaQuery()
+                    .eq(SopExecutionPlanDO::getSopId, record.getId()));
+            if (one != null) {
+                record.setNextExecutDate(one.getNextExecutDate());
+            }
+        }
         return respVOPageResult;
     }
 

+ 1 - 3
yudao-module-iscs/src/main/resources/mapper/SopMapper.xml

@@ -16,8 +16,7 @@
         w.workstation_name,
         d.machinery_name,
         any_value(di.label) as sopTypeName,
-        COUNT( p.id ) AS pointCount,
-        e.next_execut_date
+        COUNT( p.id ) AS pointCount
         FROM
         isc_sop s
         LEFT JOIN isc_workarea wa ON wa.id = s.workarea_id
@@ -25,7 +24,6 @@
         LEFT JOIN system_users u ON u.id = s.creator
         LEFT JOIN isc_machinery d ON d.id = s.machinery_id
         LEFT JOIN isc_sop_points p ON p.sop_id = s.id
-        LEFT JOIN isc_sop_execution_plan e ON e.sop_id = s.id
         LEFT JOIN system_dict_data di ON di.dict_type = "sop_type" and di.value = s.sop_type
         <where>
             <if test="vo.sopCode != null and vo.sopCode.trim != ''">