fix(pbom): 31编码的才一定需要生成虚拟包

This commit is contained in:
曹鹏飞 2024-05-17 18:27:58 +08:00
parent b34c3523e8
commit e1f093023d
1 changed files with 8 additions and 5 deletions

View File

@ -54,11 +54,14 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
List<BomNewPbomChildEntity> rcs = bomNewPbomChildService.lambdaQuery()
.eq(BomNewPbomChildEntity::getParentRowId, rootBomRowId)
.list();
List<BomNewPbomChildEntity> unVirtualParts = rcs.stream()
.filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(unVirtualParts)) {
return unVirtualParts.stream().map(c -> OperationErrorMsgVO.create(c.getMaterialNo(), "未生成发货包")).collect(Collectors.toList());
if (root.getMaterialNo().startsWith("31")) {
List<BomNewPbomChildEntity> unVirtualParts = rcs.stream()
.filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())
&& !StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, c.getProjectType(), true))
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(unVirtualParts)) {
return unVirtualParts.stream().map(c -> OperationErrorMsgVO.create(c.getMaterialNo(), "未生成发货包")).collect(Collectors.toList());
}
}
children.addAll(convert(rcs, root.getMaterialNo()));
rcs.forEach(it -> {