Bladeren bron

aps-报工检验只要没有待判的输出物料,都可以在提示确认后提交检验,不用判断是否进入详情保存过检验结果testin1894

zhoudazhuang 7 maanden geleden
bovenliggende
commit
97bbe6ffdb

+ 10 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportRecordsServiceImpl.java

@@ -1271,7 +1271,17 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
             //获取当前的输出物料
             List<ApsReportOutputDo> outputDos = apsReportOutputService.list(new QueryWrapper<ApsReportOutputDo>().lambda().eq(ApsReportOutputDo::getMainid, apsReportRecordsDo.getId()));
             List<ApsReportOutputDo> collect = outputDos.stream().filter(item -> item.getInsepctionlevel().equals(SaveConstans.CheckLevel.WAITING_JUDGMENT)).collect(Collectors.toList());
+            List<ApsReportOutputDo> qualifiedCollect = outputDos.stream().filter(item -> !item.getInsepctionlevel().equals(SaveConstans.CheckLevel.WAITING_JUDGMENT)).collect(Collectors.toList());
             if (collect.size() > 0) {
+                /**
+                 * 新增需求:提交检验之前需要将检验等级为非待判的检验状态更新为已检验
+                 */
+                qualifiedCollect.forEach(info->{
+                    info.setCheckstatus("已检验");
+                });
+                if (ObjectUtil.isNotEmpty(qualifiedCollect)){
+                    apsReportOutputService.updateBatchById(qualifiedCollect);
+                }
                 return R.ok();
             }
             //遍历输出物料 拼接输出物料描述,并更新