/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.finance.vo;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.common.constant.CommonConstant;
import org.springblade.modules.finance.entity.OrderException;

/**
 * 异常订单表视图实体类
 *
 * @author BladeX
 * @since 2022-11-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "OrderExceptionVO对象", description = "异常订单表")
public class OrderExceptionVO extends OrderException {
	private static final long serialVersionUID = 1L;

	private String orderNo;

	private String payCode;

	private String source;

	private String sourceDesc;

	private String payCodeDesc;

	private String errorTypeDesc;

	private String processDesc;


	public String getPayCodeDesc() {
		if (CommonConstant.ALI_PAY.equals(this.payCode)) {
			return "支付宝";
		} else if(CommonConstant.WX_PAY.equals(this.payCode)) {
			return "微信";
		} else {
			return "暂无";
		}
	}

	public String getErrorTypeDesc() {
		if (new Integer(1).equals(super.getErrorType())) {
			return "余额不足";
		} else if (new Integer(2).equals(super.getErrorType())) {
			return "第三方订单取消";
		} else if (new Integer(3).equals(super.getErrorType())) {
			return "地区不发货";
		} else {
			return "其他";
		}
	}

	public String getProcessDesc() {
		if (new Integer(0).equals(super.getIsProcess())) {
			return "未处理";
		} else if (new Integer(1).equals(super.getIsProcess())) {
			return "已处理";
		} else {
			return "其他";
		}
	}
}
