parent
1055d24aba
commit
53760502e8
|
|
@ -838,11 +838,22 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
//31 码 须有虚拟包
|
//31 码 须有虚拟包
|
||||||
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
||||||
|
|
||||||
VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31")))
|
// VUtils.isTure(paramDto.getFacCodes().contains("1020") && parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31")))
|
||||||
.throwMessage("31码不能生成仙桃(1020)的pbom");
|
// .throwMessage("31码不能生成仙桃(1020)的pbom");
|
||||||
|
|
||||||
VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0))
|
// VUtils.isTure(parents.stream().anyMatch(u -> u.getMaterialNo().startsWith("31") && u.getVirtrualPackageEnum() <= 0))
|
||||||
.throwMessage("31码须有虚拟包");
|
// .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
|
//检查该版本是否已转换过该工厂的Pbom
|
||||||
for (BomNewEbomParentEntity parent : parents){
|
for (BomNewEbomParentEntity parent : parents){
|
||||||
List<BomNewPbomParentEntity> list = pBomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo()).eq(BomNewPbomParentEntity::getCurrentVersion, parent.getCurrentVersion())
|
List<BomNewPbomParentEntity> list = pBomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo()).eq(BomNewPbomParentEntity::getCurrentVersion, parent.getCurrentVersion())
|
||||||
|
|
@ -864,7 +875,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
parent.setChildBomRowId(parent.getRowId());
|
parent.setChildBomRowId(parent.getRowId());
|
||||||
parent.setParentRowId(0L);
|
parent.setParentRowId(0L);
|
||||||
bomTree.add(parent);
|
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();
|
eBomToPBom.convert();
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue