package cn.pluss.platform.vo;

import java.text.SimpleDateFormat;

import cn.pluss.platform.entity.MerchantOrder;
import cn.pluss.platform.util.StringUtil;

/**
 * @author yuchen 
 * 
 * @Description 订单退款VO
 */
public class OrderRefundVO {

	    private String orderNumber;
	    private String merchantName;
	    private String storeName;
	    private String payTypeName;
	    private String consumeFee;
	    private String transNo;
	    private String createDt;
	    private String status;
		public String getOrderNumber() {
			return orderNumber;
		}
		public void setOrderNumber(String orderNumber) {
			this.orderNumber = orderNumber;
		}
		public String getMerchantName() {
			return merchantName;
		}
		public void setMerchantName(String merchantName) {
			this.merchantName = merchantName;
		}
		public String getStoreName() {
			return storeName;
		}
		public void setStoreName(String storeName) {
			this.storeName = storeName;
		}
		public String getPayTypeName() {
			return payTypeName;
		}
		public void setPayTypeName(String payTypeName) {
			this.payTypeName = payTypeName;
		}
		public String getConsumeFee() {
			return consumeFee;
		}
		public void setConsumeFee(String consumeFee) {
			this.consumeFee = consumeFee;
		}
		public String getTransNo() {
			return transNo;
		}
		public void setTransNo(String transNo) {
			this.transNo = transNo;
		}
		public String getCreateDt() {
			return createDt;
		}
		public void setCreateDt(String createDt) {
			this.createDt = createDt;
		}
		public String getStatus() {
			return status;
		}
		public void setStatus(String status) {
			this.status = status;
		}
		@Override
		public String toString() {
			return "OrderRefundVO [orderNumber=" + orderNumber + ", merchantName=" + merchantName + ", storeName="
					+ storeName + ", payTypeName=" + payTypeName + ", consumeFee=" + consumeFee + ", transNo=" + transNo
					+ ", createDt=" + createDt + ", status=" + status + "]";
		}
		
		public OrderRefundVO(MerchantOrder merchantOrder) {
			SimpleDateFormat sim=new SimpleDateFormat("yyyy/MM/dd");
			this.consumeFee=merchantOrder.getConsumeFee()+"";
			if(StringUtil.isNotEmpty(merchantOrder.getCreateDt())) {
				String format = sim.format(merchantOrder.getCreateDt());
				this.createDt=format;
			}
			this.merchantName=merchantOrder.getMerchantName();
			this.orderNumber=merchantOrder.getOrderNumber();
			this.payTypeName=merchantOrder.getPayTypeName();
			if("0".equals(merchantOrder.getStatus())) {
				this.status="交易成功";
			}else if("1".equals(merchantOrder.getStatus())) {
				this.status="交易失败";
			}else if("2".equals(merchantOrder.getStatus())) {
				this.status="退款成功";
			}else if("3".equals(merchantOrder.getStatus())) {
				this.status="退款失败";
			}else if("4".equals(merchantOrder.getStatus())) {
				this.status="退款中";
			}else if("5".equals(merchantOrder.getStatus())) {
				this.status="待付款";
			}
			this.storeName=merchantOrder.getStoreName();
			this.transNo=merchantOrder.getTransNo();
		}
}

