package com.zehong.system.domain.vo;

import com.zehong.common.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;

public class TTradeProjectExportVo {

    @Excel(name = "交易项目")
    private String relationTransactionProjectName;

    @Excel(name = "交易细项名称")
    private String transactionDetailName;

    @Excel(name ="交易状态")
    private String tradeStatus;

    @Excel(name = "卖方")
    private String applyDeptName;

    @Excel(name = "申请人")
    private String applyName;

    /** 创建时间 */

    @Excel(name = "申请时间",dateFormat="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Excel(name = "申报总价")
    private BigDecimal tradeTotal;

    @Excel(name = "买方")
    private String tradeDeptName;

    @Excel(name = "买方经办人")
    private String tradeTransactorName;

    @Excel(name = "评分")
    private Integer tradeScore;

    @Excel(name = "交易成交价")
    private BigDecimal dealPrice;

    @Excel(name = "尾款")
    private BigDecimal pendingPayment;

    public String getRelationTransactionProjectName() {
        return relationTransactionProjectName;
    }

    public void setRelationTransactionProjectName(String relationTransactionProjectName) {
        this.relationTransactionProjectName = relationTransactionProjectName;
    }

    public String getTransactionDetailName() {
        return transactionDetailName;
    }

    public void setTransactionDetailName(String transactionDetailName) {
        this.transactionDetailName = transactionDetailName;
    }

    public String getTradeStatus() {
        return tradeStatus;
    }

    public void setTradeStatus(String tradeStatus) {
        this.tradeStatus = getTradeStatusName(tradeStatus);
    }

    public String getApplyDeptName() {
        return applyDeptName;
    }

    public void setApplyDeptName(String applyDeptName) {
        this.applyDeptName = applyDeptName;
    }

    public String getApplyName() {
        return applyName;
    }

    public void setApplyName(String applyName) {
        this.applyName = applyName;
    }

    public Date getCreateTime() {
        return createTime;
    }

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

    public BigDecimal getTradeTotal() {
        return tradeTotal;
    }

    public void setTradeTotal(BigDecimal tradeTotal) {
        this.tradeTotal = tradeTotal;
    }

    public String getTradeDeptName() {
        return tradeDeptName;
    }

    public void setTradeDeptName(String tradeDeptName) {
        this.tradeDeptName = tradeDeptName;
    }

    public String getTradeTransactorName() {
        return tradeTransactorName;
    }

    public void setTradeTransactorName(String tradeTransactorName) {
        this.tradeTransactorName = tradeTransactorName;
    }

    public Integer getTradeScore() {
        return tradeScore;
    }

    public void setTradeScore(Integer tradeScore) {
        this.tradeScore = tradeScore;
    }

    public BigDecimal getDealPrice() {
        return dealPrice;
    }

    public void setDealPrice(BigDecimal dealPrice) {
        this.dealPrice = dealPrice != null ? dealPrice.setScale(2,BigDecimal.ROUND_HALF_UP) : dealPrice;
    }

    public BigDecimal getPendingPayment() {
        return pendingPayment;
    }

    public void setPendingPayment(BigDecimal pendingPayment) {
        this.pendingPayment = pendingPayment != null ? pendingPayment.setScale(2,BigDecimal.ROUND_HALF_UP) : pendingPayment;
    }

    private String getTradeStatusName(String tradeStatus){
        switch (tradeStatus){
            case "0":
                return "待买方经办人评价";
            case "1":
                return "待买方部门长确认";
            case "2":
                return "待卖方部门长确认";
            case "3":
                return "完成";
            case "4":
                return "驳回";
            case "5":
                return "待支付";
            default:
                return  "";
        }
    }
}
