| | |
| | | private static final long OUT_LOCK_REPORT_SUCCESS_WRK_STS = 21L; |
| | | private static final long OUT_LOCK_REPORT_FAIL_WRK_STS = 22L; |
| | | private static final long OUTBOUND_CRN_COMPLETE_WRK_STS = 25L; |
| | | private static final long OUTBOUND_STATION_COMPLETE_WRK_STS = 26L; |
| | | private static final String OUT_LOCK_REPORT_PENDING_FLAG = "P"; |
| | | |
| | | /** 同一 WCS 路径、同一单号下一组下发的任务条数上限 */ |
| | |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } |
| | | } else if (params.getNotifyType().equals("task")) { |
| | | } else if (isOutboundStationTaskRunComplete(params)) { |
| | | // WCS输送站点出库任务运行完成:托盘已到目的地,工作状态 -> 26。 |
| | | if (isOutboundTask(mast) && canMarkOutboundStationComplete(mast)) { |
| | | mast.setWrkSts(OUTBOUND_STATION_COMPLETE_WRK_STS); |
| | | mast.setModiTime(new Date()); |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } |
| | | } else if ("task".equalsIgnoreCase(params.getNotifyType())) { |
| | | //任务 |
| | | if (params.getMsgType().equals("task_complete")) { |
| | | if ("task_complete".equalsIgnoreCase(params.getMsgType())) { |
| | | |
| | | if (mast.getIoType() == 1 || mast.getIoType() == 2 ||mast.getIoType() == 10) { |
| | | mast.setWrkSts(4L); |
| | |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | //wcs任务取消接口 |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | } else if ("task_cancel".equalsIgnoreCase(params.getMsgType())) { |
| | | workService.cancelWrkMast(String.valueOf(mast.getWrkNo()), 9955L); |
| | | } |
| | | } |
| | |
| | | && "crn_out_task_complete".equalsIgnoreCase(params.getMsgType()); |
| | | } |
| | | |
| | | private boolean isOutboundStationTaskRunComplete(ReceviceTaskParams params) { |
| | | return params != null |
| | | && "Devp".equalsIgnoreCase(params.getNotifyType()) |
| | | && "station_out_task_run_complete".equalsIgnoreCase(params.getMsgType()); |
| | | } |
| | | |
| | | private boolean isOutboundTask(WrkMast mast) { |
| | | return mast != null && mast.getIoType() != null && (mast.getIoType() == 101 || mast.getIoType() == 110); |
| | | } |
| | |
| | | return mast.getWrkSts() < 14 |
| | | || mast.getWrkSts().equals(OUT_LOCK_REPORT_SUCCESS_WRK_STS) |
| | | || mast.getWrkSts().equals(OUT_LOCK_REPORT_FAIL_WRK_STS) |
| | | || mast.getWrkSts().equals(OUTBOUND_CRN_COMPLETE_WRK_STS) |
| | | || mast.getWrkSts().equals(OUTBOUND_STATION_COMPLETE_WRK_STS); |
| | | } |
| | | |
| | | private boolean canMarkOutboundStationComplete(WrkMast mast) { |
| | | if (mast == null || mast.getWrkSts() == null) { |
| | | return false; |
| | | } |
| | | return mast.getWrkSts() < 14 |
| | | || mast.getWrkSts().equals(OUT_LOCK_REPORT_SUCCESS_WRK_STS) |
| | | || mast.getWrkSts().equals(OUT_LOCK_REPORT_FAIL_WRK_STS) |
| | | || mast.getWrkSts().equals(OUTBOUND_CRN_COMPLETE_WRK_STS); |
| | | } |
| | | |