zoukankan      html  css  js  c++  java
  • 根据子部门获取其到根部门的路径

     /**
         * 获取子部门到根部门的路径
         * @param orgId String
         * @return List<String>
         */
        public static List<String> getOrgPath(Long orgId)
        {
            List<String> paths = new ArrayList<String>();
            List<Org> allOrgs = SystemToolKit.getOrgService().getAllSimpleOrg();
            Long parentId = orgId;
            
            if (CollectionUtils.isNotEmpty(allOrgs))
            {
                for (int i = allOrgs.size() - 1; i >= 0; --i)
                {
                    Org node = allOrgs.get(i);
                    if (!node.getId().equals(parentId))
                    {
                        continue;
                    }
                    else
                    {
                        paths.add(NumberUtils.toString(node.getId()));
                        parentId = NumberUtils.toLong(node.getParentId());
                    }
                }
            }
            return paths;
        }

  • 相关阅读:
    P5107 能量采集
    P4655 [CEOI2017]Building Bridges
    P1129 [ZJOI2007]矩阵游戏
    P5299 [PKUWC2018]Slay the Spire
    P1625求和 giao精大杂烩
    背包
    根号分治
    CF963B
    国王游戏
    P6006 USACO 3SUM G
  • 原文地址:https://www.cnblogs.com/guoyuqiangf8/p/3507183.html
Copyright © 2011-2022 走看看