Merge branch 'refs/heads/feature/DM/nflg-bom' into feature/DM/nflg-bom-transition

This commit is contained in:
曹鹏飞 2024-05-20 14:30:11 +08:00
commit ae22596eaf
1 changed files with 18 additions and 5 deletions

View File

@ -833,11 +833,22 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//31 须有虚拟包
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31")))
.throwMessage("31码不能生成仙桃(1020)的pbom");
// VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31")))
// .throwMessage("31码不能生成仙桃(1020)的pbom");
VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0))
.throwMessage("31码须有虚拟包");
// VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0))
// .throwMessage("31码须有虚拟包");
parents.forEach(p -> {
if (p.getMaterialNo().startsWith("31")) {
List<String> errors = new ArrayList<>();
if (ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, p.getRowId())
.eq(BomNewEbomChildEntity::getVirtualPartType, VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())
.exists()) {
errors.add(p.getMaterialNo() + "下还有未生成发货包的物料");
}
VUtils.isTure(CollUtil.isNotEmpty(errors)).throwMessage(StrUtil.join("<br/>", errors));
}
});
//检查该版本是否已转换过该工厂的Pbom
for (BomNewEbomParentEntity parent : parents){
List<BomNewPbomParentEntity> list = pBomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo()).eq(BomNewPbomParentEntity::getCurrentVersion, parent.getCurrentVersion())
@ -859,7 +870,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
parent.setChildBomRowId(parent.getRowId());
parent.setParentRowId(0L);
bomTree.add(parent);
EBomToPBom eBomToPBom = new EBomToPBom(parent, bomTree, paramDto.getFacCodes(), 0L);
EBomToPBom eBomToPBom = new EBomToPBom(parent, bomTree
, parent.getMaterialNo().startsWith("31") ? Collections.singletonList("1010") : paramDto.getFacCodes()
, 0L);
eBomToPBom.convert();
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {