CZT
2023-10-11 564295458c720206db9b5194b90481b711f4b010
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.ld.igds.models;
 
import com.bstek.dorado.annotation.PropertyDef;
import com.ld.igds.constant.DeviceLocation;
import com.ld.igds.constant.DeviceStatus;
import com.ld.igds.constant.DeviceType;
 
import lombok.Data;
 
import javax.persistence.*;
 
import java.io.Serializable;
 
/**
 * 基础设备信息
 *
 * @author Andy
 * <p>
 * 版本升级记录: 1,UUID 调整为ID 2,ID 调整为 passCode
 */
@Data
@Entity
@Table(name = "D_DEVICE")
public class Device implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    @Id
    @Column(name = "ID_", length = 40)
    @PropertyDef(label = "ID")
    private String id;
 
    @Column(name = "COMPANY_ID_", length = 10)
    @PropertyDef(label = "组织编码", description = "")
    private String companyId;
 
    @Column(name = "DEPOT_ID_", length = 50)
    @PropertyDef(label = "所属仓库")
    private String depotId;
 
    @Column(name = "PASS_CODE_")
    @PropertyDef(label = "通道/地址", description = "设备通道配置")
    private int passCode;
 
    @Column(name = "NAME_", length = 50)
    @PropertyDef(label = "名称")
    private String name;
 
    @Column(name = "SER_ID_", length = 10)
    @PropertyDef(label = "所属分机")
    private String serId;
 
    @Column(name = "TYPE_", length = 10)
    @PropertyDef(label = "设备类型")
    private String type;
 
    @Column(name = "LOCATION_", length = 10)
    @PropertyDef(label = "所属位置", description = "01-正面,02-背面,03-左侧面,04-右侧面")
    private String location;
 
    @Column(name = "STATUS_", length = 10)
    @PropertyDef(label = "当前状态", description = "查看枚举")
    private String status;
 
    @Column(name = "POWER_")
    @PropertyDef(label = "设备功率", description = "设备功率,没有可不填写:KW/H")
    private Double power;
 
//    @Column(name = "MODBUS_",length = 100)
//    @PropertyDef(label = "Modbus配置")
//    private String modbus;
 
    @Column(name = "REMARK_", length = 250)
    @PropertyDef(label = "备注", description = "备注信息")
    private String remark;
 
    @Column(name = "LINK_", length = 40)
    @PropertyDef(label = "关联设备通道", description = "针对双通道配置设备,如混流风口的风机、轴流风口的风机")
    private String link;
 
//    @Column(name = "LINK_MODBUS_",length = 100)
//    @PropertyDef(label = "关联设备Modbus")
//    private String linkModbus;
 
    @Column(name = "EXT1_", length = 20)
    @PropertyDef(label = "扩展字段1", description = "根据业务需要自定义存储值")
    private String ext1;
 
    @Column(name = "EXT2_", length = 20)
    @PropertyDef(label = "扩展字段2", description = "根据业务需要自定义存储值")
    private String ext2;
 
    @Column(name = "EXT3_", length = 20)
    @PropertyDef(label = "扩展字段3", description = "根据业务需要自定义存储值")
    private String ext3;
 
    @PropertyDef(label = "X坐标", description = "三维模型中坐标,页面无需维护")
    @Column(name = "POS_X_")
    private Double posX;
 
    @PropertyDef(label = "Y坐标", description = "三维模型中坐标,页面无需维护")
    @Column(name = "POS_Y_")
    private Double posY;
 
    @Transient
    @PropertyDef(label = "目标状态", description = "查看枚举")
    private String targetStatus;
 
    @Transient
    @PropertyDef(label = "设备类型")
    private String typeName;
 
    @Transient
    @PropertyDef(label = "位置")
    private String locationName;
 
    @Transient
    @PropertyDef(label = "当前状态")
    private String statusName;
 
    public String getStatusName() {
        if (null != this.type) {
            return DeviceStatus.getDeviceStatus(this.status);
        }
        return null;
    }
 
    public String getTypeName() {
        if (null != this.type) {
            return DeviceType.getMsg(this.type);
        }
        return null;
    }
 
    public String getLocationName() {
        if (null != this.type) {
            return DeviceLocation.getMsg(this.type);
        }
        return null;
    }
 
}