Examples of GroupRelation


Examples of com.sishuok.es.sys.group.entity.GroupRelation

        Organization organization2 = new Organization();
        organization2.setName("test2");
        organizationService.save(organization1);
        organizationService.save(organization2);

        GroupRelation groupRelation1 = new GroupRelation();
        groupRelation1.setGroupId(group.getId());
        groupRelation1.setOrganizationId(organization1.getId());
        GroupRelation groupRelation2 = new GroupRelation();
        groupRelation2.setGroupId(group.getId());
        groupRelation2.setOrganizationId(organization2.getId());

        groupRelationService.save(groupRelation1);
        groupRelationService.save(groupRelation2);

        Searchable searchable = Searchable.newSearchable();
View Full Code Here

Examples of com.sishuok.es.sys.group.entity.GroupRelation

        }
        for (Long organizationId : organizationIds) {
            if (organizationId == null) {
                continue;
            }
            GroupRelation r = getGroupRelationRepository().findByGroupIdAndOrganizationId(groupId, organizationId);
            if (r == null) {
                r = new GroupRelation();
                r.setGroupId(groupId);
                r.setOrganizationId(organizationId);
                save(r);
            }
        }
    }
View Full Code Here

Examples of com.sishuok.es.sys.group.entity.GroupRelation

        if (!ArrayUtils.isEmpty(userIds)) {
            for (Long userId : userIds) {
                if (userId == null) {
                    continue;
                }
                GroupRelation r = getGroupRelationRepository().findByGroupIdAndUserId(groupId, userId);
                if (r == null) {
                    r = new GroupRelation();
                    r.setGroupId(groupId);
                    r.setUserId(userId);
                    save(r);
                }
            }
        }

        if (!ArrayUtils.isEmpty(startUserIds)) {
            for (int i = 0, l = startUserIds.length; i < l; i++) {
                Long startUserId = startUserIds[i];
                Long endUserId = endUserIds[i];
                //范围查 如果在指定范围内 就没必要再新增一个 如当前是[10,20] 如果数据库有[9,21]
                GroupRelation r = getGroupRelationRepository().findByGroupIdAndStartUserIdLessThanEqualAndEndUserIdGreaterThanEqual(groupId, startUserId, endUserId);

                if (r == null) {
                    //删除范围内的
                    getGroupRelationRepository().deleteInRange(startUserId, endUserId);
                    r = new GroupRelation();
                    r.setGroupId(groupId);
                    r.setStartUserId(startUserId);
                    r.setEndUserId(endUserId);
                    save(r);
                }

            }
        }
View Full Code Here

Examples of com.sishuok.es.sys.group.entity.GroupRelation

            clear();
            return true;
        }
        if (r.getUserId() != null) {// 当添加/修改/删除的是某个用户的,只清理这个用户的缓存
            evict(r.getUserId());
            GroupRelation dbR = groupRelationService.findOne(r.getId());
            if (dbR != null && !dbR.getUserId().equals(r.getUserId())) { //如果a用户替换为b用户时清理两个用户的缓存

                log.debug("cacheName:{}, method:evictForGroupRelation, evict userId:{}", cacheName, dbR.getUserId());
                evict(dbR.getUserId());
            }
        }
        return false;
    }
View Full Code Here

