package com.zm.order.tool.server.model;

import com.alibaba.fastjson.JSON;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author nianchang
 * @ClassName XueliOrder
 * @date 2021/11/08 11:10 上午
 */
public class XueliOrder implements Serializable {

    private static final long serialVersionUID = -4453007257845934761L;

    private Integer channelId;

    private Integer couponAmount;

    private Integer deliveryAmount;

    private String extStoreCode;

    private String externalId;

    private Long memberId;

    private Integer orderAmount;

    private Integer payAmount;

    private Date orderDate;

    private Date orderTime;

    private Integer orderType;

    private Integer points;

    private Integer status;

    private Integer storeId;

    private String storeName;

    private String orderItems;
    
    private List<XueliOrderItem> orderItemList;

    private String orderCoupons;

    private List<XueliOrderDiscount> discountList;

    private String ordPayments;

    private List<XueliOrderPay> payList;

    public List<XueliOrderPay> getPayList() {
        return payList;
    }

    public void setPayList(List<XueliOrderPay> payList) {
        this.payList = payList;
    }

    public List<XueliOrderDiscount> getDiscountList() {
        return discountList;
    }

    public void setDiscountList(List<XueliOrderDiscount> discountList) {
        this.discountList = discountList;
    }

    public String getOrderCoupons() {
        return orderCoupons;
    }

    public void setOrderCoupons(String orderCoupons) {
        if(!StringUtils.isEmpty(orderCoupons)){
            this.discountList = JSON.parseArray(orderCoupons, XueliOrderDiscount.class);
        }
        this.orderCoupons = orderCoupons;
    }

    public String getOrdPayments() {
        return ordPayments;
    }

    public void setOrdPayments(String ordPayments) {
        if(!StringUtils.isEmpty(ordPayments)){
            this.payList = JSON.parseArray(ordPayments, XueliOrderPay.class);
        }
        this.ordPayments = ordPayments;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public Integer getCouponAmount() {
        return couponAmount;
    }

    public void setCouponAmount(Integer couponAmount) {
        this.couponAmount = couponAmount;
    }

    public Integer getDeliveryAmount() {
        return deliveryAmount;
    }

    public void setDeliveryAmount(Integer deliveryAmount) {
        this.deliveryAmount = deliveryAmount;
    }

    public String getExtStoreCode() {
        return extStoreCode;
    }

    public void setExtStoreCode(String extStoreCode) {
        this.extStoreCode = extStoreCode;
    }

    public String getExternalId() {
        return externalId;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Integer getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(Integer orderAmount) {
        this.orderAmount = orderAmount;
    }

    public Integer getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Integer payAmount) {
        this.payAmount = payAmount;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    public Integer getStatus() {
        return status;
    }

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

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(String orderItems) {
        if (!StringUtils.isEmpty(orderItems)) {
            this.orderItemList = JSON.parseArray(orderItems, XueliOrderItem.class);
        }
        this.orderItems = orderItems;
    }

    public List<XueliOrderItem> getOrderItemList() {
        return orderItemList;
    }

    public void setOrderItemList(List<XueliOrderItem> orderItemList) {
        this.orderItemList = orderItemList;
    }
}
