From a1be6075c6b1365a7abc66bf559d6058039248ab Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 19 五月 2021 18:13:29 +0800
Subject: [PATCH] 淘礼金兼容

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java |   91 +++++++++++++++++++++++----------------------
 1 files changed, 47 insertions(+), 44 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
index 6831a24..183b10a 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -10,6 +10,7 @@
 import javax.servlet.http.HttpSession;
 
 import com.yeshi.fanli.exception.pdd.PDDApiException;
+import com.yeshi.fanli.lijin.manager.GoodsLijinMnager;
 import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
 import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
 import org.springframework.core.task.TaskExecutor;
@@ -20,7 +21,7 @@
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
-import com.yeshi.fanli.dto.ConfigParamsDTO;
+import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
 import com.yeshi.fanli.dto.jd.JDFilter;
 import com.yeshi.fanli.dto.jd.JDSearchFilter;
 import com.yeshi.fanli.dto.jd.JDSearchResult;
@@ -46,23 +47,16 @@
 import com.yeshi.fanli.exception.user.TokenRecordException;
 import com.yeshi.fanli.service.inter.brand.BrandInfoService;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
-import com.yeshi.fanli.service.inter.config.BusinessSystemService;
 import com.yeshi.fanli.service.inter.config.ConfigService;
-import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
 import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
-import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
-import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
 import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
-import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
-import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
 import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service;
 import com.yeshi.fanli.service.inter.user.HistorySearchService;
 import com.yeshi.fanli.service.inter.user.TokenRecordService;
 import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
 import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
 import com.yeshi.fanli.service.manger.IClipboardAnalysisResult;
-import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
 import com.yeshi.common.entity.PageEntity;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
@@ -144,6 +138,9 @@
 
     @Resource
     private PDDAuthService pddAuthService;
+
+    @Resource
+    private GoodsLijinMnager goodsLijinMnager;
 
 
     /**
@@ -277,12 +274,17 @@
                                                 .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd")
                                                 .create();
                                         data.put("type", 3);
+
+
+                                        GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertCommonGoods(goods,
+                                                orderHongBaoMoneyComputeService.getShowComputeRate(
+                                                        acceptData.getPlatform(),
+                                                        acceptData.getVersion(), acceptData.getSystem()));
+
+                                        goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO);
+
                                         data.put("goods",
-                                                gson.toJson(
-                                                        GoodsDetailVOFactory.convertCommonGoods(goods,
-                                                                orderHongBaoMoneyComputeService.getShowComputeRate(
-                                                                        acceptData.getPlatform(),
-                                                                        acceptData.getVersion(), acceptData.getSystem()))));
+                                                gson.toJson(goodsDetailVO));
                                         // 璺宠浆璇︽儏
                                         if (VersionUtil.greaterThan_2_1_3(acceptData.getPlatform(),
                                                 acceptData.getVersion())) {
@@ -299,10 +301,11 @@
                                     data.put("type", 3);
                                     data.put("goods",
                                             gson.toJson(
-                                                    GoodsDetailVOFactory.convertCommonGoods(goods,
-                                                            orderHongBaoMoneyComputeService.getShowComputeRate(
-                                                                    acceptData.getPlatform(),
-                                                                    acceptData.getVersion(), acceptData.getSystem()))));
+                                                    goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goods,
+                                                            GoodsDetailVOFactory.convertCommonGoods(goods,
+                                                                    orderHongBaoMoneyComputeService.getShowComputeRate(
+                                                                            acceptData.getPlatform(),
+                                                                            acceptData.getVersion(), acceptData.getSystem())))));
                                     // if
                                     // (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
                                     // acceptData.getVersion())) {
@@ -563,7 +566,7 @@
 
         /*--------- 浜笢鍟嗗搧  -------*/
         if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) {
-            searchJDGoods(acceptData, searchkey, page, filter, order, ap, out);
+            searchJDGoods(acceptData, uid, searchkey, page, filter, order, ap, out);
             return;
         }
 
