package cn.pluss.platform.entity;

import cn.pluss.platform.config.mybatis.SqlConditionExtra;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author bzg
 * @since 2020-11-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_pluss_device_stock")
public class DeviceStock implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    /**
     * 设备唯一编码，码牌即为二维码编号
     */
    @TableField(value = "snNo",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String snNo;

    /**
     * 厂家设备编号，音箱播报需要
     */
    @TableField(value = "deviceNo")
    private String deviceNo;

    /**
     * code
     */
    @TableField(value = "code", whereStrategy = FieldStrategy.NOT_EMPTY)
    private String code;


    /**
     * 设备购买单号
     */
    @TableField(value = "orderNo",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String orderNo;


    /**
     * 设备购买价格
     */
    @TableField("price")
    private BigDecimal price;


    /**
     * 设备版本
     */
    @TableField(value = "type",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String type;

    /**
     * 库存分组
     */
    @TableField(value = "groupNo",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String groupNo;

    /**
     * 购买商家名称
     */
    @TableField(value = "buyMercName",whereStrategy = FieldStrategy.NOT_EMPTY,condition = SqlCondition.LIKE)
    private String buyMercName;


    /**
     * 购买商家ID
     */
    @TableField(value = "buyMercId",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String buyMercId;


    /**
     * 激活商家名称
     */
    @TableField(value = "actMercName",whereStrategy = FieldStrategy.NOT_EMPTY,condition = SqlCondition.LIKE)
    private String actMercName;


    /**
     * 激活商家ID
     */
    @TableField(value = "actMercId",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String actMercId;

    @TableField(exist = false)
    private String actUserId;

    @TableField(exist = false)
    private String buyUserId;


    /**
     * 二维码状态1：未出售，2：已出售 3:已激活
     */
    @TableField(value = "status",whereStrategy = FieldStrategy.NOT_EMPTY)
    private String status;


    /**
     * 创建时间
     */
    @TableField(value = "createTime", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "updateTime", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 创建时间 开始时间
     */
    @TableField(select = false, value = "createTime", condition = SqlConditionExtra.GT)
    private Date createTimeStart;

    /**
     * 创建时间 截止时间
     */
    @TableField(select = false, value = "createTime", condition = SqlConditionExtra.LT)
    private Date createTimeEnd;

    /**
     * 创建人
     */
    @TableField("createBy")
    private String createBy;


    /**
     * 删除标记1：正常2：删除
     */
    @TableField("delFlag")
    private String delFlag;


    /**
     * 备注
     */
    @TableField("remarks")
    private String remarks;

    /**
     *开始设备编号
     */
    @TableField(exist = false)
    private String startSnNo;

    /**
     *结束设备编号
     */
    @TableField(exist = false)
    private String endSnNo;

    /**
     * 归属用户ID 如果是商户直接从设备商城购买的问题
     * 就显示当前使用用户ID
     * 如果是直营团队那边的 就归属于上级ID
     */
    @TableField("belongUserId")
    private Long belongUserId;

    /**
     * 提货人用户ID
     */
    @TableField("extractUserId")
    private Long extractUserId;

    /**
     * 所属角色
     */
    @TableField("roleCode")
    private String roleCode;

    /**
     * 入库时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("inStockTime")
    private Date inStockTime;


    /**
     * 划拨状态 划拨状态 01：待接收 其他表示已接收
     */
    @TableField("transferStatus")
    private String transferStatus;

    /**
     * 绑定时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date bindTime;

}