From c8f11c229b87d1652b6da0b15576c166cd51eb8b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 01 一月 2020 14:25:22 +0800
Subject: [PATCH] 首页悬浮图mapperbug修改,增加商品详情中的比例展示

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java
index a53eac2..e4f3f88 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/LabelServiceImpl.java
@@ -10,14 +10,12 @@
 import java.util.UUID;
 
 import javax.annotation.Resource;
-import javax.transaction.Transactional;
-
-import jxl.Sheet;
-import jxl.Workbook;
 
 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;
 
 import com.yeshi.fanli.dao.mybatis.lable.LabelClassMapper;
 import com.yeshi.fanli.dao.mybatis.lable.LabelGoodsMapper;
@@ -25,11 +23,12 @@
 import com.yeshi.fanli.entity.bus.lable.Label;
 import com.yeshi.fanli.entity.bus.lable.LabelGoods;
 import com.yeshi.fanli.entity.common.AdminUser;
-import com.yeshi.fanli.exception.LabelException;
-import com.yeshi.fanli.log.LogHelper;
+import com.yeshi.fanli.exception.goods.quality.LabelException;
 import com.yeshi.fanli.service.inter.lable.LabelService;
 import com.yeshi.fanli.util.StringUtil;
-import org.yeshi.utils.tencentcloud.COSManager;
+
+import jxl.Sheet;
+import jxl.Workbook;
 
 @Service
 public class LabelServiceImpl implements LabelService {
@@ -50,7 +49,7 @@
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public void insertList(List<Label>  records,AdminUser admin) throws LabelException{
 		if (records != null && records.size() > 0) {
 			for (Label label : records) {
@@ -97,7 +96,7 @@
 	}
 	
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public void updateList(List<Label>  records) throws LabelException{
 		if (records != null && records.size() > 0) {
 			for (Label label : records) {
@@ -126,13 +125,13 @@
 
 	
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public int deleteBatchById(long[] ids) throws LabelException{
 		return labelMapper.deleteBatchByPrimaryKey(ids);
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public void deleteBatchByPrimaryKey(List<Long> ids) throws LabelException {
 		for (Long id : ids) {
 			Label label = labelMapper.selectByPrimaryKey(id);
@@ -157,14 +156,21 @@
 	
 	@Override
 	public List<Label> selectByTitle(String title) throws LabelException{
-		LogHelper.test("鏌ヨ鏍囩锛�  "+title);
 		return labelMapper.selectByTitle(title);
 	}
 
+	
 	@Override
-	@Cacheable(value = "labelCache",key="'selectByTitleCache-'+#labKey +'-'+#title")
-	public List<Label> selectByTitleCache(String labKey, String title) throws LabelException{
-		return selectByTitle(title);
+	@Cacheable(value = "labelCache",key="'getByTitleCache-'+#labKey +'-'+#title")
+	public Label getByTitleCache(String labKey, String title) throws LabelException{
+		return labelMapper.getByTitle(title);
+	}
+	
+	
+	@Override
+	@Cacheable(value = "labelCache",key="'listByTitlesCache-'+#list")
+	public List<Label> listByTitlesCache(List<String> list){
+		return labelMapper.listByTitles(list);
 	}
 	
 	

--
Gitblit v1.8.0