@@ -575,13 +578,13 @@
 
         /*-------- 鍞搧浼氬晢鍝� ------*/
         if (goodsType.intValue() == Constant.SOURCE_TYPE_VIP) {
-            searchVIPGoods(acceptData, searchkey, page, filter, order, ap, out);
+            searchVIPGoods(acceptData, uid, searchkey, page, filter, order, ap, out);
             return;
         }
 
         /*-------- 鑻忓畞鍟嗗搧 ------*/
         if (goodsType.intValue() == Constant.SOURCE_TYPE_SUNING) {
-            searchSuningGoods(acceptData, searchkey, page, filter, order, ap, out);
+            searchSuningGoods(acceptData, uid, searchkey, page, filter, order, ap, out);
             return;
         }
 
@@ -692,13 +695,10 @@
             }
         }
 
-        List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
-        ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+        GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                 acceptData.getVersion(), acceptData.getSystem());
 
-        for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
-            list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
-        }
+        List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, taoBaoGoodsBriefs, paramsDTO);
 
         Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                 .excludeFieldsWithoutExposeAnnotation().create();
@@ -762,7 +762,7 @@
      * @param ap
      * @param out
      */
-    private void searchJDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
+    private void searchJDGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order,
                                AppPageNotification ap, PrintWriter out) {
 
         JDSearchResult result = null;
@@ -907,16 +907,19 @@
             if (goodsList != null && goodsList.size() > 0) {
                 Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                         .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
-                ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+                GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                         acceptData.getVersion(), acceptData.getSystem());
-                for (JDGoods goods : goodsList) {
-                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
+
+
+                List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
+
+                for (GoodsDetailVO vo : voList) {
                     if (hasCoupon) {
-                        if (goodsDetailVO.isHasCoupon()) {
-                            array.add(gson.toJson(goodsDetailVO));
+                        if (vo.isHasCoupon()) {
+                            array.add(gson.toJson(vo));
                         }
                     } else {
-                        array.add(gson.toJson(goodsDetailVO));
+                        array.add(gson.toJson(vo));
                     }
                 }
             }
@@ -1010,11 +1013,11 @@
             Gson gson = JsonUtil.getApiCommonGson();
             List<PDDGoodsDetail> goodsList = result.getGoodsList();
             if (goodsList != null && goodsList.size() > 0) {
-                ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
-                        acceptData.getVersion(), acceptData.getSystem());
 
-                for (PDDGoodsDetail goods : goodsList) {
-                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
+                GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+                        acceptData.getVersion(), acceptData.getSystem());
+                List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
+                for (GoodsDetailVO goodsDetailVO : voList) {
                     array.add(gson.toJson(goodsDetailVO));
                 }
             }
@@ -1038,7 +1041,7 @@
      * @Title: searchVIPGoods
      * @Description:
      */
-    private void searchVIPGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
+    private void searchVIPGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order,
                                 AppPageNotification ap, PrintWriter out) {
         VIPSearchFilter searchFilter = new VIPSearchFilter();
         searchFilter.setKeyword(key);
@@ -1088,11 +1091,11 @@
             Gson gson = JsonUtil.getApiCommonGson();
             List<VIPGoodsInfo> goodsList = result.getGoodsList();
             if (goodsList != null && goodsList.size() > 0) {
-                ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+                GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                         acceptData.getVersion(), acceptData.getSystem());
 
-                for (VIPGoodsInfo goods : goodsList) {
-                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO);
+                List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO);
+                for (GoodsDetailVO goodsDetailVO : voList) {
                     array.add(gson.toJson(goodsDetailVO));
                 }
             }
@@ -1116,7 +1119,7 @@
      * @Title: searchVIPGoods
      * @Description:
      */
-    private void searchSuningGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order,
+    private void searchSuningGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order,
                                    AppPageNotification ap, PrintWriter out) {
         SuningQueryModel searchFilter = new SuningQueryModel();
         searchFilter.setKeyword(key);
@@ -1192,11 +1195,11 @@
         if (resultList != null) {
             Gson gson = JsonUtil.getApiCommonGson();
             if (resultList != null && resultList.size() > 0) {
-                ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+                GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
                         acceptData.getVersion(), acceptData.getSystem());
 
-                for (SuningGoodsInfo goods : resultList) {
-                    GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO);
+                List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, resultList, paramsDTO);
+                for (GoodsDetailVO goodsDetailVO : voList) {
                     array.add(gson.toJson(goodsDetailVO));
                 }
             }

--
Gitblit v1.8.0