| | |
| | | listImg.add(imgVideo); |
| | | } |
| | | |
| | | int totalImg = 0; |
| | | if (!StringUtil.isNullOrEmpty(activityPic) || !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | if (imgactivity != null) { |
| | | imgactivity.setUrl(activityPic); |
| | |
| | | imgactivity.setH(imgactivity.getH()); |
| | | } |
| | | listImg.add(imgactivity); |
| | | totalImg ++; |
| | | } |
| | | resultObj.setLineNum(1); |
| | | |
| | | int lineNum = 0; |
| | | if (totalImg > 0) { |
| | | if (totalImg == 1) { |
| | | lineNum = 1; |
| | | } else if (totalImg <= 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | |
| | | resultObj.setLineNum(lineNum); |
| | | resultObj.setImgList(listImg); |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | |
| | | listImg.add(imgActivity); |
| | | } |
| | | |
| | | int totalImg = 0; |
| | | // 编辑图片 |
| | | if (!StringUtil.isNullOrEmpty(picUrls)) { |
| | | String[] pics = picUrls.split(","); |
| | |
| | | imgInfo0.setW(1); |
| | | imgInfo0.setH(1); |
| | | listImg.add(imgInfo0); |
| | | totalImg ++; |
| | | continue; |
| | | } |
| | | } |
| | |
| | | String url = imgInfo.getUrl(); |
| | | if (picLink.equals(url)) { |
| | | listImg.add(imgInfo); |
| | | totalImg ++; |
| | | break; |
| | | } |
| | | } |
| | |
| | | listDel.add(listOld.get(j)); |
| | | } |
| | | } |
| | | resultObj.setLineNum(1); |
| | | |
| | | int lineNum = 0; |
| | | if (totalImg > 0) { |
| | | if (totalImg == 1) { |
| | | lineNum = 1; |
| | | } else if (totalImg <= 4) { |
| | | lineNum = 2; |
| | | } else { |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | |
| | | resultObj.setLineNum(lineNum); |
| | | resultObj.setImgList(listImg); |
| | | goodsEvaluateDao.save(resultObj); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | // @Cacheable(value = "dynamicCache", key = |
| | | // "'queryMaterialsCache-'+#start+'-'+#type") |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type") |
| | | public List<GoodsEvaluate> queryMaterialsCache(int start, int count, int type) throws Exception { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, type); |
| | | if (list == null) { |
| | |
| | | List<CommentInfo> commentNew = new ArrayList<>(); |
| | | |
| | | for (CommentInfo commentInfo : comments) { |
| | | if (StringUtil.isNullOrEmpty(commentInfo.getContent()) && |
| | | StringUtil.isNullOrEmpty(commentInfo.getCoupon())) { |
| | | continue; |
| | | } |
| | | |
| | | CommentInfo commentInfoNew = new CommentInfo(); |
| | | try { |
| | | PropertyUtils.copyProperties(commentInfoNew, commentInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | comment++; |
| | | CommentInfoEnum typeComment = commentInfo.getTypeEnum(); |
| | | CommentInfoEnum typeComment = commentInfoNew.getTypeEnum(); |
| | | if (typeComment != null && typeComment == CommentInfoEnum.goodsCoupon) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | | if (goods.isHasCoupon()) { |
| | | commentNew.add(commentInfo); |
| | | if (goods != null && goods.isHasCoupon()) { |
| | | commentNew.add(commentInfoNew); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | String coupon = commentInfo.getCoupon(); |
| | | String endTime = commentInfo.getEndTime(); |
| | | String coupon = commentInfoNew.getCoupon(); |
| | | String endTime = commentInfoNew.getEndTime(); |
| | | if (!StringUtil.isNullOrEmpty(coupon) && !StringUtil.isNullOrEmpty(endTime)) { |
| | | Date endDay = sdf.parse(endTime); |
| | | if (endDay.getTime() > now.getTime()) { |
| | |
| | | styleVO.setColor("#E5005C"); |
| | | styleVO.setContent(daysBetween + "天后过期"); |
| | | |
| | | List<ClientTextStyleVO> tagList = commentInfo.getTagList(); |
| | | List<ClientTextStyleVO> tagList = commentInfoNew.getTagList(); |
| | | tagList.add(styleVO); |
| | | commentInfo.setTagList(tagList); |
| | | commentInfoNew.setTagList(tagList); |
| | | |
| | | commentNew.add(commentInfo); |
| | | commentNew.add(commentInfoNew); |
| | | continue; |
| | | } |
| | | } |