diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java index 4919bf7c2..00cf23fb5 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java @@ -1,12 +1,15 @@ package cn.iocoder.yudao.framework.lock4j.config; import cn.hutool.core.util.ClassUtil; +import com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration; import cn.iocoder.yudao.framework.lock4j.core.DefaultLockFailureStrategy; import cn.iocoder.yudao.framework.lock4j.core.Lock4jRedisKeyConstants; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration +@AutoConfigureBefore(LockAutoConfiguration.class) public class YudaoLock4jConfiguration { static { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java index 8b96db03d..333dbefa6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java @@ -206,7 +206,7 @@ public class CodegenServiceImpl implements CodegenService { public Map generationCodes(Long tableId) { // 校验是否已经存在 CodegenTableDO table = codegenTableMapper.selectById(tableId); - if (codegenTableMapper.selectById(tableId) == null) { + if (table == null) { throw exception(CODEGEN_TABLE_NOT_EXISTS); } List columns = codegenColumnMapper.selectListByTableId(tableId);