From ca1ad791b7b7b04e57db6bd4fb93f0c1066a9f99 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 24 九月 2020 18:31:23 +0800
Subject: [PATCH] 淘口令格式兼容

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java
index 197d53f..6d87550 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java
@@ -7,22 +7,24 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.util.SystemInfoUtil;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.yeshi.utils.JsonUtil;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
+import com.yeshi.fanli.dto.ConfigParamsDTO;
 import com.yeshi.fanli.entity.accept.AcceptData;
 import com.yeshi.fanli.entity.taobao.ShareHotGoods;
 import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
-import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
-import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
+import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
 import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
 import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
 import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
 import com.yeshi.fanli.util.TaoBaoConstant;
-import com.yeshi.fanli.util.TimeUtil;
+import org.yeshi.utils.TimeUtil;
 import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
@@ -42,13 +44,15 @@
 	private ShareHotGoodsService shareHotGoodsService;
 
 	@Resource
-	private HongBaoManageService hongBaoManageService;
+	private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
 
 	@Resource
 	private ConfigTaoLiJinService configTaoLiJinService;
 
 	@RequestMapping("getTLJBuyGoods")
 	public void getTLJBuyGoods(AcceptData acceptData, PrintWriter out, String callback) {
+		if (acceptData.getSystem() == null)
+			acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
 		//
 		List<TLJBuyGoods> goodsList = tljBuyGoodsService
 				.listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
@@ -60,19 +64,22 @@
 		BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
+
+		ConfigParamsDTO configParamsDTO =  orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion(),null);
 		for (TLJBuyGoods goods : goodsList) {
 			TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods();
 			if (taoBaoGoodsBrief == null) {
 				continue;
 			}
 			// 璁$畻鎺ㄥ箍绾㈠寘
-			BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, proportion);
+			BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, proportion,false);
 			// 鎺ㄥ箍绾㈠寘 涓嶈兘灏忎簬1
 			if (spreadMoney.compareTo(new BigDecimal(1.0)) < 0) {
 				continue;
 			}
 
-			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion);
+			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
 
 			// 澶т簬1.6.5鐨勬墠浼氭樉绀虹鍒╀环
 			if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -97,6 +104,8 @@
 	 */
 	@RequestMapping("getShareHotGoods")
 	public void getShareHotGoods(AcceptData acceptData, PrintWriter out, String callback) {
+		if (acceptData.getSystem() == null)
+			acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
 		List<ShareHotGoods> goodsList = shareHotGoodsService
 				.listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
 		int count = goodsList.size();
@@ -106,8 +115,8 @@
 		goodsList = goodsList.size() > 10 ? goodsList.subList(0, 10) : goodsList;
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
-		BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
-		BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
+		ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion(),null);
 		for (ShareHotGoods hotGoods : goodsList) {
 			TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
 			if (taoBaoGoodsBrief == null) {
@@ -123,7 +132,7 @@
 				continue;
 			}
 
-			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
+			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
 
 			// 澶т簬1.6.5鐨勬墠浼氭樉绀虹鍒╀环
 			if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {

--
Gitblit v1.8.0