huang
5 天以前 9571229a2013472dc701ecf5767f2873b36d8f90
mes-processes/mes-plcSend/src/main/java/com/mes/device/entity/DeviceConfig.java
@@ -2,7 +2,8 @@
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -15,101 +16,102 @@
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("device_config")
@Schema(name = "DeviceConfig", description = "设备配置信息")
@ApiModel(value = "设备配置信息")
public class DeviceConfig {
    @Schema(description = "设备ID", example = "1")
    @ApiModelProperty(value = "设备ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @Schema(description = "设备唯一标识", example = "DEVICE_001")
    @ApiModelProperty(value = "设备唯一标识", example = "DEVICE_001")
    @TableField("device_id")
    private String deviceId;
    @Schema(description = "设备名称", example = "上大车设备1")
    @ApiModelProperty(value = "设备名称", example = "大车设备1")
    @TableField("device_name")
    private String deviceName;
    @Schema(description = "设备编号", example = "DEV_001")
    @ApiModelProperty(value = "设备编号", example = "DEV_001")
    @TableField("device_code")
    private String deviceCode;
    @Schema(description = "设备类型", example = "上大车/大理片/玻璃存储")
    @ApiModelProperty(value = "设备类型", example = "大车设备/大理片笼")
    @TableField("device_type")
    private String deviceType;
    @Schema(description = "所属项目ID", example = "1")
    @ApiModelProperty(value = "所属项目ID", example = "1")
    @TableField("project_id")
    private Long projectId;
    @Schema(description = "PLC IP地址", example = "192.168.1.100")
    @ApiModelProperty(value = "PLC IP地址", example = "192.168.1.100")
    @TableField("plc_ip")
    private String plcIp;
    @Schema(description = "PLC端口", example = "102")
    @ApiModelProperty(value = "PLC端口", example = "102")
    @TableField("plc_port")
    private Integer plcPort;
    @Schema(description = "设备状态", example = "在线/离线/维护中/故障")
    @ApiModelProperty(value = "设备状态", example = "在线/离线/维护中/故障")
    @TableField("status")
    private String status;
    @Schema(description = "PLC类型", example = "S7-1200/S7-1500")
    @ApiModelProperty(value = "PLC类型", example = "S7-1200/S7-1500")
    @TableField("plc_type")
    private String plcType;
    @Schema(description = "模块名称", example = "上大车模块")
    @ApiModelProperty(value = "模块名称", example = "大车设备模块")
    @TableField("module_name")
    private String moduleName;
    @Schema(description = "是否主控设备", example = "true")
    @ApiModelProperty(value = "是否主控设备", example = "true")
    @TableField("is_primary")
    private Boolean isPrimary;
    @Schema(description = "是否启用", example = "true")
    @ApiModelProperty(value = "是否启用", example = "true")
    @TableField("enabled")
    private Boolean enabled;
    @Schema(description = "设备特定配置JSON", example = "{\"vehicleCapacity\": 6000, \"glassIntervalMs\": 1000}")
    @ApiModelProperty(value = "设备特定配置JSON", example = "{\"vehicleCapacity\": 6000, \"glassIntervalMs\": 1000}")
    @TableField("config_json")
    private String configJson;
    @Schema(description = "设备描述", example = "上大车设备1")
    @ApiModelProperty(value = "设备描述", example = "大车设备1")
    @TableField("description")
    private String description;
    @Schema(description = "扩展参数JSON", example = "{\"timeout\": 5000, \"retries\": 3}")
    @ApiModelProperty(value = "扩展参数JSON", example = "{\"timeout\": 5000, \"retries\": 3}")
    @TableField("extra_params")
    private String extraParams;
    @Schema(description = "是否删除:0-否,1-是", example = "0")
    @ApiModelProperty(value = "是否删除:0-否,1-是", example = "0")
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;
    @Schema(description = "创建时间")
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;
    @Schema(description = "更新时间")
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;
    @Schema(description = "创建人", example = "system")
    @ApiModelProperty(value = "创建人", example = "system")
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;
    @Schema(description = "更新人", example = "system")
    @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 GLASS_STORAGE = "玻璃存储";   // 玻璃存储
        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类型常量