| | |
| | | public class StoreInTaskGenerationService { |
| | | private static final int APPLY_IN_TASK_TIMEOUT_SECONDS = 5; |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private StationOperateProcessUtils stationOperateProcessUtils; |
| | |
| | | HashMap<String, String> systemConfigMap) { |
| | | StoreInTaskContext context = buildContext(basDevp, stationObjModel); |
| | | if (context == null) { |
| | | return; |
| | | } |
| | | |
| | | StationProtocol stationProtocol = context.getStationProtocol(); |
| | | if (stationProtocol == null) { |
| | | return; |
| | | } |
| | | |
| | | if (!stationProtocol.isAutoing()) { |
| | | return; |
| | | } |
| | | |
| | | if (!stationProtocol.isLoading()) { |
| | | return; |
| | | } |
| | | |
| | | if (!stationProtocol.isInEnable()) { |
| | | return; |
| | | } |
| | | |
| | | if (stationProtocol.getTaskNo() == 0) { |
| | | return; |
| | | } |
| | | |
| | | if (Cools.isEmpty(stationProtocol.getBarcode())) { |
| | | return; |
| | | } |
| | | |
| | | if (stationProtocol.getError() > 0) { |
| | | return; |
| | | } |
| | | |
| | | if (stationProtocol.isInBarcodeError()) { |
| | | return; |
| | | } |
| | | |
| | |
| | | result.setResponse(response); |
| | | result.setMessage(message); |
| | | |
| | | News.error("WMS入库请求失败,barcode={},stationId={},response={}", |
| | | request.getBarcode(), request.getSourceStaNo(), policy.buildFailureMessage(result)); |
| | | News.error("WMS入库请求失败,barcode={},stationId={},response={},WCS响应={}", |
| | | request.getBarcode(), request.getSourceStaNo(), result.getResponse(), result.getMessage()); |
| | | redisUtil.set(policy.getGenerateLockKey(context), "lock", policy.getRetryLockSeconds(context)); |
| | | policy.onApplyFailed(context, result); |
| | | } |