YzgFileVo.java 5.95 KB
package com.yanzuoguang.cloud.vo;

import com.yanzuoguang.dao.TableAnnotation;
import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.BaseVo;
import com.yanzuoguang.util.vo.InitDao;
import io.swagger.annotations.ApiModelProperty;

/**
 * 生成Excel文件
 *
 * @author 颜佐光
 */
@TableAnnotation("yzg_file")
public class YzgFileVo extends BaseVo implements InitDao {

    /**
     * 文件下载状态:0-等待生成,1-正在生成,2-生成完成,3-生成失败,具体原因查看错误消息
     */
    @ApiModelProperty(notes = "文件下载名,用于显示", position = 10)
    public static final int FILE_STATUS_INIT = 0;
    public static final int FILE_STATUS_RELEASE = 1;
    public static final int FILE_STATUS_OK = 2;
    public static final int FILE_STATUS_ERROR = 3;

    /**
     * 文件Id,用于后续文件下载
     */
    @ApiModelProperty(notes = "文件Id,用于后续文件下载", position = 10)
    private String fileId;
    /**
     * 公司Id,用于判断每个公司同一个人不能生成多次文件,同一个公司Id需要配置每日最大运行次数,默认每日为50
     */
    @ApiModelProperty(notes = "公司Id,用于后续文件下载,同一个公司Id需要配置每日最大运行次数,默认为50", position = 20)
    private String companyId;
    /**
     * 功能点关键字,同一个callbackMQ需要设置最大执行次数,回调MQ
     */
    @ApiModelProperty(notes = "功能点关键字,同一个callbackMQ需要设置最大执行次数,回调MQ", position = 30)
    private String callbackMQ;
    /**
     * 公司名称,用于对公司Id的说明
     */
    @ApiModelProperty(notes = "回调参数字符串,最好是json", position = 40)
    private String callbackParameter;
    /**
     * 文件下载名,用于显示
     */
    @ApiModelProperty(notes = "文件下载名,用于显示", position = 50)
    private String fileName;
    /**
     * 文件下载状态:0-等待生成,1-正在生成,2-生成完成,3-生成失败,具体原因查看错误消息
     */
    @ApiModelProperty(notes = "文件下载状态:0-等待生成,1-正在生成,2-生成完成,3-生成失败,具体原因查看错误消息", position = 60)
    private Integer fileStatus;
    /**
     * 文件导出行数,用于显示
     */
    @ApiModelProperty(notes = "文件导出行数,用于显示", position = 70)
    private Integer fileRow;
    /**
     * 错误消息
     */
    @ApiModelProperty(notes = "错误消息", position = 80)
    private String errorMessage;
    /**
     * 下载时间
     */
    @ApiModelProperty(notes = "下载时间", position = 90)
    private String downloadDate;
    /**
     * 下载人
     */
    @ApiModelProperty(notes = "下载人", position = 100)
    private String downloadUserId;
    /**
     * 创建时间
     */
    @ApiModelProperty(notes = "创建时间", position = 110)
    private String createDate;
    /**
     * 创建人
     */
    @ApiModelProperty(notes = "创建人", position = 120)
    private String createUserId;

    /**
     * 初始化数据,去掉空值
     */
    @Override
    public void init() {
        this.fileId = StringHelper.getFirst(this.fileId);
        this.companyId = StringHelper.getFirst(this.companyId);
        this.callbackMQ = StringHelper.getFirst(this.callbackMQ);
        this.callbackParameter = StringHelper.getFirst(this.callbackParameter);
        this.fileName = StringHelper.getFirst(this.fileName);
        this.fileStatus = StringHelper.getFirst(this.fileStatus);
        this.fileRow = StringHelper.getFirst(this.fileRow);
        this.errorMessage = StringHelper.getFirst(this.errorMessage);
        this.downloadDate = StringHelper.getFirstNull(this.downloadDate);
        this.downloadUserId = StringHelper.getFirst(this.downloadUserId);
        this.createDate = StringHelper.getFirst(this.createDate, DateHelper.getNow());
        this.createUserId = StringHelper.getFirst(this.createUserId);
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getCallbackMQ() {
        return callbackMQ;
    }

    public void setCallbackMQ(String callbackMQ) {
        this.callbackMQ = callbackMQ;
    }

    public String getCallbackParameter() {
        return callbackParameter;
    }

    public void setCallbackParameter(String callbackParameter) {
        this.callbackParameter = callbackParameter;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Integer getFileStatus() {
        return fileStatus;
    }

    public void setFileStatus(Integer fileStatus) {
        this.fileStatus = fileStatus;
    }

    public Integer getFileRow() {
        return fileRow;
    }

    public void setFileRow(Integer fileRow) {
        this.fileRow = fileRow;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getDownloadDate() {
        return downloadDate;
    }

    public void setDownloadDate(String downloadDate) {
        this.downloadDate = downloadDate;
    }

    public String getDownloadUserId() {
        return downloadUserId;
    }

    public void setDownloadUserId(String downloadUserId) {
        this.downloadUserId = downloadUserId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }
}