ebom编辑删除调整
This commit is contained in:
parent
db934e1f4a
commit
ca6c4ab940
|
|
@ -1492,6 +1492,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
* 用户临时处理数据,数据的处理状态为“待处理”,当用户单击暂存的时候,所有的数据都不需要校验,直接保存即可。
|
||||
*/
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean temporary(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
|
||||
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue());
|
||||
|
|
@ -1499,6 +1500,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
eBomEdit.temporary(dto);
|
||||
|
||||
|
||||
|
||||
|
||||
if (dto.getParent() != null) {
|
||||
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
|
||||
deleteBomChild(dto.getDelDatas());
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
|
||||
this.saveOrUpdateBatch(eBomEdit.parentEntities);
|
||||
}
|
||||
|
|
@ -1511,11 +1520,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
superMaterialStatus(dto.getDatas());
|
||||
|
||||
|
||||
if (dto.getParent() != null) {
|
||||
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
|
||||
deleteBomChild(dto.getDelDatas());
|
||||
}
|
||||
}
|
||||
|
||||
List<BomNewEbomParentVO> childList = dto.getDatas();
|
||||
|
||||
if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) {
|
||||
|
|
@ -1534,6 +1539,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
* <p>
|
||||
* 1.
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submit(BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
|
@ -1614,8 +1618,15 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
return;
|
||||
}
|
||||
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不正常
|
||||
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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue