package com.tax.file.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

@Data
@ToString
public class TkFile {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.id
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private Integer id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.taxno
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String taxno;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.inv_spec
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String invSpec;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.inv_type
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String invType;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.dec_pwd
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String decPwd;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.url
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String url;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.apply_status
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String applyStatus;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.down_status
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String downStatus;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.inv_date_start
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    @JSONField(format = "yyyy-MM-dd")
    private Date invDateStart;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.inv_date_end
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    @JSONField(format = "yyyy-MM-dd")
    private Date invDateEnd;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column tk_file.file_name
     *
     * @mbggenerated Mon Aug 19 17:42:02 CST 2019
     */
    private String fileName;

    private String userName;

    private String token;

    private String zoneCode;
    
    private String taskno;
    
    private String responseStatus;

    private String fileKey;
    private String errorCode;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date uploadTime;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date applyDate;
    
    private Integer downCount;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date responseTime;
    
    private String excelImport;
    private Integer excelImportCount;

    private String isHasData = "0";

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateDate;

    private String fileMd5;
    private String applyErrorCode;

    @JSONField(format = "yyyy-MM-dd")
    private Date oldApplyDate;
    private String fileMonth;
    private String fileDataType;

    private String downloadTaxStatus = "0";

    private int fileNum;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date resetDate;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date downDate;

    private String invDateStartStr;
    private String invDateEndStr;

    private String sEcho;
    private String iDisplayStart;
    private String iDisplayLength;

    public String getInvoiceInfo() {
        return "InvSpec:" + getInvSpec() + ",invTypes:" + getInvType()
                + ",preDateStart:" + getInvDateStartStr()
                + ",preDateEnd:" + getInvDateEndStr()
                + ",fileMd5:" + getFileMd5();
    }

    public String getFileGroupKey() {
        return getUserName() + "=" + getTaxno() + "=" + getInvSpec() + "=" + getInvType();
    }

    public String getFileErrorMessage() {
        return getApplyStatus() + "=" + getDownStatus() + "=" + getApplyErrorCode() + "=" + getErrorCode() + "=" + getOldApplyDate();
    }
}