package com.qmth.sop.business.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.base.BaseEntity;
import com.qmth.sop.common.enums.DeviceStatusEnum;
import com.qmth.sop.common.enums.InOutTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 设备配置表
 * </p>
 *
 * @author wangliang
 * @since 2023-08-01
 */
@ApiModel(value="SysDevice对象", description="设备配置表")
public class SysDevice extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "设备编号")
    @NotBlank(message = "设备编号不能为空")
    private String deviceCode;

    @ApiModelProperty(value = "序列号")
    @NotBlank(message = "序列号不能为空")
    private String serialNo;

    @ApiModelProperty(value = "品牌")
    @NotBlank(message = "品牌不能为空")
    private String brand;

    @ApiModelProperty(value = "型号")
    @NotBlank(message = "型号不能为空")
    private String model;

    @ApiModelProperty(value = "购买时间")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
//    @NotNull(message = "购买时间不能为空")
    private Long buyTime;

    @ApiModelProperty(value = "供应商id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long supplierId;

    @ApiModelProperty(value = "状态，NORMAL：正常，BREAK_DOWN：故障")
    private DeviceStatusEnum status;

    @ApiModelProperty(value = "当前所在地")
    private String location;

    @ApiModelProperty(value = "当前所在地(回显)")
    private String locationArr;

    @ApiModelProperty(value = "总扫描量")
    private Long scanCount;

    @ApiModelProperty(value = "出库/入库")
    private InOutTypeEnum bound;

    @ApiModelProperty(value = "是否crm同步，0：否，1：是")
    @NotNull(message = "是否crm同步不能为空")
    private Boolean sync;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    @NotNull(message = "是否启用不能为空")
    private Boolean enable;


    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public Long getBuyTime() {
        return buyTime;
    }

    public void setBuyTime(Long buyTime) {
        this.buyTime = buyTime;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public DeviceStatusEnum getStatus() {
        return status;
    }

    public void setStatus(DeviceStatusEnum status) {
        this.status = status;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getLocationArr() {
        return locationArr;
    }

    public void setLocationArr(String locationArr) {
        this.locationArr = locationArr;
    }

    public Long getScanCount() {
        return scanCount;
    }

    public void setScanCount(Long scanCount) {
        this.scanCount = scanCount;
    }

    public Boolean getSync() {
        return sync;
    }

    public void setSync(Boolean sync) {
        this.sync = sync;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public InOutTypeEnum getBound() {
        return bound;
    }

    public void setBound(InOutTypeEnum bound) {
        this.bound = bound;
    }
}
