package org.dromara.zhishu.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import org.dromara.zhishu.domain.Task;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 任务列表视图对象 t_task
 *
 * @author yxy
 * @date 2025-03-21
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = Task.class)
public class TaskVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ExcelProperty(value = "")
    private Long id;

    /**
     * 任务类型 1 发布商品;SYNC_GOODS_KFZ 同步商品-孔夫子；UPDATE_GOODS_PRICE改价商品任务；
     * GET_SHOP_GOODS 拉取商品任务；EDIT_ISONSALE_GOODS 上下架商品任务；
     * EDIT_STOCK_GOODS 更新库存任务；DELETE_SHOP_GOODS 定时删除商品任务；
     */
    @ExcelProperty(value = "任务类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "t_task_type")
    private String taskType;

    /**
     * 店铺id 字符串
     */
    @ExcelProperty(value = "店铺id")
    private String shopIds;

    @ExcelProperty(value = "店铺名称")
    private String shopNames;

    /**
     * 文件名称
     */
    @ExcelProperty(value = "文件名称")
    private String fileName;

    /**
     * 执行数据条数
     */
    @ExcelProperty(value = "执行数据条数")
    private Long dataNum;

    /**
     * 任务状态
     */
    @ExcelProperty(value = "任务状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "t_task_status")
    private String taskStatus;

    /**
     * 状态（0正常 1停用）
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
    private String status;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 线程id
     */
    private String threadId;

    /**
     * 是否存在待同步商品文件
     */
    @ExcelIgnore
    private Boolean hasSyncFile;

    /**
     * 创建者
     */
    private Long createBy;

    /**
     * 消息
     */
    private String msg;

    private int successCount;

    private int waitCount;

    private int pauseCount;

}
