EmergencyCommandLiaisonIdModel.java 2.1 KB
package com.skua.modules.emergency.model;

import com.skua.modules.emergency.entity.EmergencyCommandLiaison;

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

/**
 * 应急联络表 封装树结构的部门的名称的实体类
 * @author 11389
 */
public class EmergencyCommandLiaisonIdModel  implements Serializable {

    private static final long serialVersionUID = 1L;

    // 主键ID
    private String key;

    // 主键ID
    private String value;

    // 应急组名称
    private String title;

    List<EmergencyCommandLiaisonIdModel> children = new ArrayList<>();

    /**
     * 将EmergencyCommandLiaisonTreeModel的部分数据放在该对象当中
     * @param treeModel
     * @return
     */
    public EmergencyCommandLiaisonIdModel convert(EmergencyCommandLiaisonTreeModel treeModel) {
        this.key = treeModel.getId();
        this.value = treeModel.getId();
        this.title = treeModel.getEmergencyName();
        return this;
    }

    /**
     * 该方法为用户应急人员的实现类所使用
     * @param emergencyCommandLiaison
     * @return
     */
    public EmergencyCommandLiaisonIdModel convertByUserEmergencyCommandLiaison(EmergencyCommandLiaison emergencyCommandLiaison) {
        this.key = emergencyCommandLiaison.getId();
        this.value = emergencyCommandLiaison.getId();
        this.title = emergencyCommandLiaison.getEmergencyName();
        return this;
    }

    public List<EmergencyCommandLiaisonIdModel> getChildren() {
        return children;
    }

    public void setChildren(List<EmergencyCommandLiaisonIdModel> children) {
        this.children = children;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}