package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.common.SortColumn;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author gongbiao
 */
@TableName(value = "wx_bill_property")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxBillProperty extends BaseEntity {


    protected Long id;


    @Excel(name = "商户名称", width = 20, orderNum = "2")
	@TableField(exist = false)
	private String merchantName;

	@io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId")
	private Long propertyContractId;

	@SortColumn(column = "receivePay")
    @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay")
    private Long receivePay;

	public String getReceivePayStr() {
		return new BigDecimal(receivePay == null ? 0 : receivePay).divide(new BigDecimal(100)).toPlainString();
	}

	@Excel(name = "本期账款(元)", width = 20, orderNum = "6")
	@TableField(exist = false)
	private String receivePayStr;


	public String getPayStr() {
		return new BigDecimal(pay == null ? 0 : pay).divide(new BigDecimal(100)).toPlainString();
	}

	@Excel(name = "实收账款(元)", width = 20, orderNum = "7")
	@TableField(exist = false)
	private String payStr;

	@io.swagger.annotations.ApiModelProperty(value="实收金额",name="pay")
    private Long pay;

	@Excel(name = "缴款截止日期", format = "yyyy-MM-dd", width = 20, orderNum = "10")
	@io.swagger.annotations.ApiModelProperty(value="收款日期",name="receiveDate")
	private Date receiveDate;

	@Excel(name = "收款日期", format = "yyyy-MM-dd", width = 20, orderNum = "11")
	@io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate")
	private Date payDate;
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
	private Date createtime;

	@Excel(name = "逾期(天) ", width = 20, orderNum = "13")
	@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
	private Long expiredDay;

	@io.swagger.annotations.ApiModelProperty(value="租户",name="tenantId")
	private String tenantId;
	@io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe")
    private Long owe;

	public String getOweStr() {
		return new BigDecimal(owe == null ? 0 : owe).divide(new BigDecimal(100)).toPlainString();
	}

	@Excel(name = "欠缴金额(元)", width = 20, orderNum = "9")
	@TableField(exist = false)
	private String oweStr;

	@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "8")
	@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
	private Integer status;
	@io.swagger.annotations.ApiModelProperty(value="是否删除 是1否0 未到期不显示",name="isDel")
	private Integer isDel;

    @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay")
    private Long needPay;

	@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
	private Long merchantId;

	@io.swagger.annotations.ApiModelProperty(value="账号ID",name="userId")
	private Long userId;

	@io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId")
	private Long shopId;

	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime")
	private Date updatetime;

	@Excel(name = "周期开始时间", format = "yyyy-MM-dd", width = 20, orderNum = "4")
	@io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime")
	private Date starttime;

	@Excel(name = "周期结束时间", format = "yyyy-MM-dd", width = 20, orderNum = "5")
	@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime")
	private Date endtime;

	@io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType")
	private Integer rentShopType;

	@io.swagger.annotations.ApiModelProperty(value = "营业额", name = "revenue")
    private Long revenue;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金费率", name = "latePayRatio")
	private Integer latePayRatio;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金时间", name = "latePayTime")
	private Date latePayTime;

    @io.swagger.annotations.ApiModelProperty(value = "滞纳金总额", name = "latePayPrice")
    private Long latePayPrice;

	public String getLatePayPriceStr() {
		return new BigDecimal(latePayPrice == null ? 0 : latePayPrice).divide(new BigDecimal(100)).toPlainString();
	}

	@Excel(name = "滞纳金(元)", width = 20, orderNum = "12")
	@TableField(exist = false)
	private String latePayPriceStr;

	@io.swagger.annotations.ApiModelProperty(value = "账期", name = "period")
	private Integer period;

	@io.swagger.annotations.ApiModelProperty(value = "预览账单0否1是", name = "isPreview")
	private Integer isPreview;

    @io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
    private String shopInfo;

	@io.swagger.annotations.ApiModelProperty(value = "支付方式：见枚举EnumBillPayWay", name = "payWay")
	private Integer payWay;

	@io.swagger.annotations.ApiModelProperty(value = "滞纳金状态", name = "latePayStatus")
	private Integer latePayStatus;

	@io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments")
	private String comments;

	@TableField(exist = false)
	private Integer allPeriod;

	@Excel(name = "商铺号", width = 20, orderNum = "1")
	@TableField(exist = false)
	private String shopNumber;

    @Excel(name = "押金状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "无押金_0"}, width = 20, orderNum = "3")
    @TableField(exist = false)
    private Integer depositStatus;

	@TableField(exist = false)
	private Long deposit;

	@TableField(exist = false)
	private Integer limitStart;
	@TableField(exist = false)
	private Integer limitEnd;

	@io.swagger.annotations.ApiModelProperty(value = "n日后开始计算滞纳金", name = "latePayRatio")
	@TableField(exist = false)
	private Integer latePayDay;


	@TableField(exist = false)
	private String latePayMoneyBefore;
	@TableField(exist = false)
	private String latePayMoneyUpdate;

	@io.swagger.annotations.ApiModelProperty(value = "冻结状态，0正常1冻结", name = "freeze")
	private Integer freeze;

	@io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay")
	private Integer serviceChargePay;

	@io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay")
	@TableField(exist = false)
	private Long realReceivePay;

	@TableField(exist = false)
	private String serviceChargePayBefore;
	@TableField(exist = false)
	private String serviceChargePayUpdate;
}
