抛异常代码改造
This commit is contained in:
parent
17b8037ff6
commit
20c7282bed
@ -165,5 +165,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MAT_REQ_NOT_EXISTS = new ErrorCode(1_013_003, "领料单不存在");
|
ErrorCode MAT_REQ_NOT_EXISTS = new ErrorCode(1_013_003, "领料单不存在");
|
||||||
ErrorCode MAT_REQ_DETAIL_NOT_EXISTS = new ErrorCode(1_013_004, "领料单明细不存在");
|
ErrorCode MAT_REQ_DETAIL_NOT_EXISTS = new ErrorCode(1_013_004, "领料单明细不存在");
|
||||||
ErrorCode TASK_IN_REPORT_NOT_EXISTS = new ErrorCode(1_013_005 , "该报工信息不存在,请退出刷新界面");
|
ErrorCode TASK_IN_REPORT_NOT_EXISTS = new ErrorCode(1_013_005 , "该报工信息不存在,请退出刷新界面");
|
||||||
|
ErrorCode TASK_IN_REPORT_IS_FINISH = new ErrorCode(1_013_006 , "该报工已完成,不允许删除,请确认");
|
||||||
|
ErrorCode TASK_IN_REPORT_NOT_REWORK = new ErrorCode(1_013_007 , "该报工没有完成,不允许返工,请确认");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ public class TaskInReportServiceImpl implements TaskInReportService {
|
|||||||
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId());
|
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId());
|
||||||
if (taskDispatchDetailDO != null) {
|
if (taskDispatchDetailDO != null) {
|
||||||
if (taskDispatchDetailDO.getInReportProcess() != 2) {
|
if (taskDispatchDetailDO.getInReportProcess() != 2) {
|
||||||
throw new RuntimeException("当前报工状态不允许重新报工");
|
throw exception(TASK_IN_REPORT_NOT_REWORK);
|
||||||
}
|
}
|
||||||
taskDispatchDetailDO.setInReportProcess(1);
|
taskDispatchDetailDO.setInReportProcess(1);
|
||||||
taskDispatchDetailDO.setReturnRemark(remark);
|
taskDispatchDetailDO.setReturnRemark(remark);
|
||||||
@ -79,7 +79,7 @@ public class TaskInReportServiceImpl implements TaskInReportService {
|
|||||||
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId());
|
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId());
|
||||||
if (taskDispatchDetailDO != null) {
|
if (taskDispatchDetailDO != null) {
|
||||||
if (taskDispatchDetailDO.getInReportProcess() == 2) {
|
if (taskDispatchDetailDO.getInReportProcess() == 2) {
|
||||||
throw new RuntimeException("该报工已完成,不允许删除,请确认");
|
throw exception(TASK_IN_REPORT_IS_FINISH);
|
||||||
} else {
|
} else {
|
||||||
List<TaskInReportDO> taskInReportDOS = taskInReportMapper.selectList(taskInReportDO.getDispatchDetailId(), taskInReportDO.getId());
|
List<TaskInReportDO> taskInReportDOS = taskInReportMapper.selectList(taskInReportDO.getDispatchDetailId(), taskInReportDO.getId());
|
||||||
if (taskInReportDOS.isEmpty()) {
|
if (taskInReportDOS.isEmpty()) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user