package cn.pluss.platform.vo;

import java.text.SimpleDateFormat;

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

/**
 * @author yuchen 交易查询VO
 *
 * @Description 
 */
@Data
public class MerchantOrderDVO {
	
	
		private String orderNumber;
	    private String merchantName;
	    private String storeName;
	    private String payTypeName;
	    private String consumeFee;
	   // private String transNo;
	    private String createDt;
	    private String status;

		@Override
		public String toString() {
			return "MerchantOrderVO [orderNumber=" + orderNumber + ", merchantName=" + merchantName + ", storeName="
					+ storeName + ", payTypeName=" + payTypeName + ", consumeFee=" + consumeFee +", createDt=" + createDt + ", status=" + status + "]";
		}
		
		public MerchantOrderDVO(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();
		}
}

