bug修改

This commit is contained in:
lym
2024-04-25 11:09:39 +08:00
parent a1cbfbfaef
commit 82e388372c
5 changed files with 80 additions and 67 deletions
@@ -180,6 +180,7 @@ public interface ErrorCodeConstants {
//=========== 工序信息 1-002-028-000 ============
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_028_000, "工序不存在");
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_028_000, "工序ID填写错误不存在");
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_028_000, "工序状态以已禁用");
//=========== 工序组信息 1-002-029-000 ============
ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_000, "工序组不存在");
@@ -83,6 +83,8 @@ public class ProcessServiceImpl implements ProcessService {
public void updateProcess(ProcessUserSaveReqVO updateReqVO) {
// 校验存在
validateProcessExists(updateReqVO.getId());
// 校验状态
validateProcessStatus(updateReqVO.getId());
ProcessDO updateProcess = BeanUtils.toBean(updateReqVO, ProcessDO.class);
processUserService.deleteProcessUserByProcess(updateReqVO.getId());
@@ -123,6 +125,13 @@ public class ProcessServiceImpl implements ProcessService {
}
}
private void validateProcessStatus(Long id) {
ProcessDO process = processMapper.selectById(id);
if (process != null && process.getIsEnabled() == Boolean.FALSE) {
throw exception(PROCESS_STATUS_DISABLE);
}
}
@Override
public ProcessUserRespVO getProcess(Long id) {
// 校验存在