package com.uas.eis.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

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

/**
 * Created by luhg on 2018/4/25.
 * 云顶销售订单
 */
@Entity
@Table(name = "edi_sale")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Sale implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name="EDI_SALE_SEQUENCE_GENERATOR", sequenceName="EDI_SALE_SEQ", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="EDI_SALE_SEQUENCE_GENERATOR")
    @Column(name = "id_")
    private Long id;

    @Column(name = "trade_no")
    private String trade_no;

    @Column(name = "consign_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date consign_time;

    @Column(name = "customer_no")
    private String customer_no;

    @Column(name = "customer_name")
    private String customer_name;

    @Column(name = "warehouse_no")
    private String warehouse_no;


    @Column(name = "date_")
    private Date date = new Date();

    @Column(name = "shop_no")
    private String shop_no;


    @Column(name = "remark")
    private String remark;

    @Column(name = "salesman_no")
    private String salesman_no;

    @Column(name = "src_trade_no")
    private String src_trade_no;



    /**
     * 销售订单明细.
     */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name = "mainid_")
    private List<SaleDetail> details_list;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTrade_no() {
        return trade_no;
    }

    public void setTrade_no(String trade_no) {
        this.trade_no = trade_no;
    }

    public Date getConsign_time() {
        return consign_time;
    }

    public void setConsign_time(Date consign_time) {
        this.consign_time = consign_time;
    }

    public String getCustomer_no() {
        return customer_no;
    }

    public void setCustomer_no(String customer_no) {
        this.customer_no = customer_no;
    }

    public String getCustomer_name() {
        return customer_name;
    }

    public void setCustomer_name(String customer_name) {
        this.customer_name = customer_name;
    }

    public List<SaleDetail> getDetails_list() {
        return details_list;
    }

    public void setDetails_list(List<SaleDetail> details_list) {
        this.details_list = details_list;
    }

    public String getWarehouse_no() {
        return warehouse_no;
    }

    public void setWarehouse_no(String warehouse_no) {
        this.warehouse_no = warehouse_no;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getShop_no() {
        return shop_no;
    }

    public void setShop_no(String shop_no) {
        this.shop_no = shop_no;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getSalesman_no() {
        return salesman_no;
    }

    public void setSalesman_no(String salesman_no) {
        this.salesman_no = salesman_no;
    }

    public String getSrc_trade_no() {
        return src_trade_no;
    }

    public void setSrc_trade_no(String src_trade_no) {
        this.src_trade_no = src_trade_no;
    }
}
