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() List<BomNewPbomChildEntity> rcs = bomNewPbomChildService.lambdaQuery()
.eq(BomNewPbomChildEntity::getParentRowId, rootBomRowId) .eq(BomNewPbomChildEntity::getParentRowId, rootBomRowId)
.list(); .list();
List<BomNewPbomChildEntity> unVirtualParts = rcs.stream() if (root.getMaterialNo().startsWith("31")) {
.filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())) List<BomNewPbomChildEntity> unVirtualParts = rcs.stream()
.collect(Collectors.toList()); .filter(c -> Objects.equals(c.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())
if (CollUtil.isNotEmpty(unVirtualParts)) { && !StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, c.getProjectType(), true))
return unVirtualParts.stream().map(c -> OperationErrorMsgVO.create(c.getMaterialNo(), "未生成发货包")).collect(Collectors.toList()); .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())); children.addAll(convert(rcs, root.getMaterialNo()));
rcs.forEach(it -> { rcs.forEach(it -> {