From 207dc8655711cddac2653e18b51e58a88dba2084 Mon Sep 17 00:00:00 2001
From: yj <Administrator@192>
Date: 星期五, 06 三月 2020 18:14:36 +0800
Subject: [PATCH] 发圈处理

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java |   59 ++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
index b36776a..22599b6 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -33,6 +33,7 @@
 import com.yeshi.fanli.entity.jd.JDGoods;
 import com.yeshi.fanli.entity.jd.JDGoodsClass;
 import com.yeshi.fanli.entity.system.BusinessSystem;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.system.SystemClientParams;
 import com.yeshi.fanli.entity.taobao.ClientTBPid;
 import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
@@ -194,10 +195,9 @@
 
 	@Resource
 	private UserVIPInfoService userVIPInfoService;
-	
+
 	@Resource
 	private UserVipConfigService userVipConfigService;
-	
 
 	/**
 	 * 娣樺疂鍟嗗搧璇︽儏
@@ -374,6 +374,7 @@
 
 		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
 				acceptData.getVersion());
+		paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
 
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
@@ -381,8 +382,10 @@
 			goodsDetail.getMoneyInfo().setShareMoney(
 					"楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods, hongBaoManageService.getVIPShareRate()));
 			goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
+			goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
 		}
-		goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get("goods_detail_fanli_rate_help_url"));
+		goodsDetail.getMoneyInfo()
+				.setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
 
 		if (TaoBaoUtil.isYUShou(goods)) {
 			if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
@@ -415,7 +418,7 @@
 		}
 
 		extraVO.setTbPidInfo(clientTBPid);
-		extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
+		extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img.html?id=" + id);
 
 		// 鍒嗕韩璧氫汉鎻愮ず
 		MoneyInfoVO moneyInfo = goodsDetail.getMoneyInfo();
@@ -480,7 +483,7 @@
 			moneyType = 2;
 			fanliValid = true;
 			shareValid = false;
-			helpLink = configService.get("zigoulijian_nofanli_help");
+			helpLink = configService.get(ConfigKeyEnum.zigoulijianNofanliHelp.getKey());
 
 			BigDecimal tljHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
 
@@ -540,7 +543,7 @@
 			rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 			JSONObject params1 = new JSONObject();
 			if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
-				params1.put("url", configService.get("special_guide_reward_coupon_link"));
+				params1.put("url", configService.get(ConfigKeyEnum.specialGuideRewardCouponLink.getKey()));
 			else
 				params1.put("url", userVipConfigService.getValueByKey("vip_link"));
 			rewardCoupon.setMaxMoney(goodsDetail.getMoneyInfo().getMaxMoney());
@@ -551,7 +554,12 @@
 			} else
 				rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
 			rewardCoupon.setParams(params1.toString());
+
 			otherInfo.setRewardCoupon(rewardCoupon);
+			if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+					&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
+				otherInfo.setRewardCoupon(null);
+
 			goodsDetail.setOtherInfo(otherInfo);
 		}
 		extraVO.setFanliValid(fanliValid);
@@ -564,7 +572,7 @@
 
 		// 鍒嗕韩璺緞
 		if (StringUtil.isNullOrEmpty(helpLink)) {
-			helpLink = configService.get("no_rebate_help_link");
+			helpLink = configService.get(ConfigKeyEnum.noRebateHelpLink.getKey());
 		}
 
 		// 鍒嗕韩璺緞
@@ -599,8 +607,9 @@
 	 * @param from
 	 * @param out
 	 */
-	@RequestMapping(value = "getDetailJD", method = RequestMethod.POST)
+	@RequestMapping(value = "getDetailJD")
 	public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
+//		uid=2255993L;
 		// 绯荤粺楠岃瘉
 		BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
 				acceptData.getPackages());
@@ -631,14 +640,17 @@
 
 		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
 				acceptData.getVersion());
+		paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
 			goodsDetail.getMoneyInfo()
 					.setShareMoney("楼" + JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getVIPShareRate()));
 			goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
+			goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
 		}
-		goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get("goods_detail_fanli_rate_help_url"));
+		goodsDetail.getMoneyInfo()
+				.setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
 
 		// 闄勫姞淇℃伅
 		OtherInfo otherInfo = new OtherInfo();
@@ -677,7 +689,7 @@
 		rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 		JSONObject params1 = new JSONObject();
 		if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
-			params1.put("url", configService.get("special_guide_reward_coupon_link"));
+			params1.put("url", configService.get(ConfigKeyEnum.specialGuideRewardCouponLink.getKey()));
 		else
 			params1.put("url", userVipConfigService.getValueByKey("vip_link"));
 
