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
package com.mes.device.entity;
 
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
 
import java.util.Date;
 
/**
 * 设备配置实体类
 * 对应数据库表:device_config
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("device_config")
@ApiModel(value = "设备配置信息")
public class DeviceConfig {
 
    @ApiModelProperty(value = "设备ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
 
    @ApiModelProperty(value = "设备名称", example = "大车设备1")
    @TableField("device_name")
    private String deviceName;
 
    @ApiModelProperty(value = "设备编号", example = "DEV_001")
    @TableField("device_code")
    private String deviceCode;
 
    @ApiModelProperty(value = "设备类型", example = "大车设备/大理片笼")
    @TableField("device_type")
    private String deviceType;
 
    @ApiModelProperty(value = "所属项目ID", example = "1")
    @TableField("project_id")
    private Long projectId;
 
    @ApiModelProperty(value = "PLC IP地址", example = "192.168.1.100")
    @TableField("plc_ip")
    private String plcIp;
 
    @ApiModelProperty(value = "PLC端口", example = "102")
    @TableField("plc_port")
    private Integer plcPort;
 
    @ApiModelProperty(value = "设备状态", example = "在线/离线/维护中/故障")
    @TableField("status")
    private String status;
 
    @ApiModelProperty(value = "PLC类型", example = "S7-1200/S7-1500")
    @TableField("plc_type")
    private String plcType;
 
    @ApiModelProperty(value = "模块名称", example = "大车设备模块")
    @TableField("module_name")
    private String moduleName;
 
    @ApiModelProperty(value = "是否主控设备", example = "true")
    @TableField("is_primary")
    private Boolean isPrimary;
 
    @ApiModelProperty(value = "是否启用", example = "true")
    @TableField("enabled")
    private Boolean enabled;
 
    @ApiModelProperty(value = "设备特定配置JSON", example = "{\"vehicleCapacity\": 6000, \"glassIntervalMs\": 1000}")
    @TableField("config_json")
    private String configJson;
 
    @ApiModelProperty(value = "设备描述", example = "大车设备1")
    @TableField("description")
    private String description;
 
    @ApiModelProperty(value = "扩展参数JSON", example = "{\"timeout\": 5000, \"retries\": 3}")
    @TableField("extra_params")
    private String extraParams;
 
    @ApiModelProperty(value = "是否删除:0-否,1-是", example = "0")
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;
 
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;
 
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;
 
    @ApiModelProperty(value = "创建人", example = "system")
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;
 
    @ApiModelProperty(value = "更新人", example = "system")
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;
 
    // 设备类型常量
    public static final class DeviceType {
        public static final String LOAD_VEHICLE = "大车设备";      // 大车设备
        public static final String LARGE_GLASS = "大理片笼";      // 大理片笼
        public static final String WORKSTATION_SCANNER = "卧转立扫码设备"; // 卧转立扫码设备
        public static final String WORKSTATION_TRANSFER = "卧转立设备";    // 卧转立设备
    }
 
    // PLC类型常量
    public static final class PlcType {
        public static final String S7_1200 = "S7-1200";  // S7-1200
        public static final String S7_1500 = "S7-1500";  // S7-1500
    }
    
    // 设备状态常量
    public static final class Status {
        public static final String ONLINE = "在线";        // 在线
        public static final String OFFLINE = "离线";       // 离线
        public static final String MAINTENANCE = "维护中";  // 维护中
        public static final String FAULT = "故障";         // 故障
    }
}