Bladeren bron

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

# Conflicts:
#	fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java
wutt 5 jaren geleden
bovenliggende
commit
97e92dc239

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/PlatformStartApplication.java

@@ -2,6 +2,7 @@ package com.management.platform;
 
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.Bean;
@@ -9,6 +10,11 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
 import org.springframework.data.redis.serializer.StringRedisSerializer;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import javax.activation.DataSource;
 
 /**
  * Author: 吴涛涛
@@ -18,9 +24,10 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
  */
 @SpringBootApplication
 @MapperScan("com.management.platform.mapper")
+@EnableTransactionManagement //开启事务支持
 public class PlatformStartApplication {
     public static void main(String[] args) {
-        SpringApplication.run(PlatformStartApplication.class,args);
+        SpringApplication.run(PlatformStartApplication.class, args);
     }
 
     //防止存入redis数据后乱码

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import javax.annotation.Resources;
@@ -33,6 +34,7 @@ import java.util.Set;
  * @since 2020-01-02
  */
 @Service
+@Transactional
 public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screenshot> implements ScreenshotService {
 
     @Value(value = "${upload.path}")