Package net.yanhl.iouser.pojo

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


    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

          + 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

          + 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

  }
 
  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

            return false;
          }
        }
       
      });
      GroupRelation group = (GroupRelation) getBaseManager().get(GroupRelation.class, groupId);
      JSONObject jsonObject = JSONObject.fromObject(group, config);
      GroupRelation parentGroup = group.getParentGroup();
      jsonObject.accumulate("parentId", parentGroup.getId());
      jsonObject.accumulate("parentName", parentGroup.getGroupName());
      print(response, jsonObject.toString());
      log.info(currentUserName + ">载入分组:" + group + "");
    } catch(JSONException je) {
      je.printStackTrace();
      log.error(currentUserName + ">载入分组>解析JSON数据出错:" + je.getMessage());
View Full Code Here

  }
 
  public ActionForward updateGroup(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");
      log.debug("分组<" + group.getGroupName() + ">,parentId=" + parentId);
      GroupRelation parentGroup = (GroupRelation) getBaseManager().get(GroupRelation.class, parentId);
     
      //获得并设置更新字段
      GroupRelation tempGroup = (GroupRelation) getBaseManager().get(GroupRelation.class, jsonObject.getLong("id"));
      tempGroup.setGroupName(group.getGroupName());
      tempGroup.setParentGroup(parentGroup);
      tempGroup.setRemark(group.getRemark());
     
      getBaseManager().update(tempGroup);
      print(response, RESBONSE_SUCCESS);
      log.info(currentUserName + ">成功修改分组[" + group + "]信息");
    } catch(JSONException je) {
View Full Code Here

TOP

Related Classes of net.yanhl.iouser.pojo.GroupRelation

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.