调整创建bom 设计复核
This commit is contained in:
parent
762422d2ba
commit
fb83dca188
|
|
@ -260,8 +260,7 @@ public class EbomApi extends BaseApi {
|
|||
dto.setRevertUserName(SessionUtil.getUserName());
|
||||
dto.setUserCode(SessionUtil.getUserCode());
|
||||
bomNewEbomParentService.revertDesign(dto);
|
||||
//更新-待复核根节点
|
||||
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
|
||||
|
||||
return ResultVO.success(true);
|
||||
|
||||
|
|
@ -367,7 +366,7 @@ public class EbomApi extends BaseApi {
|
|||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
||||
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
|
||||
return ResultVO.success(temporary);
|
||||
}
|
||||
|
||||
|
|
@ -378,7 +377,7 @@ public class EbomApi extends BaseApi {
|
|||
checkDeleteRule(dto);
|
||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
||||
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
// bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
return ResultVO.success(temporary);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1174,7 +1174,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
|
||||
|
||||
|
||||
//更新-待复核根节点
|
||||
getBaseMapper().updateRootForWaitReview();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1260,7 +1261,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
.set(BomNewEbomParentEntity::getAuditUserName, SessionUtil.getUserName())
|
||||
.set(BomNewEbomParentEntity::getStatus, EBomStatusEnum.CHECKED.getValue())
|
||||
.set(BomNewEbomParentEntity::getEditStatus, EbomEditStatusEnum.HANDLER_FINISHED.getValue())
|
||||
.set(BomNewEbomParentEntity::getRootIsForWaitReview,0)
|
||||
.set(BomNewEbomParentEntity::getRevertDesc,"")
|
||||
|
||||
.in(BomNewEbomParentEntity::getRowId, updateReviewIdList);
|
||||
|
||||
//child表状态变更
|
||||
|
|
@ -1651,6 +1654,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
||||
// ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
||||
|
||||
if (eBomEdit.isRootForWaitReview()) {
|
||||
this.getBaseMapper().updateRootForWaitReview();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity());
|
||||
retParentVO.setBomRowId(retParentVO.getRowId());
|
||||
|
||||
|
|
@ -1713,7 +1723,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
superMaterialStatus(dto.getDatas());
|
||||
|
||||
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
||||
|
||||
if (eBomEdit.isRootForWaitReview()) {
|
||||
this.getBaseMapper().updateRootForWaitReview();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public class EBomEdit {
|
|||
public List<BomNewEbomParentEntity> parentEntities;
|
||||
@Getter
|
||||
private BomNewEbomParentEntity parentEntity;
|
||||
@Getter
|
||||
private boolean isRootForWaitReview=false;
|
||||
|
||||
public List<BomNewEbomChildEntity> childEntities;
|
||||
|
||||
|
|
@ -78,9 +80,16 @@ public class EBomEdit {
|
|||
parent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||
|
||||
boolean isTechnician= SpringUtil.getBean(UserRoleService.class).technician();
|
||||
parent.setStatus(isTechnician? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue());
|
||||
parent.setCreatedJob(isTechnician? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||
|
||||
parent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue());
|
||||
parent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||
//工艺人不用更新
|
||||
if(isTechnician){
|
||||
isRootForWaitReview=false;
|
||||
}else{
|
||||
isRootForWaitReview=true;
|
||||
}
|
||||
|
||||
parent.setCreatedTime(LocalDateTime.now());
|
||||
parent.setModifyTime(LocalDateTime.now());
|
||||
|
|
@ -125,12 +134,12 @@ public class EBomEdit {
|
|||
});
|
||||
|
||||
|
||||
if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) {
|
||||
//工艺人员
|
||||
if (roleList.contains(EBomConstant.TECHNICIAN)) {
|
||||
parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue());
|
||||
}
|
||||
}
|
||||
// if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) {
|
||||
// //工艺人员
|
||||
// if (roleList.contains(EBomConstant.TECHNICIAN)) {
|
||||
// parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue());
|
||||
// }
|
||||
// }
|
||||
|
||||
childEntities.addAll(updateOrCreateChild(createDTO));
|
||||
|
||||
|
|
@ -293,6 +302,7 @@ public class EBomEdit {
|
|||
//rowId is null 必定是未入库作为根
|
||||
if (dto.getParent().getRowId() == null || dto.getParent().getRowId().longValue() == 0) {
|
||||
createRootBom(dto);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue