コード例 #1
0
  /**
   * 平台方可以查看所有互动.
   *
   * @param model
   * @param request
   * @return
   */
  @RequestMapping(value = "/getAllClassNewsByWJ", method = RequestMethod.GET)
  public String getAllClassNewsByWJ(ModelMap model, HttpServletRequest request) {
    ResponseMessage responseMessage = RestUtil.addResponseMessageForModelMap(model);
    try {

      // 请求消息体
      if (!RightUtils.hasRight(
          SystemConstants.Group_uuid_wjkj, RightConstants.AD_classnew_m, request)) {
        responseMessage.setStatus(RestConstants.Return_ResponseMessage_failed);
        responseMessage.setMessage(RightConstants.Return_msg);
        return "";
      }

      PaginationData pData = this.getPaginationDataByRequest(request);
      SessionUserInfoInterface user = this.getUserInfoBySession(request);
      pData.setPageSize(5);

      PageQueryResult pageQueryResult = classNewsService.getAllClassNewsByWJ(user, pData);

      model.addAttribute(RestConstants.Return_ResponseMessage_list, pageQueryResult);
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_success);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_failed);
      responseMessage.setMessage("服务器异常:" + e.getMessage());
      return "";
    }
    return "";
  }
コード例 #2
0
  /**
   * 所有学校的互动
   *
   * @param model
   * @param request
   * @return
   */
  @RequestMapping(value = "/getAllGroupNews", method = RequestMethod.GET)
  public String getAllGroupNews(ModelMap model, HttpServletRequest request) {
    ResponseMessage responseMessage = RestUtil.addResponseMessageForModelMap(model);
    String type = request.getParameter("type");
    try {

      PaginationData pData = this.getPaginationDataByRequest(request);
      SessionUserInfoInterface user = this.getUserInfoBySession(request);
      String uuid = request.getParameter("uuid");
      pData.setPageSize(5);
      String groups = this.getMyGroupUuidsBySession(request);
      if (StringUtils.isBlank(groups)) {
        responseMessage.setMessage(RightConstants.Return_msg);
        return "";
      }

      PageQueryResult pageQueryResult = classNewsService.listClassNewsByAllgroup(user, uuid, pData);

      model.addAttribute(RestConstants.Return_ResponseMessage_list, pageQueryResult);
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_success);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_failed);
      responseMessage.setMessage("服务器异常:" + e.getMessage());
      return "";
    }
    return "";
  }
コード例 #3
0
  /**
   * 管理员-查询我管理学校的互动
   *
   * @param model
   * @param request
   * @return
   */
  @RequestMapping(value = "/listClassNewsByAdmin", method = RequestMethod.GET)
  public String listClassNewsByAdmin(ModelMap model, HttpServletRequest request) {
    ResponseMessage responseMessage = RestUtil.addResponseMessageForModelMap(model);
    try {

      String right = RightConstants.KD_announce_m;
      if (SessionListener.isPXLogin(request)) {
        right = RightConstants.PX_announce_m;
      }

      PaginationData pData = this.getPaginationDataByRequest(request);
      SessionUserInfoInterface user = this.getUserInfoBySession(request);
      pData.setPageSize(5);
      String groups = RightUtils.getRightGroups(right, request);
      if (StringUtils.isBlank(groups)) {
        responseMessage.setMessage(RightConstants.Return_msg);
        return "";
      }

      String groupuuid = request.getParameter("groupuuid");
      if (StringUtils.isNotBlank(groupuuid) && !groups.contains(groupuuid)) {
        responseMessage.setMessage("选择的幼儿园没有权限");
        return "";
      }
      if (StringUtils.isNotBlank(groupuuid)) {
        groups = groupuuid;
      }
      PageQueryResult pageQueryResult = classNewsService.listClassNewsByAdmin(groups, user, pData);
      model.addAttribute(RestConstants.Return_ResponseMessage_list, pageQueryResult);
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_success);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_failed);
      responseMessage.setMessage("服务器异常:" + e.getMessage());
      return "";
    }
    return "";
  }