/** * 单个商品评论 * * @param gct */ public void ProcessGoodsCommentListByGoodsid(List<GoodsCommentT> gct) { total = this.getGoodsCommentTService().countfindAllGoodsComment(); for (Iterator<GoodsCommentT> it = gct.iterator(); it.hasNext(); ) { GoodsCommentT gctt = (GoodsCommentT) it.next(); gctt.setState(StaticKey.DataShowState.getName(gctt.getState())); if (gctt.getVirtualadd().equals(StaticKey.COMMENT_VIRTUALADD_ONE_NUM)) { gctt.setVirtualadd(StaticKey.COMMENT_VIRTULADD); } else { gctt.setVirtualadd(StaticKey.COMMENT_NOTVIRTULADD); } if (gctt.getReplyorcomment().equals(StaticKey.COMMENT_REPLY_ONE_NUM)) { gctt.setReplyorcomment(StaticKey.COMMENT_REPLY_ONE); } else { gctt.setReplyorcomment(StaticKey.COMMENT_REPLY_TWO); } Map<String, Object> cellMap = new HashMap<String, Object>(); cellMap.put("id", gctt.getCommentid()); cellMap.put( "cell", new Object[] { gctt.getCommentcontent(), gctt.getReplyorcommentusername(), gctt.getScore(), gctt.getReplyorcomment(), gctt.getVirtualadd(), gctt.getState(), BaseTools.formateDbDate(gctt.getPosttime()), "<a id='goodscommentdetail' href='goodscommentdetail.jsp?operate=editdetail&commentid=" + gctt.getCommentid() + "' name='goodscommentdetail'>[编辑]</a>" }); rows.add(cellMap); } }
/** * 处理商品评论迭代 * * @param gct */ public void ProcessGoodsCommentList(List<GoodsCommentT> gct) { total = this.getGoodsCommentTService().countfindAllGoodsComment(); for (Iterator<GoodsCommentT> it = gct.iterator(); it.hasNext(); ) { GoodsCommentT gctt = (GoodsCommentT) it.next(); gctt.setState(StaticKey.DataShowState.getName(gctt.getState())); Map<String, Object> cellMap = new HashMap<String, Object>(); cellMap.put("id", gctt.getGoodsid()); cellMap.put( "cell", new Object[] { gctt.getGoodsname(), gctt.getState(), "<a id='showgoodscomment' href='goodscommentlistment.jsp?operate=edit&goodsname=" + gctt.getGoodsname() + "&goodsid=" + gctt.getGoodsid() + "' name='showgoodscomment'>[查看详细]</a>" }); rows.add(cellMap); } }