Bladeren bron

aps-开工更新物料时,顺便更新下报工主表的输出物料testin1934

zhoudazhuang 7 maanden geleden
bovenliggende
commit
7f7494a08c

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

@@ -354,6 +354,13 @@ public class ApsReportOutputServiceImpl extends ServiceImpl<ApsReportOutputDao,
             apsReportOutputDo.setTenantid(tenantId);
         }
         this.saveBatch(resList);
+        //更新主表中的输出物料
+        List<String> outPutMaterialList = resList.stream().map(ApsReportOutputDo::getOutputmaterial).distinct().collect(Collectors.toList());
+        String outPutMaterials = String.join(",", outPutMaterialList);
+        ApsReportRecordsDo apsReportRecordsDo = new ApsReportRecordsDo();
+        apsReportRecordsDo.setId(req.getMainId());
+        apsReportRecordsDo.setReportoutmaterrequest(outPutMaterials);
+        apsReportRecordsService.updateById(apsReportRecordsDo);
         return R.ok();
     }