| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | 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, |