package com.yuchen.saas.payment.api.vo.orderCenter.orderList;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.*;
import com.thinkunion.park.service.common.utils.CommonStringUtil;
import com.yuchen.saas.payment.api.enums.PayChannelEnum;
import com.yuchen.saas.payment.api.enums.PayTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.nest.springwrap.core.tool.utils.Func;

import java.util.Date;

@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@HeadRowHeight(25)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@ColumnWidth(12)
@ContentRowHeight(15)
@HeadFontStyle(fontHeightInPoints =9)
@Data
public class ParkingOrderDataExcelVO {

    /**
     * 停车场名称
     */
    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","停车场"})
    private String parkingName;

    /**
     * 车牌号
     */
    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","车牌号"})
    private String plateNo;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","入场时间"})
    @ApiModelProperty("入场时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    private Date enterTime;


    @ApiModelProperty("出场时间")
    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","出场时间"})
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    private Date outTime;


    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","付款时间"})
    @ApiModelProperty(name = "payTime", value = "付款时间")
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","付款方式"})
    @ApiModelProperty(name = "payTypeValue", value = "支付方式 1:微信支付; 2:钱包支付;")
    private String payTypeValue;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","付款方式"})
    @ApiModelProperty(name = "payChannelName", value = "收款渠道 xc_pay:厦门银行; all_in_pay:通联支付;")
    private String payChannelName;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","订单金额(元)"})
    private String receivableAmountStr;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","优惠金额(元)"})
    @ApiModelProperty(name = "discountsAmountStr", value = "优惠金额(元)")
    private String discountsAmountStr;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","实收金额(元)"})
    @ApiModelProperty(name = "actualAmountStr", value = "实收金额(元)")
    private String actualAmountStr;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "银行结算费率"})
    @ApiModelProperty("银行结算费率")
    private String backSettlement;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "银行结算手续费(元)"})
    @ApiModelProperty("银行结算手续费(元)")
    private String backSettlementOperationCost;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "银行结算金额(元)"})
    @ApiModelProperty("银行结算金额(元)")
    private String backSettlementCost;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "结算费率"})
    @ApiModelProperty("结算费率")
    private String customerRate;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "结算手续费(元)"})
    @ApiModelProperty("结算手续费(元)")
    private String customerRateCost;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "总结算金额(元)"})
    @ApiModelProperty("总结算金额(元)")
    private String totalCost;


    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","订单号"})
    @ApiModelProperty(name = "orderNo", value = "订单号")
    private String orderNo;

    @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","支付单号"})
    @ApiModelProperty(name = "payNo", value = "支付单号")
    private String payNo;

   /* @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","订单类型"})
    @ApiModelProperty(name = "orderType", value = "订单类型 1or3 ：临停， 2月卡，20错时卡，26充电，30：占位费")
    private String orderType;*/






    /*@ApiModelProperty("计费区间")
    private String section;*/

    /**
     * 停车时长
     */
    @ExcelIgnore
    //@ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","停车总时长/分钟"})
    private Long parkTime;




    @ExcelIgnore
    @ApiModelProperty(name = "receivableAmount", value = "应收金额(分)")
    private Long receivableAmount;




    @ExcelIgnore
    @ApiModelProperty(name = "discountsAmount", value = "优惠金额(分)")
    private Long discountsAmount;




    @ExcelIgnore
    @ApiModelProperty(name = "actualAmount", value = "实收金额(分)")
    private Long actualAmount;


    @ExcelIgnore
    // @ExcelProperty({"停车场停车收费明细表","临停订单&账单信息","付款账号"})
    @ApiModelProperty(name = "payAccount", value = "付款账号")
    private String payAccount;

    @ExcelIgnore
    private String payType;

    @ExcelIgnore
    private String payChannelCode;




    @ExcelIgnore
    //@ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "上次结算时间"})
    @DateTimeFormat(value = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("上次结算时间")
    private Date lastPayTime;

    @ExcelIgnore
    //@ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "账单总费用(元)"})
    @ApiModelProperty("账单总费用(元)")
    private String billTotalCostStr;

    @ExcelIgnore
    private Long billTotalCost;

    @ExcelIgnore
    //@ExcelProperty({"停车场停车收费明细表","临停订单&账单信息", "已支付金额(元)"})
    @ApiModelProperty("已支付金额(元)")
    private String billPayCostStr;

    @ExcelIgnore
    private Long billPayCost;

    public String getPayTypeValue(){
        if(Func.isEmpty(payType)){
            return "";
        }
        return PayTypeEnum.getPayTypeValue(payType);
    }

    public String getPayChannelName(){
        return PayChannelEnum.getEnumDesc(payChannelCode);
    }


    public String getReceivableAmountStr(){
        return CommonStringUtil.formatFenToYuan(receivableAmount);
    }

    public String getDiscountsAmountStr(){
        return CommonStringUtil.formatFenToYuan(discountsAmount);
    }

    public String getActualAmountStr(){
        return CommonStringUtil.formatFenToYuan(actualAmount);
    }


    public String getBillTotalCostStr(){
        return CommonStringUtil.formatFenToYuan(billTotalCost);
    }

    public String getBillPayCostStr(){
        return CommonStringUtil.formatFenToYuan(billPayCost);
    }




}
