package com.ym.mec.biz.dal.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 学生查询订单详情返回类
 *
 * @author hgw
 * Created by 2022-01-12
 */
public class StudentPaymentOrderVo {

    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 订单类型
     */
    private String orderType;
    /**
     * 订单类型-枚举的code
     */
    private String orderTypeCode;
    /**
     * 总金额
     */
    private BigDecimal totalAmount;
    /**
     * 现金
     */
    private BigDecimal actualAmount;
    /**
     * 余额
     */
    private BigDecimal balanceAmount;
    /**
     * 总优惠金额
     */
    private BigDecimal totalRemitFee;
    /**
     * 订单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;
    /**
     * 三方订单好
     */
    private String transNo;

    /**
     * 明细
     */
    private List<StudentPaymentDetailVo> list;

    public static class StudentPaymentDetailVo {
        /**
         * 商品名称
         */
        private String goodsName;
        /**
         * 金额-扣除优惠券后的
         */
        private BigDecimal price;

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = StringUtils.isBlank(goodsName) ? null : OrderDetailTypeEnum.valueOf(goodsName).getMsg();
        }

        public BigDecimal getPrice() {
            return price;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = OrderTypeEnum.valueOf(orderType).getMsg();
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(BigDecimal actualAmount) {
        this.actualAmount = actualAmount;
    }

    public BigDecimal getBalanceAmount() {
        return balanceAmount;
    }

    public void setBalanceAmount(BigDecimal balanceAmount) {
        this.balanceAmount = balanceAmount;
    }

    public BigDecimal getTotalRemitFee() {
        return totalRemitFee;
    }

    public void setTotalRemitFee(BigDecimal totalRemitFee) {
        this.totalRemitFee = totalRemitFee;
    }

    public List<StudentPaymentDetailVo> getList() {
        return list;
    }

    public void setList(List<StudentPaymentDetailVo> list) {
        this.list = list;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getOrderTypeCode() {
        return orderTypeCode;
    }

    public void setOrderTypeCode(String orderTypeCode) {
        this.orderTypeCode = orderTypeCode;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }
}
