|
@@ -1,10 +1,12 @@
|
|
|
package com.yunfeiyun.agmp.iot.common.service;
|
|
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.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 负责型号相关操作,用来替换之前的枚举写死的name获取相关
|
|
* 负责型号相关操作,用来替换之前的枚举写死的name获取相关
|
|
|
|
|
+ * 如果其他的,自行处理
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
public class TypeCoreService {
|
|
public class TypeCoreService {
|
|
@@ -19,42 +21,11 @@ public class TypeCoreService {
|
|
|
*/
|
|
*/
|
|
|
public String getTypeLv2NameByTypeCode(String typeCode) {
|
|
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);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|