yj
2020-03-06 ca53b2a58a60695d56dd2d523aa3658b8482b6de
发圈
1个文件已修改
65 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -1072,6 +1072,7 @@
            listImg.add(imgVideo);
        }
        int totalImg = 0;
        if (!StringUtil.isNullOrEmpty(activityPic) || !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) {
            if (imgactivity != null) {
                imgactivity.setUrl(activityPic);
@@ -1095,8 +1096,21 @@
                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);
    }
@@ -1213,6 +1227,7 @@
            listImg.add(imgActivity);
        }
        int totalImg = 0;
        // 编辑图片
        if (!StringUtil.isNullOrEmpty(picUrls)) {
            String[] pics = picUrls.split(",");
@@ -1234,6 +1249,7 @@
                            imgInfo0.setW(1);
                            imgInfo0.setH(1);
                            listImg.add(imgInfo0);
                            totalImg ++;
                            continue;
                        }
                    }
@@ -1244,6 +1260,7 @@
                                String url = imgInfo.getUrl();
                                if (picLink.equals(url)) {
                                    listImg.add(imgInfo);
                                    totalImg ++;
                                    break;
                                }
                            }
@@ -1267,7 +1284,19 @@
                    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);
@@ -1443,8 +1472,7 @@
    }
    @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) {
@@ -1471,18 +1499,31 @@
                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()) {
@@ -1492,11 +1533,11 @@
                                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;
                            }
                        }