All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.shoulder.batch.model.BatchRecord Maven / Gradle / Ivy

Go to download

Shoulder 扩展-批处理模块,提供批量数据导入、导出、异步校验、导入历史记录管理等能力。

There is a newer version: 0.8.1
Show newest version
package org.shoulder.batch.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 批量处理记录-标准模型
 *
 * @author lym
 */
@Data
@Builder
@AllArgsConstructor
public class BatchRecord implements Serializable {

    /**
     * 主键
     */
    private String id;

    /**
     * 操作数据类型,建议可翻译。如对应 导入数据库表名、业务线名,例:用户、用户组、推广消息
     */
    private String dataType;

    /**
     * 操作类型,建议可翻译。如对应 动作名称,例:导入、同步、推送、下载
     */
    private String operation;

    // 目前 不区分操作类型,而是根据 detail 的结果分辨 operationType;

    /**
     * 处理总数
     */
    private int totalNum;

    /**
     * 成功条数
     */
    private int successNum;

    /**
     * 失败条数
     */
    private int failNum;

    /**
     * 触发处理的用户
     */
    private Long creator;

    /**
     * 处理时间
     */
    private Date createTime;

    /**
     * 关联的详情(每行信息)
     */
    private List detailList;

    public BatchRecord() {
    }

    public void addDetail(List detailList) {
        if (CollectionUtils.isEmpty(this.detailList)) {
            this.detailList = new ArrayList<>(detailList);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy