ebom编辑删除调整

This commit is contained in:
jing's 2024-03-12 22:55:30 +08:00
parent db934e1f4a
commit ca6c4ab940
1 changed files with 21 additions and 10 deletions

View File

@ -1492,6 +1492,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* 用户临时处理数据数据的处理状态为待处理当用户单击暂存的时候所有的数据都不需要校验直接保存即可 * 用户临时处理数据数据的处理状态为待处理当用户单击暂存的时候所有的数据都不需要校验直接保存即可
*/ */
@Transactional(rollbackFor = Exception.class)
public Boolean temporary(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { public Boolean temporary(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue()); EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue());
@ -1499,6 +1500,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
eBomEdit.temporary(dto); eBomEdit.temporary(dto);
if (dto.getParent() != null) {
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
deleteBomChild(dto.getDelDatas());
}
}
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) { if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
this.saveOrUpdateBatch(eBomEdit.parentEntities); this.saveOrUpdateBatch(eBomEdit.parentEntities);
} }
@ -1511,11 +1520,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
superMaterialStatus(dto.getDatas()); superMaterialStatus(dto.getDatas());
if (dto.getParent() != null) {
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
deleteBomChild(dto.getDelDatas());
}
}
List<BomNewEbomParentVO> childList = dto.getDatas(); List<BomNewEbomParentVO> childList = dto.getDatas();
if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) { if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) {
@ -1534,6 +1539,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* <p> * <p>
* 1. * 1.
*/ */
@Transactional(rollbackFor = Exception.class)
public Boolean submit(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { public Boolean submit(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue()); EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue());
@ -1594,9 +1600,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
// checkAndSaveEBomException(childList);
// ebomChildService.getBaseMapper().updateEBomMaterialUse();
// ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
return true; return true;
} }
@ -1614,8 +1618,15 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
return; return;
} }
List<BomNewEbomParentVO> delTagList = new ArrayList<>(); List<BomNewEbomParentVO> delTagList = new ArrayList<>();
// CheckEBomException checkEBomException = new CheckEBomException(delList);
// checkEBomException.initException(); List<BomNewEbomParentVO> okList = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
&& Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
if(CollUtil.isNotEmpty(okList)){
throw new NflgBusinessException(STATE.Error,"从原始Bom导入的数据数据没有异常的情况下不可以删除");
}
//原始bom不正常 //原始bom不正常
List<BomNewEbomParentVO> s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) List<BomNewEbomParentVO> s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
&& !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());