From 3824cbcaec6e6c67418d5280a53e9c2fedeef6f9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 11 七月 2019 16:34:13 +0800
Subject: [PATCH] 订单bug,分享爆款自购修改

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
index 63d3cd0..3a76084 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java
@@ -15,9 +15,9 @@
 import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
-import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
-import com.yeshi.fanli.util.StringUtil;
+import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
+import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
 
 /**
  * 鍒嗕韩鍟嗗搧妯℃澘
@@ -35,8 +35,10 @@
 	private ConfigService configService;
 	
 	@Resource
-	private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
-
+	private ConfigTaoLiJinService configTaoLiJinService;
+	
+	
+	
 	@Override
 	public void saveCommonTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
 		isCommonTemplateRight(template);
@@ -165,10 +167,13 @@
 	
 	@Override
 	public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
-			String shortLink, boolean hasCoupon, String from) {
+			String shortLink, boolean hasCoupon, Long tljId) {
 		
-		if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
-			BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
+		if (tljId != null) {
+			// 璁$畻鎺ㄥ箍绾㈠寘
+			String warningRate = configTaoLiJinService.getValueByKey("warning_value");
+			BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
+						
 			return template.replace("{鏍囬}", goods.getTitle()).replace("{鍟嗗搧鍘熶环}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
 					.replace("{鏈堥攢閲弣", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{棰嗗埜鐭摼}", shortLink)
 					.replace("{娣樺彛浠", token).replace("{浼樻儬鍒搁潰棰潁", BigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString())

--
Gitblit v1.8.0