Beispiel #1
0
 /**
  * @Title: selectReplyByCommentId @Description: TODO(根据评论id查询回复列表)
  *
  * @author <a href="*****@*****.**">赖彩妙</a>
  * @date 2015-5-20 下午2:31:00
  * @version 1.0.0
  * @param @param data
  * @param @return
  * @return Object 返回类型
  * @throws
  */
 public Object selectReplyByCommentId(Object data) {
   log.info("start[MemberCommentService.selectReplyByCommentId]");
   net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(data);
   Integer pageIndex = jsonObject.getInt("pageIndex");
   Integer pageSize = jsonObject.getInt("pageSize");
   Integer commentId = jsonObject.getInt("commentId");
   PageHelper.startPage(pageIndex, pageSize);
   ResultPage<OrderCommentDetailDTO> commentPage =
       new ResultPage(orderCommentMapper.selectReplyByCommentId(commentId));
   if (commentPage.getRows() != null && commentPage.getRows().size() >= 1) {
     SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     for (int i = 0; i < commentPage.getRows().size(); i++) {
       if (commentPage.getRows().get(i).getCreateTime() != null) {
         commentPage
             .getRows()
             .get(i)
             .setCommentDate(format.format(commentPage.getRows().get(i).getCreateTime()));
       }
     }
   }
   log.info("end[MemberCommentService.selectReplyByCommentId]");
   //	    	return new ResultObject(new HeadObject(ErrorCode.SUCCESS),
   // JSONObject.fromObject(commentPage));
   return new ResultObject(
       new HeadObject(ErrorCode.SUCCESS), com.alibaba.fastjson.JSONObject.toJSON(commentPage));
 }