From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 27 八月 2019 12:32:46 +0800
Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java |   41 +++++++++++++++++++++++++++++++++--------
 1 files changed, 33 insertions(+), 8 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 21fce07..ef56422 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
@@ -8,10 +8,10 @@
 import java.util.UUID;
 
 import javax.annotation.Resource;
-import javax.transaction.Transactional;
 
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 import org.yeshi.utils.tencentcloud.COSManager;
 
@@ -35,22 +35,22 @@
 
 
 	@Override
-	public int insertSelective(SwiperPicture record) throws SwiperPictureException{
+	public int insertSelective(SwiperPicture record) {
 		return swiperPictureMapper.insertSelective(record);
 	}
 
 	@Override
-	public SwiperPicture selectByPrimaryKey(Long id) throws SwiperPictureException{
+	public SwiperPicture selectByPrimaryKey(Long id) {
 		return swiperPictureMapper.selectByPrimaryKey(id);
 	}
 
 	@Override
-	public int updateByPrimaryKeySelective(SwiperPicture record) throws SwiperPictureException{
+	public int updateByPrimaryKeySelective(SwiperPicture record) {
 		return swiperPictureMapper.updateByPrimaryKeySelective(record);
 	}
 
 	@Override
-	public int updateByPrimaryKey(SwiperPicture record) throws SwiperPictureException{
+	public int updateByPrimaryKey(SwiperPicture record){
 		return swiperPictureMapper.updateByPrimaryKey(record);
 	}
 
@@ -80,6 +80,8 @@
 		String params = record.getParams();
 		if (params == null || params.trim().length() == 0 || "null".equalsIgnoreCase(params) ) {
 			record.setParams(null);
+		} else if (!StringUtil.isJson(params)) {
+			throw new SwiperPictureException(1, "璺宠浆鍙傛暟闈濲SON鏍煎紡");
 		}
 		
 		if (!StringUtil.isNullOrEmpty(jumpType)) {
@@ -105,6 +107,11 @@
 			
 		} catch (ParseException e) {
 			e.printStackTrace();
+		}
+		
+		String remark = record.getRemark();
+		if (remark != null && (remark.trim().length() == 0 || remark.equalsIgnoreCase("null"))) {
+			record.setRemark(null);
 		}
 		
 		
@@ -221,7 +228,7 @@
 
 
 	@Override
-	public List<SwiperPicture> getOrderByBannerID(Long bannerId, Integer type, Integer order) throws SwiperPictureException {
+	public List<SwiperPicture> getOrderByBannerID(Long bannerId, Integer type, Integer order) {
 		return swiperPictureMapper.getOrderByBannerID(bannerId, type, order);
 	}
 
@@ -232,8 +239,26 @@
 	
 	@Override
 	@Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card")
-	public List<SwiperPicture> getByBannerCard(String card) throws SwiperPictureException {
-		return swiperPictureMapper.getByBannerCard(card);
+	public List<SwiperPicture> getByBannerCard(String card) {
+		List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card);
+		if (list != null && list.size() > 0) {
+			for (SwiperPicture swiperPicture: list) {
+				boolean needLogin = swiperPicture.isJumpNeedLogin();
+				JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
+				if (jumpDetail != null) {
+					jumpDetail.setNeedLogin(needLogin);
+					swiperPicture.setJumpDetail(jumpDetail);
+				}
+			}
+		}
+		return list;
+	}
+	
+	
+	@Override
+	@Cacheable(value = "bannerCache", key = "'getByBannerId-'+#bannerId")
+	public List<SwiperPicture> getByBannerId(Long bannerId) {
+		return swiperPictureMapper.getByBannerId(bannerId);
 	}
 	
 }

--
Gitblit v1.8.0