1、ebom,pbom 正式表保存所有正式版数据

This commit is contained in:
大米 2024-06-15 17:44:23 +08:00
parent ac9901a0a1
commit 1a459a6057
2 changed files with 12 additions and 6 deletions

View File

@ -913,7 +913,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
ebomChildService.getBaseMapper().delBomChild(delParentBom); ebomChildService.getBaseMapper().delBomChild(delParentBom);
} }
} }
//需修改正式版版本的BOM //需修改正式版BOM的版本
List<BomNewEbomParentVO> upVersionEBomParents = bomTree.stream().filter(u -> u.getHasChangeState().equals(2)).collect(Collectors.toList()); List<BomNewEbomParentVO> upVersionEBomParents = bomTree.stream().filter(u -> u.getHasChangeState().equals(2)).collect(Collectors.toList());
if(CollUtil.isNotEmpty(upVersionEBomParents)){ if(CollUtil.isNotEmpty(upVersionEBomParents)){
List<BomNewEbomParentEntity> upVersionList=new ArrayList<>(); List<BomNewEbomParentEntity> upVersionList=new ArrayList<>();
@ -2492,7 +2492,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
/** /**
* ebom发布时将历史正式版-移到正式表 * ebom发布时将历史正式版-移到正式表(所有正式数据都会移到formal正式表中)
* @param exceptRowIds * @param exceptRowIds
*/ */
private void eBomToFormal(List<Long> exceptRowIds, List<BomNewEbomParentVO> parents){ private void eBomToFormal(List<Long> exceptRowIds, List<BomNewEbomParentVO> parents){
@ -2502,8 +2502,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if(CollUtil.isNotEmpty(toParents)) { if(CollUtil.isNotEmpty(toParents)) {
List<Long> childParentRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList()); List<Long> childParentRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList());
this.getBaseMapper().insertEBomFormalParent(childParentRowIds); List<Long> toFormalRowIds = new ArrayList<>();
this.getBaseMapper().insertEBomFormalChild(childParentRowIds); toFormalRowIds.addAll(exceptRowIds);
toFormalRowIds.addAll(childParentRowIds);
this.getBaseMapper().insertEBomFormalParent(toFormalRowIds);
this.getBaseMapper().insertEBomFormalChild(toFormalRowIds);
//转移后删除 //转移后删除
this.getBaseMapper().delEBomHistory(childParentRowIds); this.getBaseMapper().delEBomHistory(childParentRowIds);

View File

@ -1210,8 +1210,11 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
if(CollUtil.isNotEmpty(toParents)) { if(CollUtil.isNotEmpty(toParents)) {
List<Long> oldPBomRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList()); List<Long> oldPBomRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList());
this.getBaseMapper().insertPBomParentToFormal(oldPBomRowIds); List<Long> toFormalPBomRowIds = new ArrayList<>();
this.getBaseMapper().insertPBomChildToFormal(oldPBomRowIds); toFormalPBomRowIds.addAll(exceptRowIds);
toFormalPBomRowIds.addAll(oldPBomRowIds);
this.getBaseMapper().insertPBomParentToFormal(toFormalPBomRowIds);
this.getBaseMapper().insertPBomChildToFormal(toFormalPBomRowIds);
//转移后删除 //转移后删除
this.getBaseMapper().delPBom(oldPBomRowIds); this.getBaseMapper().delPBom(oldPBomRowIds);