From b6c37e4bc38db88a360d0f2c6099183f9bb75bdc Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 22 四月 2019 14:31:59 +0800 Subject: [PATCH] 券推送插入 --- fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java index 99e2a11..4758c7c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsClassServiceImpl.java @@ -9,10 +9,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; @@ -284,8 +284,8 @@ @Override - @Cacheable(value="classCache",key="'getClassListAllCache'") - public List<Map<String, Object>> getClassListAllCache() throws Exception { + @Cacheable(value="classCache",key="'getClassListAllCache'+#changePicture") + public List<Map<String, Object>> getClassListAllCache(boolean changePicture) throws Exception { List<GoodsClass> goodsClassList = goodsClassMapper.getEffectiveClass(); if (goodsClassList == null || goodsClassList.size() == 0) { @@ -312,10 +312,21 @@ GoodsSubClass goodsSubClass = iterator.next(); GoodsClass goodsClassInner = goodsSubClass.getRootClass(); if (goodsClass.getId() == goodsClassInner.getId()) { + + // 1.5.3鏂扮増鍥剧墖鏇挎崲 + if (changePicture) { + String pictureSecond = goodsSubClass.getPictureSecond(); + if (pictureSecond != null && pictureSecond.trim().length() > 0) { + goodsSubClass.setPicture(pictureSecond); + } + } + // 瀵瑰簲涓嬪瓙鍒嗙被 subClassList.add(goodsSubClass); iterator.remove(); } + + } } -- Gitblit v1.8.0