转EBOM时- PBOM发布报错修复3

This commit is contained in:
大米 2024-08-28 14:23:04 +08:00
parent ef3287ba9c
commit ca7bbdc353
2 changed files with 22 additions and 20 deletions

View File

@ -1151,24 +1151,23 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
else { else {
bomRowIds.add(bomRowId); bomRowIds.add(bomRowId);
} }
this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds); if(CollUtil.isNotEmpty(bomRowIds)) {
//同步sap this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds);
// saySyncDEMO(); //记录-BOM版本RowId
// importSap(parent,allBom); List<BomNewPbomChildEntity> pBomChildren = new ArrayList<>();
//记录-BOM版本RowId allBom.forEach(k -> {
List<BomNewPbomChildEntity> pBomChildren = new ArrayList<>(); BomNewPbomChildEntity entChild = new BomNewPbomChildEntity();
allBom.forEach(k -> { entChild.setRowId(k.getRowId());
BomNewPbomChildEntity entChild = new BomNewPbomChildEntity(); entChild.setBomVersionRowId(k.getBomRowId());
entChild.setRowId(k.getRowId()); pBomChildren.add(entChild);
entChild.setBomVersionRowId(k.getBomRowId()); });
pBomChildren.add(entChild); if (CollUtil.isNotEmpty(pBomChildren)) {
}); pbomChildService.updateBatchById(pBomChildren);
if (CollUtil.isNotEmpty(pBomChildren)) { }
pbomChildService.updateBatchById(pBomChildren);
}
//历史版本转移到formal正式工作表 //历史版本转移到formal正式工作表
pBomToFormal(bomRowIds, parentMaterialNos,parent.getFacCode()); pBomToFormal(bomRowIds, parentMaterialNos, parent.getFacCode());
}
// SpringUtil.getBean(BomNewPbomParentFormalService.class).copyPbomFormal(bomRowId); // SpringUtil.getBean(BomNewPbomParentFormalService.class).copyPbomFormal(bomRowId);
} catch (Exception ex) { } catch (Exception ex) {

View File

@ -89,10 +89,13 @@ public class EBomToPBomForFormalNew extends FormalEBomToPbomBase {
continue; continue;
} }
//检查是否用户跟用户节点 //检查是否用户跟用户节点
List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parentEnt.getMaterialNo()); if(parentEnt.getMaterialNo().equals(parent.getMaterialNo())) {
if(CollUtil.isEmpty(childMaterialNos)){ List<String> childMaterialNos = SpringUtil.getBean(BomNewPbomParentMapper.class).getPBomExistMaterialInChildForWorkList(parent.getMaterialNo());
parentEnt.setUserRootIs(1); if (CollUtil.isEmpty(childMaterialNos)) {
parentEnt.setUserRootIs(1);
}
} }
//子级 //子级
if (CollUtil.isNotEmpty(child)) { if (CollUtil.isNotEmpty(child)) {
//合并子级 //合并子级