package com.yuchen.saas.parking.api.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yuchen.saas.parking.api.util.AttributeConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.nest.springwrap.core.tool.utils.Func;
import org.nest.springwrap.core.tool.utils.StringPool;

/**
 * @author 颜艺波
 * @date 2021/9/15 17:04
 * @Description
 */
@HeadRowHeight(value = 35) // 表头行高
@ContentRowHeight(value = 25) // 内容行高
@ColumnWidth(value = 20) // 列宽
@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@Data
public class TempDetailsVO {

    @ApiModelProperty(value = "账单ID")
    @ExcelIgnore
    private Long billId;

    @ApiModelProperty(value = "本次支付时间")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "本次支付时间"}, order = 1)
    private String timeOfPayment;

    @ApiModelProperty(value = "订单号")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "支付单号"}, order = 2)
    private String orderNumber;

    @ApiModelProperty(value = "支付金额（元）")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "支付金额（元）"}, order = 3)
    private String paidCost;

    @ApiModelProperty(value = "支付方式")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "支付方式"}, order = 4)
    private String paymentMethod;

    @ApiModelProperty(value = "计费时间区间")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "计费时间区间"}, order = 5)//导出新字段新
    private String chargingTime;

    @ApiModelProperty(value = "上次支付时间")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "本次支付信息", "上次支付时间"}, order = 6)
    private String timeLastPayment;


    @ApiModelProperty(value = "停车场所")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "停车场所"}, order = 7)
    private String parkingName;

    @ApiModelProperty(value = "车牌号")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "车牌号"}, order = 8)
    private String plateNo;

    @ApiModelProperty(value = "入场时间")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "入场时间"}, order = 9)
    private String enterTime;


    @ApiModelProperty(value = "停车账单")
    @ExcelIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "停车账单"}, order = 10)//导出新
    private String idStr;

    @ApiModelProperty(value = "停车账单")
    @ExcelIgnore
    private Long id;

    @ApiModelProperty(value = "当前场内支付次数")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "当前场内支付次数"}, order = 11)
    private Integer numPaymentCurrent;


    @ExcelIgnore
    @ApiModelProperty(value = "计费时长（分钟）")
    //@ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "车辆入场信息", "计费时长（分钟）"}, order = 7)
    private Long billingTime;

    @ApiModelProperty("停车总时长(分钟)")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "停车总时长(分钟)"}, order = 12)//导出新字段
    private Long parkTime;

    @ApiModelProperty("总账单应收金额")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "总账单应收金额(元)"}, order = 13)//导出新字段
    private String billTotalCost;

    @ApiModelProperty(value = "优惠券抵扣金额（元）")
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "停车账单信息", "优惠券抵扣金额（元）"}, order = 14)
    private String deduceCost;

    @ExcelIgnore
    @ApiModelProperty(value = "应收金额（元）")
    //@ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "车辆缴费信息", "应收金额（元）"}, order = 8)
    private String supposeCost;

    @ExcelIgnore
    @ApiModelProperty(value = "优惠券")
    //@ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "车辆缴费信息", "优惠券"}, order = 9)
    private String coupon;

    @ExcelIgnore
    @ApiModelProperty(value = "优惠方式")
    //@ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "车辆缴费信息", "优惠方式"}, order = 10)
    private String couponWay;







    @ApiModelProperty(value = "银行结算费率")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "银行结算费率"}, order = 15)
    private String bankSettlementRate;

    @ApiModelProperty(value = "银行结算手续费（元）")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "银行结算手续费（元）"}, order = 16)
    private String bankSettlementCharge;

    @ApiModelProperty(value = "银行结算金额（元）")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "银行结算金额（元）"}, order = 17)
    private String bankSettlementAmount;

    @ApiModelProperty(value = "结算费率")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "结算费率"}, order = 18)
    private String clientSettlementRate;

    @ApiModelProperty(value = "结算手续费（元）")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "结算手续费（元）"}, order = 19)
    private String clientSettlementCharge;

    @ApiModelProperty(value = "总结算金额（元）")
    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "总结算金额（元）"}, order = 20)
    private String clientSettlementAmount;


    @ExcelIgnore
    @ApiModelProperty(value = "计费开始时间")
    private String payStartTime;

    @ExcelIgnore
    @ApiModelProperty(value = "计费结束时间")
    private String payEndTime;

    @ExcelIgnore
    @ApiModelProperty("缴费后允许延时出场时间 单位：分钟")
    private Long delayTime;

    @ExcelIgnore
    @ApiModelProperty(value = "离场时间")
    private String outTime;

    @ExcelIgnore
    @ApiModelProperty("账单状态：0-部分结算，1-已结算（已出停车场）,2未结算")
    private Integer payBillStatus;

    /**
     *
     */

    @ExcelIgnore
    @ApiModelProperty("账单实收金额")
    private String billPaidCost;


    @ExcelIgnore
    @ApiModelProperty("outMsg")
    private String outMsg;





    /*@JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "物业分成比例"}, order = 20)
    private String propertySettlementRate;

    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "物业分成（元）"}, order = 21)
    private String propertySettlementCharge;

    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "厦门火炬集团结算金额（元）"}, order = 22)
    private String propertySettlementAmount;*/

    /*@JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "物业管理费比例"}, order = 23)
    private String propertyManageRate;

    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "物业管理费（元）"}, order = 24)
    private String propertyManageAmount;

    @JsonIgnore
    @ExcelProperty(value = {AttributeConstant.TEMP_DETAIL_EXPORT_NAME, "费用结算", "集团收入（元）"}, order = 25)
    private String ownerSettlementAmount;*/
    @JsonIgnore
    @ExcelIgnore
    private Long payId;

    @JsonIgnore
    @ExcelIgnore
    private String payType;


    public String getChargingTime(){
        if(Func.isNotEmpty(payStartTime)||Func.isNotEmpty(payEndTime)){
            return String.format("%s~%s",payStartTime,payEndTime);
        }
        return StringPool.EMPTY;
    }

    public String getIdStr(){
        return String.valueOf(id);
    }
}
