From c9cbdfa41d645d42eeaa7e06d550d4ef8ac328e7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 03 一月 2020 12:15:08 +0800
Subject: [PATCH] redis关键词

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
index b6fa8c1..907610e 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -21,6 +21,7 @@
 import com.yeshi.fanli.exception.homemodule.FloatADException;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.homemodule.FloatADService;
+import com.yeshi.fanli.util.FilePathEnum;
 import com.yeshi.fanli.util.StringUtil;
 
 @Service
@@ -53,6 +54,10 @@
 			throw new FloatADException(1, "璺宠浆鍙傛暟闈濲SON鏍煎紡");
 		}
 		
+		FloatADTypeEnum typeEnum = record.getTypeEnum();
+		if (typeEnum == null)
+			throw new FloatADException(1, "绫诲瀷涓嶈兘涓虹┖");
+			
 		if (!StringUtil.isNullOrEmpty(jumpType)) {
 			List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
 			if (listByType !=null && listByType.size() > 0) {
@@ -142,7 +147,7 @@
 		String type = contentType.substring(contentType.indexOf("/") + 1);
 	
 		// 鏂囦欢璺緞
-		String filePath="/img/FloatAD/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
+		String filePath= FilePathEnum.floatAD.getPath() +UUID.randomUUID().toString().replace("-", "") + "." + type;
 		// 鎵ц涓婁紶
 		String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
 		
@@ -161,7 +166,7 @@
 	}
 	
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public void updateOrder(Long id, Integer moveType) throws FloatADException {
 		
 		if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
@@ -194,7 +199,7 @@
 	}
 	
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
 		
 		List<FloatAD> listSwiper = floatADMapper.ListByPrimaryKey(list);

--
Gitblit v1.8.0