DataAssessmentItemIdModel.java 1.3 KB
package com.skua.modules.assessment.model;

import com.skua.modules.assessment.entity.DataAssessmentItem;
import lombok.Data;

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

/**
 * 评分项表 封装树结构的评分项的名称的实体类
 * @author 11389
 */
@Data
public class DataAssessmentItemIdModel implements Serializable {

    private static final long serialVersionUID = 1L;
    // 主键ID
    private String key;
    // 主键ID
    private String value;
    // 部门名称
    private String title;
    List<DataAssessmentItemIdModel> children = new ArrayList<>();
    /**
     * 将SysDepartTreeModel的部分数据放在该对象当中
     * @param treeModel
     * @return
     */
    public DataAssessmentItemIdModel convert(DataAssessmentItemTreeModel treeModel) {
        this.key = treeModel.getId();
        this.value = treeModel.getId();
        this.title = treeModel.getFillName();
        return this;
    }

    /**
     * 该方法为用户评分项的实现类所使用
     * @param dataAssessmentItem
     * @return
     */
    public DataAssessmentItemIdModel convertByUserDepart(DataAssessmentItem dataAssessmentItem) {
        this.key = dataAssessmentItem.getId();
        this.value = dataAssessmentItem.getId();
        this.title = dataAssessmentItem.getFillName();
        return this;
    }


}