From 91ddd96c12ec25aaf6d0cb38d54288d863ab2b58 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 10 七月 2021 18:10:38 +0800
Subject: [PATCH] 礼金红包兼容

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 103 insertions(+), 0 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..cb59a64 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)
      *
@@ -186,6 +192,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) {
             out.print(JsonUtil.loadFalseResult(1, "鑾峰彇鏁版嵁澶辫触"));

--
Gitblit v1.8.0