diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index b1039144..d0c79bad 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -165,5 +165,7 @@ public interface ErrorCodeConstants { ErrorCode MAT_REQ_NOT_EXISTS = new ErrorCode(1_013_003, "领料单不存在"); 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_IS_FINISH = new ErrorCode(1_013_006 , "该报工已完成,不允许删除,请确认"); + ErrorCode TASK_IN_REPORT_NOT_REWORK = new ErrorCode(1_013_007 , "该报工没有完成,不允许返工,请确认"); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java index a155614a..3ffb3bf3 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskinreport/TaskInReportServiceImpl.java @@ -60,7 +60,7 @@ public class TaskInReportServiceImpl implements TaskInReportService { TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId()); if (taskDispatchDetailDO != null) { if (taskDispatchDetailDO.getInReportProcess() != 2) { - throw new RuntimeException("当前报工状态不允许重新报工"); + throw exception(TASK_IN_REPORT_NOT_REWORK); } taskDispatchDetailDO.setInReportProcess(1); taskDispatchDetailDO.setReturnRemark(remark); @@ -79,7 +79,7 @@ public class TaskInReportServiceImpl implements TaskInReportService { TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskInReportDO.getDispatchDetailId()); if (taskDispatchDetailDO != null) { if (taskDispatchDetailDO.getInReportProcess() == 2) { - throw new RuntimeException("该报工已完成,不允许删除,请确认"); + throw exception(TASK_IN_REPORT_IS_FINISH); } else { List taskInReportDOS = taskInReportMapper.selectList(taskInReportDO.getDispatchDetailId(), taskInReportDO.getId()); if (taskInReportDOS.isEmpty()) {