Package org.apdplat.module.security.model

Examples of org.apdplat.module.security.model.Org


            ids.addAll(getChildIds(item));
        }
        return ids;
    }
    public static boolean isParentOf(Org parent,Org child){
        Org org=child.getParent();
        while(org!=null){
            if(org.getId()==parent.getId()){
                return true;
            }
            org=org.getParent();
        }
        return false;
    }
View Full Code Here


        }
        return false;
    }
   
    public String toRootJson(){
        Org rootOrg=getRootOrg();
        if(rootOrg==null){
            LOG.error("获取根组织架构失败!");
            return "";
        }
        StringBuilder json=new StringBuilder();
        json.append("[");

        json.append("{'text':'")
            .append(rootOrg.getOrgName())
            .append("','id':'")
            .append(rootOrg.getId());
            if(rootOrg.getChild().isEmpty()){
                json.append("','leaf':true,'cls':'file'");
            }else{
                json.append("','leaf':false,'cls':'folder'");
            }
        json.append("}");
View Full Code Here

        json.append("]");
       
        return json.toString();
    }
    public String toJson(int orgId){
        Org org=serviceFacade.retrieve(Org.class, orgId);
        if(org==null){
            LOG.error("获取ID为 "+orgId+" 的组织架构失败!");
            return "";
        }
        List<Org> child=org.getChild();
        if(child.isEmpty()){
            return "";
        }
        StringBuilder json=new StringBuilder();
        json.append("[");
View Full Code Here

            start = 0;
        }
        if(len < 1){
            len = 10;
        }
        Org org = null;
        Role role = null;
        if(orgId > 0){
            //返回特定组织架构及其所有子机构的在线用户
            org = serviceFacade.retrieve(Org.class, orgId);
        }
View Full Code Here

        if(propertyCriteria == null){
            propertyCriteria = new PropertyCriteria();
        }
        //orgId==-1或orgId<0代表为根节点,不加过滤条件
        if(orgId > 0){
            Org org = serviceFacade.retrieve(Org.class, orgId);
            //获取orgId的所有子机构的ID
            List<Integer> orgIds = OrgService.getChildIds(org);
            //加上orgId
            orgIds.add(org.getId());
           
            PropertyEditor pe = new PropertyEditor("org.id", Operator.in, PropertyType.List, orgIds);
            propertyCriteria.addPropertyEditor(pe);
        }
        return propertyCriteria;
View Full Code Here

TOP

Related Classes of org.apdplat.module.security.model.Org

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.