package cn.hnthyy.thmz.entity.thmz;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * 发票表
 */
@Data
public class Receipt {
    //主键
    private Long id;
    //用户id
    private String userIdCode;
    //发票开始
    private String receiptBegin;
    //发票结束
    private String receiptEnd;
    //当前发票号
    private String receiptCurrent;
    //当前发票范围维护时间
    private Date updateDate;

    public void setReceiptCurrent(String receiptCurrent) {
        if(StringUtils.isNotBlank(this.receiptCurrent) && StringUtils.isNotBlank(receiptCurrent) && this.receiptCurrent.length()>receiptCurrent.length()){
            receiptCurrent=this.receiptCurrent.substring(0,this.receiptCurrent.length()-receiptCurrent.length())+receiptCurrent;
        }
        this.receiptCurrent = receiptCurrent;
    }
}
