package com.ruoyi.system.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 导出任务表 sys_export_task
 */
public class SysExportTask extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String STATUS_PENDING = "0";
    public static final String STATUS_PROCESSING = "1";
    public static final String STATUS_SUCCESS = "2";
    public static final String STATUS_FAILED = "3";

    @Excel(name = "任务ID", cellType = ColumnType.NUMERIC)
    private Long taskId;

    @Excel(name = "任务名称")
    private String taskName;

    @Excel(name = "任务类型")
    private String taskType;

    private String corpId;

    private String queryParams;

    @Excel(name = "状态", readConverterExp = "0=待处理,1=处理中,2=成功,3=失败")
    private String status;

    @Excel(name = "进度")
    private Integer progress;

    @Excel(name = "总数据量")
    private Integer totalCount;

    @Excel(name = "已处理数量")
    private Integer processedCount;

    private String filePath;

    @Excel(name = "文件名")
    private String fileName;

    private Long fileSize;

    private String errorMsg;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    public Long getTaskId()
    {
        return taskId;
    }

    public void setTaskId(Long taskId)
    {
        this.taskId = taskId;
    }

    public String getTaskName()
    {
        return taskName;
    }

    public void setTaskName(String taskName)
    {
        this.taskName = taskName;
    }

    public String getTaskType()
    {
        return taskType;
    }

    public void setTaskType(String taskType)
    {
        this.taskType = taskType;
    }

    public String getCorpId()
    {
        return corpId;
    }

    public void setCorpId(String corpId)
    {
        this.corpId = corpId;
    }

    public String getQueryParams()
    {
        return queryParams;
    }

    public void setQueryParams(String params)
    {
        this.queryParams = params;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public Integer getProgress()
    {
        return progress;
    }

    public void setProgress(Integer progress)
    {
        this.progress = progress;
    }

    public Integer getTotalCount()
    {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount)
    {
        this.totalCount = totalCount;
    }

    public Integer getProcessedCount()
    {
        return processedCount;
    }

    public void setProcessedCount(Integer processedCount)
    {
        this.processedCount = processedCount;
    }

    public String getFilePath()
    {
        return filePath;
    }

    public void setFilePath(String filePath)
    {
        this.filePath = filePath;
    }

    public String getFileName()
    {
        return fileName;
    }

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

    public Long getFileSize()
    {
        return fileSize;
    }

    public void setFileSize(Long fileSize)
    {
        this.fileSize = fileSize;
    }

    public String getErrorMsg()
    {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg)
    {
        this.errorMsg = errorMsg;
    }

    public Date getFinishTime()
    {
        return finishTime;
    }

    public void setFinishTime(Date finishTime)
    {
        this.finishTime = finishTime;
    }

    public boolean isFinished()
    {
        return STATUS_SUCCESS.equals(status) || STATUS_FAILED.equals(status);
    }

    public boolean isSuccess()
    {
        return STATUS_SUCCESS.equals(status);
    }
}
