package com.qianwen.smartman.modules.cps.convert;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import com.qianwen.smartman.modules.cps.entity.DeviceType;
|
import com.qianwen.smartman.modules.cps.excel.DeviceTypeExcel;
|
import com.qianwen.smartman.modules.cps.vo.DeviceTypeAddVO;
|
import com.qianwen.smartman.modules.cps.vo.DeviceTypeUpdateVO;
|
import com.qianwen.smartman.modules.cps.vo.DeviceTypeVO;
|
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/convert/DeviceTypeConvertImpl.class */
|
public class DeviceTypeConvertImpl implements DeviceTypeConvert {
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public DeviceType convert(DeviceTypeAddVO deviceTypeDTO) {
|
if (deviceTypeDTO == null) {
|
return null;
|
}
|
DeviceType deviceType = new DeviceType();
|
deviceType.setStatus(deviceTypeDTO.getStatus());
|
deviceType.setCode(deviceTypeDTO.getCode());
|
deviceType.setName(deviceTypeDTO.getName());
|
deviceType.setRemark(deviceTypeDTO.getRemark());
|
return deviceType;
|
}
|
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public DeviceType convert(DeviceTypeUpdateVO deviceTypeUpdateDTO) {
|
if (deviceTypeUpdateDTO == null) {
|
return null;
|
}
|
DeviceType deviceType = new DeviceType();
|
deviceType.setId(deviceTypeUpdateDTO.getId());
|
deviceType.setStatus(deviceTypeUpdateDTO.getStatus());
|
deviceType.setName(deviceTypeUpdateDTO.getName());
|
deviceType.setRemark(deviceTypeUpdateDTO.getRemark());
|
return deviceType;
|
}
|
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public DeviceTypeVO convert(DeviceType deviceType) {
|
if (deviceType == null) {
|
return null;
|
}
|
DeviceTypeVO deviceTypeVO = new DeviceTypeVO();
|
deviceTypeVO.setId(deviceType.getId());
|
deviceTypeVO.setCode(deviceType.getCode());
|
deviceTypeVO.setName(deviceType.getName());
|
deviceTypeVO.setRemark(deviceType.getRemark());
|
deviceTypeVO.setStatus(deviceType.getStatus());
|
return deviceTypeVO;
|
}
|
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public List<DeviceTypeVO> convert(List<DeviceType> deviceTypeList) {
|
if (deviceTypeList == null) {
|
return null;
|
}
|
List<DeviceTypeVO> list = new ArrayList<>(deviceTypeList.size());
|
for (DeviceType deviceType : deviceTypeList) {
|
list.add(convert(deviceType));
|
}
|
return list;
|
}
|
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public List<DeviceTypeExcel> convert1(List<DeviceType> deviceTypeList) {
|
if (deviceTypeList == null) {
|
return null;
|
}
|
List<DeviceTypeExcel> list = new ArrayList<>(deviceTypeList.size());
|
for (DeviceType deviceType : deviceTypeList) {
|
list.add(deviceTypeToDeviceTypeExcel(deviceType));
|
}
|
return list;
|
}
|
|
@Override // org.springblade.modules.cps.convert.DeviceTypeConvert
|
public DeviceType convert(DeviceTypeExcel excel) {
|
if (excel == null) {
|
return null;
|
}
|
DeviceType deviceType = new DeviceType();
|
deviceType.setStatus(excel.getStatus());
|
deviceType.setCode(excel.getCode());
|
deviceType.setName(excel.getName());
|
deviceType.setRemark(excel.getRemark());
|
return deviceType;
|
}
|
|
protected DeviceTypeExcel deviceTypeToDeviceTypeExcel(DeviceType deviceType) {
|
if (deviceType == null) {
|
return null;
|
}
|
DeviceTypeExcel deviceTypeExcel = new DeviceTypeExcel();
|
deviceTypeExcel.setCode(deviceType.getCode());
|
deviceTypeExcel.setName(deviceType.getName());
|
deviceTypeExcel.setRemark(deviceType.getRemark());
|
deviceTypeExcel.setStatus(deviceType.getStatus());
|
return deviceTypeExcel;
|
}
|
}
|