ソースを参照

导出设备增加采集标签字段

欧阳劲驰 2 週間 前
コミット
192567c574

+ 6 - 0
custom-gateway-core/src/main/java/com/shkpr/service/customgateway/core/components/DeviceRegistry.java

@@ -323,6 +323,12 @@ public class DeviceRegistry {
                             .map(it -> fieldMap.get(it.getField()))
                             .collect(Collectors.joining("/"))
             );
+            //设置标签
+            deviceExcel.setTags(
+                    device.getTags().stream()
+                            .map(it -> fieldMap.get(it.getTag()))
+                            .collect(Collectors.joining("/"))
+            );
             return deviceExcel;
         }).collect(Collectors.toList());
 

+ 5 - 0
custom-gateway-core/src/main/java/com/shkpr/service/customgateway/core/domain/DeviceExcel.java

@@ -41,5 +41,10 @@ public class DeviceExcel {
      */
     @ExcelMapping("字段")
     private String field;
+    /**
+     * 标签
+     */
+    @ExcelMapping("标签")
+    private String tags;
 
 }