设计复核

This commit is contained in:
jing's 2023-12-27 16:26:25 +08:00
parent e4e4dca10e
commit 747ab69c96
1 changed files with 12 additions and 7 deletions

View File

@ -256,7 +256,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
child.setSourceRowId(parentEntity.getSourceRowId());
child.setBomExist(parentEntity.getBomExist());
child.setShouldBomExist(parentEntity.getShouldBomExist());
child.setStatus(parentEntity.getStatus());
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
child.setStatus(OriginalStatusEnum.BORROWED_PARTS.getValue());
@ -783,7 +783,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//忽略叶子节点
revertList.addAll(bomTreeList.stream()
.filter(u -> u.getBomRowId() > 0)
.map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()));
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
}
@ -846,20 +846,23 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<Long> updateReviewIdList = new ArrayList<>();
for (Long bomRowId :
rowIds) {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
System.out.println(JSON.toJSONString(checkEBomException.getAllBomDetail()));
checkEBomException.initException();
List<BomNewEbomParentVO > childList=getBomTree(bomRowId);
CheckEBomException checkEBomException = new CheckEBomException(childList);
// System.out.println(JSON.toJSONString(checkEBomException.getAllBomDetail()));
checkEBomException.initException("projectType");
//错误状态包含在checkStatus内有异常抛出
checkEBomException.checkContainExcept(checkStatus);
//筛选bomRowId()>0 说明有bom更新只到parent这层无bom不需要更新
//设计人员只可以复核自己的物料如果存在引用其他用户创建的物料时不可以改变被引用物料的审核状态
updateReviewIdList.addAll(checkEBomException.getAllBomDetail().stream()
.filter(u -> u.getBomRowId() > 0
&& u.getCreatedBy().equals(dto.getUserCode()))
.map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()));
&& u.getCreatedBy().equals(SessionUtil.getUserCode()))
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
updateReviewIdList.add(bomRowId);
}
//改变复核状态
List<BomNewEbomParentEntity> updateReviewList = new ArrayList<>();
for (Long id : updateReviewIdList) {
BomNewEbomParentEntity entity = new BomNewEbomParentEntity();
@ -960,6 +963,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
MaterialMainEntity materialMainEntity = materialMainList.get(0);
BomNewEbomParentVO baseMaterialVO = new BomNewEbomParentVO();
BeanUtil.copyProperties(materialMainEntity, baseMaterialVO);
baseMaterialVO.setCreatedBy(null);
baseMaterialVO.setExceptionStatus(materialMainEntity.getMaterialState());
return baseMaterialVO;
}