Forráskód Böngészése

:bug: Fixing a bug. 修复保存时没有增加事物的问题导致事件不处理

aeizzz 1 éve
szülő
commit
d1fe3e9b6e

+ 3 - 3
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/config/ClientDetailsInitRunner.java

@@ -39,16 +39,16 @@ public class ClientDetailsInitRunner implements InitializingBean {
 
 	private final RedisTemplate redisTemplate;
 
-
 	@Async
 	@Order
 	@EventListener({ WebServerInitializedEvent.class })
-	public void WebServerInit(){
+	public void WebServerInit() {
 		this.initClientDetails();
 	}
+
 	@Async
 	@Order
-	@EventListener({ ClientDetailsInitEvent.class })
+	@TransactionalEventListener({ ClientDetailsInitEvent.class })
 	public void initClientDetails() {
 		log.debug("初始化客户端信息开始 ");
 

+ 1 - 0
pigx-upms/pigx-upms-biz/src/main/java/com/pig4cloud/pigx/admin/service/impl/SysOauthClientDetailsServiceImpl.java

@@ -78,6 +78,7 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClient
 	 */
 	@Override
 	@CacheEvict(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#clientDetailsDTO.clientId")
+	@Transactional(rollbackFor = Exception.class)
 	public Boolean updateClientById(SysOauthClientDetailsDTO clientDetailsDTO) {
 		this.insertOrUpdate(clientDetailsDTO);
 		return Boolean.TRUE;