package org.dromara.progress.domain.vo.progresscategory;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.json.handler.BigDecimalToIntegerSerializer;
import org.dromara.progress.domain.PgsProgressCategory;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 进度类别视图对象 pgs_progress_category
 *
 * @author lcj
 * @date 2025-05-26
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = PgsProgressCategory.class)
public class PgsProgressCategoryVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 父类别id
     */
    @ExcelProperty(value = "父类别id")
    private Long pid;

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

    /**
     * 方阵id
     */
    private Long matrixId;

    /**
     * 类别名称
     */
    @ExcelProperty(value = "类别名称")
    private String name;

    /**
     * 计量方式（0无 1数量 2百分比）
     */
    @ExcelProperty(value = "计量方式", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=无,1=数量,2=百分比")
    private String unitType;

    /**
     * 总数量/百分比
     */
    @JsonSerialize(using = BigDecimalToIntegerSerializer.class)
    @ExcelProperty(value = "总数量/百分比")
    private BigDecimal total;

    /**
     * 已完成数量/百分比
     */
    @JsonSerialize(using = BigDecimalToIntegerSerializer.class)
    @ExcelProperty(value = "已完成数量/百分比")
    private BigDecimal completed;

    /**
     * 计划总数量/百分比
     */
    @JsonSerialize(using = BigDecimalToIntegerSerializer.class)
    @ExcelProperty(value = "计划总数量/百分比")
    private BigDecimal planTotal;

    /**
     * 已完成数量百分比
     */
    private String completedPercentage;

    /**
     * 计划中数量百分比
     */
    private String planTotalPercentage;

    /**
     * 是否超期（0否 1是）
     */
    @ExcelProperty(value = "是否超期", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=否,1=是")
    private String isDelay;

    /**
     * 完成状态（0未开始 1进行中 2已完成）
     */
    @ExcelProperty(value = "完成状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=未开始,1=进行中,2=已完成")
    private String status;

}
