/*
*  Copyright 2019-2025 Tz
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import me.zhengjie.modules.system.domain.dto.BusTreeVo;

/**
* @description /
* @author tz
* @date 2025-05-20
**/
@Data
@TableName("bus_device")
public class BusDevice implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "设备唯一标识")
    private Long id;

    @ApiModelProperty(value = "机器序号")
    private String deviceCode;

    @ApiModelProperty(value = "设备序列号")
    private String deviceSn;

    @ApiModelProperty(value = "型号")
    private String model;

    @ApiModelProperty(value = "品牌")
    private String brand;

    @ApiModelProperty(value = "设备名称")
    private String name;

    @ApiModelProperty(value = "固件版本")
    private String firmwareVersion;

    @ApiModelProperty(value = "协议版本")
    private String protocolVersion;

    @ApiModelProperty(value = "放置位置")
    private String location;

    @ApiModelProperty(value = "设备状态(-1默认/断开，0空闲，1任务中，2准备中，3铲件中)")
    private Integer status;

    @ApiModelProperty(value = "打印状态(-1默认/断开，0空闲，1归零中，2下降中，3曝光中，4抬升中，5正在执行暂停动作中，6已暂停，7正在执行停止动作中，8已停止，9打印完成，10文件检测中，11加液中，12铲件中)")
    private Integer printStatus;

    @ApiModelProperty(value = "异常状态(-1默认/断开，0正常，1文件校验失败，2设备或加密错误，3打印准备过程出错，4打印出错，5加液失败，6铲件失败，7图片异物)")
    private Integer errorStatus;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "类型：1打印机")
    private Integer type;

    @ApiModelProperty(value = "创建者")
    private String createBy;

    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @TableField(exist = false)
    private List<BusDeviceCommand> commandList;

    public void copy(BusDevice source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
