package com.ruoyi.system.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 区域-省市区县对象 sys_area
 *
 * @author ruoyi
 * @date 2025-09-29
 */
public class SysArea
{
    private static final long serialVersionUID = 1L;

    /** ID */
    @Excel(name = "ID")
    private Long areaId;

    /** 级别 */
    @Excel(name = "级别")
    private String levelType;

    /** 名称 */
    @Excel(name = "名称")
    private String areaName;

    /** 简称 */
    @Excel(name = "简称")
    private String shortName;

    /** 拼音 */
    @Excel(name = "拼音")
    private String pinyin;

    /** 省份 */
    @Excel(name = "省份")
    private String provinceName;

    /** 省份简称 */
    @Excel(name = "省份简称")
    private String provinceShortname;

    /** 省份拼音 */
    @Excel(name = "省份拼音")
    private String provincePinyin;

    /** 城市 */
    @Excel(name = "城市")
    private String cityName;

    private Boolean hasChildren;


    /** 城市简称 */
    @Excel(name = "城市简称")
    private String cityShortname;

    /** 城市拼音 */
    @Excel(name = "城市拼音")
    private String cityPinyin;

    /** 区县 */
    @Excel(name = "区县")
    private String districtName;

    /** 区县简称 */
    @Excel(name = "区县简称")
    private String districtShortname;

    /** 区县拼音 */
    @Excel(name = "区县拼音")
    private String districtPinyin;

    /** 简拼 */
    @Excel(name = "简拼")
    private String jianpin;

    /** 首字母 */
    @Excel(name = "首字母")
    private String firstChar;

    /** 区号 */
    @Excel(name = "区号")
    private String areaCode;

    /** 邮编 */
    @Excel(name = "邮编")
    private String zipCode;

    /** 经度 */
    @Excel(name = "经度")
    private String lontitude;

    /** 纬度 */
    @Excel(name = "纬度")
    private String latitude;

    /** 类型 */
    @Excel(name = "类型")
    private String type;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 区域状态（0正常 1停用） */
    @Excel(name = "区域状态", readConverterExp = "0=正常,1=停用")
    private String status;


    /** 父菜单名称 */
    private String parentName;

    /** 父菜单ID */
    private Long parentId;

    /** 显示顺序 */
    private Integer orderNum;

    /** 祖级列表 */
    private String ancestors;

    /** 子机构 */
    private List<SysArea> children = new ArrayList<>();
    private String remark;

    public Boolean getHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(Boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getParentName()
    {
        return parentName;
    }

    public void setParentName(String parentName)
    {
        this.parentName = parentName;
    }

    public Long getParentId()
    {
        return parentId;
    }

    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public Integer getOrderNum()
    {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum)
    {
        this.orderNum = orderNum;
    }

    public String getAncestors()
    {
        return ancestors;
    }

    public void setAncestors(String ancestors)
    {
        this.ancestors = ancestors;
    }

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

    public void setChildren(List<SysArea> children)
    {
        this.children = children;
    }
    public void setAreaId(Long areaId)
    {
        this.areaId = areaId;
    }

    public Long getAreaId()
    {
        return areaId;
    }

    public void setLevelType(String levelType)
    {
        this.levelType = levelType;
    }

    public String getLevelType()
    {
        return levelType;
    }

    public void setAreaName(String areaName)
    {
        this.areaName = areaName;
    }

    public String getAreaName()
    {
        return areaName;
    }

    public void setShortName(String shortName)
    {
        this.shortName = shortName;
    }

    public String getShortName()
    {
        return shortName;
    }

    public void setPinyin(String pinyin)
    {
        this.pinyin = pinyin;
    }

    public String getPinyin()
    {
        return pinyin;
    }

    public void setProvinceName(String provinceName)
    {
        this.provinceName = provinceName;
    }

    public String getProvinceName()
    {
        return provinceName;
    }

    public void setProvinceShortname(String provinceShortname)
    {
        this.provinceShortname = provinceShortname;
    }

    public String getProvinceShortname()
    {
        return provinceShortname;
    }

    public void setProvincePinyin(String provincePinyin)
    {
        this.provincePinyin = provincePinyin;
    }

    public String getProvincePinyin()
    {
        return provincePinyin;
    }

    public void setCityName(String cityName)
    {
        this.cityName = cityName;
    }

    public String getCityName()
    {
        return cityName;
    }

    public void setCityShortname(String cityShortname)
    {
        this.cityShortname = cityShortname;
    }

    public String getCityShortname()
    {
        return cityShortname;
    }

    public void setCityPinyin(String cityPinyin)
    {
        this.cityPinyin = cityPinyin;
    }

    public String getCityPinyin()
    {
        return cityPinyin;
    }

    public void setDistrictName(String districtName)
    {
        this.districtName = districtName;
    }

    public String getDistrictName()
    {
        return districtName;
    }

    public void setDistrictShortname(String districtShortname)
    {
        this.districtShortname = districtShortname;
    }

    public String getDistrictShortname()
    {
        return districtShortname;
    }

    public void setDistrictPinyin(String districtPinyin)
    {
        this.districtPinyin = districtPinyin;
    }

    public String getDistrictPinyin()
    {
        return districtPinyin;
    }

    public void setJianpin(String jianpin)
    {
        this.jianpin = jianpin;
    }

    public String getJianpin()
    {
        return jianpin;
    }

    public void setFirstChar(String firstChar)
    {
        this.firstChar = firstChar;
    }

    public String getFirstChar()
    {
        return firstChar;
    }

    public void setAreaCode(String areaCode)
    {
        this.areaCode = areaCode;
    }

    public String getAreaCode()
    {
        return areaCode;
    }

    public void setZipCode(String zipCode)
    {
        this.zipCode = zipCode;
    }

    public String getZipCode()
    {
        return zipCode;
    }

    public void setLontitude(String lontitude)
    {
        this.lontitude = lontitude;
    }

    public String getLontitude()
    {
        return lontitude;
    }

    public void setLatitude(String latitude)
    {
        this.latitude = latitude;
    }

    public String getLatitude()
    {
        return latitude;
    }

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

    public String getType()
    {
        return type;
    }

    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("areaId", getAreaId())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("levelType", getLevelType())
            .append("areaName", getAreaName())
            .append("shortName", getShortName())
            .append("pinyin", getPinyin())
            .append("provinceName", getProvinceName())
            .append("provinceShortname", getProvinceShortname())
            .append("provincePinyin", getProvincePinyin())
            .append("cityName", getCityName())
            .append("cityShortname", getCityShortname())
            .append("cityPinyin", getCityPinyin())
            .append("districtName", getDistrictName())
            .append("districtShortname", getDistrictShortname())
            .append("districtPinyin", getDistrictPinyin())
            .append("jianpin", getJianpin())
            .append("firstChar", getFirstChar())
            .append("areaCode", getAreaCode())
            .append("zipCode", getZipCode())
            .append("lontitude", getLontitude())
            .append("latitude", getLatitude())
            .append("type", getType())
            .append("remark", getRemark())
            .append("orderNum", getOrderNum())
            .append("delFlag", getDelFlag())
            .append("status", getStatus())
            .toString();
    }

    public SysArea addChildren(SysArea row) {
        if (null == this.children) {
            this.children = new ArrayList<>(12);
        }
        if (!this.children.contains(row)) {
            this.children.add(row);
        }
        return this;
    }
}
