#
Junjie
昨天 4d3c73e7a089100050e5e1b44bd31158d452f2b0
src/main/java/com/zy/core/plugin/NormalProcess.java
@@ -124,6 +124,7 @@
                    // 满足自动、有物、有工作号,生成入库数据
                    if (stationProtocol.isAutoing()
                            && stationProtocol.isLoading()
                            && stationProtocol.isInEnable()
                            && stationProtocol.getTaskNo() > 0) {
                        if (Cools.isEmpty(stationProtocol.getBarcode())) {
                            continue;
@@ -131,7 +132,9 @@
                        // 检测任务是否生成
                        List<WrkMast> wrkMasts = wrkMastService
                                .selectList(new EntityWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode()));
                                .selectList(new EntityWrapper<WrkMast>()
                                        .eq("io_type", WrkIoType.IN.id)
                                        .eq("barcode", stationProtocol.getBarcode()));
                        if (!wrkMasts.isEmpty()) {
                            continue;
                        }
@@ -156,6 +159,7 @@
                                wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal,
                                        stationProtocol.getPalletHeight());
                                redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2);
                                stationProtocol.setSystemWarning("请求入库失败,WMS返回=" + response);
                                continue;
                            }
@@ -170,14 +174,7 @@
                                taskParam.setTaskPri(dto.getTaskPri());
                                taskParam.setBarcode(barcode);
                                WrkMast wrkMast = commonService.createInTask(taskParam);
                                StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO,
                                        wrkMast.getWrkNo(), stationId, stationId, 0);
                                if (command == null) {
                                    News.taskInfo(wrkMast.getWrkNo(), "获取输送线命令失败");
                                    continue;
                                }
                                MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
                                stationProtocol.setSystemWarning("");
                            } else {
                                // 接口返回非200,重新发起请求
                                News.error("WMS入库接口返回非200,重新发起请求,barcode={},stationId={},response={}", barcode,
@@ -185,6 +182,7 @@
                                wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal,
                                        stationProtocol.getPalletHeight());
                                redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2);
                                stationProtocol.setSystemWarning("请求入库失败,WMS返回=" + response);
                            }
                        } else {
                            // 3. 没有响应结果,检查是否有请求正在进行中
@@ -194,8 +192,8 @@
                                wmsOperateUtils.applyInTaskAsync(barcode, stationIdVal,
                                        stationProtocol.getPalletHeight());
                                redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 2);
                                stationProtocol.setSystemWarning("请求入库失败,WMS无返回");
                            }
                            // 如果有请求进行中,等待下次循环再检查
                        }
                    }
                }