BOM删除2

This commit is contained in:
10002327 2024-10-18 15:11:09 +08:00
parent 8fd2e93252
commit a32372b5ce
2 changed files with 22 additions and 0 deletions

View File

@ -593,6 +593,12 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
List<BomNewPbomChildEntity> childList = pbomChildService.getBaseMapper().selectBatchIds(paramDTO.getRowIdList());
List<BomNewPbomParentVO> childListVO = Convert.toList(BomNewPbomParentVO.class, childList);
materialMainService.intiMaterialInfo(childListVO);
//校验当前BOM中如果只有一行BOM已删除标记行时不让删除保存
List<BomNewPbomChildEntity> kChildList = childList.stream().filter(c -> Objects.equals("K",c.getProjectType())).collect(Collectors.toList());
if(kChildList.size() > 0){
int cnt = pbomChildService.count(Wrappers.<BomNewPbomChildEntity>lambdaQuery().eq(BomNewPbomChildEntity::getParentRowId,paramDTO.getBomRowId()));
VUtils.isTure(cnt == childList.size()).throwMessage("当前BOM中有一行“BOM已删除”标记行时不能全部删除~");
}
// 判断是否是工艺包
List<BomNewPbomParentVO> technologypackages = childListVO.stream()
@ -1316,6 +1322,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
if(StrUtil.isNotBlank(newPBom.getEbomVersion()) ){
continue;
}
//旧bom除T项之外
List<BomNewPbomParentVO> oldBomDetail = this.getBaseMapper().getParentChild(oldParent.getRowId());
List<BomNewPbomParentVO> oldBomNoTChildren = oldBomDetail.stream().filter(u -> !EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProjectType())).collect(Collectors.toList());
@ -1481,6 +1488,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
pbomParent.setRootIs(1);
pbomParent.setUserRootIs(1);
pbomParent.setLastVersionIs(1);
pbomParent.setEbomVersion(null);
pbomParent.setBomExist(1);
//设置旧版本
parent.setLastVersionIs(0);
parentList.add(pbomParent);
@ -2312,6 +2321,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
List<String> materialNos = pbomChildService.lambdaQuery()
.select(BomNewPbomChildEntity::getMaterialNo)
.eq(BomNewPbomChildEntity::getParentRowId, bom.getBomRowId())
.apply(" material_no != '' ")
.list()
.stream()
.map(BomNewPbomChildEntity::getMaterialNo)

View File

@ -52,6 +52,18 @@ public class PBomDetailTask extends RecursiveTask<List<BomNewPbomParentVO>> {
*/
public void handlerChildBomVersionDetail() {
List<String> materialNos = bomDetail.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).map(BomNewPbomParentVO::getMaterialNo).collect(Collectors.toList());
//项目列表为K项时没有物料编码相关属性取parent值 by 10002327 241018
// List<BomNewPbomParentVO> kList = bomDetail.stream().filter(u -> Objects.equals(u.getProjectType(),"K")).collect(Collectors.toList());
// kList.forEach(k -> {
// BomNewPbomParentEntity parent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getRowId, k.getParentRowId()).one();
// k.setDeviseUserCode(parent.getDeviseUserCode());
// k.setDeviseName(parent.getDeviseName());
// k.setDeptName(parent.getDeptName());
// k.setDeptRowId(parent.getDeptRowId());
// k.setStatus(parent.getStatus());
// k.setEditStatus(parent.getEditStatus());
// k.setVirtualPackageIs(parent.getVirtualPackageIs());
// });
if (CollUtil.isNotEmpty(materialNos)) {