Commit a426793f authored by 耿迪迪's avatar 耿迪迪

代码还原 gengdidi

parent e9e89cc2
...@@ -2,12 +2,9 @@ package com.zehong.system.service.impl; ...@@ -2,12 +2,9 @@ package com.zehong.system.service.impl;
import java.util.*; import java.util.*;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.TPipe;
import com.zehong.system.domain.vo.DeviceInfoVo; import com.zehong.system.domain.vo.DeviceInfoVo;
import com.zehong.system.mapper.TPipeMapper; import com.zehong.system.mapper.TPipeMapper;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -28,8 +25,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -28,8 +25,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
private TDeviceInfoMapper tDeviceInfoMapper; private TDeviceInfoMapper tDeviceInfoMapper;
@Autowired @Autowired
private TPipeMapper tPipeMapper; private TPipeMapper tPipeMapper;
@Autowired
private ISysDictTypeService iSysDictTypeService;
/** /**
* 查询设备信息 * 查询设备信息
...@@ -38,22 +33,9 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -38,22 +33,9 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
* @return 设备信息 * @return 设备信息
*/ */
@Override @Override
public DeviceInfoVo selectTDeviceInfoById(int deviceId) public TDeviceInfo selectTDeviceInfoById(int deviceId)
{ {
DeviceInfoVo deviceInfoVo = new DeviceInfoVo(); return tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
BeanUtils.copyProperties(tDeviceInfo, deviceInfoVo);
if (StringUtils.isNotEmpty(tDeviceInfo.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (tDeviceInfo.getDeviceType().equals(sysDictData.getDictValue())) {
deviceInfoVo.setDeviceType(sysDictData.getDictLabel());
}
}
}
return deviceInfoVo;
} }
/** /**
...@@ -77,15 +59,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -77,15 +59,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId()); TPipe pipe = tPipeMapper.selectTPipeById(device.getPipeId());
deviceInfoVo.setPipeName(pipe.getPipeName()); deviceInfoVo.setPipeName(pipe.getPipeName());
if (StringUtils.isNotEmpty(device.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (device.getDeviceType().equals(sysDictData.getDictValue())) {
deviceInfoVo.setDeviceType(sysDictData.getDictLabel());
}
}
}
list.add(deviceInfoVo); list.add(deviceInfoVo);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment