1、变更记录暂时先取消
This commit is contained in:
parent
6069836320
commit
d10e070038
|
|
@ -897,35 +897,36 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
//标记跟节点
|
||||
upRootMark(parent);
|
||||
if (CollUtil.isNotEmpty(eBomToPBom.getVirtualPackageCompositionResult())) {
|
||||
//先删除
|
||||
Set<String> delSet = eBomToPBom.getVirtualPackageCompositionResult().stream().map(u -> StrUtil.join("-", u.getVirtualPackageMaterialNo(), u.getParentMaterialNo())).collect(Collectors.toSet());
|
||||
for (String s : delSet) {
|
||||
String[] split = StrUtil.split(s, "-");
|
||||
virtualPackageCompositionService.getBaseMapper().delByVnoAndParentNo(split[0], split[1]);
|
||||
}
|
||||
virtualPackageCompositionService.saveOrUpdateBatch(eBomToPBom.getVirtualPackageCompositionResult());
|
||||
} else {
|
||||
//记录变更影响
|
||||
if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())) {
|
||||
|
||||
List<String> vNos = eBomToPBom.getUpgradeChangeResult().stream().map(u -> StrUtil.join(u.getMaterialNo(), u.getRelMaterialNo())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(vNos)) {
|
||||
upgradeChangeService.getBaseMapper().delByVNo(vNos);
|
||||
}
|
||||
upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
|
||||
}
|
||||
if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeDetailResult())) {
|
||||
|
||||
//先删除
|
||||
Set<String> delSet = eBomToPBom.getUpgradeChangeDetailResult().stream().map(u -> StrUtil.join("-", u.getVirtualPackageMaterialNo(), u.getParentMaterialNo())).collect(Collectors.toSet());
|
||||
for (String s : delSet) {
|
||||
String[] split = StrUtil.split(s, "-");
|
||||
updateDetailService.getBaseMapper().delByVnoAndParentNo(split[0], split[1]);
|
||||
}
|
||||
updateDetailService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeDetailResult());
|
||||
}
|
||||
}
|
||||
// if (CollUtil.isNotEmpty(eBomToPBom.getVirtualPackageCompositionResult())) {
|
||||
// //先删除
|
||||
// Set<String> delSet = eBomToPBom.getVirtualPackageCompositionResult().stream().map(u -> StrUtil.join("-", u.getVirtualPackageMaterialNo(), u.getParentMaterialNo())).collect(Collectors.toSet());
|
||||
// for (String s : delSet) {
|
||||
// String[] split = StrUtil.split(s, "-");
|
||||
// virtualPackageCompositionService.getBaseMapper().delByVnoAndParentNo(split[0], split[1]);
|
||||
// }
|
||||
// virtualPackageCompositionService.saveOrUpdateBatch(eBomToPBom.getVirtualPackageCompositionResult());
|
||||
// }
|
||||
// else {
|
||||
// //记录变更影响
|
||||
// if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())) {
|
||||
//
|
||||
// List<String> vNos = eBomToPBom.getUpgradeChangeResult().stream().map(u -> StrUtil.join(u.getMaterialNo(), u.getRelMaterialNo())).collect(Collectors.toList());
|
||||
// if (CollUtil.isNotEmpty(vNos)) {
|
||||
// upgradeChangeService.getBaseMapper().delByVNo(vNos);
|
||||
// }
|
||||
// upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
|
||||
// }
|
||||
// if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeDetailResult())) {
|
||||
//
|
||||
// //先删除
|
||||
// Set<String> delSet = eBomToPBom.getUpgradeChangeDetailResult().stream().map(u -> StrUtil.join("-", u.getVirtualPackageMaterialNo(), u.getParentMaterialNo())).collect(Collectors.toSet());
|
||||
// for (String s : delSet) {
|
||||
// String[] split = StrUtil.split(s, "-");
|
||||
// updateDetailService.getBaseMapper().delByVnoAndParentNo(split[0], split[1]);
|
||||
// }
|
||||
// updateDetailService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeDetailResult());
|
||||
// }
|
||||
// }
|
||||
List<Long> bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(bomRowIds)) {
|
||||
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), bomRowIds);
|
||||
|
|
|
|||
Loading…
Reference in New Issue