yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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;
    }
}