@@ -690,7 +702,12 @@
 			rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
 		}
 		rewardCoupon.setParams(params1.toString());
+
 		otherInfo.setRewardCoupon(rewardCoupon);
+		if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+				&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
+			otherInfo.setRewardCoupon(null);
+
 		goodsDetail.setOtherInfo(otherInfo);
 
 		CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
@@ -722,7 +739,7 @@
 		List<ShamUser> listShareUser = new ArrayList<ShamUser>();
 
 		// 浜笢寮�鍚垎浜�
-		String open = configService.get("share_jd_open");
+		String open = configService.get(ConfigKeyEnum.shareOpenJD.getKey());
 		if ("1".equals(open.trim())) {
 			extraVO.setShareValid(true);
 			MoneyInfoVO moneyInfo = goodsDetail.getMoneyInfo();
@@ -775,7 +792,7 @@
 		extraVO.setFanliValid(true);
 
 		if (StringUtil.isNullOrEmpty(helpLink)) {
-			helpLink = configService.get("no_rebate_help_link");
+			helpLink = configService.get(ConfigKeyEnum.noRebateHelpLink.getKey());
 		}
 
 		ShareVO shareInfoVO = new ShareVO();
@@ -788,11 +805,12 @@
 		out.print(JsonUtil.loadTrueResult(object.toString()));
 
 		final JDGoods goods = jdGoods;
+		final Long fuid=uid;
 		ThreadUtil.run(new Runnable() {
 			public void run() {
 				// 娣诲姞娴忚璁板綍
 				try {
-					scanHistoryV2Service.addJDScanHistory(uid, acceptData.getDevice(), goods);
+					scanHistoryV2Service.addJDScanHistory(fuid, acceptData.getDevice(), goods);
 				} catch (Exception e) {
 					e.printStackTrace();
 				}
@@ -827,14 +845,18 @@
 
 		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
 				acceptData.getVersion());
+		paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate());
+
 		GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
 		if (goodsDetail != null && goodsDetail.getMoneyInfo() != null && userVIPInfoService.isVIP(uid)) {
 			goodsDetail.getMoneyInfo().setFanliMoney(goodsDetail.getMoneyInfo().getMaxMoney());
 			goodsDetail.getMoneyInfo().setShareMoney(
 					"楼" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, hongBaoManageService.getVIPShareRate()));
 			goodsDetail.getMoneyInfo().setRateInfo(goodsDetail.getMoneyInfo().getMaxRateInfo());
+			goodsDetail.getMoneyInfo().setCompositionInfo(goodsDetail.getMoneyInfo().getMaxCompositionInfo());
 		}
-		goodsDetail.getMoneyInfo().setRateInfoHelpUrl(configService.get("goods_detail_fanli_rate_help_url"));
+		goodsDetail.getMoneyInfo()
+				.setRateInfoHelpUrl(configService.get(ConfigKeyEnum.goodsDetailFanliRateHelpUrl.getKey()));
 
 		// 闄勫姞淇℃伅
 		OtherInfo otherInfo = new OtherInfo();
@@ -842,7 +864,7 @@
 		rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
 		JSONObject params1 = new JSONObject();
 		if (!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
-			params1.put("url", configService.get("special_guide_reward_coupon_link"));
+			params1.put("url", configService.get(ConfigKeyEnum.specialGuideRewardCouponLink.getKey()));
 		else
 			params1.put("url", userVipConfigService.getValueByKey("vip_link"));
 
@@ -855,6 +877,9 @@
 			rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
 		rewardCoupon.setParams(params1.toString());
 		otherInfo.setRewardCoupon(rewardCoupon);
+		if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+				&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
+			otherInfo.setRewardCoupon(null);
 		goodsDetail.setOtherInfo(otherInfo);
 
 		CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
@@ -882,7 +907,7 @@
 		}
 
 		// 鍥炬枃璇︽儏
-		extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id=" + id);
+		extraVO.setDetailUrl("http://apph5.banliapp.com/apppage/goods_img_pdd.html?id=" + id);
 
 		String salesTip = pddGoods.getSalesTip();
 		if (!StringUtil.isNullOrEmpty(salesTip)) {
@@ -942,7 +967,7 @@
 		extraVO.setShareValid(true);
 
 		if (StringUtil.isNullOrEmpty(helpLink)) {
-			helpLink = configService.get("no_rebate_help_link");
+			helpLink = configService.get(ConfigKeyEnum.noRebateHelpLink.getKey());
 		}
 
 		ShareVO shareInfoVO = new ShareVO();

--
Gitblit v1.8.0