package com.usoft.fin.grpc.bl.entity.b2b;

import com.alibaba.fastjson.annotation.JSONField;
import com.usoft.fin.grpc.api.entity.OrderInfo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 订单
 * @author wangmh
 * @date 2018-08-29 11:30
 **/
public class Order {

    /**
     * 客户企业名称
     */
    private String custName;

    /**
     * 客户企业UU号
     */
    private int custUU;

    /**
     * 订单时间
     */
    private String date;

    /**
     * 订单id
     */
    private int id;

    /**
     * 订单编号
     */
    private String orderCode;

    /**
     * 订单总金额，默认为0
     */
    private int total = 0;

    /**
     * 订单明细
     */
    private List<OrderItem> orderItems;

    @JSONField(name = "customerName")
    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    public int getCustUU() {
        return custUU;
    }

    public void setCustUU(int custUU) {
        this.custUU = custUU;
    }

    @JSONField(name = "orderDate")
    public String getDate() {
        return date;
    }

    public void setDate(long date) {
        this.date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(date));
    }

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

    public int getId() {
        return id;
    }

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

    @JSONField(name = "code")
    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    @JSONField(name = "amount")
    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    @JSONField(name = "orderDetailInfo")
    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }
}
