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/homemodule/SwiperPictureServiceImpl.java | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 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..c18d7fd 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; @@ -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); } @@ -233,7 +240,25 @@ @Override @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card") public List<SwiperPicture> getByBannerCard(String card) throws SwiperPictureException { - return swiperPictureMapper.getByBannerCard(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) throws SwiperPictureException { + return swiperPictureMapper.getByBannerId(bannerId); } } -- Gitblit v1.8.0