From 8eb62ee0efe77e264cd48b3f1fd835e9b8430318 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期三, 28 十月 2026 15:02:12 +0800
Subject: [PATCH] fix 设备数采

---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/collect/config/MesCollectProperties.java |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/collect/config/MesCollectProperties.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/collect/config/MesCollectProperties.java
index 2571fec..c4ef755 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/collect/config/MesCollectProperties.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/collect/config/MesCollectProperties.java
@@ -14,6 +14,15 @@
 @Data
 public class MesCollectProperties {
 
+    /**
+     * 鎶ユ枃鏍煎紡锛氭敞濉戞満 /YLCY/IMM 鍗忚锛堟姤鏂囧甫 topic 瀛楁锛屼富棰樻湯娈典负鎶ユ枃绫诲瀷锛�
+     */
+    public static final String FORMAT_YLCY = "ylcy";
+    /**
+     * 鎶ユ枃鏍煎紡锛氳澶囩綉鍏冲崗璁紙涓婚鍥哄畾 gateway/xxx锛屾姤鏂囬灞� key 涓鸿澶囧悕锛屽�间负灞炴�у瓧鍏革級
+     */
+    public static final String FORMAT_GATEWAY = "gateway";
+
     private Mqtt mqtt = new Mqtt();
     private Retention retention = new Retention();
 
@@ -35,9 +44,17 @@
          */
         private String clientIdPrefix = "mes-collect";
         /**
-         * 涓婚鍓嶇紑锛屼緥濡� /YLCY/IMM
+         * 涓婚鍓嶇紑锛屼緥濡� /YLCY/IMM銆乬ateway
          */
         private String topicPrefix = "/YLCY/IMM";
+        /**
+         * 鎶ユ枃鏍煎紡锛岃 {@link MesCollectProperties#FORMAT_YLCY}銆亄@link MesCollectProperties#FORMAT_GATEWAY}
+         */
+        private String format = FORMAT_YLCY;
+        /**
+         * 鏄惧紡鎸囧畾璁㈤槄涓婚锛屽涓敤閫楀彿鍒嗛殧锛涗负绌烘椂鎸� format + topicPrefix 鑷姩鎺ㄥ
+         */
+        private String topics;
         private Integer qos = 0;
         private Integer keepAlive = 65;
         private Integer connectionTimeout = 10;
@@ -46,6 +63,13 @@
          */
         private String alarmTopicSuffix = "wm";
 
+        /**
+         * 鏄惁涓鸿澶囩綉鍏虫牸寮忔姤鏂�
+         */
+        public boolean isGatewayFormat() {
+            return FORMAT_GATEWAY.equalsIgnoreCase(format == null ? "" : format.trim());
+        }
+
     }
 
     @Data

--
Gitblit v1.9.3