package cn.pluss.platform.vo;

import cn.pluss.platform.constants.Constant;
import cn.pluss.platform.entity.MercOrderDetail;
import cn.pluss.platform.entity.MercOrderNew;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@ApiModel("设备订单信息VO")
@EqualsAndHashCode(callSuper = true)
public class MercOrderNewVO extends MercOrderNew {

    /**
     * 取自订单物流信息表的状态
     * 物流状态。物流状态 00:待发货 01:已接单 02：已揽收 03：已收入  04：已发出 05：已打包 06：派件中 07：自提柜入库 08：已签收 90：揽收失败 99：签收失败
     */
    private String expressStatus;

    private String statusDesc;

    private String expressStatusDesc;

    private String payTypeDesc;

    private String pStatus;

    private List<MercOrderDetail> detailList;

    public String getStatusDesc() {
        switch (this.getStatus()){
            case "00":
                this.statusDesc = "待付款";
                break;
            case "01":
                this.statusDesc = "已付款";
                break;
            case "02":
                this.statusDesc = "已退款";
                break;
            case "03":
                this.statusDesc = "发起退款中";
                break;
            case "04":
                this.statusDesc = "已完成";
                break;
            default:
                this.statusDesc = "未知";
                break;
        }
        return statusDesc;
    }

//    public String getExpressStatusDesc() {
//        switch (this.getExpressStatus()){
//            case "00":
//                this.expressStatusDesc = "待发货";
//                break;
//            case "01":
//                this.expressStatusDesc = "已接单";
//                break;
//            case "02":
//                this.expressStatusDesc = "已揽收";
//                break;
//            case "03":
//                this.expressStatusDesc = "已收入";
//                break;
//            case "05":
//                this.expressStatusDesc = "已打包";
//                break;
//            case "06":
//                this.expressStatusDesc = "派件中";
//                break;
//            case "07":
//                this.expressStatusDesc = "自提柜入库";
//                break;
//            case "08":
//                this.expressStatusDesc = "已签收";
//                break;
//            case "90":
//                this.expressStatusDesc = "揽收失败";
//                break;
//            case "99":
//                this.expressStatusDesc = "签收失败";
//                break;
//            default:
//                this.expressStatusDesc = "未知";
//                break;
//        }
//        return expressStatusDesc;
//    }

    public String getPayTypeDesc() {
        switch (this.getPayType()){
            case Constant.PAY_TYPE_ALIPAY:
                this.payTypeDesc = Constant.PAY_TYPE_NAME_ALIPAY;
                break;
            case Constant.PAY_TYPE_WECHAT:
                this.payTypeDesc = Constant.PAY_TYPE_NAME_WECHAT;
                break;
            case Constant.PAY_TYPE_YSFPAY:
                this.payTypeDesc = Constant.PAY_TYPE_NAME_YSFPAY;
                break;
            default:
                this.payTypeDesc = "未知";
                break;
        }
        return payTypeDesc;
    }
}
