Example #1
0
 private static boolean validateRole(Role role, List<Long> subSystemIds) {
   BusinessSystem system = role.getBusinessSystem();
   if (system != null) {
     if (subSystemIds.contains(system.getId())) { // 但前系统是子系统,且角色所在的系统包含在子系统集合中
       return true;
     } else {
       if (subSystemIds.size() <= 0) { // 当前系统不是子系统
         if (ContextUtils.getSystemId().equals(system.getId())) {
           return true;
         }
       }
     }
   }
   return false;
 }
  public void getSecondNodesInWftypeTree(
      List<WorkflowType> wfTypes,
      List<BusinessSystem> businessSystemList,
      String belongType,
      List<ZTreeNode> treeNodes,
      String parentId) {
    // 流程类型
    ZTreeNode root =
        new ZTreeNode(
            belongType + "_WFT_0", parentId, "流程类型", "true", "false", "", "", "folder", "");
    treeNodes.add(root);
    for (WorkflowType wft : wfTypes) {
      root =
          new ZTreeNode(
              belongType + "_WFT_" + wft.getId(),
              belongType + "_WFT_0",
              wft.getName(),
              "false",
              "false",
              "",
              "",
              "folder",
              "");
      treeNodes.add(root);
    }

    // 所有系统
    root =
        new ZTreeNode(
            belongType + "_BSYS_0", parentId, "所有系统", "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    for (BusinessSystem bs : businessSystemList) {
      root =
          new ZTreeNode(
              belongType + "_BSYS_" + bs.getId(),
              belongType + "_BSYS_0",
              bs.getName(),
              "false",
              "false",
              "",
              "",
              "folder",
              "");
      treeNodes.add(root);
    }
  }