From ab9e60fa9a8e43d797446730a5dc9ebfb6b3f4e6 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 27 六月 2019 09:48:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
index abd0af3..633a56b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -48,7 +48,6 @@
 import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
 import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
 import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
-import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
@@ -61,6 +60,7 @@
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
+import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
 import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
 import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
 import com.yeshi.fanli.vo.user.UserTaoLiJinRecordVO;
@@ -119,9 +119,6 @@
 	
 	@Resource
 	private QualityGoodsService qualityGoodsService;
-	
-	@Resource
-	private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
 	
 	@Resource
 	private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
@@ -330,7 +327,21 @@
 					return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy.MM.dd HH:mm"));
 				}
 			}
+		}).registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
+			@Override
+			public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
+				if (value == null) {
+					return new JsonPrimitive("");
+				} else {
+					// 淇濈暀2浣嶅皬鏁�
+					value = value.setScale(2);
+					return new JsonPrimitive(value.toString());
+				}
+			}
 		});
+		
+		
+		
 		Gson gson = gsonBuilder.create();
 
 		JSONObject data = new JSONObject();
@@ -383,7 +394,7 @@
 			data.put("jumpName", "鍘讳娇鐢�");
 			data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
 			data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip"));
-			data.put("rules", configTaoLiJinService.getValueByKey("taolijin_rules"));
+			data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link"));
 			
 			out.print(JsonUtil.loadTrueResult(data));
 			return;
@@ -392,7 +403,6 @@
 		
 		// 鐧诲綍鐢ㄦ埛
 		JSONObject data = new JSONObject();
-		data.put("rules", configTaoLiJinService.getValueByKey("taolijin_rules"));
 		data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon"));
 		
 		if (type.equals(TaoLiJinOriginEnum.newbiesWin.name())) {
@@ -418,6 +428,7 @@
 			data.put("jumpName", "鍘讳娇鐢�");
 			data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
 			data.put("tip", configTaoLiJinService.getValueByKey("hongbao_newbies_tip"));
+			data.put("rules", configTaoLiJinService.getValueByKey("newbies_rules_link"));
 			
 		} else if(type.equals(TaoLiJinOriginEnum.rankWin.name())) {
 			boolean isRank = false;
@@ -453,6 +464,7 @@
 				data.put("jumpName", "鍘绘煡鐪�");
 				data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("user_rank"));
 				data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_not_enough_tip"));
+				data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link"));
 				out.print(JsonUtil.loadTrueResult(data));
 				return;
 			} else {
@@ -464,6 +476,7 @@
 				data.put("jumpName", "鍘讳娇鐢�");
 				data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot"));
 				data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_tip"));
+				data.put("rules", configTaoLiJinService.getValueByKey("rank_rules_link"));
 			}
 			
 		} else {
@@ -517,13 +530,16 @@
 				continue;
 			}
 			
-			TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
+			// 璁$畻鎺ㄥ箍绾㈠寘
+			String warningRate = configTaoLiJinService.getValueByKey("warning_value");
+			BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, taoBaoGoodsBrief);
 			
-			BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(taoBaoGoodsBrief);
 			// 鎺ㄥ箍绾㈠寘 涓嶈兘灏忎簬1
-			if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
+			if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
 				continue;
 			}
+			
+			TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
 			// 鍘绘帀鏍囩
 			extra.setLabels(null);
 						

--
Gitblit v1.8.0