소스 검색

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

zhoudazhuang 7 달 전
부모
커밋
7f7494a08c
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsReportOutputServiceImpl.java

+ 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();
     }