From 4d0c5d771b04d7ba32471df58c91c37dabe96bbf Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 24 十二月 2019 12:08:32 +0800
Subject: [PATCH] 返利订单到账时同时扣除维权金额

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java |   58 ++++++++++++++++++++++++++++++----------------------------
 1 files changed, 30 insertions(+), 28 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 77d1fa6..26bd11e 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
@@ -54,6 +54,7 @@
 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.goods.jd.JDGoodsLinkParseManager;
 import com.yeshi.fanli.tag.PageEntity;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.DouYinUtil;
@@ -129,11 +130,12 @@
 
 	@Resource
 	private IntegralGetCacheManager integralGetCacheManager;
-	
-	
+
 	@Resource
 	private BrandInfoService brandInfoService;
-	
+
+	@Resource
+	private JDGoodsLinkParseManager jdGoodsLinkParseManager;
 
 	/**
 	 * 绮樿创鏉夸俊鎭帹鑽�
@@ -261,17 +263,17 @@
 			if (tb == null)// 娣樺疂鏄┖鍊�
 			{
 				String jdId = JDUtil.getJDGoodsId(text);
-				
+
 				// 寰俊閾炬帴
 				if (StringUtil.isNullOrEmpty(jdId)) {
 					jdId = JDUtil.getJDGoodsIdByWeiXin(text);
 				}
-				
+
 				// 棰嗗埜鐭繛鎺�
 				if (StringUtil.isNullOrEmpty(jdId) && text.contains("u.jd.com")) {
-					jdId = JDUtil.getJDGoodsIdByUJD(text);
+					jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(text);
 				}
-				
+
 				if (!StringUtil.isNullOrEmpty(jdId)) {
 					JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(jdId));
 					if (goods != null) {
@@ -362,13 +364,11 @@
 				commonGoods = CommonGoodsFactory.create(goodsBrief);
 			}
 
-			BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-			BigDecimal shareRate = hongBaoManageService.getShareRate();
 			Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 					.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
 			data.put("type", type);
 			data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,
-					new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()))));
+					hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
 			out.print(JsonUtil.loadTrueResult(data));
 			return;
 		}
@@ -484,15 +484,14 @@
 							return false;
 						}
 
-						BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-						BigDecimal shareRate = hongBaoManageService.getShareRate();
 						Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 								.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
 
 						JSONObject data = new JSONObject();
 						data.put("type", 3);
-						data.put("goods", gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief,
-								new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate()))));
+						data.put("goods",
+								gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, hongBaoManageService
+										.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
 						out.print(JsonUtil.loadTrueResult(data));
 						return true;
 					}
@@ -762,9 +761,8 @@
 		}
 
 		List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
-		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-		BigDecimal shareRate = hongBaoManageService.getShareRate();
-		ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
+		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion());
 
 		for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
 			list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
@@ -782,16 +780,23 @@
 			String version = acceptData.getVersion();
 			if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_1(platform, version))
 					|| ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) {
-				BrandInfoVO brandInfoVO = brandInfoService.listByAlikeName(key);
+				BrandInfoVO brandInfoVO = null;
+				try {
+					brandInfoVO = brandInfoService.listByAlikeName(key, acceptData.getPlatform(),
+							acceptData.getVersion());
+				} catch (Exception e) {
+				}
 				if (brandInfoVO != null)
 					data.put("shop", JsonUtil.getApiCommonGson().toJson(brandInfoVO));
 			} else {
-				List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key);
+				List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key, acceptData.getPlatform(),
+						acceptData.getVersion());
 				if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoodsVO() != null
 						&& listShop.get(0).getListGoodsVO().size() > 2) {
 					TaoBaoShopVO taoBaoShop = listShop.get(0);
 					if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0(platform, version))
-					   || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_1(platform, version))) {
+							|| ("android".equalsIgnoreCase(platform)
+									&& VersionUtil.greaterThan_2_0_1(platform, version))) {
 						BrandInfoVO brandInfoVO = new BrandInfoVO();
 						brandInfoVO.setId(taoBaoShop.getId());
 						brandInfoVO.setName(taoBaoShop.getShopName());
@@ -804,7 +809,7 @@
 				}
 			}
 		}
-		
+
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -962,12 +967,10 @@
 
 			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,hongBaoManageService.getVIPFanLiRate());
-
+				ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion());
 				for (JDGoods goods : goodsList) {
 					GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
 					if (hasCoupon) {
@@ -1048,9 +1051,8 @@
 			Gson gson = JsonUtil.getApiCommonGson();
 			List<PDDGoodsDetail> goodsList = result.getGoodsList();
 			if (goodsList != null && goodsList.size() > 0) {
-				BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-				BigDecimal shareRate = hongBaoManageService.getShareRate();
-				ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
+				ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion());
 
 				for (PDDGoodsDetail goods : goodsList) {
 					GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);

--
Gitblit v1.8.0