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;
|
}
|
|
}
|