| | |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.dispatch.StationCommandDispatchResult; |
| | | import com.zy.core.dispatch.StationCommandDispatcher; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.enums.StationCommandType; |
| | | import com.zy.core.enums.WrkIoType; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.command.StationCommand; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | } |
| | | |
| | | String barcode = context.getStationProtocol().getBarcode(); |
| | | long count = wrkMastService.count(new QueryWrapper<WrkMast>().eq("barcode", barcode)); |
| | | if (count > 0) { |
| | | List<WrkMast> wrkMastList = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("barcode", barcode) |
| | | ); |
| | | if (wrkMastList.size() > 0) { |
| | | boolean showTips = true; |
| | | for (WrkMast wrkMast : wrkMastList) { |
| | | if (wrkMast.getWrkSts().equals(WrkStsType.NEW_INBOUND.sts)) { |
| | | showTips = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | Object tipsLimit = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_SUCCESS_REPEAT_WARNING_TIPS_LIMIT.key + barcode); |
| | | if (tipsLimit == null) { |
| | | if (tipsLimit == null && showTips) { |
| | | policy.setSystemWarning(context, "系统任务已存在"); |
| | | } |
| | | return; |
| | |
| | | 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, |