Commit 467170d3defacf7ac8f4cf422426d44ab1b96adb
Merge branch 'master' of https://github.com/YunaiV/ruoyi-vue-pro
Showing
3 changed files
with
5 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java
| ... | ... | @@ -539,11 +539,11 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme |
| 539 | 539 | /** |
| 540 | 540 | * 该 {@link MappedStatement} 对应的规则 |
| 541 | 541 | */ |
| 542 | - private static final ThreadLocal<List<DataPermissionRule>> RULES = new TransmittableThreadLocal<>(); | |
| 542 | + private static final ThreadLocal<List<DataPermissionRule>> RULES = ThreadLocal.withInitial(Collections::emptyList); | |
| 543 | 543 | /** |
| 544 | 544 | * SQL 是否进行重写 |
| 545 | 545 | */ |
| 546 | - private static final ThreadLocal<Boolean> REWRITE = new TransmittableThreadLocal<>(); | |
| 546 | + private static final ThreadLocal<Boolean> REWRITE = ThreadLocal.withInitial(() -> Boolean.FALSE); | |
| 547 | 547 | |
| 548 | 548 | public static void init(List<DataPermissionRule> rules) { |
| 549 | 549 | RULES.set(rules); | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
| ... | ... | @@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | 12 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 13 | 13 | import cn.iocoder.yudao.framework.common.util.date.DateUtils; |
| 14 | +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; | |
| 14 | 15 | import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; |
| 15 | 16 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 16 | 17 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| ... | ... | @@ -136,6 +137,7 @@ public class CodegenEngine { |
| 136 | 137 | globalBindingMap.put("ServiceExceptionUtilClassName", ServiceExceptionUtil.class.getName()); |
| 137 | 138 | globalBindingMap.put("DateUtilsClassName", DateUtils.class.getName()); |
| 138 | 139 | globalBindingMap.put("ExcelUtilsClassName", ExcelUtils.class.getName()); |
| 140 | + globalBindingMap.put("LocalDateTimeUtilsClassName", LocalDateTimeUtils.class.getName()); | |
| 139 | 141 | globalBindingMap.put("ObjectUtilsClassName", ObjectUtils.class.getName()); |
| 140 | 142 | globalBindingMap.put("DictConvertClassName", DictConvert.class.getName()); |
| 141 | 143 | globalBindingMap.put("OperateLogClassName", OperateLog.class.getName()); | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm
| ... | ... | @@ -22,6 +22,7 @@ import static cn.hutool.core.util.RandomUtil.*; |
| 22 | 22 | import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*; |
| 23 | 23 | import static ${baseFrameworkPackage}.test.core.util.AssertUtils.*; |
| 24 | 24 | import static ${baseFrameworkPackage}.test.core.util.RandomUtils.*; |
| 25 | +import static ${LocalDateTimeUtilsClassName}.*; | |
| 25 | 26 | import static ${ObjectUtilsClassName}.*; |
| 26 | 27 | import static ${DateUtilsClassName}.*; |
| 27 | 28 | import static org.junit.jupiter.api.Assertions.*; | ... | ... |