package com.ff.weijinxiao.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.weijinxiao.util.jsonfilter.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户设置表
 */
@Data
@Entity
@Table(name = "tb_user_setting")
public class UserSetting implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name = "uid")
    @ApiModelProperty(value = "用户登录ID")
    private String uid;

    //价格设置
    @Column(name = "prices2", columnDefinition = "int COMMENT '员工内部价'")
    @ApiModelProperty(value = "员工内部价")
    private Integer prices2;

    @Column(name = "prices3", columnDefinition = "int COMMENT '一级代理价格'")
    @ApiModelProperty(value = "一级代理价格")
    private Integer prices3;

    @Column(name = "prices4", columnDefinition = "int COMMENT '二级代理价格'")
    @ApiModelProperty(value = "二级代理价格")
    private Integer prices4;

    @Column(name = "prices5", columnDefinition = "int COMMENT '三级代理价格'")
    @ApiModelProperty(value = "三级代理价格")
    private Integer prices5;

    //进货设置
    @Column(name = "goods_category", columnDefinition = "int COMMENT '商品分类'")
    @ApiModelProperty(value = "商品分类")
    private Integer goodsCategory = 1;

    @Column(name = "goods_code", columnDefinition = "int COMMENT '商品货号'")
    @ApiModelProperty(value = "商品货号")
    private Integer goodsCode = 1;

    @Column(name = "goods_bar_code", columnDefinition = "int COMMENT '商品条码'")
    @ApiModelProperty(value = "商品条码")
    private Integer goodsBarCode = 1;

    @Column(name = "real_payed", columnDefinition = "int COMMENT '实付款'")
    @ApiModelProperty(value = "实付款")
    private Integer realPayMoney = 1;

    @Column(name = "debt", columnDefinition = "int COMMENT '欠款'")
    @ApiModelProperty(value = "欠款")
    private Integer debt = 1;

    @Column(name = "supplier", columnDefinition = "int COMMENT '供应商'")
    @ApiModelProperty(value = "供应商")
    private Integer supplier = 1;

    @Column(name = "purchase_date", columnDefinition = "int COMMENT '进货日期'")
    @ApiModelProperty(value = "进货日期")
    private Integer purchaseDate = 1;

    @Column(name = "production_date", columnDefinition = "int COMMENT '生产日期'")
    @ApiModelProperty(value = "生产日期")
    private Integer productionDate = 1;

    @Column(name = "be_good_Time", columnDefinition = "int COMMENT '有效期'")
    @ApiModelProperty(value = "有效期")
    private Integer beGoodTime = 1;

    @Column(name = "warning_days", columnDefinition = "int COMMENT '有效期预警时间(天）'")
    @ApiModelProperty(value = "有效期预警时间(天）")
    private Integer warningDays = 30;

    @Column(name = "stock_warning_amount", columnDefinition = "int COMMENT '库存预警数量'")
    @ApiModelProperty(value = "库存预警数量")
    private Integer stockWarningAmount = 10;

    @Column(name = "factory", columnDefinition = "int COMMENT '生产厂商'")
    @ApiModelProperty(value = "生产厂商")
    private Integer factory = 1;

    @Column(name = "explains", columnDefinition = "int COMMENT '商品描述'")
    @ApiModelProperty(value = "商品描述")
    private Integer explains = 1;

    @Column(name = "image", columnDefinition = "int COMMENT '商品图片'")
    @ApiModelProperty(value = "商品图片")
    private Integer image = 1;
    /*------------------------------*/
    //收款方式设置
    @Column(name = "pay_way1", columnDefinition = "varchar(50) COMMENT '收款方式1'")
    @ApiModelProperty(value = "收款方式1")
    private String payWay1 = "现金";

    @Column(name = "pay_way2", columnDefinition = "varchar(50) COMMENT '收款方式2'")
    @ApiModelProperty(value = "收款方式2")
    private String payWay2 = "刷卡";

    @Column(name = "pay_way3", columnDefinition = "varchar(50) COMMENT '收款方式3'")
    @ApiModelProperty(value = "收款方式3")
    private String payWay3 = "支付宝";

    @Column(name = "pay_way4", columnDefinition = "varchar(50) COMMENT '收款方式4'")
    @ApiModelProperty(value = "收款方式4")
    private String payWay4 = "微信";

    @Column(name = "pay_way5", columnDefinition = "varchar(50) COMMENT '收款方式5'")
    @ApiModelProperty(value = "收款方式5")
    private String payWay5 = "";

    @Column(name = "pay_way6", columnDefinition = "varchar(50) COMMENT '收款方式6'")
    @ApiModelProperty(value = "收款方式6")
    private String payWay6 = "";

    @Column(name = "pay_way7", columnDefinition = "varchar(50) COMMENT '收款方式7'")
    @ApiModelProperty(value = "收款方式7")
    private String payWay7 = "";

    @Column(name = "pay_way8", columnDefinition = "varchar(50) COMMENT '收款方式8'")
    @ApiModelProperty(value = "收款方式8")
    private String payWay8 = "";

    /*----------------------------------*/
    @Column(name = "negative_stock", columnDefinition = "int COMMENT '允许负库存'")
    @ApiModelProperty(value = "允许负库存")
    private Integer negativeStock = 0;

    @Column(name = "last_price_notify", columnDefinition = "int COMMENT '上次销售价格提醒'")
    @ApiModelProperty(value = "上次销售价格提醒")
    private Integer lastPriceNotify = 1;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date createTime;

    @Column(name = "modify_time")
    @ApiModelProperty(value = "更新时间")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date modifyTime;


}
