From 8b4062e020094437a0af2cff6dfce5e9c811f4b7 Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@MS-20170306HGUF> Date: 星期二, 25 二月 2020 11:12:57 +0800 Subject: [PATCH] 素材分享 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java | 106 +++++++++++++++++++++++++++++----------------------- 1 files changed, 59 insertions(+), 47 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java index 8ea7806..16f6114 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java @@ -2,7 +2,6 @@ import java.io.PrintWriter; import java.lang.reflect.Type; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; @@ -27,7 +26,6 @@ import com.google.gson.JsonSerializer; import com.yeshi.fanli.dto.jd.JDCouponInfo; import com.yeshi.fanli.entity.accept.AcceptData; -import com.yeshi.fanli.entity.bus.activity.ActivityUser; import com.yeshi.fanli.entity.bus.clazz.GoodsClass; import com.yeshi.fanli.entity.bus.homemodule.Special; import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel; @@ -40,10 +38,8 @@ import com.yeshi.fanli.entity.dynamic.DynamicInfo; import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; -import com.yeshi.fanli.entity.dynamic.GoodsPicture; import com.yeshi.fanli.entity.dynamic.ImgInfo; import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum; -import com.yeshi.fanli.entity.dynamic.SimpleGoods; import com.yeshi.fanli.entity.jd.JDGoods; import com.yeshi.fanli.entity.system.ConfigKeyEnum; import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; @@ -593,9 +589,9 @@ @RequestMapping(value = "getDynamicList", method = RequestMethod.POST) public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, PrintWriter out) { int type = 1; - if (cid == TYPE_FAQUAN) + if (cid == TYPE_FAQUAN){ type = 1; - else if (cid == TYPE_SUCAI) { + } else if (cid == TYPE_SUCAI) { type = 2; } @@ -755,47 +751,8 @@ } List<String> list = new ArrayList<>(); - // 鍗曞搧 - if (goodsEvaluate.getType() == EvaluateEnum.single) { - for (ImgInfo imgInfo : imgs) { - GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); - if (goodsVO == null) { - list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); - continue; - } - - String jumpLink = getJumpLink(goodsVO, user, inviteCode); - if (!StringUtil.isNullOrEmpty(jumpLink)) { - list.add(jumpLink); - } - } - - } else if (goodsEvaluate.getType() == EvaluateEnum.multiple) { - - if (type == 1) { - for (ImgInfo imgInfo : imgs) { - if (imgInfo.getGoodsVO() != null) - if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() - && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { - String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, inviteCode); - if (!StringUtil.isNullOrEmpty(jumpLink)) { - list.add(jumpLink); - } - break; - } - } - } else if (type == 2 || type == 3) { - for (ImgInfo imgInfo : imgs) { - if (imgInfo.getGoodsVO() != null) { - String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, inviteCode); - if (!StringUtil.isNullOrEmpty(jumpLink)) { - list.add(jumpLink); - } - } - } - } - - } else if (goodsEvaluate.getType() == EvaluateEnum.activity) { + Integer dynamicType = goodsEvaluate.getDynamicType(); + if (dynamicType == null || dynamicType.intValue() == 2) { for (ImgInfo imgInfo : imgs) { if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) continue; @@ -806,7 +763,60 @@ list.add(imgInfo.getActivityPic()); } } + } else { + // 鍗曞搧 + if (goodsEvaluate.getType() == EvaluateEnum.single) { + for (ImgInfo imgInfo : imgs) { + GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); + if (goodsVO == null) { + list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); + continue; + } + + String jumpLink = getJumpLink(goodsVO, user, inviteCode); + if (!StringUtil.isNullOrEmpty(jumpLink)) { + list.add(jumpLink); + } + } + + } else if (goodsEvaluate.getType() == EvaluateEnum.multiple) { + if (type == 1) { + for (ImgInfo imgInfo : imgs) { + if (imgInfo.getGoodsVO() != null) + if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() + && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { + String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, inviteCode); + if (!StringUtil.isNullOrEmpty(jumpLink)) { + list.add(jumpLink); + } + break; + } + } + } else if (type == 2 || type == 3) { + for (ImgInfo imgInfo : imgs) { + if (imgInfo.getGoodsVO() != null) { + String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, inviteCode); + if (!StringUtil.isNullOrEmpty(jumpLink)) { + list.add(jumpLink); + } + } + } + } + + } else if (goodsEvaluate.getType() == EvaluateEnum.activity) { + for (ImgInfo imgInfo : imgs) { + if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) + continue; + if (imgInfo.getType() == ImgEnum.img) + list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); + else if (imgInfo.getType() == ImgEnum.activity) + if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { + list.add(imgInfo.getActivityPic()); + } + } + } } + Integer shareCount = goodsEvaluate.getShareNum(); if (shareCount == null) { @@ -933,4 +943,6 @@ data.put("text", text); out.print(JsonUtil.loadTrueResult(data)); } + } + -- Gitblit v1.8.0