From eec7e789a87863c25d92c10ad5dfc22ad80c448d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 14 七月 2020 12:36:48 +0800
Subject: [PATCH] 系统区分BUG修复

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
index 7f4e743..895fd7c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -12,6 +12,7 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.SystemEnum;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -321,9 +322,9 @@
 	}
 
 	@Override
-	@Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
-	public List<BannerVO> getByBannerCard(String card) {
-		List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
+	@Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card+'-'+#system")
+	public List<BannerVO> getByBannerCard(String card,SystemEnum system) {
+		List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card,system);
 		if (list != null && list.size() > 0) {
 			for (SwiperPicture swiperPicture : list) {
 				boolean needLogin = swiperPicture.isJumpNeedLogin();
@@ -334,7 +335,7 @@
 				}
 			}
 		}
-		return transformVO(list);
+		return transformVO(list,system);
 	}
 
 	/**
@@ -344,10 +345,10 @@
 	 * @param platform
 	 * @param versionCode
 	 */
-	private void filterSwipePicture(List<SwiperPicture> list, String platform, int versionCode) {
+	private void filterSwipePicture(List<SwiperPicture> list, String platform, int versionCode,SystemEnum system) {
 		if (list == null || list.size() == 0)
 			return;
-		AppVersionInfo app = appVersionService.getClientVersion(platform, versionCode);
+		AppVersionInfo app = appVersionService.getClientVersion(platform, versionCode,system);
 		if (app == null) {
 			list.clear();
 			return;
@@ -368,34 +369,34 @@
 		}
 	}
 
-	@Cacheable(value = "bannerCache", key = "'getByBannerCardAndVersion-'+#card+'-'+#platform+'-'+#version")
+	@Cacheable(value = "bannerCache", key = "'getByBannerCardAndVersion-'+#card+'-'+#platform+'-'+#version+'-'+#system")
 	@Override
-	public List<BannerVO> getByBannerCardAndVersion(String card, String platform, int version) {
-		List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
-		filterSwipePicture(list, platform, version);
+	public List<BannerVO> getByBannerCardAndVersion(String card, String platform, int version,SystemEnum system) {
+		List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card,system);
+		filterSwipePicture(list, platform, version,system);
 		for (SwiperPicture picture : list) {
 			if (picture.isJumpNeedLogin() && picture.getJumpDetail() != null) {
 				picture.getJumpDetail().setNeedLogin(true);
 			}
 		}
 
-		return transformVO(list);
+		return transformVO(list,system);
 	}
 
 	@Override
 	@Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId")
-	public List<BannerVO> getByBannerId(Long bannerId) {
+	public List<BannerVO> getByBannerId(Long bannerId,SystemEnum system) {
 		List<SwiperPicture>  pictureList = swiperPictureMapper.getByBannerId(bannerId);
-		return transformVO(pictureList);
+		return transformVO(pictureList,system);
 	}
 
-	@Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId+'-'+#platform+'-'+#version")
+	@Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId+'-'+#platform+'-'+#version+'-'+#system")
 	@Override
-	public List<BannerVO> getByBannerId(Long bannerId, String platform, int version)
+	public List<BannerVO> getByBannerId(Long bannerId, String platform, int version,SystemEnum system)
 			throws SwiperPictureException {
 		List<SwiperPicture> pictureList = swiperPictureMapper.getByBannerId(bannerId);
-		filterSwipePicture(pictureList, platform, version);
-		return transformVO(pictureList);
+		filterSwipePicture(pictureList, platform, version,system);
+		return transformVO(pictureList,system);
 	}
 
 	@Transactional(rollbackFor = Exception.class)
@@ -455,7 +456,7 @@
 	 * @param list
 	 * @return
 	 */
-	private List<BannerVO> transformVO(List<SwiperPicture> list) {
+	private List<BannerVO> transformVO(List<SwiperPicture> list, SystemEnum system) {
 		List<BannerVO> listVo = new ArrayList<BannerVO>();
 		if (list != null && list.size() > 0) {
 			for (SwiperPicture swiperPicture: list) {
@@ -471,7 +472,7 @@
 				CommonShareInfo info = commonShareInfoService.getByPidAndType(bannerVO.getId(), 
 						CommonShareInfoEnum.banner.name());
 				if (info != null && !StringUtil.isNullOrEmpty(info.getComment())) {
-					String link = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
+					String link = configService.getValue(ConfigKeyEnum.activityDetailLink.getKey(),system) + "?type=%s&id=%s";
 					link = String.format(link, CommonShareInfoEnum.banner.name(),bannerVO.getId());
 					
 					JSONObject params = new JSONObject();

--
Gitblit v1.8.0