From 26f7accb815f55f18f8eedfca4324700a96884ec Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 26 八月 2020 18:23:49 +0800
Subject: [PATCH] 资金验证优化

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java |   52 ++++++++++++++++++++++++++++------------------------
 1 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
index ddee89a..107caa6 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -1,7 +1,6 @@
 package com.yeshi.fanli.controller.client.v2;
 
 import java.io.PrintWriter;
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -27,20 +26,21 @@
 import com.yeshi.fanli.entity.accept.AcceptData;
 import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.jd.JDGoods;
-import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
+import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
 import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
 import com.yeshi.fanli.service.inter.goods.JDCommonTemplateContentService;
 import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
 import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
-import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
-import com.yeshi.fanli.tag.PageEntity;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
+import com.yeshi.common.entity.PageEntity;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
 import com.yeshi.fanli.vo.goods.GoodsDetailVO;
+import com.yeshi.fanli.vo.homemodule.BannerVO;
 
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
@@ -59,7 +59,7 @@
 	private SwiperPictureService swiperPictureService;
 
 	@Resource
-	private HongBaoManageService hongBaoManageService;
+	private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
 
 	@Resource
 	private CommonTemplateContentService commonTemplateContentService;
@@ -86,7 +86,7 @@
 
 		List<CommonContentNav> list = null;
 		if (type == null || type == Constant.SOURCE_TYPE_TAOBAO) {
-			list = commonTemplateContentService.getNavList(CommonContentTypeEnum.valueOf(key));
+			list = commonTemplateContentService.getNavList(CommonContentTypeEnum.valueOf(key),acceptData.getSystem());
 		} else if (type == Constant.SOURCE_TYPE_JD) {
 			// 鏆傛棤鍒嗙被
 		} else if (type == Constant.SOURCE_TYPE_PDD) {
@@ -146,10 +146,10 @@
 			// 鐚滀綘鍠滄
 			String idfa = acceptData.getIdfa();
 			String imei = acceptData.getImei();
-			result = guessLikeDeviceTB(idfa, imei, page);
+			result = guessLikeDeviceTB(idfa, imei, acceptData.getUtdid(), page);
 		} else {
 			// 澶ф窐瀹㈤〉鐮佸彧鑳戒负10,50,100,200
-			result = commonTemplateContentService.getContentList(type, cid, page, 10);
+			result = commonTemplateContentService.getContentList(type, cid, page, 10,acceptData.getSystem());
 		}
 
 		JSONObject root = new JSONObject();
@@ -161,22 +161,25 @@
 
 		JSONArray array = new JSONArray();
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
-		List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
-		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-		BigDecimal shareRate = hongBaoManageService.getShareRate();
-		ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+		List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
+		if (result != null)
+			goodsList = result.getGoodsList();
+
+		ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion(),acceptData.getSystem());
 		for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
 			GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO);
 			if (type == CommonContentTypeEnum.mianDan)// 鍏嶅崟鍟嗗搧
 			{
 				vo.getMoneyInfo().setFanliMoney("楼" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
 				vo.getMoneyInfo().setShareMoney("楼" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief));
+				vo.getMoneyInfo().setMaxMoney(null);
 			}
 			array.add(gson.toJson(vo));
 		}
 
 		root.put("list", array);
-		root.put("count", result.getCount());
+		root.put("count", result != null ? result.getCount() : 0);
 		out.print(JsonUtil.loadTrueResult(root));
 	}
 
@@ -209,11 +212,11 @@
 
 			List<JDGoods> goodsList = result.getGoodsList();
 			if (goodsList != null && goodsList.size() > 0) {
-				BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-				BigDecimal shareRate = hongBaoManageService.getShareRate();
 				Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 						.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
-				ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+				ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion(),acceptData.getSystem());
+
 				for (JDGoods goods : goodsList) {
 					array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
 				}
@@ -238,13 +241,14 @@
 		JSONObject data = new JSONObject();
 		if (page == 1) {
 			// 2銆侀《閮ㄨ疆鎾浘
-			List<SwiperPicture> bannerList = null;
+			List<BannerVO> bannerList = null;
 			if (Constant.IS_TEST) {
-				bannerList = swiperPictureService.getByBannerCard("index_top");
+				bannerList = swiperPictureService.getByBannerCardAndVersion("index_top", acceptData.getPlatform(),
+						Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
 			}
 
 			if (bannerList == null) {
-				bannerList = new ArrayList<SwiperPicture>();
+				bannerList = new ArrayList<BannerVO>();
 			}
 
 			data.put("bannerList", new Gson().toJson(bannerList));
@@ -259,11 +263,11 @@
 
 			List<PDDGoodsDetail> goodsList = result.getGoodsList();
 			if (goodsList != null && goodsList.size() > 0) {
-				BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-				BigDecimal shareRate = hongBaoManageService.getShareRate();
 				Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 						.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
-				ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+				ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion(),acceptData.getSystem());
+
 				for (PDDGoodsDetail goods : goodsList) {
 					array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
 				}
@@ -283,8 +287,8 @@
 	 * @return
 	 */
 	@Cacheable(value = "commonContentCache", key = "#idfa+'-'+#imei+'-'+#page")
-	private CommonContentResult guessLikeDeviceTB(String idfa, String imei, Integer page) {
-		TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa);
+	private CommonContentResult guessLikeDeviceTB(String idfa, String imei, String utdid, Integer page) {
+		TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa, utdid);
 		if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null
 				&& searchResult.getTaoBaoGoodsBriefs().size() > 0) {
 			CommonContentResult result = new CommonContentResult();

--
Gitblit v1.8.0