BOM删除2
This commit is contained in:
parent
8fd2e93252
commit
a32372b5ce
|
|
@ -593,6 +593,12 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
List<BomNewPbomChildEntity> childList = pbomChildService.getBaseMapper().selectBatchIds(paramDTO.getRowIdList());
|
List<BomNewPbomChildEntity> childList = pbomChildService.getBaseMapper().selectBatchIds(paramDTO.getRowIdList());
|
||||||
List<BomNewPbomParentVO> childListVO = Convert.toList(BomNewPbomParentVO.class, childList);
|
List<BomNewPbomParentVO> childListVO = Convert.toList(BomNewPbomParentVO.class, childList);
|
||||||
materialMainService.intiMaterialInfo(childListVO);
|
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()
|
List<BomNewPbomParentVO> technologypackages = childListVO.stream()
|
||||||
|
|
@ -1316,6 +1322,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
if(StrUtil.isNotBlank(newPBom.getEbomVersion()) ){
|
if(StrUtil.isNotBlank(newPBom.getEbomVersion()) ){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//旧bom除T项之外
|
//旧bom除T项之外
|
||||||
List<BomNewPbomParentVO> oldBomDetail = this.getBaseMapper().getParentChild(oldParent.getRowId());
|
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());
|
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.setRootIs(1);
|
||||||
pbomParent.setUserRootIs(1);
|
pbomParent.setUserRootIs(1);
|
||||||
pbomParent.setLastVersionIs(1);
|
pbomParent.setLastVersionIs(1);
|
||||||
|
pbomParent.setEbomVersion(null);
|
||||||
|
pbomParent.setBomExist(1);
|
||||||
//设置旧版本
|
//设置旧版本
|
||||||
parent.setLastVersionIs(0);
|
parent.setLastVersionIs(0);
|
||||||
parentList.add(pbomParent);
|
parentList.add(pbomParent);
|
||||||
|
|
@ -2312,6 +2321,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
List<String> materialNos = pbomChildService.lambdaQuery()
|
List<String> materialNos = pbomChildService.lambdaQuery()
|
||||||
.select(BomNewPbomChildEntity::getMaterialNo)
|
.select(BomNewPbomChildEntity::getMaterialNo)
|
||||||
.eq(BomNewPbomChildEntity::getParentRowId, bom.getBomRowId())
|
.eq(BomNewPbomChildEntity::getParentRowId, bom.getBomRowId())
|
||||||
|
.apply(" material_no != '' ")
|
||||||
.list()
|
.list()
|
||||||
.stream()
|
.stream()
|
||||||
.map(BomNewPbomChildEntity::getMaterialNo)
|
.map(BomNewPbomChildEntity::getMaterialNo)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,18 @@ public class PBomDetailTask extends RecursiveTask<List<BomNewPbomParentVO>> {
|
||||||
*/
|
*/
|
||||||
public void handlerChildBomVersionDetail() {
|
public void handlerChildBomVersionDetail() {
|
||||||
List<String> materialNos = bomDetail.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).map(BomNewPbomParentVO::getMaterialNo).collect(Collectors.toList());
|
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)) {
|
if (CollUtil.isNotEmpty(materialNos)) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue