ImportPoolProgress.java 1.28 KB
package com.uccc.number.domain;


import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

@Setter
@Getter
@ToString
public class ImportPoolProgress {
    private String importKey;//导入标识
    private String filename;//正在导入的文件名
    private Integer totalCount;//上传总数
    private Integer pushedCount;//实时上传成功数
    private Integer failCount;//实时上传失败数
    private String failFile;//上传结束后错误报告url
    private Integer status;

    private Date cts;
    private Date uts;

    private String type;


    public ImportPoolProgress() {}

    public ImportPoolProgress(String fileName, String importKey, Integer total) {
        this.filename = fileName;
        this.importKey = importKey;
        this.totalCount = total;
        this.pushedCount = 0;
        this.failCount = 0;
    }

    public static ImportPoolProgress getInstance() {
        ImportPoolProgress instance = new ImportPoolProgress();
        instance.setPushedCount(0);
        instance.setFailCount(0);
        return instance;
    }

    public void addSucceedCount(Integer succeedCount) {
        this.pushedCount += succeedCount;
    }

    public void addFailedCount(Integer failedCount) {
        this.failCount += failedCount;
    }
}