From c7b3edb405149d76e0e71d7e754bd46c42b05eb3 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期六, 26 七月 2025 12:24:51 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/utils/NotifyUtils.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/NotifyUtils.java b/src/main/java/com/zy/asrs/utils/NotifyUtils.java
index 431bf18..0468a0f 100644
--- a/src/main/java/com/zy/asrs/utils/NotifyUtils.java
+++ b/src/main/java/com/zy/asrs/utils/NotifyUtils.java
@@ -27,12 +27,12 @@
     @Autowired
     private ConfigService configService;
 
-    public synchronized boolean notify(String notifyType, Integer device, String taskNo, NotifyMsgType msgType) {
-        return append(notifyType, device, taskNo, msgType, null);
+    public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType) {
+        return append(notifyType, device, taskNo, superTaskNo, msgType, null);
     }
 
-    public synchronized boolean notify(String notifyType, Integer device, String taskNo, NotifyMsgType msgType, String data) {
-        return append(notifyType, device, taskNo, msgType, data);
+    public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data) {
+        return append(notifyType, device, taskNo, superTaskNo, msgType, data);
     }
 
     public synchronized List<String> takeKeys(String notifyType, Integer device) {
@@ -68,9 +68,19 @@
         return key;
     }
 
-    private boolean append(String notifyType, Integer device, String taskNo, NotifyMsgType msgType, String data) {
+    private boolean append(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data) {
+        boolean notifyEnable = true;
+        Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable"));
+        if (notifyEnableConfig != null) {
+            notifyEnable = notifyEnableConfig.getValue().equals("Y");
+        }
+
+        if (!notifyEnable) {
+            return false;
+        }
+
         String key = getKey(notifyType, device);
-        if(key == null){
+        if (key == null) {
             return false;
         }
 
@@ -82,6 +92,7 @@
         dto.setMsgDesc(msgType.desc);
         dto.setData(data);
         dto.setTaskNo(taskNo);
+        dto.setSuperTaskNo(superTaskNo);
 
         //閲嶈瘯娆℃暟
         Config notifyFailTimesConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyFailTimes"));

--
Gitblit v1.9.1