package jnpf.model.cultivate.v2.item_pool.vo;


import jnpf.model.cultivate.po.FtbCultivateIdentifyItemsPool;
import jnpf.util.excelv2.annotation.Excel;
import lombok.Data;

import java.io.Serializable;


@Data
public class V2IdentifyItemVo implements Serializable {
    private static final long serialVersionUID = 1L;


    @Excel(name = "鉴定项内容", type = Excel.Type.ALL, cellType = Excel.ColumnType.STRING, prompt = "鉴定项内容")
    private String itemName;

    @Excel(name = "鉴定项分类", type = Excel.Type.ALL, comboFromBeanMethod = "ftbCultivateIdentifyCategoriesServiceImpl.getAllNameList()")
    private String cateName;


    @Excel(name = "分值", type = Excel.Type.ALL)
    private String score;


    /**
     * 是否成功，0成功 1失败
     */
    private Integer success = 0;

    /**
     * 错误原因
     */
    private String msg;


    /**
     * 鉴定项分值类型 0-固定 1-浮动
     */
    private Integer type;


    /**
     * 鉴定项分类ID
     */
    private String cateId;

    /**
     * 鉴定项总分值
     */
    private Integer totalScore;

    /**
     * 浮动最小分
     */
    private Integer minScore;

    /**
     * 浮动最大分
     */
    private Integer maxScore;

    public FtbCultivateIdentifyItemsPool convertData(String userId) {
        FtbCultivateIdentifyItemsPool entity = new FtbCultivateIdentifyItemsPool();
        entity.setName(getItemName());
        entity.setCateId(getCateId());
        entity.setType(getType());
        entity.setTotalScore(getTotalScore());
        entity.setMinScore(getMinScore());
        entity.setMaxScore(getMaxScore());
        entity.setEnabledMark(0);
        entity.setCreatorTime(new java.util.Date());
        entity.setCreatorUserId(userId);
        entity.setLastModifyTime(new java.util.Date());
        entity.setLastModifyUserId(userId);
        return entity;
    }
}
