Junjie
2026-04-13 2cb43c8bcc1f5b7e6807dfe16bc9e08109bf7833
src/main/java/com/zy/core/plugin/store/StoreInTaskGenerationService.java
@@ -33,6 +33,7 @@
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@@ -335,13 +336,13 @@
                request.getBarcode(), request.getSourceStaNo(), result.getResponse(), result.getMessage());
        redisUtil.set(policy.getGenerateLockKey(context), "lock", policy.getRetryLockSeconds(context));
        policy.onApplyFailed(context, result);
        triggerStationBackOnApplyFailed(context, request, result);
        triggerStationBackOnApplyFailed(policy, context, request, result);
    }
    /**
     * WMS 申请入库失败后,货物仍停留在扫码站,此时补发退回到入库站的输送命令,避免货物长期滞留。
     */
    private void triggerStationBackOnApplyFailed(StoreInTaskContext context,
    private void triggerStationBackOnApplyFailed(StoreInTaskPolicy policy, StoreInTaskContext context,
                                                 InTaskApplyRequest request,
                                                 InTaskApplyResult result) {
        if (context == null || context.getStationThread() == null || context.getStationObjModel() == null) {
@@ -412,6 +413,12 @@
        }
        redisUtil.set(lockKey, "lock", APPLY_FAIL_STATION_BACK_LOCK_SECONDS);
        String currentWarning = stationProtocol.getSystemWarning();
        String backWarning = "WMS入库失败,已退回入库站";
        if (!Cools.isEmpty(currentWarning)) {
            backWarning = currentWarning + ";" + backWarning;
        }
        policy.setSystemWarning(context, backWarning);
        News.warn("WMS入库失败,已触发货物退回入库站。barcode={},stationId={},backStationId={},warning={}",
                request == null ? null : request.getBarcode(),
                currentStationId,