#
Junjie
8 分钟以前 a8e8b92a28fd7b48b6eeae2f2f859ba381a39614
src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
@@ -47,6 +47,7 @@
    private RedisUtil redisUtil;
    private ZyStationConnectDriver zyStationConnectDriver;
    private int deviceLogCollectTime = 200;
    private boolean initStatus = false;
    private long deviceDataLogTime = System.currentTimeMillis();
    private ExecutorService executor = Executors.newFixedThreadPool(9999);
@@ -64,14 +65,16 @@
        Thread readThread = new Thread(() -> {
            while (true) {
                try {
                    deviceLogCollectTime = Utils.getDeviceLogCollectTime();
                    if (initStatus) {
                        deviceLogCollectTime = Utils.getDeviceLogCollectTime();
                    }
                    readStatus();
                    Thread.sleep(100);
                } catch (Exception e) {
                    log.error("StationV4Thread Fail", e);
                }
            }
        });
        }, "DevpRead-" + deviceConfig.getDeviceNo());
        readThread.start();
        Thread processThread = new Thread(() -> {
@@ -91,7 +94,7 @@
                    log.error("StationV4Process Fail", e);
                }
            }
        });
        }, "DevpProcess-" + deviceConfig.getDeviceNo());
        processThread.start();
    }
@@ -122,6 +125,7 @@
                stationProtocol.setStationId(entity.getStationId());
                statusList.add(stationProtocol);
            }
            initStatus = true;
        }
        List<ZyStationStatusEntity> zyStationStatusEntities = zyStationConnectDriver.getStatus();
@@ -302,6 +306,18 @@
            List<Integer> path = JSON.parseArray(JSON.toJSONString(original.getNavigatePath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class);
            List<Integer> liftTransferPath = JSON.parseArray(JSON.toJSONString(original.getLiftTransferPath(), SerializerFeature.DisableCircularReferenceDetect), Integer.class);
            if (path == null || path.isEmpty()) {
                // 同站点任务不会生成路径,但仍需下发命令写入任务数据
                if (Objects.equals(original.getStationId(), original.getTargetStaNo())) {
                    while (true) {
                        CommandResponse commandResponse = sendCommand(original);
                        if (commandResponse != null && commandResponse.getResult()) {
                            break;
                        }
                        try {
                            Thread.sleep(200);
                        } catch (Exception ignore) {}
                    }
                }
                return;
            }