From 651a15c78f668bef3859d9ed1bb7ad0b669d3600 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 03 七月 2020 17:52:07 +0800
Subject: [PATCH] 多APP优化

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/ShareGoodsTextTemplateServiceImpl.java |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 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 bf369b4..7f3ad59 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
@@ -5,6 +5,8 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.SystemEnum;
+import com.yeshi.fanli.service.inter.user.UserInfoService;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.yeshi.utils.BigDecimalUtil;
@@ -47,6 +49,9 @@
 
 	@Resource
 	private ConfigTaoLiJinService configTaoLiJinService;
+
+	@Resource
+	private UserInfoService userInfoService;
 
 	@Override
 	public void saveCommonTemplate(Long uid, String template) throws ShareGoodsTextTemplateException {
@@ -234,8 +239,9 @@
 				template = ""; // 鑰佹澘鍒嗕韩
 			}
 		}
+		SystemEnum system=userInfoService.getUserSystem(uid);
 		if (StringUtil.isNullOrEmpty(template)) {
-			template = configService.get(ConfigKeyEnum.shareCommentTextTB.getKey());
+			template = configService.getValue(ConfigKeyEnum.shareCommentTextTB.getKey(),system);
 		}
 
 		return template;
@@ -252,7 +258,8 @@
 			}
 		}
 		if (StringUtil.isNullOrEmpty(template)) {
-			template = configService.get(ConfigKeyEnum.shareCommentTextJD.getKey());
+			SystemEnum system=userInfoService.getUserSystem(uid);
+			template = configService.getValue(ConfigKeyEnum.shareCommentTextJD.getKey(),system);
 		}
 		return template;
 	}
@@ -268,7 +275,8 @@
 			}
 		}
 		if (StringUtil.isNullOrEmpty(template)) {
-			template = configService.get(ConfigKeyEnum.shareCommentTextPDD.getKey());
+			SystemEnum system=userInfoService.getUserSystem(uid);
+			template = configService.getValue(ConfigKeyEnum.shareCommentTextPDD.getKey(),system);
 		}
 
 		return template;
@@ -282,7 +290,8 @@
 			template = objct.getShareVIPTextTemplate();
 		}
 		if (StringUtil.isNullOrEmpty(template)) {
-			template = configService.get(ConfigKeyEnum.shareCommentTextVIP.getKey());
+			SystemEnum system=userInfoService.getUserSystem(uid);
+			template = configService.getValue(ConfigKeyEnum.shareCommentTextVIP.getKey(),system);
 		}
 
 		return template;
@@ -296,7 +305,8 @@
 			template = objct.getShareSuNingTextTemplate();
 		}
 		if (StringUtil.isNullOrEmpty(template)) {
-			template = configService.get(ConfigKeyEnum.shareCommentTextSuNing.getKey());
+			SystemEnum system=userInfoService.getUserSystem(uid);
+			template = configService.getValue(ConfigKeyEnum.shareCommentTextSuNing.getKey(),system);
 		}
 
 		return template;
@@ -837,8 +847,8 @@
 	}
 
 	@Override
-	public String getRecommendText(boolean coupon, String title, String sales, String couponAmount, String description) {
-		String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey());
+	public String getRecommendText(boolean coupon, String title, String sales, String couponAmount, String description, SystemEnum system) {
+		String template = configService.getValue(ConfigKeyEnum.quickShareGoodsText.getKey(),system);
 		String recommendText = template.replace("[鍟嗗搧鏍囬]", title);
 		if (!coupon) {
 			recommendText = recommendText.replace("鎺ㄨ崘鐞嗙敱:[鎺ㄨ崘璇璢", "");
@@ -862,8 +872,8 @@
 	
 
 	@Override
-	public String getCommentTextByTaoToken(boolean coupon, String taoToken, String zkPrice, String quanPrice) {
-		String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey());
+	public String getCommentTextByTaoToken(boolean coupon, String taoToken, String zkPrice, String quanPrice, SystemEnum system) {
+		String quickCommentText = configService.getValue(ConfigKeyEnum.quickShareTBCommentText.getKey(),system);
 		String commentText = quickCommentText.replace("[鍘熶环]", zkPrice);
 		commentText = commentText.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoToken));
 		if (!coupon) {
@@ -876,8 +886,8 @@
 	}
 	
 	@Override
-	public String getCommentTextByLink(boolean coupon, String link, String zkPrice, String quanPrice, ConfigKeyEnum keyEnum) {
-		String quickCommentText = configService.get(keyEnum.getKey());
+	public String getCommentTextByLink(boolean coupon, String link, String zkPrice, String quanPrice, ConfigKeyEnum keyEnum, SystemEnum system) {
+		String quickCommentText = configService.getValue(keyEnum.getKey(),system);
 		String commentText = quickCommentText.replace("[鍘熶环]", zkPrice);
 		commentText = commentText.replace("[閾炬帴]", link);
 		if (!coupon) {

--
Gitblit v1.8.0