Examples of com.sishuok.es.sys.group.entity.GroupRelation

    @Before(value = "groupRelationServicePointcut() && groupRelationMaybeCacheEvictAllOrSpecialPointcut(arg)", argNames = "jp,arg")
    public void groupRelationMaybeCacheClearAllOrSpecialAdvice(JoinPoint jp, Object arg) {
        String methodName = jp.getSignature().getName();
        if (arg instanceof GroupRelation) {
            GroupRelation r = (GroupRelation) arg;

            log.debug("cacheName:{}, method:groupRelationMaybeCacheClearAllOrSpecialAdvice delagate to evictForGroupRelation", cacheName);
            if (evictForGroupRelation(r)) {
                return;
            }

        } else if ("delete".equals(methodName)) {//删除情况
            if (arg instanceof Long) {
                Long rId = (Long) arg;
                GroupRelation r = groupRelationService.findOne(rId);

                log.debug("cacheName:{}, method:groupRelationMaybeCacheClearAllOrSpecialAdvice delagate to evictForGroupRelation", cacheName);
                if (evictForGroupRelation(r)) {
                    return;
                }
            } else if (arg instanceof Long[]) {
                for (Long rId : (Long[]) arg) {
                    GroupRelation r = groupRelationService.findOne(rId);

                    log.debug("cacheName:{}, method:groupRelationMaybeCacheClearAllOrSpecialAdvice delagate to evictForGroupRelation", cacheName);
                    if (evictForGroupRelation(r)) {
                        return;
                    }
View Full Code Here

Examples of net.yanhl.iouser.pojo.GroupRelation

    List<GroupRelation> allGroup = groupDao.loadAllGroup(tree);
    log.debug("groupId=" + tree.getParentId() + ",得到" + allGroup.size() + "个用户组");
   
    // TODO 增加组下面的组
    for (Iterator<GroupRelation> iterator = allGroup.iterator(); iterator.hasNext();) {
      GroupRelation group = iterator.next();
      log.debug("用户组:id=" + group.getId() + ",name=" + group.getGroupName());
      String ajaxUrl = tree.getBasePath() + "tree/getUserTree.do?gid=" + group.getId();
      result.append("<li id='")
        .append(group.getId())
        //add li end
        .append("'>\n\t<span")
        .append(" type='")
        .append(TreeUtil.TYPE_GROUP)
        .append("'>")
        .append(group.getGroupName())
        .append("</span>")
        //add span end
        .append("\n\t<ul class='ajax'>\n\t\t<li>\n\t\t\t{url:")
        .append(ajaxUrl + "}")
        .append("\n\t\t</li>\n\t</ul>\n</li>\n");
View Full Code Here

Examples of net.yanhl.iouser.pojo.GroupRelation

    List<GroupRelation> allGroup = groupDao.loadAllGroup(tree);
    log.debug("groupId=" + tree.getParentId() + ",得到" + allGroup.size() + "个用户组");
   
    // TODO 增加组下面的组
    for (Iterator<GroupRelation> iterator = allGroup.iterator(); iterator.hasNext();) {
      GroupRelation group = iterator.next();
      log.debug("用户组:id=" + group.getId() + ",name=" + group.getGroupName());
      String ajaxUrl = tree.getBasePath() + "tree/getGroupTree.do?gid=" + group.getId();
      int childs = group.getChildGroups().size();
      if(childs > 0) {
        result.append("<li id='")
        .append(group.getId())
        .append("'>\n\t<span")
        .append(" type='")
        .append(TreeUtil.TYPE_GROUP)
//        .append("' title='共" + childs + "个子分组'>")
        .append("'>")
        .append(group.getGroupName())
        .append("</span>")
        .append("\n\t<ul class='ajax'>\n\t\t<li>\n\t\t\t{url:")
        .append(ajaxUrl + "}")
        .append("\n\t\t</li>\n\t</ul>\n</li>\n");
      } else {
        result.append("<li id='")
        .append(group.getId())
        .append("'>\n\t<span")
        .append(" type='")
        .append(TreeUtil.TYPE_GROUP)
        .append("'>")
        .append(group.getGroupName())
        .append("</span>\n</li>\n");
      }
    }
    log.debug("分组groupId=" + tree.getParentId() + ",输出=\n" + result.toString());
    return result.toString();
View Full Code Here

Examples of net.yanhl.iouser.pojo.GroupRelation

          + jsonObject.get("tel_ext");
      user.setCompanyPhone(tmpComPhone);
      // 设置分组关系
      Long groupId = jsonObject.getLong("groupId");
      if(groupId != null) {
        GroupRelation group = (GroupRelation) getBaseManager().get(GroupRelation.class, groupId);
        if(group == null) {
          throw new IouserException("债务人关系->分组为空");
        }
        user.setGroup(group);
      }
View Full Code Here

Examples of net.yanhl.iouser.pojo.GroupRelation

          + jsonObject.get("tel_ext");
      user.setCompanyPhone(tmpComPhone);
      // 设置分组关系
      Long groupId = jsonObject.getLong("groupId");
      if(groupId != null) {
        GroupRelation group = (GroupRelation) getBaseManager().get(GroupRelation.class, groupId);
        if(group == null) {
          throw new IouserException("债务人关系->分组为空");
        }
        user.setGroup(group);
      }
View Full Code Here

Examples of net.yanhl.iouser.pojo.GroupRelation

  }
 
  public ActionForward addGroup(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    String currentUserName = null;
    GroupRelation group = null;
    try {
      currentUserName = UserUtil.getCurrentUserName(request);
      JSONObject jsonObject = readJson(request);
      group = (GroupRelation) JSONObject.toBean(jsonObject, GroupRelation.class);
      Long parentId = jsonObject.getLong("parentId");
      Object object = getBaseManager().get(GroupRelation.class, parentId);
      if(object == null) {
        GroupRelation parentGroup = new GroupRelation();
        parentGroup.setId(-1l);
        parentGroup.setGroupName("账务管理系统");
        group.setParentGroup(parentGroup);
      } else {
        group.setParentGroup((GroupRelation) object);
      }
      group.setCreatorId(new Integer(UserUtil.getCurrentUserId(request)));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.