From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 25 二月 2025 16:41:22 +0800
Subject: [PATCH] 淘宝转链接口更新

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java |  130 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 117 insertions(+), 13 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
index 4649977..7cb00a5 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -3,8 +3,11 @@
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
+import com.yeshi.fanli.dto.common.CommonContentResult;
+import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
 import com.yeshi.fanli.entity.SystemEnum;
 import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
+import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
 import com.yeshi.goods.facade.dto.taobao.dataoke.DingDongTime;
 import com.yeshi.fanli.dto.jd.JDSearchResult;
 import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
@@ -133,6 +136,9 @@
     @Resource
     private GoodsLijinMnager goodsLijinMnager;
 
+    @Resource
+    private CommonTemplateContentService commonTemplateContentService;
+
     /**
      * 鏂扮増鎺ㄨ崘涓撻绠$悊(1.5.3)
      *
@@ -185,6 +191,103 @@
 
             if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
                 root.put("searchDiscovery", getSearchDiscoveryInfo(acceptData));
+
+
+            out.print(JsonUtil.loadTrueResult(root));
+        } catch (Exception e) {
+            out.print(JsonUtil.loadFalseResult(1, "鑾峰彇鏁版嵁澶辫触"));
+            try {
+                LogHelper.errorDetailInfo(e);
+            } catch (Exception e1) {
+                e1.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * 鐗逛环鎺ㄨ崘
+     *
+     * @param acceptData
+     * @param uid
+     * @param out
+     */
+    @RequestMapping(value = "getRecommendIndexTJ")
+    public void getRecommendIndexTJ(AcceptData acceptData, Long uid, PrintWriter out) {
+        try {
+            // 鑾峰彇璁惧瀹氫箟鎬у埆
+            int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(), acceptData.getSystem());
+
+            // 1銆佷笓棰樻ā鍧�
+            JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex, acceptData.getSystem());
+
+            // 2銆侀《閮ㄨ疆鎾浘
+            List<BannerVO> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("index_top",
+                    acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem());
+
+            List<BannerVO> topPicList = new ArrayList<>();
+            if (oldtopPicList != null && oldtopPicList.size() > 0)
+                topPicList.addAll(oldtopPicList);
+
+            root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
+
+            // 3銆侀個璇锋湁濂�
+            List<BannerVO> invitePicList = null;
+            if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+                    && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()), acceptData.getSystem())) {
+                // 濡傛灉IOS褰撳墠鐗堟湰澶勪簬瀹℃牳鐘舵�佸氨涓嶈繑鍥�
+            } else {
+                invitePicList = swiperPictureService.getByBannerCardAndVersion("index_invite", acceptData.getPlatform(),
+                        Integer.parseInt(acceptData.getVersion()), acceptData.getSystem());
+            }
+
+            if (invitePicList == null) {
+                invitePicList = new ArrayList<BannerVO>();
+            }
+            root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
+
+            // 4銆両OS鐨勫簳閮ㄧ綉椤甸摼鎺�
+            String platform = acceptData.getPlatform();
+            if ("ios".equalsIgnoreCase(platform)) {
+                root.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkIos.getKey(), acceptData.getSystem()));
+            }
+
+            root.put("spikeGoods", getSpikeGoodsContent(acceptData));
+            if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
+                root.put("scoreExchange", getScoreExchangeInfo(acceptData));
+
+            if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
+                root.put("searchDiscovery", getSearchDiscoveryInfo(acceptData));
+
+
+            //浠婃棩鐖嗘
+            CommonContentResult commonContentResult = commonTemplateContentService.getContentList(CommonContentTypeEnum.pddHotGoodsRank, null, 1, 10, acceptData.getSystem());
+            if (commonContentResult != null && commonContentResult.getGoodsList() != null && commonContentResult.getGoodsList().size() > 0) {
+                com.alibaba.fastjson.JSONObject hotSale = new com.alibaba.fastjson.JSONObject();
+                JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
+                jumpDetailV2.setActivity("com.tejia.lijin.app.ui.sellwellcommodity.SellWellGoods");
+
+                hotSale.put("jumpDetail", jumpDetailV2);
+                com.alibaba.fastjson.JSONObject params = new com.alibaba.fastjson.JSONObject();
+                String navs = "[{\"key\":\"pddHotGoodsRank\",\"title\":\"鎷煎澶歕"},{\"key\":\"jdHotGoodsRank\",\"title\":\"浜笢\"},{\"key\":\"tbHotGoodsRank\",\"title\":\"娣樺疂\"}]";
+                params.put("navs", navs.replace("\"","\\"+"\""));
+                hotSale.put("params", params);
+
+                Collections.shuffle(commonContentResult.getGoodsList());
+
+                //鑾峰彇goodsList
+                GoodsMoneyConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+                        acceptData.getVersion(), acceptData.getSystem());
+                List<GoodsDetailVO> goodsList = goodsLijinMnager.loadCommonGoodsMoneyInfo(acceptData.getSystem(), uid, commonContentResult.getGoodsList(), configParamsDTO);
+                JSONArray array = new JSONArray();
+                Gson gson = new Gson();
+                for (GoodsDetailVO vo : goodsList) {
+                    array.add(gson.toJson(vo));
+                }
+                hotSale.put("goodsList", array);
+                root.put("hotSales", hotSale);
+            }
+
 
             out.print(JsonUtil.loadTrueResult(root));
         } catch (Exception e) {
@@ -256,9 +359,9 @@
 
         JumpDetailV2 jumpDetail = null;
         if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
-            jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list");
+            jumpDetail = jumpDetailV2Service.getByTypeCache("spike_goods_list",acceptData.getSystem());
         } else {
-            jumpDetail = jumpDetailV2Service.getByTypeCache("web");
+            jumpDetail = jumpDetailV2Service.getByTypeCache("web",acceptData.getSystem());
         }
 
         if (array == null) {
@@ -382,7 +485,7 @@
      * @param out
      */
     @RequestMapping("getSpikeGoodsList")
-    public void getSpikeGoodsList(AcceptData acceptData, Integer page, Long goodsId, String qtime, PrintWriter out) {
+    public void getSpikeGoodsList(AcceptData acceptData, Integer page, String goodsId, String qtime, PrintWriter out) {
         List<DaTaoKeDetailV2> detailList0 = daTaoKeGoodsDetailV2Service.getDingDongQiangData(qtime);
         if (detailList0 == null)
             detailList0 = new ArrayList<>();
@@ -392,7 +495,7 @@
         JSONArray array = new JSONArray();
         if (page == 1 && goodsId != null && detailList != null) {
             for (int i = 0; i < detailList.size(); i++) {
-                if (detailList.get(i).getGoodsId().longValue() == goodsId) {
+                if ( TaoBaoUtil.isEqual( detailList.get(i).getGoodsId(), goodsId)) {
                     DaTaoKeDetailV2 goods = detailList.get(i);
                     detailList.remove(i);
                     detailList.add(0, goods);
@@ -435,7 +538,7 @@
         params.put("balanceMore", true);
         root.put("params", params);
         root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange",
-                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
+                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
 
         root.put("name", "閲戝竵鍏戞崲");
         root.put("desc", "姣忔棩绛惧埌锛屾儕鍠滀笉鍋�");
@@ -473,10 +576,10 @@
         root.put("picture", "http://img.flqapp.com/resource/home_search_found.png");
         root.put("params", params);
         root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("web",
-                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
+                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
 
         root.put("jumpResult", jumpDetailV2Service.getByTypeCache("search_goods_result",
-                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
+                Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
         root.put("keyList", array);
         return root;
     }
@@ -552,7 +655,7 @@
                     acceptData.getVersion(), acceptData.getSystem());
 
 
-            List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
+            List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO,false);
 
             for (GoodsDetailVO vo : voList) {
                 if (page < 3)
@@ -592,10 +695,11 @@
 
             JSONArray array = new JSONArray();
             for (GoodsDetailVO vo : voList) {
-                if (acceptData.getSystem() == SystemEnum.yhqjx) {
-                    if (!StringUtil.isNullOrEmpty(vo.getMoneyInfo().getHongBaoMoney())) {
+                if (acceptData.getSystem() == SystemEnum.yhqjx||acceptData.getSystem() == SystemEnum.hsb) {
+                    //鏆傛椂涓嶇瓫閫夌孩鍖�
+//                    if (!StringUtil.isNullOrEmpty(vo.getMoneyInfo().getHongBaoMoney())) {
                         array.add(gson.toJson(vo));
-                    }
+//                    }
                 } else {
                     array.add(gson.toJson(vo));
                 }
@@ -642,7 +746,7 @@
                                 deviceGoodsList.add(goods);
                             }
                         }
-                        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO);
+                        List<GoodsDetailVO> voList = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, deviceGoodsList, paramsDTO,false);
                         for (GoodsDetailVO vo : voList) {
                             vo.setRecommend(true);
                         }
@@ -683,7 +787,7 @@
 
         JSONArray array = new JSONArray();
         for (GoodsDetailVO vo : finalVOList) {
-            if (acceptData.getSystem() == SystemEnum.yhqjx) {
+            if (acceptData.getSystem() == SystemEnum.yhqjx||acceptData.getSystem() == SystemEnum.hsb) {
                 if (!StringUtil.isNullOrEmpty(vo.getMoneyInfo().getHongBaoMoney())) {
                     array.add(gson.toJson(vo));
                 }

--
Gitblit v1.8.0