Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom

This commit is contained in:
jing's 2024-03-29 10:19:37 +08:00
commit 63f125918a
1 changed files with 12 additions and 42 deletions

View File

@ -1496,16 +1496,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
eBomDel.classifyBom();
if (CollectionUtil.isNotEmpty(eBomDel.getDelEBom())) {
List<Long> bomRowIdList= eBomDel.getDelEBom().stream()
.map(BomNewEbomParentVO::getBomRowId) .collect(Collectors.toList());
//取bom信息删除 parent child删除
this.getBaseMapper().delBatch(bomRowIdList);
//取bom信息删除
this.getBaseMapper().delBatch(eBomDel.getDelEBom().stream()
.map(BomNewEbomParentVO::getBomRowId)
.collect(Collectors.toList()));
}
@ -1514,10 +1508,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<Long> rowIds = eBomDel.getRevertOBom().stream().map(BomNewEbomParentVO::getSourceRowId).collect(Collectors.toList());
SpringUtil.getBean(BomNewOriginalParentService.class).revertBom(rowIds);
}
if (CollectionUtil.isNotEmpty(eBomDel.getDelEBom())) {
ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
@ -1604,15 +1594,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
queryWrapper.lambda().eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo());
queryWrapper.lambda().eq(BomNewEbomParentEntity::getLastVersionIs, 1);
queryWrapper.lambda().notIn(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId());
BomNewEbomParentEntity oldParent= this.getOne(queryWrapper);
if(oldParent!=null){
eBomEdit.getParentEntity().setCurrentVersion(oldParent.getCurrentVersion());
BomNewEbomParentEntity updateOld=new BomNewEbomParentEntity();
updateOld.setLastVersionIs(0);
updateOld.setModifyTime(LocalDateTime.now());
updateOld.setRowId(oldParent.getRowId());
this.updateById(updateOld);
}
}
@ -1669,25 +1652,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (eBomEdit.getParentEntity() != null) {
if(ObjectUtil.isNotNull(eBomEdit.getParentEntity().getLastVersionIs()) && ObjectUtil.equal(eBomEdit.getParentEntity().getLastVersionIs(),1)) {
QueryWrapper<BomNewEbomParentEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BomNewEbomParentEntity::getMaterialNo, eBomEdit.getParentEntity().getMaterialNo());
queryWrapper.lambda().eq(BomNewEbomParentEntity::getLastVersionIs, 1);
queryWrapper.lambda().notIn(BomNewEbomParentEntity::getRowId, eBomEdit.getParentEntity().getRowId());
BomNewEbomParentEntity oldParent= this.getOne(queryWrapper);
if(oldParent!=null){
eBomEdit.getParentEntity().setCurrentVersion(oldParent.getCurrentVersion());
BomNewEbomParentEntity updateOld=new BomNewEbomParentEntity();
updateOld.setLastVersionIs(0);
updateOld.setModifyTime(LocalDateTime.now());
updateOld.setRowId(oldParent.getRowId());
this.updateById(updateOld);
}
}
this.saveOrUpdate(eBomEdit.getParentEntity());
}
@ -1710,6 +1674,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
// checkAndSaveEBomException(dto.getParent().getBomRowId());
List<BomNewEbomParentVO> childList = dto.getDatas();
if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) {
childList.add(dto.getParent());
}
return true;