package com.mvc.othermodel;

import com.mvc.model.StationAccModel;
import com.mvc.model.TUnitStructureModel;
import com.mvc.utils.PinyinUtil;

//返回树形封装对象
public class GroupAndStationTree {

    private String id;
    private String label;
    private String code;
    private String parentcode;
    private String parentname;
    private String type;//0 分组  1遥测站
    private Object data;
    private String deviceType;//设备类型1水表,2压力表 2022-09-14 guozhao

    private String labelpy;

    public GroupAndStationTree(){}

    /**
     * 根据站点结构对象封装成树形对象
     * @param unitStructure
     */
    public GroupAndStationTree(TUnitStructureModel unitStructure){
        this.id = unitStructure.getId().toString();
        this.label = unitStructure.getNodeName();
        this.code = unitStructure.getNodeCode();
        this.parentcode = unitStructure.getParentCode();
        this.type = "1";
        this.data = unitStructure;
        this.labelpy = PinyinUtil.getPinYinHeadChar(unitStructure.getNodeName(), true);
    }

    /**
     * 根据站点对象封装成树形对象
     * @param accModel
     */
    public GroupAndStationTree(StationAccModel accModel){
        this.id = accModel.getId().toString();
        this.label = accModel.getStationName();
        this.code = accModel.getStationCode();
        //this.parentcode = parentCode;//在引用处赋值更有通用性
        this.type = "3";
        this.data = accModel;
        this.deviceType = accModel.getDeviceType();
        this.labelpy = accModel.getStationPy();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getParentcode() {
        return parentcode;
    }

    public void setParentcode(String parentcode) {
        this.parentcode = parentcode;
    }

    public String getParentname() {
        return parentname;
    }

    public void setParentname(String parentname) {
        this.parentname = parentname;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getLabelpy() {
        return labelpy;
    }

    public void setLabelpy(String labelpy) {
        this.labelpy = labelpy;
    }
}
