From 470718b6f7de2688807a59b4e32f437624c51499 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 15 一月 2026 16:06:17 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/task/NotifyScheduler.java | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/NotifyScheduler.java b/src/main/java/com/zy/asrs/task/NotifyScheduler.java
index 43fe4f9..8e40b08 100644
--- a/src/main/java/com/zy/asrs/task/NotifyScheduler.java
+++ b/src/main/java/com/zy/asrs/task/NotifyScheduler.java
@@ -4,15 +4,14 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.domain.NotifyDto;
+import com.zy.asrs.entity.DeviceConfig;
import com.zy.asrs.entity.HttpRequestLog;
+import com.zy.asrs.service.DeviceConfigService;
import com.zy.asrs.service.HttpRequestLogService;
import com.zy.asrs.utils.NotifyUtils;
import com.zy.common.utils.HttpHandler;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.SlaveType;
-import com.zy.core.model.ForkLiftSlave;
-import com.zy.core.model.ShuttleSlave;
-import com.zy.core.properties.SlaveProperties;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
@@ -32,23 +31,27 @@
@Autowired
private NotifyUtils notifyUtils;
@Autowired
- private SlaveProperties slaveProperties;
- @Autowired
private ConfigService configService;
@Autowired
private HttpRequestLogService httpRequestLogService;
+ @Autowired
+ private DeviceConfigService deviceConfigService;
@Scheduled(cron = "0/3 * * * * ? ")
public synchronized void notifyShuttle(){
- for (ShuttleSlave slave : slaveProperties.getShuttle()) {
- notifyMsg(String.valueOf(SlaveType.Shuttle), slave.getId());
+ List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Crn)));
+ for (DeviceConfig device : deviceList) {
+ notifyMsg(String.valueOf(SlaveType.Crn), device.getDeviceNo());
}
}
@Scheduled(cron = "0/3 * * * * ? ")
public synchronized void notifyForkLift(){
- for (ForkLiftSlave slave : slaveProperties.getForkLift()) {
- notifyMsg(String.valueOf(SlaveType.ForkLift), slave.getId());
+ List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
+ .eq("device_type", String.valueOf(SlaveType.Rgv)));
+ for (DeviceConfig device : deviceList) {
+ notifyMsg(String.valueOf(SlaveType.Rgv), device.getDeviceNo());
}
}
@@ -57,6 +60,16 @@
notifyMsg("task", 1);
}
+ @Scheduled(cron = "0/3 * * * * ? ")
+ public synchronized void notifyCrn(){
+ notifyMsg("crn", 1);
+ }
+
+ @Scheduled(cron = "0/3 * * * * ? ")
+ public synchronized void notifyDualCrn(){
+ notifyMsg("dualCrn", 1);
+ }
+
private synchronized void notifyMsg(String notifyType, Integer device) {
Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable"));
if(notifyEnableConfig == null){
--
Gitblit v1.9.1