1
zhang
2026-04-17 471faf9943b3c2f29ccf2dc8e27ac09b8b97423c
zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/operation/ConveyorBackgroundService.java
@@ -49,18 +49,18 @@
        });
        // 启动定时任务
        executorService.scheduleAtFixedRate(this::processConveyorTasks,
        executorService.scheduleWithFixedDelay(this::processConveyorTasks,
                properties.getInitialDelay(),
                properties.getInterval(),
                TimeUnit.MILLISECONDS);
        running.set(true);
        log.info("输送线后台服务线程初始化完成");
        News.info("输送线后台服务线程初始化完成");
    }
    private void processConveyorTasks() {
        // 系统运行状态判断
        if (!SystemProperties.WCS_RUNNING_STATUS.get() || !running.get()) {
            log.debug("系统未运行或服务已停止,跳过输送线任务处理");
            News.info("系统未运行或服务已停止,跳过输送线任务处理");
            return;
        }
        long currentTime = System.currentTimeMillis();
@@ -74,7 +74,7 @@
                operationExecutor.execute(config);
            }
        } catch (Exception e) {
            log.error("输送线任务处理异常", e);
            News.error("输送线任务处理异常,{}", e.getMessage());
        }
    }
@@ -82,7 +82,7 @@
    public void shutDown() {
        running.set(false);
        if (executorService != null && !executorService.isShutdown()) {
            log.info("正在关闭输送线后台服务线程...");
            News.info("正在关闭输送线后台服务线程...");
            executorService.shutdown();
            try {
                if (!executorService.awaitTermination(5, TimeUnit.SECONDS)) {
@@ -92,7 +92,7 @@
                executorService.shutdownNow();
                Thread.currentThread().interrupt();
            }
            log.info("输送线后台服务线程已关闭");
            News.info("输送线后台服务线程已关闭");
        }
    }
}