自动化立体仓库 - WMS系统
zwl
2 天以前 cac27c083bacfcb1fe602d722729676f87ee7023
src/main/java/com/zy/api/service/impl/WcsApiServiceImpl.java
@@ -51,6 +51,7 @@
    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 路径、同一单号下一组下发的任务条数上限 */
@@ -701,9 +702,18 @@
                    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);
@@ -717,7 +727,7 @@
                    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);
            }
        }
@@ -736,6 +746,12 @@
                && "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);
    }
@@ -756,6 +772,17 @@
        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);
    }