yujian
2020-05-18 bf052072dbce8c74f1eeff6adb4af1c73e94ffce
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -12,6 +12,7 @@
import javax.annotation.Resource;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -621,11 +622,61 @@
         } else if (cid == TYPE_SUCAI) {
            type = 2;
         }
         List<GoodsEvaluate> listNew = new ArrayList<GoodsEvaluate>();
         List<GoodsEvaluate> list = goodsEvaluateService.queryMaterialsCache((page - 1) * Constant.PAGE_SIZE,
               Constant.PAGE_SIZE, type);
         if (list == null) {
            list = new ArrayList<>();
         if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
            listNew.addAll(list);
         } else if (list.size() > 0) { // 活动图片不允许跳转
            for (GoodsEvaluate goodsEvaluate : list) {
               if (goodsEvaluate.getType() != EvaluateEnum.activity) {
                  listNew.add(goodsEvaluate);
                  continue;
               }
               GoodsEvaluate evaluateNew = new GoodsEvaluate();
               try {
                  PropertyUtils.copyProperties(evaluateNew, goodsEvaluate);
               } catch (Exception e) {
                  e.printStackTrace();
                  continue;
               }
               // 跳转过渡页
               String jumpLink = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
               jumpLink = String.format(jumpLink, "circle", evaluateNew.getId());
               evaluateNew.setJumpLink(jumpLink);
               // 图片数量
               if (evaluateNew.getImgList() != null && evaluateNew.getImgList().size() > 0) {
                  int size = evaluateNew.getImgList().size();
                  List<ImgInfo> listInfoNew = new ArrayList<ImgInfo>();
                  for (ImgInfo imgInfo : goodsEvaluate.getImgList()) {
                     if (imgInfo.getType() != ImgEnum.activity) {
                        listInfoNew.add(imgInfo);
                        continue;
                     }
                     ImgInfo infoNew = new ImgInfo();
                     try {
                        PropertyUtils.copyProperties(infoNew, imgInfo);
                     } catch (Exception e) {
                        e.printStackTrace();
                        continue;
                     }
                     infoNew.setType(ImgEnum.img);
                     // 图片大于一张时 显示九宫格图
                     if (size > 1) {
                        infoNew.setW(1);
                        infoNew.setH(1);
                     }
                     listInfoNew.add(infoNew);
                  }
                  evaluateNew.setImgList(listInfoNew);
               }
               listNew.add(evaluateNew);
            }
         }
         GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
@@ -706,7 +757,7 @@
         JSONArray jsonArray = new JSONArray();
         String listStr = gson.toJson(list);
         String listStr = gson.toJson(listNew);
         JSONArray array = JSONArray.fromObject(listStr);
         for (int i = 0; i < array.size(); i++) {
            Object object = array.get(i);
@@ -1211,6 +1262,12 @@
            comment = shareInfo.getComment();
         }
      }
      if (!StringUtil.isNullOrEmpty(comment)) { // 替换淘宝官方活动
         List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(comment);
         for (String st : activityIdList)
            comment = comment.replace(st, "");
      }
      JSONObject data = new JSONObject();
      data.put("title", title);