1、替换草稿态的虚拟包
This commit is contained in:
parent
6176f3b903
commit
78b4b9ac38
|
|
@ -949,6 +949,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
//将历史已发布版-转移到正式历史表
|
//将历史已发布版-转移到正式历史表
|
||||||
eBomToFormal(bomRowIds, bomTree.stream().filter(u ->!u.getHasChangeState().equals(1) && !EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).collect(Collectors.toList()) );
|
eBomToFormal(bomRowIds, bomTree.stream().filter(u ->!u.getHasChangeState().equals(1) && !EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).collect(Collectors.toList()) );
|
||||||
}
|
}
|
||||||
|
//替换需覆盖的受影响的虚拟包
|
||||||
|
if(CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResultForCover())){
|
||||||
|
for (BomNewEbomUpgradeChangeEntity upgradeChangeResultForCoverEnt : eBomToPBom.getUpgradeChangeResultForCover()) {
|
||||||
|
upgradeChangeService.updateChangeImpactDo(upgradeChangeResultForCoverEnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//子级记录-bom版本
|
//子级记录-bom版本
|
||||||
List<BomNewEbomChildEntity> bomChildren = new ArrayList<>();
|
List<BomNewEbomChildEntity> bomChildren = new ArrayList<>();
|
||||||
bomTree.forEach(k -> {
|
bomTree.forEach(k -> {
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,6 @@ import java.util.stream.Collectors;
|
||||||
public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgradeChangeMapper, BomNewEbomUpgradeChangeEntity> {
|
public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgradeChangeMapper, BomNewEbomUpgradeChangeEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
BomNewPbomParentService pbomParentService;
|
BomNewPbomParentService pbomParentService;
|
||||||
|
|
||||||
|
|
@ -61,8 +58,6 @@ public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgrad
|
||||||
BomNewEbomParentService ebomParentService;
|
BomNewEbomParentService ebomParentService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
|
|
@ -79,6 +74,17 @@ public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgrad
|
||||||
//
|
//
|
||||||
for (BomNewEbomUpgradeChangeEntity ent : upList) {
|
for (BomNewEbomUpgradeChangeEntity ent : upList) {
|
||||||
|
|
||||||
|
updateChangeImpactDo(ent);
|
||||||
|
ent.setStatus(1);
|
||||||
|
ent.setUpdatedTime(LocalDateTime.now());
|
||||||
|
this.updateById(ent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateChangeImpactDo(BomNewEbomUpgradeChangeEntity ent) throws ExecutionException, InterruptedException {
|
||||||
BomNewEbomParentEntity ebom = ebomParentService.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, ent.getVirtualMaterialParentMaterialNo())
|
BomNewEbomParentEntity ebom = ebomParentService.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, ent.getVirtualMaterialParentMaterialNo())
|
||||||
.eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).last(" order by current_version desc limit 1").one();
|
.eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).last(" order by current_version desc limit 1").one();
|
||||||
if (Objects.nonNull(ebom)) {
|
if (Objects.nonNull(ebom)) {
|
||||||
|
|
@ -105,23 +111,7 @@ public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgrad
|
||||||
pbomParentService.getBaseMapper().insertPBomChildToFormal(oldPBomRowIds);
|
pbomParentService.getBaseMapper().insertPBomChildToFormal(oldPBomRowIds);
|
||||||
pbomParentService.getBaseMapper().delPBom(oldPBomRowIds);
|
pbomParentService.getBaseMapper().delPBom(oldPBomRowIds);
|
||||||
}
|
}
|
||||||
ent.setStatus(1);
|
|
||||||
ent.setUpdatedTime(LocalDateTime.now());
|
|
||||||
this.updateById(ent);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public class ChangeImpactUpgrade extends EBomToPbomBase {
|
||||||
//pbom 处于工作表
|
//pbom 处于工作表
|
||||||
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
||||||
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
||||||
oldParent.setCurrentVersion(parentVo.getCurrentVersion());
|
// oldParent.setCurrentVersion(parentVo.getCurrentVersion());
|
||||||
oldParent.setSourceRowId(parentVo.getRowId());
|
oldParent.setSourceRowId(parentVo.getRowId());
|
||||||
oldParent.setCreatedTime(LocalDateTime.now());
|
oldParent.setCreatedTime(LocalDateTime.now());
|
||||||
this.pBomParentResult.add(oldParent);
|
this.pBomParentResult.add(oldParent);
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,10 @@ public abstract class EBomToPbomBase {
|
||||||
@Getter
|
@Getter
|
||||||
protected List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
|
protected List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
|
||||||
|
|
||||||
|
//需覆盖的虚拟包
|
||||||
|
@Getter
|
||||||
|
protected List<BomNewEbomUpgradeChangeEntity> upgradeChangeResultForCover=new ArrayList<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
// protected List<BomNewEbomUpdateDetailEntity> upgradeChangeDetailResult = new ArrayList<>();
|
// protected List<BomNewEbomUpdateDetailEntity> upgradeChangeDetailResult = new ArrayList<>();
|
||||||
|
|
||||||
|
|
@ -485,7 +489,16 @@ public abstract class EBomToPbomBase {
|
||||||
changeEntity.setUpdatedTime(LocalDateTime.now());
|
changeEntity.setUpdatedTime(LocalDateTime.now());
|
||||||
changeEntity.setFacCode(v.getFacCode());
|
changeEntity.setFacCode(v.getFacCode());
|
||||||
changeEntity.setVirtualMaterialParentMaterialNo(v.getVirtualMaterialParentMaterialNo());
|
changeEntity.setVirtualMaterialParentMaterialNo(v.getVirtualMaterialParentMaterialNo());
|
||||||
|
//虚拟包最新版PBom
|
||||||
|
BomNewPbomParentEntity lastVirtrualPbomEnt = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery()
|
||||||
|
.eq(BomNewPbomParentEntity::getMaterialNo, v.getVirtualPackageMaterialNo())
|
||||||
|
.eq(BomNewPbomParentEntity::getFacCode,v.getFacCode())
|
||||||
|
.last("order by current_version desc limit 1").one();
|
||||||
|
if(Objects.nonNull(lastVirtrualPbomEnt) && PBomStatusEnum.PUBLISH.getValue()>lastVirtrualPbomEnt.getStatus()){
|
||||||
|
upgradeChangeResultForCover.add(changeEntity);
|
||||||
|
}else {
|
||||||
upgradeChangeResult.add(changeEntity);
|
upgradeChangeResult.add(changeEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue