Merge branch 'feature/DM/nflg-bom-transition' of http://192.168.0.40:3000/root/nflg_project into feature/DM/nflg-bom-transition

This commit is contained in:
曹鹏飞 2024-08-16 16:48:38 +08:00
commit 9e37fcd9ef
2 changed files with 24 additions and 15 deletions

View File

@ -309,12 +309,12 @@ public class EBomImportService {
); );
} }
numError = datas.stream().filter(u -> Objects.isNull(u.getNum()) || BigDecimal.ZERO.compareTo(u.getNum()) >= 0) numError = datas.stream().filter(u -> Objects.isNull(u.getNum()) || BigDecimal.ZERO.compareTo(u.getNum()) == 0)
.map(BaseImportExcelDTO::getRowNum) .map(BaseImportExcelDTO::getRowNum)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!numError.isEmpty()) { if (!numError.isEmpty()) {
errorMsg.addAll(numError.stream().map(n -> OperationErrorMsgVO.create("" + n + "", "数量不正确")) errorMsg.addAll(numError.stream().map(n -> OperationErrorMsgVO.create("" + n + "", "数量不正确(不能为空或0)"))
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
} }

View File

@ -739,20 +739,23 @@ public abstract class EBomToPbomBase {
else { else {
addEBomNew.add(parentBom.getBomRowId()); addEBomNew.add(parentBom.getBomRowId());
} }
}
//如子级都为F 项父级也不转 //如子级都为F 项父级也不转
Set<String> projectSet = newParentChild.stream().map(u -> u.getProjectType().toUpperCase()).collect(Collectors.toSet()); Set<String> projectSet = newParentChild.stream().map(u -> u.getProjectType().toUpperCase()).collect(Collectors.toSet());
if (CollUtil.isNotEmpty(projectSet)) { if (CollUtil.isNotEmpty(projectSet)) {
if (!VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey().equals(parentBom.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getProductTypeKey().equals(parentBom.getVirtualPartType()) && if (!VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey().equals(parentBom.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getProductTypeKey().equals(parentBom.getVirtualPartType()) &&
(ImmutableSet.of("F").equals(projectSet) || ImmutableSet.of("F", "Z").equals(projectSet) || ImmutableSet.of("Z").equals(projectSet))) { (ImmutableSet.of("F").equals(projectSet) || ImmutableSet.of("F", "Z").equals(projectSet) || ImmutableSet.of("Z").equals(projectSet))) {
parentBom.setNoConvertToPBomIs(1); parentBom.setNoConvertToPBomIs(1);
parentBom.setNotToPBomForFZ(BomConstant.YES); parentBom.setNotToPBomForFZ(BomConstant.YES);
childDelMaterialNos.add(parentBom.getMaterialNo()); childDelMaterialNos.add(parentBom.getMaterialNo());
}
} }
} }
} }
List<BomNewEbomParentVO> FzItem = allBomDetail.stream().filter(u -> StrUtil.isNotBlank(u.getProjectType()) && ImmutableList.of("F", "Z").contains(u.getProjectType())).collect(Collectors.toList());
FzItem.forEach(u->{
u.setNotToPBomForFZ(BomConstant.YES);
});
//递归 FZ项所有父级 //递归 FZ项所有父级
handlerFZEmptyBom(); handlerFZEmptyBom();
@ -764,9 +767,11 @@ public abstract class EBomToPbomBase {
List<BomNewEbomParentVO> parentBoms = getParentForAllSubNodeIsNotToPBomForFZ(); List<BomNewEbomParentVO> parentBoms = getParentForAllSubNodeIsNotToPBomForFZ();
while (CollUtil.isNotEmpty(parentBoms)){ while (CollUtil.isNotEmpty(parentBoms)){
parentBoms.forEach(u->{ parentBoms.forEach(u->{
u.setNoConvertToPBomIs(1); if (!VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey().equals(u.getVirtualPartType()) && !VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getProductTypeKey().equals(u.getVirtualPartType())) {
u.setNotToPBomForFZ(BomConstant.YES); u.setNoConvertToPBomIs(1);
childDelMaterialNos.add(u.getMaterialNo()); u.setNotToPBomForFZ(BomConstant.YES);
childDelMaterialNos.add(u.getMaterialNo());
}
}); });
parentBoms = getParentForAllSubNodeIsNotToPBomForFZ(); parentBoms = getParentForAllSubNodeIsNotToPBomForFZ();
} }
@ -811,6 +816,10 @@ public abstract class EBomToPbomBase {
} }
List<BomNewEbomParentVO> FzItem = allBomDetail.stream().filter(u -> StrUtil.isNotBlank(u.getProjectType()) && ImmutableList.of("F", "Z").contains(u.getProjectType())).collect(Collectors.toList());
FzItem.forEach(u->{
u.setNotToPBomForFZ(BomConstant.YES);
});
//递归 FZ项所有父级 //递归 FZ项所有父级
handlerFZEmptyBom(); handlerFZEmptyBom();