/** * 单个商品评论 * * @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); } }
/** * 增加虚拟评论 * * @return */ @Action( value = "addvirtualGoodsComment", results = {@Result(name = "json", type = "json")}) public String addvirtualGoodsComment() { if (StringUtils.isBlank(this.getGoodsid())) { return "json"; } GoodsCommentT gct = new GoodsCommentT(); gct.setCommentid(this.getSerial().Serialid(Serial.GOODSCOMMENT)); gct.setGoodsid(this.getGoodsid().trim()); gct.setGoodsname(this.getGoodsname().trim()); gct.setReplyorcommentusername(this.getReplyorcommentusername()); gct.setReplyorcommentuserid(BaseTools.adminCreateId()); gct.setPosttime(BaseTools.systemtime()); gct.setCommentcontent(this.getCommentcontent()); gct.setScore(this.getScore()); gct.setState(StaticKey.COMMENT_STATE_ONE_NUM); gct.setReplyorcomment(StaticKey.COMMENT_REPLY_TWO_NUM); gct.setReplyid(StaticKey.COMMENT_DEFAULT_REPLYID); gct.setEmailable(StaticKey.COMMENT_EMAILABLE_ONE_NUM); gct.setVirtualadd(StaticKey.COMMENT_VIRTUALADD_ONE_NUM); this.getGoodsCommentTService().save(gct); this.setSucflag(true); return "json"; }