Exemplo n.º 1
0
 /**
  * @description <b>获取用户的评论信息</b>
  * @author 王鹏
  * @version 1.0.0
  * @data 2015-5-15
  * @param @param data
  * @param @return
  * @return Object
  */
 public Object findMemberComment(Object data) {
   HeadObject headObject = new HeadObject();
   ResultPage<Object> comments = null;
   try {
     MemberCommentQryDTO qryDTO = (MemberCommentQryDTO) data;
     qryDTO.buildOrderByField();
     PageHelper.startPage(qryDTO.getPage(), qryDTO.getRows());
     comments = new ResultPage<Object>(this.orderCommentMapper.selectMemberCommentCount(qryDTO));
     if (comments.getRows().size() > 0) {
       qryDTO.setCommentIds(comments.getRows());
       qryDTO.setCommentsType(CommentsType.COMMENT.getKey().toString());
       comments.setRows(orderCommentMapper.selectMemberComment(qryDTO));
     }
     headObject.setRetCode(ErrorCode.SUCCESS);
   } catch (Exception e) {
     headObject.setRetCode(ErrorCode.FAILURE);
     log.error("获取用户评论失败", e);
     e.printStackTrace();
   }
   return new ResultObject(headObject, JSONObject.toJSON(comments));
 }
Exemplo n.º 2
0
  /**
   * @Title: commentsListData @Description: 评论列表
   *
   * @author <a href="*****@*****.**">蔡志杰</a>
   * @date 2015-8-25 下午4:34:48
   * @version 1.0.0
   * @param @param data
   * @param @param request
   * @param @return
   * @return Object 返回类型
   * @throws
   */
  @RequestMapping("/commentsListData")
  public Object commentsListData(String data, HttpServletRequest request) {
    log.info("---------CommentsManagerController.commentsListData-----------");
    log.info("----------------------data:" + data + "-------------------------");
    HeadObject headObject = null;
    ResultObject resultObject = null;
    try {
      MemberListDo memberListDo =
          APICommonUtil.getMemberListDo((String) request.getAttribute("sessionid"));
      if (null != memberListDo) {
        JSONObject obj = JSON.parseObject(data);
        String pageIndex = obj.getString("page");
        String pageSize = obj.getString("rows");

        MemberCommentQryDTO qryDTO = new MemberCommentQryDTO();
        qryDTO.setPage(
            StringUtil.isEmpty(pageIndex)
                ? GlobalStatic.DEFAULT_PAGE_INDEX
                : Integer.parseInt(pageIndex));
        qryDTO.setRows(
            StringUtil.isEmpty(pageSize)
                ? GlobalStatic.DEFAULT_PAGE_SIZE
                : Integer.parseInt(pageSize));
        qryDTO.setStoreId(memberListDo.getStoreId().intValue());
        qryDTO.setCompanyId(memberListDo.getCompanyId());
        qryDTO.setObjectType("order");
        headObject = CommonHeadUtil.geneHeadObject("orderCommentService.findMemberComment");
        resultObject =
            (ResultObject) orderService.doServiceByServer(new RequestObject(headObject, qryDTO));
      }

    } catch (Exception e) {
      log.error(e.getMessage(), e);
      return processExpction(e.getMessage());
    }
    return resultObject;
  }