xujie hace 1 año
padre
commit
1c9ae93573

+ 6 - 6
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotDeviceInfoServiceImpl.java

@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.SecurityConstants;
-import com.xunmei.common.core.enums.iot.DeviceTypeEnum;
+import com.xunmei.common.core.enums.iot.BaseDeviceTypeEnum;
 import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.iot.dto.deviceInfo.IotDeviceInfoPageDto;
@@ -42,7 +42,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
         List<IotDeviceInfoPageVo> records = page.getRecords();
         if (records != null && records.size() > 0){
             for (IotDeviceInfoPageVo record : records) {
-                record.setDeviceTypeName(DeviceTypeEnum.getDescByCode(record.getDeviceType()));
+                record.setDeviceTypeName(BaseDeviceTypeEnum.getDescByCode(record.getDeviceType()));
             }
         }
         return TableDataInfo.build(page);
@@ -52,16 +52,16 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
     public DeviceDetailInfoVo getDetail(Serializable id) {
         DeviceDetailInfoVo detailInfoVo = baseMapper.getDetailById(id);
         if (detailInfoVo != null){
-            detailInfoVo.setDeviceTypeName(DeviceTypeEnum.getDescByCode(detailInfoVo.getDeviceType()));
+            detailInfoVo.setDeviceTypeName(BaseDeviceTypeEnum.getDescByCode(detailInfoVo.getDeviceType()));
             String deviceProduct = null;
             //监控主机需要查询deviceProduct
-            if (ObjectUtil.equal(DeviceTypeEnum.DVS.getCode(),detailInfoVo.getDeviceType())){
+            if (ObjectUtil.equal(BaseDeviceTypeEnum.Dvs.getCode(),detailInfoVo.getDeviceType())){
                 deviceProduct = detailInfoVo.getDeviceProduct();
             }
             List<DeviceDetailInfoVo> infoList = baseMapper.getChildrenInfoList(deviceProduct, detailInfoVo.getIotToken(), detailInfoVo.getDeviceCode());
             if (infoList !=null && infoList.size() > 0){
                 for (DeviceDetailInfoVo infoVo : infoList) {
-                    infoVo.setDeviceTypeName(DeviceTypeEnum.getDescByCode(infoVo.getDeviceType()));
+                    infoVo.setDeviceTypeName(BaseDeviceTypeEnum.getDescByCode(infoVo.getDeviceType()));
                 }
             }
             detailInfoVo.setChildrenInfos(infoList);
@@ -74,7 +74,7 @@ public class IotDeviceInfoServiceImpl extends ServiceImpl<IotDeviceInfoMapper, I
     public DeviceDetailInfoVo getAlarmHostDetail(Serializable id) {
         DeviceDetailInfoVo detailInfoVo = baseMapper.getDetailById(id);
         if (detailInfoVo != null){
-            detailInfoVo.setDeviceTypeName(DeviceTypeEnum.getDescByCode(detailInfoVo.getDeviceType()));
+            detailInfoVo.setDeviceTypeName(BaseDeviceTypeEnum.getDescByCode(detailInfoVo.getDeviceType()));
             //查询报警控制器列表(报警子系统)
             List<DeviceDetailInfoVo> list = subsystemMapper.getByDeviceCodeAndIotToken(detailInfoVo.getDeviceCode(), detailInfoVo.getIotToken());
             detailInfoVo.setChildrenInfos(list);