| | |
| | | } |
| | | |
| | | StoreInTaskContext earlyContext = buildContext(basDevp, stationObjModel); |
| | | if (earlyContext == null || !handleErrorStationBack(earlyContext)) { |
| | | if (earlyContext == null || !handleErrorStationBack(policy, earlyContext)) { |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean handleErrorStationBack(StoreInTaskContext context) { |
| | | private boolean handleErrorStationBack(StoreInTaskPolicy policy, StoreInTaskContext context) { |
| | | StationProtocol stationProtocol = context.getStationProtocol(); |
| | | if (stationProtocol == null) { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | stationCommandDispatcher.dispatch(context.getBasDevp().getDevpNo(), command, "store-in-task", "station-back"); |
| | | String errorMsg = Cools.isEmpty(stationProtocol.getErrorMsg()) ? "未知异常" : stationProtocol.getErrorMsg(); |
| | | String warning = "条码站异常退回,报警信息:" + errorMsg; |
| | | if (!Cools.isEmpty(stationProtocol.getSystemWarning())) { |
| | | warning = stationProtocol.getSystemWarning() + ";" + warning; |
| | | } |
| | | policy.setSystemWarning(context, warning); |
| | | News.info("{}扫码站异常,已退回至{},条码站状态:{}", stationProtocol.getTaskNo(), |
| | | backStation.getStationId(), JSON.toJSONString(stationProtocol)); |
| | | redisUtil.set(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationProtocol.getStationId(), |