public static void showMemberList(String id,QueryCondition query){

    

    //TODO 调试完毕取消

//    if(id == null || id.equals("")){

//    render();

//    }

    if(session.get("companyid") == null)

    login();

    

    Group group  = Group.findById(new ObjectId(id));

    if(group != null){

    String groupName = group.companyName;

    Map<String,Member> members = group.members;

    List<User> users = null;

    if(members!=null){

    Set<String> set = members.keySet();

    String filterUuid = "contact.uuid in";

    

    if(query!=null){

    if(query.name!=null && !"".equals(query.name) && query.phone!=null && !"".equals(query.phone)){

    users = User.q().filter("contact.displayName", query.name.trim()).filter("contact.defaultPhone", query.phone.trim()).filter("contact <> ", null).filter(filterUuid, set).order("-contact.created").asList();

    }else if(query.name!=null && !"".equals(query.name)){

    users = User.q().filter("contact.displayName", Pattern.compile("["+query.name.trim()+"]", Pattern.CASE_INSENSITIVE)).filter("contact <> ", null).filter(filterUuid, set).order("-contact.created").asList();

    }else if(query.phone!=null && !"".equals(query.phone)){

    users = User.q().filter("contact.defaultPhone", query.phone.trim()).filter("contact <> ", null).filter(filterUuid, set).order("-contact.created").asList();

    }else{

    users = User.q().filter("contact <> ", null).filter(filterUuid, set).order("-contact.created").asList();

    }

    }else{

    users = User.q().filter("contact <> ", null).filter(filterUuid, set).order("-contact.created").asList();

    }

    

    ValuePaginator paginator = new ValuePaginator(users);

       paginator.setPagesDisplayed(Constant.PAGE_SET_PAGES_DISPLAYED);

       paginator.setPageSize(Constant.PAGE_SET_PAGE_SIZE);

    render(paginator,groupName,id,query);

    }else{

    render(groupName,id,query);

    }

    

    }else {

    render();

    }

}

Play Framework 1.2.3 (用户list)


转载于:https://my.oschina.net/cpy/blog/485159

相关文章:

  • 2021-08-25
  • 2022-12-23
  • 2021-08-31
  • 2021-07-10
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
猜你喜欢
  • 2021-05-02
  • 2021-09-09
  • 2022-12-23
  • 2021-08-24
  • 2021-05-16
  • 2021-06-21
相关资源
相似解决方案