package com.yuchen.saas.park.api.vo.property;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.thinkunion.park.service.common.utils.CommonStringUtil;
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;

import java.util.Date;


@Data
@HeadStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@HeadRowHeight(25)
@ContentStyle(horizontalAlignment = HorizontalAlignment.CENTER)
@ColumnWidth(12)
@ContentRowHeight(15)
@HeadFontStyle(fontHeightInPoints =9)
@ExcelIgnoreUnannotated
public class PropertyOfflinePaymentRecordExcelVO {
    @ExcelProperty("园区名称")
    @ApiModelProperty(name = "parkName", value = "园区名称")
    private String parkName;

    @ExcelProperty("资源代码")
    @ApiModelProperty(name = "resourceCode", value = "资源代码")
    private String resourceCode;

    @ExcelProperty("客户名称")
    @ApiModelProperty(name = "customerName", value = "客户名称")
    private String customerName;

    @ExcelProperty("客户类型")
    @ApiModelProperty(name = "customerTypeName", value = "客户类型")
    private String customerTypeName;
    public String getCustomerTypeName(){
        if(Func.isEmpty(customerType)){
            return StringPool.EMPTY;
        }
        if(customerType==1){
            return "机构";
        }
        if(customerType==2){
            return "个人";
        }
        return StringPool.EMPTY;
    }

    @ExcelIgnore
    @ApiModelProperty(name = "customerType", value = "客户类型(1:机构 2:个人)")
    private Integer customerType;

    @ExcelProperty("应收金额(元)")
    @ApiModelProperty(name = "receivableAmtYuan", value = "应收金额")
    private String receivableAmtYuan;
    public String getReceivableAmtYuan(){
        return CommonStringUtil.formatFenToYuan(receivableAmtFen);
    }

    @ExcelIgnore
    @ApiModelProperty(name = "receivableAmtFen", value = "应收金额;单位：分")
    private Long receivableAmtFen;

    @ExcelProperty("实收金额(元)")
    @ApiModelProperty(name = "payAmtYuan", value = "已缴金额;单位：元")
    private String payAmtYuan;
    public String getPayAmtYuan(){
        return CommonStringUtil.formatFenToYuan(payAmtFen);
    }

    @ExcelIgnore
    @ApiModelProperty(name = "payAmtFen", value = "已缴金额;单位：分")
    private Long payAmtFen;

    @ExcelProperty("付款人员")
    @ApiModelProperty(name = "payUser", value = "付款人员")
    private String payUser;

    @ExcelProperty("付款账户")
    @ApiModelProperty(name = "payAccount", value = "付款账户")
    private String payAccount;

    @ExcelProperty("付款日期")
    @ApiModelProperty(name = "payTime", value = "付款时间")
    private Date payTime;

    @ExcelProperty("收款账户")
    @ApiModelProperty(name = "payeeAccount", value = "收款账户")
    private String payeeAccount;

    @ExcelProperty("收款人员")
    @ApiModelProperty(name = "payee", value = "收款人员")
    private String payee;

    @ExcelProperty("收款单号")
    @ApiModelProperty(name = "payeeOrder", value = "收款单号")
    private String payeeOrder;

    @ExcelProperty("收款截图")
    @ApiModelProperty(name = "payeeFile", value = "收款截图,按逗号隔开")
    private String payeeFile;

    @ExcelProperty("备注")
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    @ExcelProperty("审核状态")
    @ApiModelProperty(name = "reviewStateStr", value = "审核状态（0 待审核 1 审核通过 2 拒绝）")
    private String reviewStateStr;
    public String getReviewStateStr(){
        if(reviewState==0){
            return "待确认";
        }else if(reviewState==1){
            return "已确认";
        }else if(reviewState==2){
            return "已驳回";
        }
        return StringPool.EMPTY;
    }

    @ExcelIgnore
    @ApiModelProperty(name = "reviewState", value = "审核状态（0 待审核 1 进行中 2 已完成 3 已撤回 4 已拒绝）")
    private Integer reviewState;

    @ExcelProperty("登记方式")
    @ApiModelProperty(name = "registerTypeStr", value = "登记方式:1管理员登记,2租客登记")
    private String registerTypeStr;
    public String getRegisterTypeStr(){
        if(registerType==1){
            return "管理员登记";
        }else if(registerType==2){
            return "租客登记";
        }
        return StringPool.EMPTY;
    }

    @ExcelIgnore
    @ApiModelProperty(name = "registerType", value = "登记方式:1管理员登记,2租客登记")
    private Integer registerType;

    @ExcelProperty("添加人员")
    @ApiModelProperty(name = "createUserName", value = "创建人名字")
    private String createUserName;

    @ExcelProperty("添加时间")
    @ApiModelProperty(name = "createUserName", value = "添加时间")
    private Date createTime;

}
