From 2f5935ed11672046c37f733d855214f6147b4b58 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 28 三月 2022 11:33:19 +0800
Subject: [PATCH] TDMQ兼容

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
index 757da1c..6048a09 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
@@ -25,7 +25,7 @@
 import com.yeshi.fanli.entity.taobao.TaoBaoLink;
 import com.yeshi.fanli.exception.dynamic.ActivityUserException;
 import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
-import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
+import com.yeshi.fanli.exception.goods.ConvertLinkException;
 import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
 import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
 import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
@@ -997,8 +997,8 @@
         if (!StringUtil.isNullOrEmpty(content) && commentInfo.getNeedSpin()) {
             try {
                 convertLinkManager.convertLinkFromText(system, content, Constant.LINK_TOKEN_VERIFY_UID, true, false);
-            } catch (ConvertLinkExceptionException e) {
-                if (ConvertLinkExceptionException.CODE_NONE != e.getCode()) {
+            } catch (ConvertLinkException e) {
+                if (ConvertLinkException.CODE_NONE != e.getCode()) {
                     throw new GoodsEvaluateException(1, "鍖呭惈涓嶅彲杞摼鐨勫彛浠や笌閾炬帴");
                 }
             } catch (Exception e) {
@@ -1721,7 +1721,7 @@
                                 for (String st : activityIdList)
                                     content = content.replace(st, "");
                                 content = content.replace("{relationId}", "");
-                                if (system == SystemEnum.yhqjx) {
+                                if (system == SystemEnum.yhqjx || system == SystemEnum.hsb) {
                                     content = content.replace("\n", "<br>");
                                 }
                                 commentInfoNew.setContent(content);
@@ -1813,7 +1813,7 @@
                                     simpleGoods.setState(1);
                                     simpleGoods.setRemarks("璇勮楠岃瘉涓嬫灦");
                                 }
-                                if (system == SystemEnum.yhqjx) {
+                                if (system == SystemEnum.yhqjx || system == SystemEnum.hsb) {
                                     imgInfo.setGoods(null);
                                 }
                             }
@@ -2301,7 +2301,7 @@
 
         Date limitDate = DateUtil.reduceDay(new Date(), 7);
 
-        String identifyCode = "dataoke-" + StringUtil.Md5(DaTaoKeTipOffUtil.getRecoomendDesc(dto)) + "-" + dto.getUpdateTime().getTime();
+        String identifyCode = "dataoke-" + StringUtil.Md5(DaTaoKeTipOffUtil.getRecoomendDesc(dto));
 
         GoodsEvaluate evaluate = goodsEvaluateDao.selectExistLimitTime(identifyCode, limitDate);
         if (evaluate != null)
@@ -2319,16 +2319,15 @@
             Set<String> imgSet = new HashSet<>();
             imgSet.addAll(imgs);
             String id = dto.getIdList().get(0);
-            String source = dto.getSource();
+            String source = dto.getPlatformType();
             switch (source) {
-                case "tmall":
-                case "taobao":
+                case "tb":
                     try {
-                        TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.getSimpleGoodsInfo(Long.parseLong(id));
+                        TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(Long.parseLong(id));
                         if (goodsBrief != null && goodsBrief.getImgList() != null) {
                             GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system);
                             goods = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params);
-                            goods = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBrief, goods);
+                            goods = goodsLijinMnager.loadTBMoneyInfo(system, null, goodsBrief, goods, false);
                             for (String img : goodsBrief.getImgList()) {
                                 if (!imgSet.contains(img) && imgs.size() < 9) {
                                     imgSet.add(img);
@@ -2414,7 +2413,11 @@
         goodsEvaluate.setPublishTime(new Date());
         goodsEvaluate.setCreateTime(new Date());
         goodsEvaluate.setUpdateTime(new Date());
-        goodsEvaluate.setGoods(goods);
+        //绾挎姤涓嶆樉绀哄晢鍝�
+        if (goods != null && goods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
+            goods.setCreatetime(null);
+            goodsEvaluate.setGoods(goods);
+        }
         goodsEvaluate.setLineNum(lineNum);
         goodsEvaluate.setImgList(imgList);
         goodsEvaluate.setComments(null);

--
Gitblit v1.8.0