| | |
| | | record.setId(id); |
| | | record.setShareNumReal(0); |
| | | record.setCreateTime(new Date()); |
| | | record.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(record); |
| | | } else { |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(id); |
| | |
| | | resultObj.setStartTime(record.getStartTime()); |
| | | resultObj.setEndTime(record.getEndTime()); |
| | | resultObj.setTitle(tilte); |
| | | resultObj.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | return id; |
| | |
| | | commentsNew.add(commentInfo); |
| | | resultObj.setComments(commentsNew); |
| | | } |
| | | resultObj.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(resultObj); |
| | | |
| | | // 删除图片 |
| | |
| | | } |
| | | |
| | | resultObj.setComments(comments); |
| | | resultObj.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | |
| | |
| | | |
| | | List<GoodsEvaluate> listNew = new ArrayList<>(); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | |
| | | |
| | | GoodsEvaluate evaluateNew = new GoodsEvaluate(); |
| | | try { |
| | | PropertyUtils.copyProperties(evaluateNew, goodsEvaluate); |
| | |
| | | EvaluateEnum typeEnum = evaluateNew.getType(); |
| | | List<CommentInfo> commentNew = new ArrayList<>(); |
| | | |
| | | boolean singleCoupn = true; |
| | | boolean currencyCoupon = true; |
| | | for (CommentInfo commentInfo : comments) { |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getContent()) |
| | | && StringUtil.isNullOrEmpty(commentInfo.getCoupon())) { |
| | |
| | | if (goods.isHasCoupon()) { |
| | | content = content.replace("[券后价]",MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+""); |
| | | } else { |
| | | singleCoupn = false; |
| | | content = content.replace("领券抢购", "抢购"); |
| | | content = content.replace("【券后价】[券后价]元", ""); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | comment++; |
| | | CommentInfoEnum typeComment = commentInfoNew.getTypeEnum(); |
| | | if (typeComment != null && typeComment == CommentInfoEnum.goodsCoupon) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | |
| | | commentNew.add(commentInfoNew); |
| | | continue; |
| | | } else { |
| | | currencyCoupon = false; |
| | | continue; |
| | | } |
| | | } else { |
| | | currencyCoupon = false; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | evaluateNew.setComments(commentNew); |
| | | |
| | | if (typeEnum != null && typeEnum == EvaluateEnum.single) { |
| | | if (comment > 0 && commentNew.size() == 0) { // 所有券评论下架 |
| | | if (!currencyCoupon && !singleCoupn) { // 所有券评论下架 |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | | if (goods != null) { |
| | | goods.setState(1); // 评论不存在 下架 |
| | | LogHelper.test("获取列表商品下架1"); |
| | | evaluateNew.setRemarks("评论验证下架"); |
| | | } |
| | | |
| | | List<ImgInfo> imgList = evaluateNew.getImgList(); |
| | |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods != null) { |
| | | simpleGoods.setState(1); |
| | | LogHelper.test("获取列表商品下架2"); |
| | | simpleGoods.setRemarks("评论验证下架"); |
| | | } |
| | | } |
| | | |
| | |
| | | if (goodsNew != null) { |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } else { |
| | | goodsEvaluate.setRemarks("更新-位置找到商品信息"); |
| | | goodsEvaluate.setState(0); // 已商品下架 |
| | | goods.setState(1); |
| | | goodsEvaluate.setGoods(goods); |
| | |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsDetailVO); |
| | | } else { |
| | | simpleGoods.setRemarks("更新-位置找到商品信息"); |
| | | simpleGoods.setState(1); |
| | | imgInfo.setGoods(simpleGoods); |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); |