@Action(value = "queryUserList")
  public String queryUserList() {
    String orgId = getOnlineUser().getLoginedOrg().getId();

    // TODO 判断要查询的公司是否拥有权限,如果没有权限,则默认还是自己所在的公司
    QueryResult<User> qr =
        this.userService.getUsersByOrgID(orgId, false, conditions, -1, -1, getOrderBy());
    JsonResult jr = new JsonResult(qr.getTotalrecord().intValue(), qr.getResultlist());
    jr.setContainFields(new String[] {"id", "loginId", "name", "email", "createTime"});
    this.setJsonString(jr.toJSONString());
    return SUCCESS;
  }
Пример #2
0
 /**
  * 通用灵活条件查询
  *
  * @author slx
  * @date 2011-12-26
  * @return
  * @throws BizException
  */
 @Action(value = "query")
 public String query() throws BizException {
   QueryResult<T> result =
       getBillService()
           .query(
               getOnlineUser().getUser().getId(),
               functionCode,
               getOnlineUser().getLoginedOrg().getId(),
               conditions,
               start,
               limit);
   JsonResult jr = new JsonResult(result.getResultlist());
   if (result.getResultlist() == null || result.getResultlist().size() < 1) {
     setJsonString("{success : true,msg : '无数据!',result:[]}");
     return SUCCESS;
   }
   jr.setTotalCounts(result.getTotalrecord().intValue());
   jr.setContainFields(result.getResultlist().get(0).getBeanUtility().getAttributeNamesNoLazy());
   jr.setDateFormat("yyyy-MM-dd");
   setJsonString(jr.toJSONString());
   return SUCCESS;
 }