From 856d99bb5adf7f8670206b01750bc0260b8666d2 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 01 二月 2023 15:36:55 +0800
Subject: [PATCH] 修复客户端特价首页商品列表无数据的问题

---
 fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java b/fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
index eb4d12f..755df9a 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/manger/ClipboardAnalysisManager.java
@@ -12,6 +12,9 @@
 import javax.annotation.Resource;
 
 import com.yeshi.fanli.util.*;
+import com.yeshi.fanli.util.goods.douyin.CSJCPSApiUtil;
+import com.yeshi.fanli.util.goods.douyin.DYUtil;
+import com.yeshi.fanli.util.goods.douyin.vo.DYGoodsDetail;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
 import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil;
 import org.jsoup.Jsoup;
@@ -165,19 +168,19 @@
         //鏂扮増鍙d护
         String goodsId = null;
         if (text.contains("https://m.tb.cn/")) {
-            try {
-                TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(text);
-                if (result != null) {
-                    goodsId = result.getNum_iid();
-                }
-            } catch (TaoBaoTokenParseException e) {
-                e.printStackTrace();
-            }
-            if (goodsId == null) {
-                String auctionId = DaTaoKeApiUtil.parseTaoBaoToken(text);
-                if (auctionId != null) {
-                    typeSet.add(ClipboardContentType.taoBaoToken);
-                    goodsId = auctionId;
+            String tempGoodsId = DaTaoKeApiUtil.parseGoodsIdFromToken(text);
+            if (tempGoodsId != null) {
+                goodsId = tempGoodsId;
+                typeSet.add(ClipboardContentType.taoBaoToken);
+            } else {
+                try {
+                    TaoKeApiUtil.TokenConvertResult result = TaoKeApiUtil.tokenConvert(text);
+                    if (result != null) {
+                        goodsId = result.getNum_iid();
+                        typeSet.add(ClipboardContentType.taoBaoToken);
+                    }
+                } catch (TaoBaoTokenParseException e) {
+                    e.printStackTrace();
                 }
             }
         }
@@ -480,6 +483,11 @@
             if (goods != null) {
                 commonGoods = CommonGoodsFactory.create(goods);
             }
+        }else if (simpleGoods.getGoodsType() == Constant.SOURCE_TYPE_DY) {
+            DYGoodsDetail goods = CSJCPSApiUtil.goodsDetail(Long.parseLong( simpleGoods.getGoodsId()));
+            if (goods != null) {
+                commonGoods = CommonGoodsFactory.create(goods);
+            }
         }
 
         return commonGoods;
@@ -515,6 +523,10 @@
         if (!StringUtil.isNullOrEmpty(vipId)) {
             return new SimpleCommonGoods(vipId, Constant.SOURCE_TYPE_VIP);
         }
+        String dyProductId= DYUtil.parseProdectIdFromLink(link);
+        if (!StringUtil.isNullOrEmpty(dyProductId)) {
+            return new SimpleCommonGoods(dyProductId, Constant.SOURCE_TYPE_DY);
+        }
 
         // 瑙f瀽娣樺疂
         String auctionId = parseTBAuctionIdFromLink(link);

--
Gitblit v1.8.0