From 077c158e71bec14810dcef0815d5d5b6aad8cbf0 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 13 七月 2025 20:18:27 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java | 13 -------------
src/main/java/com/zy/core/task/ShuttleDemoScheduler.java | 33 +++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/zy/core/task/ShuttleDemoScheduler.java b/src/main/java/com/zy/core/task/ShuttleDemoScheduler.java
new file mode 100644
index 0000000..6e02c01
--- /dev/null
+++ b/src/main/java/com/zy/core/task/ShuttleDemoScheduler.java
@@ -0,0 +1,33 @@
+package com.zy.core.task;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.zy.asrs.entity.DeviceConfig;
+import com.zy.asrs.service.DeviceConfigService;
+import com.zy.core.action.ShuttleAction;
+import com.zy.core.enums.SlaveType;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Slf4j
+public class ShuttleDemoScheduler {
+
+ @Autowired
+ private DeviceConfigService deviceConfigService;
+ @Autowired
+ private ShuttleAction shuttleAction;
+
+ @Scheduled(cron = "0/3 * * * * ? ")
+ public synchronized void execute() {
+ List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Shuttle)));
+ for (DeviceConfig device : shuttleList) {
+ shuttleAction.demo(device.getDeviceNo());
+ }
+ }
+
+}
diff --git a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
index e8a72d4..21832e5 100644
--- a/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
+++ b/src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -79,19 +79,6 @@
readStatus();
Thread.sleep(100);
- ShuttleAction shuttleAction = null;
- try {
- shuttleAction = SpringUtils.getBean(ShuttleAction.class);
- }catch (Exception e){
- continue;
- }
-
- if (shuttleAction == null) {
- continue;
- }
- //婕旂ず妯″紡
- shuttleAction.demo(deviceConfig.getDeviceNo());
-
// //灏忚溅绌洪棽涓旀湁璺戝簱绋嬪簭
// shuttleAction.moveLoc(deviceConfig.getDeviceNo());
} catch (Exception e) {
--
Gitblit v1.9.1