Parcourir la source

Merge remote-tracking branch 'origin/master'

liuyaowen il y a 1 an
Parent
commit
818a98ac54

+ 10 - 2
src/main/java/com/yunfeiyun/agmp/iot/common/domain/IotDevice.java

@@ -28,7 +28,7 @@ public class IotDevice extends IotBaseEntity
     private String tid;
 
     /** 设备类型标识 */
-    @Excel(name = "设备型标识")
+    @Excel(name = "设备型标识")
     private String devtypeBid;
 
     /** 厂商信息标识 */
@@ -36,7 +36,7 @@ public class IotDevice extends IotBaseEntity
     private String firmBid;
 
     /** 设备大类标识 */
-    @Excel(name = "设备类标识")
+    @Excel(name = "设备类标识")
     private String devclassBid;
 
     /** 连接配置标识 */
@@ -44,6 +44,14 @@ public class IotDevice extends IotBaseEntity
     private String devconnBid;
 
     /** 设备编号 */
+    @Excel(name = "设备型号名称")
+    private String devtypeName;
+
+    /** 设备名称 */
+    @Excel(name = "设备类型名称")
+    private String devclassName;
+
+    /** 设备编号 */
     @Excel(name = "设备编号")
     private String devCode;
 

+ 2 - 2
src/main/java/com/yunfeiyun/agmp/iot/common/enums/IotDeviceStatusTypeEnum.java

@@ -17,9 +17,9 @@ public enum IotDeviceStatusTypeEnum {
         this.name = name;
     }
 
-    public static String getNameByCode(String name) {
+    public static String getNameByCode(String code) {
         for (IotDeviceStatusTypeEnum item : IotDeviceStatusTypeEnum.values()) {
-            if (item.code.equals(name)) {
+            if (item.code.equals(code)) {
                 return item.name;
             }
         }

+ 5 - 34
src/main/java/com/yunfeiyun/agmp/iot/common/service/TypeCoreService.java

@@ -1,10 +1,12 @@
 package com.yunfeiyun.agmp.iot.common.service;
 
+import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
  * 负责型号相关操作,用来替换之前的枚举写死的name获取相关
+ * 如果其他的,自行处理
  */
 @Service
 public class TypeCoreService {
@@ -19,42 +21,11 @@ public class TypeCoreService {
      */
     public String getTypeLv2NameByTypeCode(String typeCode) {
         // 从缓存取出来
-        return typeCode;
+        return getLv2ModelByLv2Code(typeCode).getDevtypeName();
     }
 
-    /**
-     * 获取型号(二级)的id根据他的code
-     *
-     * @return
-     */
-    public String getTypeLv2IdByTypeCode(String typeCode) {
-        // 从缓存取出来
-        return typeCode;
-
-    }
-
-    /**
-     * 根据型号(二级)的id查询所属大类的类型id
-     * <p>
-     * 该方法用来兼用根据查询设备的大类信息
-     * IotDeviceDictEnum.getLv1NameByCode
-     *
-     * @param lv2TypeId
-     * @return
-     */
-    public String getLv1CodeByTypeLv2Id(String lv2TypeId) {
-        // 从缓存取出来
-        return lv2TypeId;
-    }
-
-    /**
-     * 根据型号(二级)的id查询所属大类的类型名称
-     *
-     * @return
-     */
-    public String getLv1NameByTypeLv2Id(String lv2TypeId) {
-        // 从缓存取出来
-        return lv2TypeId;
+    public TosDevicetype getLv2ModelByLv2Code(String typeCode) {
+        return typeCacheService.getCacheObjectByDevTypeCode(typeCode);
     }
 
 }