Commit 9c2243419b2974f27c99679bc1f29203a062490a
Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into develop
Showing
215 changed files
with
1367 additions
and
743 deletions
Too many changes.
To preserve performance only 100 of 215 files are displayed.
pom.xml
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 32 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 33 | 33 | ||
| 34 | <properties> | 34 | <properties> |
| 35 | - <revision>2.6.1-SNAPSHOT</revision> | 35 | + <revision>2025.08-SNAPSHOT</revision> |
| 36 | <!-- Maven 相关 --> | 36 | <!-- Maven 相关 --> |
| 37 | <java.version>17</java.version> | 37 | <java.version>17</java.version> |
| 38 | <maven.compiler.source>${java.version}</maven.compiler.source> | 38 | <maven.compiler.source>${java.version}</maven.compiler.source> |
yudao-dependencies/pom.xml
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 15 | ||
| 16 | <properties> | 16 | <properties> |
| 17 | - <revision>2.6.1-SNAPSHOT</revision> | 17 | + <revision>2025.08-SNAPSHOT</revision> |
| 18 | <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version> | 18 | <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version> |
| 19 | <!-- 统一依赖管理 --> | 19 | <!-- 统一依赖管理 --> |
| 20 | <spring.boot.version>3.4.5</spring.boot.version> | 20 | <spring.boot.version>3.4.5</spring.boot.version> |
| @@ -24,9 +24,9 @@ | @@ -24,9 +24,9 @@ | ||
| 24 | <!-- DB 相关 --> | 24 | <!-- DB 相关 --> |
| 25 | <druid.version>1.2.24</druid.version> | 25 | <druid.version>1.2.24</druid.version> |
| 26 | <mybatis.version>3.5.19</mybatis.version> | 26 | <mybatis.version>3.5.19</mybatis.version> |
| 27 | - <mybatis-plus.version>3.5.10.1</mybatis-plus.version> | 27 | + <mybatis-plus.version>3.5.12</mybatis-plus.version> |
| 28 | + <mybatis-plus-join.version>1.5.4</mybatis-plus-join.version> | ||
| 28 | <dynamic-datasource.version>4.3.1</dynamic-datasource.version> | 29 | <dynamic-datasource.version>4.3.1</dynamic-datasource.version> |
| 29 | - <mybatis-plus-join.version>1.4.13</mybatis-plus-join.version> | ||
| 30 | <easy-trans.version>3.0.6</easy-trans.version> | 30 | <easy-trans.version>3.0.6</easy-trans.version> |
| 31 | <redisson.version>3.41.0</redisson.version> | 31 | <redisson.version>3.41.0</redisson.version> |
| 32 | <dm8.jdbc.version>8.1.3.140</dm8.jdbc.version> | 32 | <dm8.jdbc.version>8.1.3.140</dm8.jdbc.version> |
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | <mapstruct.version>1.6.3</mapstruct.version> | 54 | <mapstruct.version>1.6.3</mapstruct.version> |
| 55 | <hutool-5.version>5.8.35</hutool-5.version> | 55 | <hutool-5.version>5.8.35</hutool-5.version> |
| 56 | <hutool-6.version>6.0.0-M19</hutool-6.version> | 56 | <hutool-6.version>6.0.0-M19</hutool-6.version> |
| 57 | - <easyexcel.version>4.0.3</easyexcel.version> | 57 | + <fastexcel.version>1.2.0</fastexcel.version> |
| 58 | <velocity.version>2.4.1</velocity.version> | 58 | <velocity.version>2.4.1</velocity.version> |
| 59 | <fastjson.version>1.2.83</fastjson.version> | 59 | <fastjson.version>1.2.83</fastjson.version> |
| 60 | <guava.version>33.4.8-jre</guava.version> | 60 | <guava.version>33.4.8-jre</guava.version> |
| @@ -69,8 +69,6 @@ | @@ -69,8 +69,6 @@ | ||
| 69 | <pf4j-spring.version>0.9.0</pf4j-spring.version> | 69 | <pf4j-spring.version>0.9.0</pf4j-spring.version> |
| 70 | <vertx.version>4.5.13</vertx.version> | 70 | <vertx.version>4.5.13</vertx.version> |
| 71 | <!-- 三方云服务相关 --> | 71 | <!-- 三方云服务相关 --> |
| 72 | - <commons-io.version>2.17.0</commons-io.version> | ||
| 73 | - <commons-compress.version>1.27.1</commons-compress.version> | ||
| 74 | <awssdk.version>2.30.14</awssdk.version> | 72 | <awssdk.version>2.30.14</awssdk.version> |
| 75 | <justauth.version>1.16.7</justauth.version> | 73 | <justauth.version>1.16.7</justauth.version> |
| 76 | <justauth-starter.version>1.4.0</justauth-starter.version> | 74 | <justauth-starter.version>1.4.0</justauth-starter.version> |
| @@ -480,20 +478,11 @@ | @@ -480,20 +478,11 @@ | ||
| 480 | </dependency> | 478 | </dependency> |
| 481 | 479 | ||
| 482 | <dependency> | 480 | <dependency> |
| 483 | - <groupId>com.alibaba</groupId> | ||
| 484 | - <artifactId>easyexcel</artifactId> | ||
| 485 | - <version>${easyexcel.version}</version> | ||
| 486 | - </dependency> | ||
| 487 | - <dependency> | ||
| 488 | - <groupId>commons-io</groupId> | ||
| 489 | - <artifactId>commons-io</artifactId> | ||
| 490 | - <version>${commons-io.version}</version> | ||
| 491 | - </dependency> | ||
| 492 | - <dependency> | ||
| 493 | - <groupId>org.apache.commons</groupId> | ||
| 494 | - <artifactId>commons-compress</artifactId> | ||
| 495 | - <version>${commons-compress.version}</version> | 481 | + <groupId>cn.idev.excel</groupId> |
| 482 | + <artifactId>fastexcel</artifactId> | ||
| 483 | + <version>${fastexcel.version}</version> | ||
| 496 | </dependency> | 484 | </dependency> |
| 485 | + | ||
| 497 | <dependency> | 486 | <dependency> |
| 498 | <groupId>org.apache.tika</groupId> | 487 | <groupId>org.apache.tika</groupId> |
| 499 | <artifactId>tika-core</artifactId> <!-- 文件类型的识别 --> | 488 | <artifactId>tika-core</artifactId> <!-- 文件类型的识别 --> |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java
| @@ -26,15 +26,15 @@ public class CommonResult<T> implements Serializable { | @@ -26,15 +26,15 @@ public class CommonResult<T> implements Serializable { | ||
| 26 | */ | 26 | */ |
| 27 | private Integer code; | 27 | private Integer code; |
| 28 | /** | 28 | /** |
| 29 | - * 返回数据 | ||
| 30 | - */ | ||
| 31 | - private T data; | ||
| 32 | - /** | ||
| 33 | * 错误提示,用户可阅读 | 29 | * 错误提示,用户可阅读 |
| 34 | * | 30 | * |
| 35 | * @see ErrorCode#getMsg() () | 31 | * @see ErrorCode#getMsg() () |
| 36 | */ | 32 | */ |
| 37 | private String msg; | 33 | private String msg; |
| 34 | + /** | ||
| 35 | + * 返回数据 | ||
| 36 | + */ | ||
| 37 | + private T data; | ||
| 38 | 38 | ||
| 39 | /** | 39 | /** |
| 40 | * 将传入的 result 对象,转换成另外一个泛型结果的对象 | 40 | * 将传入的 result 对象,转换成另外一个泛型结果的对象 |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java
| @@ -11,12 +11,12 @@ import java.util.List; | @@ -11,12 +11,12 @@ import java.util.List; | ||
| 11 | @Data | 11 | @Data |
| 12 | public final class PageResult<T> implements Serializable { | 12 | public final class PageResult<T> implements Serializable { |
| 13 | 13 | ||
| 14 | - @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 15 | - private List<T> list; | ||
| 16 | - | ||
| 17 | @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED) | 14 | @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED) |
| 18 | private Long total; | 15 | private Long total; |
| 19 | 16 | ||
| 17 | + @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 18 | + private List<T> list; | ||
| 19 | + | ||
| 20 | public PageResult() { | 20 | public PageResult() { |
| 21 | } | 21 | } |
| 22 | 22 |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/cache/CacheUtils.java
| @@ -15,6 +15,13 @@ import java.util.concurrent.Executors; | @@ -15,6 +15,13 @@ import java.util.concurrent.Executors; | ||
| 15 | public class CacheUtils { | 15 | public class CacheUtils { |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | + * 异步刷新的 LoadingCache 最大缓存数量 | ||
| 19 | + * | ||
| 20 | + * @see <a href="">本地缓存 CacheUtils 工具类建议</a> | ||
| 21 | + */ | ||
| 22 | + private static final Integer CACHE_MAX_SIZE = 10000; | ||
| 23 | + | ||
| 24 | + /** | ||
| 18 | * 构建异步刷新的 LoadingCache 对象 | 25 | * 构建异步刷新的 LoadingCache 对象 |
| 19 | * | 26 | * |
| 20 | * 注意:如果你的缓存和 ThreadLocal 有关系,要么自己处理 ThreadLocal 的传递,要么使用 {@link #buildCache(Duration, CacheLoader)} 方法 | 27 | * 注意:如果你的缓存和 ThreadLocal 有关系,要么自己处理 ThreadLocal 的传递,要么使用 {@link #buildCache(Duration, CacheLoader)} 方法 |
| @@ -29,6 +36,7 @@ public class CacheUtils { | @@ -29,6 +36,7 @@ public class CacheUtils { | ||
| 29 | */ | 36 | */ |
| 30 | public static <K, V> LoadingCache<K, V> buildAsyncReloadingCache(Duration duration, CacheLoader<K, V> loader) { | 37 | public static <K, V> LoadingCache<K, V> buildAsyncReloadingCache(Duration duration, CacheLoader<K, V> loader) { |
| 31 | return CacheBuilder.newBuilder() | 38 | return CacheBuilder.newBuilder() |
| 39 | + .maximumSize(CACHE_MAX_SIZE) | ||
| 32 | // 只阻塞当前数据加载线程,其他线程返回旧值 | 40 | // 只阻塞当前数据加载线程,其他线程返回旧值 |
| 33 | .refreshAfterWrite(duration) | 41 | .refreshAfterWrite(duration) |
| 34 | // 通过 asyncReloading 实现全异步加载,包括 refreshAfterWrite 被阻塞的加载线程 | 42 | // 通过 asyncReloading 实现全异步加载,包括 refreshAfterWrite 被阻塞的加载线程 |
| @@ -43,7 +51,11 @@ public class CacheUtils { | @@ -43,7 +51,11 @@ public class CacheUtils { | ||
| 43 | * @return LoadingCache 对象 | 51 | * @return LoadingCache 对象 |
| 44 | */ | 52 | */ |
| 45 | public static <K, V> LoadingCache<K, V> buildCache(Duration duration, CacheLoader<K, V> loader) { | 53 | public static <K, V> LoadingCache<K, V> buildCache(Duration duration, CacheLoader<K, V> loader) { |
| 46 | - return CacheBuilder.newBuilder().refreshAfterWrite(duration).build(loader); | 54 | + return CacheBuilder.newBuilder() |
| 55 | + .maximumSize(CACHE_MAX_SIZE) | ||
| 56 | + // 只阻塞当前数据加载线程,其他线程返回旧值 | ||
| 57 | + .refreshAfterWrite(duration) | ||
| 58 | + .build(loader); | ||
| 47 | } | 59 | } |
| 48 | 60 | ||
| 49 | } | 61 | } |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java
| @@ -74,30 +74,30 @@ public class DateUtils { | @@ -74,30 +74,30 @@ public class DateUtils { | ||
| 74 | * 创建指定时间 | 74 | * 创建指定时间 |
| 75 | * | 75 | * |
| 76 | * @param year 年 | 76 | * @param year 年 |
| 77 | - * @param mouth 月 | 77 | + * @param month 月 |
| 78 | * @param day 日 | 78 | * @param day 日 |
| 79 | * @return 指定时间 | 79 | * @return 指定时间 |
| 80 | */ | 80 | */ |
| 81 | - public static Date buildTime(int year, int mouth, int day) { | ||
| 82 | - return buildTime(year, mouth, day, 0, 0, 0); | 81 | + public static Date buildTime(int year, int month, int day) { |
| 82 | + return buildTime(year, month, day, 0, 0, 0); | ||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
| 86 | * 创建指定时间 | 86 | * 创建指定时间 |
| 87 | * | 87 | * |
| 88 | * @param year 年 | 88 | * @param year 年 |
| 89 | - * @param mouth 月 | 89 | + * @param month 月 |
| 90 | * @param day 日 | 90 | * @param day 日 |
| 91 | * @param hour 小时 | 91 | * @param hour 小时 |
| 92 | * @param minute 分钟 | 92 | * @param minute 分钟 |
| 93 | * @param second 秒 | 93 | * @param second 秒 |
| 94 | * @return 指定时间 | 94 | * @return 指定时间 |
| 95 | */ | 95 | */ |
| 96 | - public static Date buildTime(int year, int mouth, int day, | 96 | + public static Date buildTime(int year, int month, int day, |
| 97 | int hour, int minute, int second) { | 97 | int hour, int minute, int second) { |
| 98 | Calendar calendar = Calendar.getInstance(); | 98 | Calendar calendar = Calendar.getInstance(); |
| 99 | calendar.set(Calendar.YEAR, year); | 99 | calendar.set(Calendar.YEAR, year); |
| 100 | - calendar.set(Calendar.MONTH, mouth - 1); | 100 | + calendar.set(Calendar.MONTH, month - 1); |
| 101 | calendar.set(Calendar.DAY_OF_MONTH, day); | 101 | calendar.set(Calendar.DAY_OF_MONTH, day); |
| 102 | calendar.set(Calendar.HOUR_OF_DAY, hour); | 102 | calendar.set(Calendar.HOUR_OF_DAY, hour); |
| 103 | calendar.set(Calendar.MINUTE, minute); | 103 | calendar.set(Calendar.MINUTE, minute); |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java
| @@ -69,17 +69,17 @@ public class LocalDateTimeUtils { | @@ -69,17 +69,17 @@ public class LocalDateTimeUtils { | ||
| 69 | * 创建指定时间 | 69 | * 创建指定时间 |
| 70 | * | 70 | * |
| 71 | * @param year 年 | 71 | * @param year 年 |
| 72 | - * @param mouth 月 | 72 | + * @param month 月 |
| 73 | * @param day 日 | 73 | * @param day 日 |
| 74 | * @return 指定时间 | 74 | * @return 指定时间 |
| 75 | */ | 75 | */ |
| 76 | - public static LocalDateTime buildTime(int year, int mouth, int day) { | ||
| 77 | - return LocalDateTime.of(year, mouth, day, 0, 0, 0); | 76 | + public static LocalDateTime buildTime(int year, int month, int day) { |
| 77 | + return LocalDateTime.of(year, month, day, 0, 0, 0); | ||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | - public static LocalDateTime[] buildBetweenTime(int year1, int mouth1, int day1, | ||
| 81 | - int year2, int mouth2, int day2) { | ||
| 82 | - return new LocalDateTime[]{buildTime(year1, mouth1, day1), buildTime(year2, mouth2, day2)}; | 80 | + public static LocalDateTime[] buildBetweenTime(int year1, int month1, int day1, |
| 81 | + int year2, int month2, int day2) { | ||
| 82 | + return new LocalDateTime[]{buildTime(year1, month1, day1), buildTime(year2, month2, day2)}; | ||
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /** | 85 | /** |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
| @@ -18,7 +18,7 @@ import java.util.List; | @@ -18,7 +18,7 @@ import java.util.List; | ||
| 18 | */ | 18 | */ |
| 19 | @AutoConfiguration | 19 | @AutoConfiguration |
| 20 | @ConditionalOnClass(LoginUser.class) | 20 | @ConditionalOnClass(LoginUser.class) |
| 21 | -@ConditionalOnBean(value = {PermissionCommonApi.class, DeptDataPermissionRuleCustomizer.class}) | 21 | +@ConditionalOnBean(value = {DeptDataPermissionRuleCustomizer.class}) |
| 22 | public class YudaoDeptDataPermissionAutoConfiguration { | 22 | public class YudaoDeptDataPermissionAutoConfiguration { |
| 23 | 23 | ||
| 24 | @Bean | 24 | @Bean |
yudao-framework/yudao-spring-boot-starter-excel/pom.xml
| @@ -42,18 +42,19 @@ | @@ -42,18 +42,19 @@ | ||
| 42 | 42 | ||
| 43 | <!-- 工具类相关 --> | 43 | <!-- 工具类相关 --> |
| 44 | <dependency> | 44 | <dependency> |
| 45 | - <groupId>com.alibaba</groupId> | ||
| 46 | - <artifactId>easyexcel</artifactId> | 45 | + <groupId>cn.idev.excel</groupId> |
| 46 | + <artifactId>fastexcel</artifactId> | ||
| 47 | </dependency> | 47 | </dependency> |
| 48 | 48 | ||
| 49 | <dependency> | 49 | <dependency> |
| 50 | - <groupId>com.google.guava</groupId> | ||
| 51 | - <artifactId>guava</artifactId> | 50 | + <groupId>jakarta.validation</groupId> |
| 51 | + <artifactId>jakarta.validation-api</artifactId> | ||
| 52 | + <scope>provided</scope> | ||
| 52 | </dependency> | 53 | </dependency> |
| 53 | 54 | ||
| 54 | <dependency> | 55 | <dependency> |
| 55 | - <groupId>org.apache.commons</groupId> | ||
| 56 | - <artifactId>commons-compress</artifactId> <!-- 解决 https://github.com/alibaba/easyexcel/issues/3954 问题 --> | 56 | + <groupId>com.google.guava</groupId> |
| 57 | + <artifactId>guava</artifactId> | ||
| 57 | </dependency> | 58 | </dependency> |
| 58 | 59 | ||
| 59 | <dependency> | 60 | <dependency> |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/core/DictFrameworkUtils.java
| @@ -76,4 +76,9 @@ public class DictFrameworkUtils { | @@ -76,4 +76,9 @@ public class DictFrameworkUtils { | ||
| 76 | return dictData!= null ? dictData.getValue(): null; | 76 | return dictData!= null ? dictData.getValue(): null; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | + @SneakyThrows | ||
| 80 | + public static List<String> getDictDataValueList(String dictType) { | ||
| 81 | + List<DictDataRespDTO> dictDatas = GET_DICT_DATA_CACHE.get(dictType); | ||
| 82 | + return convertList(dictDatas, DictDataRespDTO::getValue); | ||
| 83 | + } | ||
| 79 | } | 84 | } |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/validation/InDict.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.dict.validation; | ||
| 2 | + | ||
| 3 | +import jakarta.validation.Constraint; | ||
| 4 | +import jakarta.validation.Payload; | ||
| 5 | + | ||
| 6 | +import java.lang.annotation.Documented; | ||
| 7 | +import java.lang.annotation.ElementType; | ||
| 8 | +import java.lang.annotation.Retention; | ||
| 9 | +import java.lang.annotation.RetentionPolicy; | ||
| 10 | +import java.lang.annotation.Target; | ||
| 11 | + | ||
| 12 | +@Target({ | ||
| 13 | + ElementType.METHOD, | ||
| 14 | + ElementType.FIELD, | ||
| 15 | + ElementType.ANNOTATION_TYPE, | ||
| 16 | + ElementType.CONSTRUCTOR, | ||
| 17 | + ElementType.PARAMETER, | ||
| 18 | + ElementType.TYPE_USE | ||
| 19 | +}) | ||
| 20 | +@Retention(RetentionPolicy.RUNTIME) | ||
| 21 | +@Documented | ||
| 22 | +@Constraint( | ||
| 23 | + validatedBy = {InDictValidator.class, InDictCollectionValidator.class} | ||
| 24 | +) | ||
| 25 | +public @interface InDict { | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 数据字典 type | ||
| 29 | + */ | ||
| 30 | + String type(); | ||
| 31 | + | ||
| 32 | + String message() default "必须在指定范围 {value}"; | ||
| 33 | + | ||
| 34 | + Class<?>[] groups() default {}; | ||
| 35 | + | ||
| 36 | + Class<? extends Payload>[] payload() default {}; | ||
| 37 | + | ||
| 38 | +} |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/validation/InDictCollectionValidator.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.dict.validation; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | +import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; | ||
| 5 | +import jakarta.validation.ConstraintValidator; | ||
| 6 | +import jakarta.validation.ConstraintValidatorContext; | ||
| 7 | + | ||
| 8 | +import java.util.Collection; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +public class InDictCollectionValidator implements ConstraintValidator<InDict, Collection<?>> { | ||
| 12 | + | ||
| 13 | + private String dictType; | ||
| 14 | + | ||
| 15 | + @Override | ||
| 16 | + public void initialize(InDict annotation) { | ||
| 17 | + this.dictType = annotation.type(); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + @Override | ||
| 21 | + public boolean isValid(Collection<?> list, ConstraintValidatorContext context) { | ||
| 22 | + // 为空时,默认不校验,即认为通过 | ||
| 23 | + if (CollUtil.isEmpty(list)) { | ||
| 24 | + return true; | ||
| 25 | + } | ||
| 26 | + // 校验全部通过 | ||
| 27 | + List<String> dbValues = DictFrameworkUtils.getDictDataValueList(dictType); | ||
| 28 | + boolean match = list.stream().allMatch(v -> dbValues.stream() | ||
| 29 | + .anyMatch(dbValue -> dbValue.equalsIgnoreCase(v.toString()))); | ||
| 30 | + if (match) { | ||
| 31 | + return true; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + // 校验不通过,自定义提示语句 | ||
| 35 | + context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 | ||
| 36 | + context.buildConstraintViolationWithTemplate( | ||
| 37 | + context.getDefaultConstraintMessageTemplate().replaceAll("\\{value}", dbValues.toString()) | ||
| 38 | + ).addConstraintViolation(); // 重新添加错误提示语句 | ||
| 39 | + return false; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | +} | ||
| 43 | + |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/dict/validation/InDictValidator.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.dict.validation; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.util.StrUtil; | ||
| 4 | +import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; | ||
| 5 | +import jakarta.validation.ConstraintValidator; | ||
| 6 | +import jakarta.validation.ConstraintValidatorContext; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +public class InDictValidator implements ConstraintValidator<InDict, Object> { | ||
| 11 | + | ||
| 12 | + private String dictType; | ||
| 13 | + | ||
| 14 | + @Override | ||
| 15 | + public void initialize(InDict annotation) { | ||
| 16 | + this.dictType = annotation.type(); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + @Override | ||
| 20 | + public boolean isValid(Object value, ConstraintValidatorContext context) { | ||
| 21 | + // 为空时,默认不校验,即认为通过 | ||
| 22 | + if (value == null) { | ||
| 23 | + return true; | ||
| 24 | + } | ||
| 25 | + // 校验通过 | ||
| 26 | + final List<String> values = DictFrameworkUtils.getDictDataValueList(dictType); | ||
| 27 | + boolean match = values.stream().anyMatch(v -> StrUtil.equalsIgnoreCase(v, value.toString())); | ||
| 28 | + if (match) { | ||
| 29 | + return true; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + // 校验不通过,自定义提示语句 | ||
| 33 | + context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值 | ||
| 34 | + context.buildConstraintViolationWithTemplate( | ||
| 35 | + context.getDefaultConstraintMessageTemplate().replaceAll("\\{value}", values.toString()) | ||
| 36 | + ).addConstraintViolation(); // 重新添加错误提示语句 | ||
| 37 | + return false; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | +} | ||
| 41 | + |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/AreaConvert.java
| @@ -3,11 +3,11 @@ package cn.iocoder.yudao.framework.excel.core.convert; | @@ -3,11 +3,11 @@ package cn.iocoder.yudao.framework.excel.core.convert; | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | import cn.iocoder.yudao.framework.ip.core.Area; | 4 | import cn.iocoder.yudao.framework.ip.core.Area; |
| 5 | import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; | 5 | import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; |
| 6 | -import com.alibaba.excel.converters.Converter; | ||
| 7 | -import com.alibaba.excel.enums.CellDataTypeEnum; | ||
| 8 | -import com.alibaba.excel.metadata.GlobalConfiguration; | ||
| 9 | -import com.alibaba.excel.metadata.data.ReadCellData; | ||
| 10 | -import com.alibaba.excel.metadata.property.ExcelContentProperty; | 6 | +import cn.idev.excel.converters.Converter; |
| 7 | +import cn.idev.excel.enums.CellDataTypeEnum; | ||
| 8 | +import cn.idev.excel.metadata.GlobalConfiguration; | ||
| 9 | +import cn.idev.excel.metadata.data.ReadCellData; | ||
| 10 | +import cn.idev.excel.metadata.property.ExcelContentProperty; | ||
| 11 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java
| @@ -3,12 +3,12 @@ package cn.iocoder.yudao.framework.excel.core.convert; | @@ -3,12 +3,12 @@ package cn.iocoder.yudao.framework.excel.core.convert; | ||
| 3 | import cn.hutool.core.convert.Convert; | 3 | import cn.hutool.core.convert.Convert; |
| 4 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; | 4 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; |
| 5 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 5 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 6 | -import com.alibaba.excel.converters.Converter; | ||
| 7 | -import com.alibaba.excel.enums.CellDataTypeEnum; | ||
| 8 | -import com.alibaba.excel.metadata.GlobalConfiguration; | ||
| 9 | -import com.alibaba.excel.metadata.data.ReadCellData; | ||
| 10 | -import com.alibaba.excel.metadata.data.WriteCellData; | ||
| 11 | -import com.alibaba.excel.metadata.property.ExcelContentProperty; | 6 | +import cn.idev.excel.converters.Converter; |
| 7 | +import cn.idev.excel.enums.CellDataTypeEnum; | ||
| 8 | +import cn.idev.excel.metadata.GlobalConfiguration; | ||
| 9 | +import cn.idev.excel.metadata.data.ReadCellData; | ||
| 10 | +import cn.idev.excel.metadata.data.WriteCellData; | ||
| 11 | +import cn.idev.excel.metadata.property.ExcelContentProperty; | ||
| 12 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | 13 | ||
| 14 | /** | 14 | /** |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/JsonConvert.java
| 1 | package cn.iocoder.yudao.framework.excel.core.convert; | 1 | package cn.iocoder.yudao.framework.excel.core.convert; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 4 | -import com.alibaba.excel.converters.Converter; | ||
| 5 | -import com.alibaba.excel.enums.CellDataTypeEnum; | ||
| 6 | -import com.alibaba.excel.metadata.GlobalConfiguration; | ||
| 7 | -import com.alibaba.excel.metadata.data.WriteCellData; | ||
| 8 | -import com.alibaba.excel.metadata.property.ExcelContentProperty; | 4 | +import cn.idev.excel.converters.Converter; |
| 5 | +import cn.idev.excel.enums.CellDataTypeEnum; | ||
| 6 | +import cn.idev.excel.metadata.GlobalConfiguration; | ||
| 7 | +import cn.idev.excel.metadata.data.WriteCellData; | ||
| 8 | +import cn.idev.excel.metadata.property.ExcelContentProperty; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * Excel Json 转换器 | 11 | * Excel Json 转换器 |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java
| 1 | package cn.iocoder.yudao.framework.excel.core.convert; | 1 | package cn.iocoder.yudao.framework.excel.core.convert; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.converters.Converter; | ||
| 4 | -import com.alibaba.excel.enums.CellDataTypeEnum; | ||
| 5 | -import com.alibaba.excel.metadata.GlobalConfiguration; | ||
| 6 | -import com.alibaba.excel.metadata.data.WriteCellData; | ||
| 7 | -import com.alibaba.excel.metadata.property.ExcelContentProperty; | 3 | +import cn.idev.excel.converters.Converter; |
| 4 | +import cn.idev.excel.enums.CellDataTypeEnum; | ||
| 5 | +import cn.idev.excel.metadata.GlobalConfiguration; | ||
| 6 | +import cn.idev.excel.metadata.data.WriteCellData; | ||
| 7 | +import cn.idev.excel.metadata.property.ExcelContentProperty; | ||
| 8 | 8 | ||
| 9 | import java.math.BigDecimal; | 9 | import java.math.BigDecimal; |
| 10 | import java.math.RoundingMode; | 10 | import java.math.RoundingMode; |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/ColumnWidthMatchStyleStrategy.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.excel.core.handler; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | +import cn.idev.excel.enums.CellDataTypeEnum; | ||
| 5 | +import cn.idev.excel.metadata.Head; | ||
| 6 | +import cn.idev.excel.metadata.data.WriteCellData; | ||
| 7 | +import cn.idev.excel.util.MapUtils; | ||
| 8 | +import cn.idev.excel.write.metadata.holder.WriteSheetHolder; | ||
| 9 | +import cn.idev.excel.write.style.column.AbstractColumnWidthStyleStrategy; | ||
| 10 | +import cn.idev.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; | ||
| 11 | +import org.apache.poi.ss.usermodel.Cell; | ||
| 12 | + | ||
| 13 | +import java.util.HashMap; | ||
| 14 | +import java.util.List; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Excel 自适应列宽处理器 | ||
| 19 | + * | ||
| 20 | + * 相比 {@link LongestMatchColumnWidthStyleStrategy} 来说,额外处理了 DATE 类型! | ||
| 21 | + * | ||
| 22 | + * @see <a href="https://github.com/YunaiV/yudao-cloud/pull/196/">添加自适应列宽处理器,并替换默认列宽策略</a> | ||
| 23 | + * @author hmb | ||
| 24 | + */ | ||
| 25 | +public class ColumnWidthMatchStyleStrategy extends AbstractColumnWidthStyleStrategy { | ||
| 26 | + | ||
| 27 | + private static final int MAX_COLUMN_WIDTH = 255; | ||
| 28 | + | ||
| 29 | + private final Map<Integer, Map<Integer, Integer>> cache = MapUtils.newHashMapWithExpectedSize(8); | ||
| 30 | + | ||
| 31 | + @Override | ||
| 32 | + protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<WriteCellData<?>> cellDataList, Cell cell, | ||
| 33 | + Head head, Integer relativeRowIndex, Boolean isHead) { | ||
| 34 | + boolean needSetWidth = isHead || CollUtil.isNotEmpty(cellDataList); | ||
| 35 | + if (!needSetWidth) { | ||
| 36 | + return; | ||
| 37 | + } | ||
| 38 | + Map<Integer, Integer> maxColumnWidthMap = cache.computeIfAbsent(writeSheetHolder.getSheetNo(), | ||
| 39 | + key -> new HashMap<>(16)); | ||
| 40 | + Integer columnWidth = dataLength(cellDataList, cell, isHead); | ||
| 41 | + if (columnWidth < 0) { | ||
| 42 | + return; | ||
| 43 | + } | ||
| 44 | + if (columnWidth > MAX_COLUMN_WIDTH) { | ||
| 45 | + columnWidth = MAX_COLUMN_WIDTH; | ||
| 46 | + } | ||
| 47 | + Integer maxColumnWidth = maxColumnWidthMap.get(cell.getColumnIndex()); | ||
| 48 | + if (maxColumnWidth == null || columnWidth > maxColumnWidth) { | ||
| 49 | + maxColumnWidthMap.put(cell.getColumnIndex(), columnWidth); | ||
| 50 | + writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), columnWidth * 256); | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @SuppressWarnings("EnhancedSwitchMigration") | ||
| 55 | + private Integer dataLength(List<WriteCellData<?>> cellDataList, Cell cell, Boolean isHead) { | ||
| 56 | + if (isHead) { | ||
| 57 | + return cell.getStringCellValue().getBytes().length; | ||
| 58 | + } | ||
| 59 | + WriteCellData<?> cellData = cellDataList.get(0); | ||
| 60 | + CellDataTypeEnum type = cellData.getType(); | ||
| 61 | + if (type == null) { | ||
| 62 | + return -1; | ||
| 63 | + } | ||
| 64 | + switch (type) { | ||
| 65 | + case STRING: | ||
| 66 | + return cellData.getStringValue().getBytes().length; | ||
| 67 | + case BOOLEAN: | ||
| 68 | + return cellData.getBooleanValue().toString().getBytes().length; | ||
| 69 | + case NUMBER: | ||
| 70 | + return cellData.getNumberValue().toString().getBytes().length; | ||
| 71 | + case DATE: | ||
| 72 | + return cellData.getDateValue().toString().getBytes().length; | ||
| 73 | + default: | ||
| 74 | + return -1; | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/handler/SelectSheetWriteHandler.java
| @@ -3,7 +3,6 @@ package cn.iocoder.yudao.framework.excel.core.handler; | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.framework.excel.core.handler; | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.lang.Assert; | 4 | import cn.hutool.core.lang.Assert; |
| 5 | import cn.hutool.core.util.ObjectUtil; | 5 | import cn.hutool.core.util.ObjectUtil; |
| 6 | -import cn.hutool.core.util.ReflectUtil; | ||
| 7 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| 8 | import cn.hutool.extra.spring.SpringUtil; | 7 | import cn.hutool.extra.spring.SpringUtil; |
| 9 | import cn.hutool.poi.excel.ExcelUtil; | 8 | import cn.hutool.poi.excel.ExcelUtil; |
| @@ -11,12 +10,12 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | @@ -11,12 +10,12 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | ||
| 11 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; | 10 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; |
| 12 | import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect; | 11 | import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect; |
| 13 | import cn.iocoder.yudao.framework.excel.core.function.ExcelColumnSelectFunction; | 12 | import cn.iocoder.yudao.framework.excel.core.function.ExcelColumnSelectFunction; |
| 14 | -import com.alibaba.excel.annotation.ExcelIgnore; | ||
| 15 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 16 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 17 | -import com.alibaba.excel.write.handler.SheetWriteHandler; | ||
| 18 | -import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; | ||
| 19 | -import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; | 13 | +import cn.idev.excel.annotation.ExcelIgnore; |
| 14 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||
| 15 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 16 | +import cn.idev.excel.write.handler.SheetWriteHandler; | ||
| 17 | +import cn.idev.excel.write.metadata.holder.WriteSheetHolder; | ||
| 18 | +import cn.idev.excel.write.metadata.holder.WriteWorkbookHolder; | ||
| 20 | import lombok.extern.slf4j.Slf4j; | 19 | import lombok.extern.slf4j.Slf4j; |
| 21 | import org.apache.poi.hssf.usermodel.HSSFDataValidation; | 20 | import org.apache.poi.hssf.usermodel.HSSFDataValidation; |
| 22 | import org.apache.poi.ss.usermodel.*; | 21 | import org.apache.poi.ss.usermodel.*; |
| @@ -87,7 +86,7 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { | @@ -87,7 +86,7 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { | ||
| 87 | 86 | ||
| 88 | /** | 87 | /** |
| 89 | * 判断字段是否是静态的、最终的、 transient 的 | 88 | * 判断字段是否是静态的、最终的、 transient 的 |
| 90 | - * 原因:EasyExcel 默认是忽略 static final 或 transient 的字段,所以需要判断 | 89 | + * 原因:FastExcel 默认是忽略 static final 或 transient 的字段,所以需要判断 |
| 91 | * | 90 | * |
| 92 | * @param field 字段 | 91 | * @param field 字段 |
| 93 | * @return 是否是静态的、最终的、transient 的 | 92 | * @return 是否是静态的、最终的、transient 的 |
| @@ -185,4 +184,4 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { | @@ -185,4 +184,4 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { | ||
| 185 | writeSheetHolder.getSheet().addValidationData(validation); | 184 | writeSheetHolder.getSheet().addValidationData(validation); |
| 186 | } | 185 | } |
| 187 | 186 | ||
| 188 | -} | ||
| 189 | \ No newline at end of file | 187 | \ No newline at end of file |
| 188 | +} |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/util/ExcelUtils.java
| 1 | package cn.iocoder.yudao.framework.excel.core.util; | 1 | package cn.iocoder.yudao.framework.excel.core.util; |
| 2 | 2 | ||
| 3 | +import cn.idev.excel.FastExcelFactory; | ||
| 4 | +import cn.idev.excel.converters.longconverter.LongStringConverter; | ||
| 3 | import cn.iocoder.yudao.framework.common.util.http.HttpUtils; | 5 | import cn.iocoder.yudao.framework.common.util.http.HttpUtils; |
| 6 | +import cn.iocoder.yudao.framework.excel.core.handler.ColumnWidthMatchStyleStrategy; | ||
| 4 | import cn.iocoder.yudao.framework.excel.core.handler.SelectSheetWriteHandler; | 7 | import cn.iocoder.yudao.framework.excel.core.handler.SelectSheetWriteHandler; |
| 5 | -import com.alibaba.excel.EasyExcel; | ||
| 6 | -import com.alibaba.excel.converters.longconverter.LongStringConverter; | ||
| 7 | -import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; | ||
| 8 | import jakarta.servlet.http.HttpServletResponse; | 8 | import jakarta.servlet.http.HttpServletResponse; |
| 9 | import org.springframework.web.multipart.MultipartFile; | 9 | import org.springframework.web.multipart.MultipartFile; |
| 10 | 10 | ||
| @@ -32,9 +32,9 @@ public class ExcelUtils { | @@ -32,9 +32,9 @@ public class ExcelUtils { | ||
| 32 | public static <T> void write(HttpServletResponse response, String filename, String sheetName, | 32 | public static <T> void write(HttpServletResponse response, String filename, String sheetName, |
| 33 | Class<T> head, List<T> data) throws IOException { | 33 | Class<T> head, List<T> data) throws IOException { |
| 34 | // 输出 Excel | 34 | // 输出 Excel |
| 35 | - EasyExcel.write(response.getOutputStream(), head) | 35 | + FastExcelFactory.write(response.getOutputStream(), head) |
| 36 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 | 36 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| 37 | - .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 | 37 | + .registerWriteHandler(new ColumnWidthMatchStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 |
| 38 | .registerWriteHandler(new SelectSheetWriteHandler(head)) // 基于固定 sheet 实现下拉框 | 38 | .registerWriteHandler(new SelectSheetWriteHandler(head)) // 基于固定 sheet 实现下拉框 |
| 39 | .registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度 | 39 | .registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度 |
| 40 | .sheet(sheetName).doWrite(data); | 40 | .sheet(sheetName).doWrite(data); |
| @@ -44,7 +44,7 @@ public class ExcelUtils { | @@ -44,7 +44,7 @@ public class ExcelUtils { | ||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | public static <T> List<T> read(MultipartFile file, Class<T> head) throws IOException { | 46 | public static <T> List<T> read(MultipartFile file, Class<T> head) throws IOException { |
| 47 | - return EasyExcel.read(file.getInputStream(), head, null) | 47 | + return FastExcelFactory.read(file.getInputStream(), head, null) |
| 48 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 | 48 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| 49 | .doReadAllSync(); | 49 | .doReadAllSync(); |
| 50 | } | 50 | } |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/package-info.java
yudao-framework/yudao-spring-boot-starter-monitor/pom.xml
| @@ -44,29 +44,35 @@ | @@ -44,29 +44,35 @@ | ||
| 44 | <dependency> | 44 | <dependency> |
| 45 | <groupId>io.opentracing</groupId> | 45 | <groupId>io.opentracing</groupId> |
| 46 | <artifactId>opentracing-util</artifactId> | 46 | <artifactId>opentracing-util</artifactId> |
| 47 | + <optional>true</optional> | ||
| 47 | </dependency> | 48 | </dependency> |
| 48 | <dependency> | 49 | <dependency> |
| 49 | <groupId>org.apache.skywalking</groupId> | 50 | <groupId>org.apache.skywalking</groupId> |
| 50 | <artifactId>apm-toolkit-trace</artifactId> | 51 | <artifactId>apm-toolkit-trace</artifactId> |
| 52 | + <optional>true</optional> | ||
| 51 | </dependency> | 53 | </dependency> |
| 52 | <dependency> | 54 | <dependency> |
| 53 | <groupId>org.apache.skywalking</groupId> | 55 | <groupId>org.apache.skywalking</groupId> |
| 54 | <artifactId>apm-toolkit-logback-1.x</artifactId> | 56 | <artifactId>apm-toolkit-logback-1.x</artifactId> |
| 57 | + <optional>true</optional> | ||
| 55 | </dependency> | 58 | </dependency> |
| 56 | <dependency> | 59 | <dependency> |
| 57 | <groupId>org.apache.skywalking</groupId> | 60 | <groupId>org.apache.skywalking</groupId> |
| 58 | <artifactId>apm-toolkit-opentracing</artifactId> | 61 | <artifactId>apm-toolkit-opentracing</artifactId> |
| 62 | + <optional>true</optional> | ||
| 59 | </dependency> | 63 | </dependency> |
| 60 | 64 | ||
| 61 | <!-- Micrometer 对 Prometheus 的支持 --> | 65 | <!-- Micrometer 对 Prometheus 的支持 --> |
| 62 | <dependency> | 66 | <dependency> |
| 63 | <groupId>io.micrometer</groupId> | 67 | <groupId>io.micrometer</groupId> |
| 64 | <artifactId>micrometer-registry-prometheus</artifactId> | 68 | <artifactId>micrometer-registry-prometheus</artifactId> |
| 69 | + <optional>true</optional> | ||
| 65 | </dependency> | 70 | </dependency> |
| 66 | 71 | ||
| 67 | <dependency> | 72 | <dependency> |
| 68 | <groupId>de.codecentric</groupId> | 73 | <groupId>de.codecentric</groupId> |
| 69 | - <artifactId>spring-boot-admin-starter-client</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | 74 | + <artifactId>spring-boot-admin-starter-client</artifactId> <!-- 实现 Spring Boot Admin Client 客户端 --> |
| 75 | + <optional>true</optional> | ||
| 70 | </dependency> | 76 | </dependency> |
| 71 | </dependencies> | 77 | </dependencies> |
| 72 | 78 |
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java
| @@ -3,6 +3,9 @@ package cn.iocoder.yudao.framework.tracer.config; | @@ -3,6 +3,9 @@ package cn.iocoder.yudao.framework.tracer.config; | ||
| 3 | import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; | 3 | import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; |
| 4 | import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect; | 4 | import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect; |
| 5 | import cn.iocoder.yudao.framework.tracer.core.filter.TraceFilter; | 5 | import cn.iocoder.yudao.framework.tracer.core.filter.TraceFilter; |
| 6 | +import io.opentracing.Tracer; | ||
| 7 | +import io.opentracing.util.GlobalTracer; | ||
| 8 | +import org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer; | ||
| 6 | import org.springframework.boot.autoconfigure.AutoConfiguration; | 9 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| 8 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| @@ -16,30 +19,32 @@ import org.springframework.context.annotation.Bean; | @@ -16,30 +19,32 @@ import org.springframework.context.annotation.Bean; | ||
| 16 | * @author mashu | 19 | * @author mashu |
| 17 | */ | 20 | */ |
| 18 | @AutoConfiguration | 21 | @AutoConfiguration |
| 19 | -@ConditionalOnClass({BizTraceAspect.class}) | 22 | +@ConditionalOnClass(name = { |
| 23 | + "org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer", | ||
| 24 | + "io.opentracing.Tracer" | ||
| 25 | +}) | ||
| 20 | @EnableConfigurationProperties(TracerProperties.class) | 26 | @EnableConfigurationProperties(TracerProperties.class) |
| 21 | @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) | 27 | @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) |
| 22 | public class YudaoTracerAutoConfiguration { | 28 | public class YudaoTracerAutoConfiguration { |
| 23 | 29 | ||
| 24 | - // TODO @芋艿:重要。目前 opentracing 版本存在冲突,要么保证 skywalking,要么保证阿里云短信 sdk | ||
| 25 | -// @Bean | ||
| 26 | -// public TracerProperties bizTracerProperties() { | ||
| 27 | -// return new TracerProperties(); | ||
| 28 | -// } | ||
| 29 | -// | ||
| 30 | -// @Bean | ||
| 31 | -// public BizTraceAspect bizTracingAop() { | ||
| 32 | -// return new BizTraceAspect(tracer()); | ||
| 33 | -// } | ||
| 34 | -// | ||
| 35 | -// @Bean | ||
| 36 | -// public Tracer tracer() { | ||
| 37 | -// // 创建 SkywalkingTracer 对象 | ||
| 38 | -// SkywalkingTracer tracer = new SkywalkingTracer(); | ||
| 39 | -// // 设置为 GlobalTracer 的追踪器 | ||
| 40 | -// GlobalTracer.register(tracer); | ||
| 41 | -// return tracer; | ||
| 42 | -// } | 30 | + @Bean |
| 31 | + public TracerProperties bizTracerProperties() { | ||
| 32 | + return new TracerProperties(); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + @Bean | ||
| 36 | + public BizTraceAspect bizTracingAop() { | ||
| 37 | + return new BizTraceAspect(tracer()); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Bean | ||
| 41 | + public Tracer tracer() { | ||
| 42 | + // 创建 SkywalkingTracer 对象 | ||
| 43 | + SkywalkingTracer tracer = new SkywalkingTracer(); | ||
| 44 | + // 设置为 GlobalTracer 的追踪器 | ||
| 45 | + GlobalTracer.registerIfAbsent(tracer); | ||
| 46 | + return tracer; | ||
| 47 | + } | ||
| 43 | 48 | ||
| 44 | /** | 49 | /** |
| 45 | * 创建 TraceFilter 过滤器,响应 header 设置 traceId | 50 | * 创建 TraceFilter 过滤器,响应 header 设置 traceId |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/MPJLambdaWrapperX.java
| @@ -118,7 +118,6 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -118,7 +118,6 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 118 | 118 | ||
| 119 | @Override | 119 | @Override |
| 120 | public <X> MPJLambdaWrapperX<T> orderByDesc(SFunction<X, ?> column) { | 120 | public <X> MPJLambdaWrapperX<T> orderByDesc(SFunction<X, ?> column) { |
| 121 | - //noinspection unchecked | ||
| 122 | super.orderByDesc(true, column); | 121 | super.orderByDesc(true, column); |
| 123 | return this; | 122 | return this; |
| 124 | } | 123 | } |
| @@ -208,7 +207,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -208,7 +207,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 208 | } | 207 | } |
| 209 | 208 | ||
| 210 | @Override | 209 | @Override |
| 211 | - public <S, X> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, String alias) { | 210 | + public <S> MPJLambdaWrapperX<T> selectCount(SFunction<S, ?> column, String alias) { |
| 212 | super.selectCount(column, alias); | 211 | super.selectCount(column, alias); |
| 213 | return this; | 212 | return this; |
| 214 | } | 213 | } |
| @@ -226,7 +225,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -226,7 +225,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 226 | } | 225 | } |
| 227 | 226 | ||
| 228 | @Override | 227 | @Override |
| 229 | - public <S, X> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, String alias) { | 228 | + public <S> MPJLambdaWrapperX<T> selectSum(SFunction<S, ?> column, String alias) { |
| 230 | super.selectSum(column, alias); | 229 | super.selectSum(column, alias); |
| 231 | return this; | 230 | return this; |
| 232 | } | 231 | } |
| @@ -244,7 +243,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -244,7 +243,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 244 | } | 243 | } |
| 245 | 244 | ||
| 246 | @Override | 245 | @Override |
| 247 | - public <S, X> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, String alias) { | 246 | + public <S> MPJLambdaWrapperX<T> selectMax(SFunction<S, ?> column, String alias) { |
| 248 | super.selectMax(column, alias); | 247 | super.selectMax(column, alias); |
| 249 | return this; | 248 | return this; |
| 250 | } | 249 | } |
| @@ -262,7 +261,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -262,7 +261,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 262 | } | 261 | } |
| 263 | 262 | ||
| 264 | @Override | 263 | @Override |
| 265 | - public <S, X> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, String alias) { | 264 | + public <S> MPJLambdaWrapperX<T> selectMin(SFunction<S, ?> column, String alias) { |
| 266 | super.selectMin(column, alias); | 265 | super.selectMin(column, alias); |
| 267 | return this; | 266 | return this; |
| 268 | } | 267 | } |
| @@ -280,7 +279,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -280,7 +279,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 280 | } | 279 | } |
| 281 | 280 | ||
| 282 | @Override | 281 | @Override |
| 283 | - public <S, X> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, String alias) { | 282 | + public <S> MPJLambdaWrapperX<T> selectAvg(SFunction<S, ?> column, String alias) { |
| 284 | super.selectAvg(column, alias); | 283 | super.selectAvg(column, alias); |
| 285 | return this; | 284 | return this; |
| 286 | } | 285 | } |
| @@ -298,7 +297,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | @@ -298,7 +297,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { | ||
| 298 | } | 297 | } |
| 299 | 298 | ||
| 300 | @Override | 299 | @Override |
| 301 | - public <S, X> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, String alias) { | 300 | + public <S> MPJLambdaWrapperX<T> selectLen(SFunction<S, ?> column, String alias) { |
| 302 | super.selectLen(column, alias); | 301 | super.selectLen(column, alias); |
| 303 | return this; | 302 | return this; |
| 304 | } | 303 | } |
yudao-framework/yudao-spring-boot-starter-web/pom.xml
| @@ -53,7 +53,13 @@ | @@ -53,7 +53,13 @@ | ||
| 53 | <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> | 53 | <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> |
| 54 | </dependency> | 54 | </dependency> |
| 55 | 55 | ||
| 56 | - <!-- xss --> | 56 | + <!-- 工具类相关 --> |
| 57 | + <dependency> | ||
| 58 | + <groupId>com.google.guava</groupId> | ||
| 59 | + <artifactId>guava</artifactId> | ||
| 60 | + <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 --> | ||
| 61 | + </dependency> | ||
| 62 | + | ||
| 57 | <dependency> | 63 | <dependency> |
| 58 | <groupId>org.jsoup</groupId> | 64 | <groupId>org.jsoup</groupId> |
| 59 | <artifactId>jsoup</artifactId> | 65 | <artifactId>jsoup</artifactId> |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyFilter.java
| 1 | package cn.iocoder.yudao.framework.web.core.filter; | 1 | package cn.iocoder.yudao.framework.web.core.filter; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.util.StrUtil; | ||
| 3 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | 4 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 4 | import org.springframework.web.filter.OncePerRequestFilter; | 5 | import org.springframework.web.filter.OncePerRequestFilter; |
| 5 | 6 | ||
| @@ -16,6 +17,14 @@ import java.io.IOException; | @@ -16,6 +17,14 @@ import java.io.IOException; | ||
| 16 | */ | 17 | */ |
| 17 | public class CacheRequestBodyFilter extends OncePerRequestFilter { | 18 | public class CacheRequestBodyFilter extends OncePerRequestFilter { |
| 18 | 19 | ||
| 20 | + /** | ||
| 21 | + * 需要排除的 URI | ||
| 22 | + * | ||
| 23 | + * 1. 排除 Spring Boot Admin 相关请求,避免客户端连接中断导致的异常。 | ||
| 24 | + * 例如说:<a href="https://github.com/YunaiV/ruoyi-vue-pro/issues/795">795 ISSUE</a> | ||
| 25 | + */ | ||
| 26 | + private static final String[] IGNORE_URIS = {"/admin/", "/actuator/"}; | ||
| 27 | + | ||
| 19 | @Override | 28 | @Override |
| 20 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) | 29 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) |
| 21 | throws IOException, ServletException { | 30 | throws IOException, ServletException { |
| @@ -24,7 +33,13 @@ public class CacheRequestBodyFilter extends OncePerRequestFilter { | @@ -24,7 +33,13 @@ public class CacheRequestBodyFilter extends OncePerRequestFilter { | ||
| 24 | 33 | ||
| 25 | @Override | 34 | @Override |
| 26 | protected boolean shouldNotFilter(HttpServletRequest request) { | 35 | protected boolean shouldNotFilter(HttpServletRequest request) { |
| 27 | - // 只处理 json 请求内容 | 36 | + // 1. 校验是否为排除的 URL |
| 37 | + String requestURI = request.getRequestURI(); | ||
| 38 | + if (StrUtil.startWithAny(requestURI, IGNORE_URIS)) { | ||
| 39 | + return true; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + // 2. 只处理 json 请求内容 | ||
| 28 | return !ServletUtils.isJsonRequest(request); | 43 | return !ServletUtils.isJsonRequest(request); |
| 29 | } | 44 | } |
| 30 | 45 |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
| @@ -5,7 +5,6 @@ import cn.hutool.core.exceptions.ExceptionUtil; | @@ -5,7 +5,6 @@ import cn.hutool.core.exceptions.ExceptionUtil; | ||
| 5 | import cn.hutool.core.map.MapUtil; | 5 | import cn.hutool.core.map.MapUtil; |
| 6 | import cn.hutool.core.util.ObjUtil; | 6 | import cn.hutool.core.util.ObjUtil; |
| 7 | import cn.hutool.core.util.StrUtil; | 7 | import cn.hutool.core.util.StrUtil; |
| 8 | -import cn.hutool.extra.servlet.JakartaServletUtil; | ||
| 9 | import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi; | 8 | import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi; |
| 10 | import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; | 9 | import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; |
| 11 | import cn.iocoder.yudao.framework.common.exception.ServiceException; | 10 | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| @@ -17,6 +16,7 @@ import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; | @@ -17,6 +16,7 @@ import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; | ||
| 17 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | 16 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 18 | import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; | 17 | import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; |
| 19 | import com.fasterxml.jackson.databind.exc.InvalidFormatException; | 18 | import com.fasterxml.jackson.databind.exc.InvalidFormatException; |
| 19 | +import com.google.common.util.concurrent.UncheckedExecutionException; | ||
| 20 | import jakarta.servlet.http.HttpServletRequest; | 20 | import jakarta.servlet.http.HttpServletRequest; |
| 21 | import jakarta.validation.ConstraintViolation; | 21 | import jakarta.validation.ConstraintViolation; |
| 22 | import jakarta.validation.ConstraintViolationException; | 22 | import jakarta.validation.ConstraintViolationException; |
| @@ -111,6 +111,9 @@ public class GlobalExceptionHandler { | @@ -111,6 +111,9 @@ public class GlobalExceptionHandler { | ||
| 111 | if (ex instanceof AccessDeniedException) { | 111 | if (ex instanceof AccessDeniedException) { |
| 112 | return accessDeniedExceptionHandler(request, (AccessDeniedException) ex); | 112 | return accessDeniedExceptionHandler(request, (AccessDeniedException) ex); |
| 113 | } | 113 | } |
| 114 | + if (ex instanceof UncheckedExecutionException && ex.getCause() != ex) { | ||
| 115 | + return allExceptionHandler(request, ex.getCause()); | ||
| 116 | + } | ||
| 114 | return defaultExceptionHandler(request, ex); | 117 | return defaultExceptionHandler(request, ex); |
| 115 | } | 118 | } |
| 116 | 119 | ||
| @@ -267,6 +270,16 @@ public class GlobalExceptionHandler { | @@ -267,6 +270,16 @@ public class GlobalExceptionHandler { | ||
| 267 | } | 270 | } |
| 268 | 271 | ||
| 269 | /** | 272 | /** |
| 273 | + * 处理 Guava UncheckedExecutionException | ||
| 274 | + * | ||
| 275 | + * 例如说,缓存加载报错,可见 <a href="https://t.zsxq.com/UszdH">https://t.zsxq.com/UszdH</a> | ||
| 276 | + */ | ||
| 277 | + @ExceptionHandler(value = UncheckedExecutionException.class) | ||
| 278 | + public CommonResult<?> uncheckedExecutionExceptionHandler(HttpServletRequest req, UncheckedExecutionException ex) { | ||
| 279 | + return allExceptionHandler(req, ex.getCause()); | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + /** | ||
| 270 | * 处理业务异常 ServiceException | 283 | * 处理业务异常 ServiceException |
| 271 | * | 284 | * |
| 272 | * 例如说,商品库存不足,用户手机号已存在。 | 285 | * 例如说,商品库存不足,用户手机号已存在。 |
| @@ -344,12 +357,12 @@ public class GlobalExceptionHandler { | @@ -344,12 +357,12 @@ public class GlobalExceptionHandler { | ||
| 344 | errorLog.setApplicationName(applicationName); | 357 | errorLog.setApplicationName(applicationName); |
| 345 | errorLog.setRequestUrl(request.getRequestURI()); | 358 | errorLog.setRequestUrl(request.getRequestURI()); |
| 346 | Map<String, Object> requestParams = MapUtil.<String, Object>builder() | 359 | Map<String, Object> requestParams = MapUtil.<String, Object>builder() |
| 347 | - .put("query", JakartaServletUtil.getParamMap(request)) | ||
| 348 | - .put("body", JakartaServletUtil.getBody(request)).build(); | 360 | + .put("query", ServletUtils.getParamMap(request)) |
| 361 | + .put("body", ServletUtils.getBody(request)).build(); | ||
| 349 | errorLog.setRequestParams(JsonUtils.toJsonString(requestParams)); | 362 | errorLog.setRequestParams(JsonUtils.toJsonString(requestParams)); |
| 350 | errorLog.setRequestMethod(request.getMethod()); | 363 | errorLog.setRequestMethod(request.getMethod()); |
| 351 | errorLog.setUserAgent(ServletUtils.getUserAgent(request)); | 364 | errorLog.setUserAgent(ServletUtils.getUserAgent(request)); |
| 352 | - errorLog.setUserIp(JakartaServletUtil.getClientIP(request)); | 365 | + errorLog.setUserIp(ServletUtils.getClientIP(request)); |
| 353 | errorLog.setExceptionTime(LocalDateTime.now()); | 366 | errorLog.setExceptionTime(LocalDateTime.now()); |
| 354 | } | 367 | } |
| 355 | 368 |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java
| @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.xss.core.clean.JsoupXssCleaner; | @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.xss.core.clean.JsoupXssCleaner; | ||
| 5 | import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; | 5 | import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; |
| 6 | import cn.iocoder.yudao.framework.xss.core.filter.XssFilter; | 6 | import cn.iocoder.yudao.framework.xss.core.filter.XssFilter; |
| 7 | import cn.iocoder.yudao.framework.xss.core.json.XssStringJsonDeserializer; | 7 | import cn.iocoder.yudao.framework.xss.core.json.XssStringJsonDeserializer; |
| 8 | -import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 9 | import org.springframework.boot.autoconfigure.AutoConfiguration; | 8 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; |
| 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| @@ -42,13 +41,13 @@ public class YudaoXssAutoConfiguration implements WebMvcConfigurer { | @@ -42,13 +41,13 @@ public class YudaoXssAutoConfiguration implements WebMvcConfigurer { | ||
| 42 | */ | 41 | */ |
| 43 | @Bean | 42 | @Bean |
| 44 | @ConditionalOnMissingBean(name = "xssJacksonCustomizer") | 43 | @ConditionalOnMissingBean(name = "xssJacksonCustomizer") |
| 45 | - @ConditionalOnBean(ObjectMapper.class) | ||
| 46 | @ConditionalOnProperty(value = "yudao.xss.enable", havingValue = "true") | 44 | @ConditionalOnProperty(value = "yudao.xss.enable", havingValue = "true") |
| 47 | public Jackson2ObjectMapperBuilderCustomizer xssJacksonCustomizer(XssProperties properties, | 45 | public Jackson2ObjectMapperBuilderCustomizer xssJacksonCustomizer(XssProperties properties, |
| 48 | PathMatcher pathMatcher, | 46 | PathMatcher pathMatcher, |
| 49 | XssCleaner xssCleaner) { | 47 | XssCleaner xssCleaner) { |
| 50 | // 在反序列化时进行 xss 过滤,可以替换使用 XssStringJsonSerializer,在序列化时进行处理 | 48 | // 在反序列化时进行 xss 过滤,可以替换使用 XssStringJsonSerializer,在序列化时进行处理 |
| 51 | - return builder -> builder.deserializerByType(String.class, new XssStringJsonDeserializer(properties, pathMatcher, xssCleaner)); | 49 | + return builder -> |
| 50 | + builder.deserializerByType(String.class, new XssStringJsonDeserializer(properties, pathMatcher, xssCleaner)); | ||
| 52 | } | 51 | } |
| 53 | 52 | ||
| 54 | /** | 53 | /** |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatConversationController.java
| @@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatCo | @@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.ai.controller.admin.chat.vo.conversation.AiChatCo | ||
| 12 | import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; | 12 | import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; |
| 13 | import cn.iocoder.yudao.module.ai.service.chat.AiChatConversationService; | 13 | import cn.iocoder.yudao.module.ai.service.chat.AiChatConversationService; |
| 14 | import cn.iocoder.yudao.module.ai.service.chat.AiChatMessageService; | 14 | import cn.iocoder.yudao.module.ai.service.chat.AiChatMessageService; |
| 15 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 15 | import io.swagger.v3.oas.annotations.Operation; | 16 | import io.swagger.v3.oas.annotations.Operation; |
| 16 | import io.swagger.v3.oas.annotations.Parameter; | 17 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | import io.swagger.v3.oas.annotations.tags.Tag; | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -54,6 +55,7 @@ public class AiChatConversationController { | @@ -54,6 +55,7 @@ public class AiChatConversationController { | ||
| 54 | 55 | ||
| 55 | @GetMapping("/my-list") | 56 | @GetMapping("/my-list") |
| 56 | @Operation(summary = "获得【我的】聊天对话列表") | 57 | @Operation(summary = "获得【我的】聊天对话列表") |
| 58 | + @TransMethodResult | ||
| 57 | public CommonResult<List<AiChatConversationRespVO>> getChatConversationMyList() { | 59 | public CommonResult<List<AiChatConversationRespVO>> getChatConversationMyList() { |
| 58 | List<AiChatConversationDO> list = chatConversationService.getChatConversationListByUserId(getLoginUserId()); | 60 | List<AiChatConversationDO> list = chatConversationService.getChatConversationListByUserId(getLoginUserId()); |
| 59 | return success(BeanUtils.toBean(list, AiChatConversationRespVO.class)); | 61 | return success(BeanUtils.toBean(list, AiChatConversationRespVO.class)); |
| @@ -62,6 +64,7 @@ public class AiChatConversationController { | @@ -62,6 +64,7 @@ public class AiChatConversationController { | ||
| 62 | @GetMapping("/get-my") | 64 | @GetMapping("/get-my") |
| 63 | @Operation(summary = "获得【我的】聊天对话") | 65 | @Operation(summary = "获得【我的】聊天对话") |
| 64 | @Parameter(name = "id", required = true, description = "对话编号", example = "1024") | 66 | @Parameter(name = "id", required = true, description = "对话编号", example = "1024") |
| 67 | + @TransMethodResult | ||
| 65 | public CommonResult<AiChatConversationRespVO> getChatConversationMy(@RequestParam("id") Long id) { | 68 | public CommonResult<AiChatConversationRespVO> getChatConversationMy(@RequestParam("id") Long id) { |
| 66 | AiChatConversationDO conversation = chatConversationService.getChatConversation(id); | 69 | AiChatConversationDO conversation = chatConversationService.getChatConversation(id); |
| 67 | if (conversation != null && ObjUtil.notEqual(conversation.getUserId(), getLoginUserId())) { | 70 | if (conversation != null && ObjUtil.notEqual(conversation.getUserId(), getLoginUserId())) { |
| @@ -90,6 +93,7 @@ public class AiChatConversationController { | @@ -90,6 +93,7 @@ public class AiChatConversationController { | ||
| 90 | @GetMapping("/page") | 93 | @GetMapping("/page") |
| 91 | @Operation(summary = "获得对话分页", description = "用于【对话管理】菜单") | 94 | @Operation(summary = "获得对话分页", description = "用于【对话管理】菜单") |
| 92 | @PreAuthorize("@ss.hasPermission('ai:chat-conversation:query')") | 95 | @PreAuthorize("@ss.hasPermission('ai:chat-conversation:query')") |
| 96 | + @TransMethodResult | ||
| 93 | public CommonResult<PageResult<AiChatConversationRespVO>> getChatConversationPage(AiChatConversationPageReqVO pageReqVO) { | 97 | public CommonResult<PageResult<AiChatConversationRespVO>> getChatConversationPage(AiChatConversationPageReqVO pageReqVO) { |
| 94 | PageResult<AiChatConversationDO> pageResult = chatConversationService.getChatConversationPage(pageReqVO); | 98 | PageResult<AiChatConversationDO> pageResult = chatConversationService.getChatConversationPage(pageReqVO); |
| 95 | if (CollUtil.isEmpty(pageResult.getList())) { | 99 | if (CollUtil.isEmpty(pageResult.getList())) { |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/model/AiChatRoleController.java
| @@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleS | @@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleS | ||
| 10 | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleSaveReqVO; | 10 | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleSaveReqVO; |
| 11 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; | 11 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; |
| 12 | import cn.iocoder.yudao.module.ai.service.model.AiChatRoleService; | 12 | import cn.iocoder.yudao.module.ai.service.model.AiChatRoleService; |
| 13 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 13 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | import io.swagger.v3.oas.annotations.Parameter; | 15 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | import io.swagger.v3.oas.annotations.tags.Tag; | 16 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -35,6 +36,7 @@ public class AiChatRoleController { | @@ -35,6 +36,7 @@ public class AiChatRoleController { | ||
| 35 | 36 | ||
| 36 | @GetMapping("/my-page") | 37 | @GetMapping("/my-page") |
| 37 | @Operation(summary = "获得【我的】聊天角色分页") | 38 | @Operation(summary = "获得【我的】聊天角色分页") |
| 39 | + @TransMethodResult | ||
| 38 | public CommonResult<PageResult<AiChatRoleRespVO>> getChatRoleMyPage(@Valid AiChatRolePageReqVO pageReqVO) { | 40 | public CommonResult<PageResult<AiChatRoleRespVO>> getChatRoleMyPage(@Valid AiChatRolePageReqVO pageReqVO) { |
| 39 | PageResult<AiChatRoleDO> pageResult = chatRoleService.getChatRoleMyPage(pageReqVO, getLoginUserId()); | 41 | PageResult<AiChatRoleDO> pageResult = chatRoleService.getChatRoleMyPage(pageReqVO, getLoginUserId()); |
| 40 | return success(BeanUtils.toBean(pageResult, AiChatRoleRespVO.class)); | 42 | return success(BeanUtils.toBean(pageResult, AiChatRoleRespVO.class)); |
| @@ -43,6 +45,7 @@ public class AiChatRoleController { | @@ -43,6 +45,7 @@ public class AiChatRoleController { | ||
| 43 | @GetMapping("/get-my") | 45 | @GetMapping("/get-my") |
| 44 | @Operation(summary = "获得【我的】聊天角色") | 46 | @Operation(summary = "获得【我的】聊天角色") |
| 45 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 47 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 48 | + @TransMethodResult | ||
| 46 | public CommonResult<AiChatRoleRespVO> getChatRoleMy(@RequestParam("id") Long id) { | 49 | public CommonResult<AiChatRoleRespVO> getChatRoleMy(@RequestParam("id") Long id) { |
| 47 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); | 50 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); |
| 48 | if (ObjUtil.notEqual(chatRole.getUserId(), getLoginUserId())) { | 51 | if (ObjUtil.notEqual(chatRole.getUserId(), getLoginUserId())) { |
| @@ -108,6 +111,7 @@ public class AiChatRoleController { | @@ -108,6 +111,7 @@ public class AiChatRoleController { | ||
| 108 | @Operation(summary = "获得聊天角色") | 111 | @Operation(summary = "获得聊天角色") |
| 109 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 112 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 110 | @PreAuthorize("@ss.hasPermission('ai:chat-role:query')") | 113 | @PreAuthorize("@ss.hasPermission('ai:chat-role:query')") |
| 114 | + @TransMethodResult | ||
| 111 | public CommonResult<AiChatRoleRespVO> getChatRole(@RequestParam("id") Long id) { | 115 | public CommonResult<AiChatRoleRespVO> getChatRole(@RequestParam("id") Long id) { |
| 112 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); | 116 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); |
| 113 | return success(BeanUtils.toBean(chatRole, AiChatRoleRespVO.class)); | 117 | return success(BeanUtils.toBean(chatRole, AiChatRoleRespVO.class)); |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionRespVO.java
| 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression; | 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelProperty; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 | ||
| @@ -27,4 +27,4 @@ public class BpmProcessExpressionRespVO { | @@ -27,4 +27,4 @@ public class BpmProcessExpressionRespVO { | ||
| 27 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | 27 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 28 | private LocalDateTime createTime; | 28 | private LocalDateTime createTime; |
| 29 | 29 | ||
| 30 | -} | ||
| 31 | \ No newline at end of file | 30 | \ No newline at end of file |
| 31 | +} |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java
| @@ -40,7 +40,7 @@ public interface ErrorCodeConstants { | @@ -40,7 +40,7 @@ public interface ErrorCodeConstants { | ||
| 40 | ErrorCode PROCESS_INSTANCE_START_USER_SELECT_ASSIGNEES_NOT_EXISTS = new ErrorCode(1_009_004_004, "任务({})的候选人({})不存在"); | 40 | ErrorCode PROCESS_INSTANCE_START_USER_SELECT_ASSIGNEES_NOT_EXISTS = new ErrorCode(1_009_004_004, "任务({})的候选人({})不存在"); |
| 41 | ErrorCode PROCESS_INSTANCE_START_USER_CAN_START = new ErrorCode(1_009_004_005, "发起流程失败,你没有权限发起该流程"); | 41 | ErrorCode PROCESS_INSTANCE_START_USER_CAN_START = new ErrorCode(1_009_004_005, "发起流程失败,你没有权限发起该流程"); |
| 42 | ErrorCode PROCESS_INSTANCE_CANCEL_FAIL_NOT_ALLOW = new ErrorCode(1_009_004_005, "流程取消失败,该流程不允许取消"); | 42 | ErrorCode PROCESS_INSTANCE_CANCEL_FAIL_NOT_ALLOW = new ErrorCode(1_009_004_005, "流程取消失败,该流程不允许取消"); |
| 43 | - ErrorCode PROCESS_INSTANCE_HTTP_TRIGGER_CALL_ERROR = new ErrorCode(1_009_004_006, "流程 Http 触发器请求调用失败"); | 43 | + ErrorCode PROCESS_INSTANCE_HTTP_CALL_ERROR = new ErrorCode(1_009_004_006, "流程 Http 请求调用失败"); |
| 44 | ErrorCode PROCESS_INSTANCE_APPROVE_USER_SELECT_ASSIGNEES_NOT_CONFIG = new ErrorCode(1_009_004_007, "下一个任务({})的审批人未配置"); | 44 | ErrorCode PROCESS_INSTANCE_APPROVE_USER_SELECT_ASSIGNEES_NOT_CONFIG = new ErrorCode(1_009_004_007, "下一个任务({})的审批人未配置"); |
| 45 | ErrorCode PROCESS_INSTANCE_CANCEL_CHILD_FAIL_NOT_ALLOW = new ErrorCode(1_009_004_008, "子流程取消失败,子流程不允许取消"); | 45 | ErrorCode PROCESS_INSTANCE_CANCEL_CHILD_FAIL_NOT_ALLOW = new ErrorCode(1_009_004_008, "子流程取消失败,子流程不允许取消"); |
| 46 | 46 | ||
| @@ -58,7 +58,6 @@ public interface ErrorCodeConstants { | @@ -58,7 +58,6 @@ public interface ErrorCodeConstants { | ||
| 58 | ErrorCode TASK_SIGN_DELETE_NO_PARENT = new ErrorCode(1_009_005_012, "任务减签失败,被减签的任务必须是通过加签生成的任务"); | 58 | ErrorCode TASK_SIGN_DELETE_NO_PARENT = new ErrorCode(1_009_005_012, "任务减签失败,被减签的任务必须是通过加签生成的任务"); |
| 59 | ErrorCode TASK_TRANSFER_FAIL_USER_REPEAT = new ErrorCode(1_009_005_013, "任务转办失败,转办人和当前审批人为同一人"); | 59 | ErrorCode TASK_TRANSFER_FAIL_USER_REPEAT = new ErrorCode(1_009_005_013, "任务转办失败,转办人和当前审批人为同一人"); |
| 60 | ErrorCode TASK_TRANSFER_FAIL_USER_NOT_EXISTS = new ErrorCode(1_009_005_014, "任务转办失败,转办人不存在"); | 60 | ErrorCode TASK_TRANSFER_FAIL_USER_NOT_EXISTS = new ErrorCode(1_009_005_014, "任务转办失败,转办人不存在"); |
| 61 | - ErrorCode TASK_CREATE_FAIL_NO_CANDIDATE_USER = new ErrorCode(1_009_006_003, "操作失败,原因:找不到任务的审批人!"); | ||
| 62 | ErrorCode TASK_SIGNATURE_NOT_EXISTS = new ErrorCode(1_009_005_015, "签名不能为空!"); | 61 | ErrorCode TASK_SIGNATURE_NOT_EXISTS = new ErrorCode(1_009_005_015, "签名不能为空!"); |
| 63 | ErrorCode TASK_REASON_REQUIRE = new ErrorCode(1_009_005_016, "审批意见不能为空!"); | 62 | ErrorCode TASK_REASON_REQUIRE = new ErrorCode(1_009_005_016, "审批意见不能为空!"); |
| 64 | ErrorCode TASK_WITHDRAW_FAIL_PROCESS_NOT_RUNNING = new ErrorCode(1_009_005_017, "撤回失败,流程实例未运行!"); | 63 | ErrorCode TASK_WITHDRAW_FAIL_PROCESS_NOT_RUNNING = new ErrorCode(1_009_005_017, "撤回失败,流程实例未运行!"); |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmParallelMultiInstanceBehavior.java
| @@ -7,44 +7,35 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | @@ -7,44 +7,35 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | ||
| 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; | 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; | 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; |
| 9 | import lombok.Setter; | 9 | import lombok.Setter; |
| 10 | -import org.flowable.bpmn.model.Activity; | ||
| 11 | -import org.flowable.bpmn.model.CallActivity; | ||
| 12 | -import org.flowable.bpmn.model.FlowElement; | ||
| 13 | -import org.flowable.bpmn.model.UserTask; | 10 | +import org.flowable.bpmn.model.*; |
| 14 | import org.flowable.engine.delegate.DelegateExecution; | 11 | import org.flowable.engine.delegate.DelegateExecution; |
| 15 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; | 12 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; |
| 16 | -import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior; | 13 | +import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior; |
| 14 | +import org.flowable.engine.impl.persistence.entity.ExecutionEntity; | ||
| 17 | 15 | ||
| 18 | import java.util.List; | 16 | import java.util.List; |
| 19 | import java.util.Set; | 17 | import java.util.Set; |
| 20 | 18 | ||
| 21 | /** | 19 | /** |
| 22 | - * 自定义的【并行】的【多个】流程任务的 assignee 负责人的分配 | ||
| 23 | - * 第一步,基于分配规则,计算出分配任务的【多个】候选人们。 | ||
| 24 | - * 第二步,将【多个】任务候选人们,设置到 DelegateExecution 的 collectionVariable 变量中,以便 BpmUserTaskActivityBehavior 使用它 | 20 | + * 自定义的【串行】的【多个】流程任务的 assignee 负责人的分配 |
| 25 | * | 21 | * |
| 26 | - * @author kemengkai | ||
| 27 | - * @since 2022-04-21 16:57 | 22 | + * 本质上,实现和 {@link BpmParallelMultiInstanceBehavior} 一样,只是继承的类不一样 |
| 23 | + * | ||
| 24 | + * @author 芋道源码 | ||
| 28 | */ | 25 | */ |
| 29 | @Setter | 26 | @Setter |
| 30 | -public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehavior { | 27 | +public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceBehavior { |
| 31 | 28 | ||
| 32 | private BpmTaskCandidateInvoker taskCandidateInvoker; | 29 | private BpmTaskCandidateInvoker taskCandidateInvoker; |
| 33 | 30 | ||
| 34 | - public BpmParallelMultiInstanceBehavior(Activity activity, | ||
| 35 | - AbstractBpmnActivityBehavior innerActivityBehavior) { | 31 | + public BpmSequentialMultiInstanceBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior) { |
| 36 | super(activity, innerActivityBehavior); | 32 | super(activity, innerActivityBehavior); |
| 37 | } | 33 | } |
| 38 | 34 | ||
| 39 | /** | 35 | /** |
| 40 | - * 重写该方法,主要实现两个功能: | ||
| 41 | - * 1. 忽略原有的 collectionVariable、collectionElementVariable 表达式,而是采用自己定义的 | ||
| 42 | - * 2. 获得任务的处理人,并设置到 collectionVariable 中,用于 BpmUserTaskActivityBehavior 从中可以获取任务的处理人 | ||
| 43 | - * | ||
| 44 | - * 注意,多个任务实例,每个任务实例对应一个处理人,所以返回的数量就是任务处理人的数量 | 36 | + * 逻辑和 {@link BpmParallelMultiInstanceBehavior#resolveNrOfInstances(DelegateExecution)} 类似 |
| 45 | * | 37 | * |
| 46 | - * @param execution 执行任务 | ||
| 47 | - * @return 数量 | 38 | + * 差异的点:是在【第二步】的时候,需要返回 LinkedHashSet 集合!因为它需要有序! |
| 48 | */ | 39 | */ |
| 49 | @Override | 40 | @Override |
| 50 | protected int resolveNrOfInstances(DelegateExecution execution) { | 41 | protected int resolveNrOfInstances(DelegateExecution execution) { |
| @@ -58,8 +49,9 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav | @@ -58,8 +49,9 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav | ||
| 58 | super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); | 49 | super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); |
| 59 | 50 | ||
| 60 | // 第二步,获取任务的所有处理人 | 51 | // 第二步,获取任务的所有处理人 |
| 52 | + // 不使用 execution.getVariable 原因:目前依次审批任务回退后 collectionVariable 变量没有清理, 如果重新进入该任务不会重新分配审批人 | ||
| 61 | @SuppressWarnings("unchecked") | 53 | @SuppressWarnings("unchecked") |
| 62 | - Set<Long> assigneeUserIds = (Set<Long>) execution.getVariable(super.collectionVariable, Set.class); | 54 | + Set<Long> assigneeUserIds = (Set<Long>) execution.getVariableLocal(super.collectionVariable, Set.class); |
| 63 | if (assigneeUserIds == null) { | 55 | if (assigneeUserIds == null) { |
| 64 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); | 56 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); |
| 65 | if (CollUtil.isEmpty(assigneeUserIds)) { | 57 | if (CollUtil.isEmpty(assigneeUserIds)) { |
| @@ -88,4 +80,19 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav | @@ -88,4 +80,19 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav | ||
| 88 | return super.resolveNrOfInstances(execution); | 80 | return super.resolveNrOfInstances(execution); |
| 89 | } | 81 | } |
| 90 | 82 | ||
| 83 | + @Override | ||
| 84 | + protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) { | ||
| 85 | + // 参见 https://t.zsxq.com/53Meo 情况 | ||
| 86 | + if (execution.getCurrentFlowElement() instanceof CallActivity | ||
| 87 | + || execution.getCurrentFlowElement() instanceof SubProcess) { | ||
| 88 | + super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F | ||
| 92 | + super.collectionExpression = null; | ||
| 93 | + super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId()); | ||
| 94 | + super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); | ||
| 95 | + super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); | ||
| 96 | + } | ||
| 97 | + | ||
| 91 | } | 98 | } |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmHttpRequestUtils.java
| @@ -6,15 +6,15 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | @@ -6,15 +6,15 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 7 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 7 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 8 | import cn.iocoder.yudao.framework.common.util.spring.SpringUtils; | 8 | import cn.iocoder.yudao.framework.common.util.spring.SpringUtils; |
| 9 | +import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; | ||
| 10 | +import cn.iocoder.yudao.module.bpm.api.event.BpmProcessInstanceStatusEvent; | ||
| 9 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; | 11 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; |
| 10 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmHttpRequestParamTypeEnum; | 12 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmHttpRequestParamTypeEnum; |
| 11 | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; | 13 | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; |
| 12 | import com.fasterxml.jackson.core.type.TypeReference; | 14 | import com.fasterxml.jackson.core.type.TypeReference; |
| 13 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
| 14 | import org.flowable.engine.runtime.ProcessInstance; | 16 | import org.flowable.engine.runtime.ProcessInstance; |
| 15 | -import org.springframework.http.HttpEntity; | ||
| 16 | -import org.springframework.http.HttpMethod; | ||
| 17 | -import org.springframework.http.ResponseEntity; | 17 | +import org.springframework.http.*; |
| 18 | import org.springframework.util.LinkedMultiValueMap; | 18 | import org.springframework.util.LinkedMultiValueMap; |
| 19 | import org.springframework.util.MultiValueMap; | 19 | import org.springframework.util.MultiValueMap; |
| 20 | import org.springframework.web.client.RestClientException; | 20 | import org.springframework.web.client.RestClientException; |
| @@ -26,7 +26,7 @@ import java.util.Map; | @@ -26,7 +26,7 @@ import java.util.Map; | ||
| 26 | 26 | ||
| 27 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 27 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 28 | import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; | 28 | import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; |
| 29 | -import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_INSTANCE_HTTP_TRIGGER_CALL_ERROR; | 29 | +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_INSTANCE_HTTP_CALL_ERROR; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * 工作流发起 HTTP 请求工具类 | 32 | * 工作流发起 HTTP 请求工具类 |
| @@ -42,7 +42,6 @@ public class BpmHttpRequestUtils { | @@ -42,7 +42,6 @@ public class BpmHttpRequestUtils { | ||
| 42 | List<BpmSimpleModelNodeVO.HttpRequestParam> bodyParams, | 42 | List<BpmSimpleModelNodeVO.HttpRequestParam> bodyParams, |
| 43 | Boolean handleResponse, | 43 | Boolean handleResponse, |
| 44 | List<KeyValue<String, String>> response) { | 44 | List<KeyValue<String, String>> response) { |
| 45 | - RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class); | ||
| 46 | BpmProcessInstanceService processInstanceService = SpringUtils.getBean(BpmProcessInstanceService.class); | 45 | BpmProcessInstanceService processInstanceService = SpringUtils.getBean(BpmProcessInstanceService.class); |
| 47 | 46 | ||
| 48 | // 1.1 设置请求头 | 47 | // 1.1 设置请求头 |
| @@ -51,6 +50,7 @@ public class BpmHttpRequestUtils { | @@ -51,6 +50,7 @@ public class BpmHttpRequestUtils { | ||
| 51 | MultiValueMap<String, String> body = buildHttpBody(processInstance, bodyParams); | 50 | MultiValueMap<String, String> body = buildHttpBody(processInstance, bodyParams); |
| 52 | 51 | ||
| 53 | // 2. 发起请求 | 52 | // 2. 发起请求 |
| 53 | + RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class); | ||
| 54 | ResponseEntity<String> responseEntity = sendHttpRequest(url, headers, body, restTemplate); | 54 | ResponseEntity<String> responseEntity = sendHttpRequest(url, headers, body, restTemplate); |
| 55 | 55 | ||
| 56 | // 3. 处理返回 | 56 | // 3. 处理返回 |
| @@ -78,27 +78,55 @@ public class BpmHttpRequestUtils { | @@ -78,27 +78,55 @@ public class BpmHttpRequestUtils { | ||
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | + public static void executeBpmHttpRequest(BpmProcessInstanceStatusEvent event, | ||
| 82 | + String url) { | ||
| 83 | + // 1.1 设置请求头 | ||
| 84 | + HttpHeaders headers = new HttpHeaders(); | ||
| 85 | + headers.setContentType(MediaType.APPLICATION_JSON); | ||
| 86 | + if (TenantContextHolder.getTenantId() != null) { | ||
| 87 | + headers.add(HEADER_TENANT_ID, String.valueOf(TenantContextHolder.getTenantId())); | ||
| 88 | + } else { | ||
| 89 | + BpmProcessInstanceService processInstanceService = SpringUtils.getBean(BpmProcessInstanceService.class); | ||
| 90 | + ProcessInstance processInstance = processInstanceService.getProcessInstance(event.getId()); | ||
| 91 | + if (processInstance != null) { | ||
| 92 | + headers.add(HEADER_TENANT_ID, String.valueOf(TenantContextHolder.getTenantId())); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + // 1.2 设置请求体 | ||
| 96 | +// MultiValueMap<String, String> body = new LinkedMultiValueMap<>(); | ||
| 97 | +// body.add("id", event.getId()); | ||
| 98 | +// body.add("processDefinitionKey", event.getProcessDefinitionKey()); | ||
| 99 | +// body.add("status", event.getStatus().toString()); | ||
| 100 | +// if (StrUtil.isNotEmpty(event.getBusinessKey())) { | ||
| 101 | +// body.add("businessKey", event.getBusinessKey()); | ||
| 102 | +// } | ||
| 103 | + | ||
| 104 | + // 2. 发起请求 | ||
| 105 | + RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class); | ||
| 106 | + sendHttpRequest(url, headers, event, restTemplate); | ||
| 107 | + } | ||
| 108 | + | ||
| 81 | public static ResponseEntity<String> sendHttpRequest(String url, | 109 | public static ResponseEntity<String> sendHttpRequest(String url, |
| 82 | MultiValueMap<String, String> headers, | 110 | MultiValueMap<String, String> headers, |
| 83 | - MultiValueMap<String, String> body, | 111 | + Object body, |
| 84 | RestTemplate restTemplate) { | 112 | RestTemplate restTemplate) { |
| 85 | - HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(body, headers); | 113 | + HttpEntity<Object> requestEntity = new HttpEntity<>(body, headers); |
| 86 | ResponseEntity<String> responseEntity; | 114 | ResponseEntity<String> responseEntity; |
| 87 | try { | 115 | try { |
| 88 | responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class); | 116 | responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class); |
| 89 | - log.info("[sendHttpRequest][HTTP 触发器,请求头:{},请求体:{},响应结果:{}]", headers, body, responseEntity); | 117 | + log.info("[sendHttpRequest][HTTP 请求,请求头:{},请求体:{},响应结果:{}]", headers, body, responseEntity); |
| 90 | } catch (RestClientException e) { | 118 | } catch (RestClientException e) { |
| 91 | - log.error("[sendHttpRequest][HTTP 触发器,请求头:{},请求体:{},请求出错:{}]", headers, body, e.getMessage()); | ||
| 92 | - throw exception(PROCESS_INSTANCE_HTTP_TRIGGER_CALL_ERROR); | 119 | + log.error("[sendHttpRequest][HTTP 请求,请求头:{},请求体:{},请求出错:{}]", headers, body, e.getMessage()); |
| 120 | + throw exception(PROCESS_INSTANCE_HTTP_CALL_ERROR); | ||
| 93 | } | 121 | } |
| 94 | return responseEntity; | 122 | return responseEntity; |
| 95 | } | 123 | } |
| 96 | 124 | ||
| 97 | public static MultiValueMap<String, String> buildHttpHeaders(ProcessInstance processInstance, | 125 | public static MultiValueMap<String, String> buildHttpHeaders(ProcessInstance processInstance, |
| 98 | List<BpmSimpleModelNodeVO.HttpRequestParam> headerSettings) { | 126 | List<BpmSimpleModelNodeVO.HttpRequestParam> headerSettings) { |
| 99 | - Map<String, Object> processVariables = processInstance.getProcessVariables(); | ||
| 100 | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); | 127 | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| 101 | headers.add(HEADER_TENANT_ID, processInstance.getTenantId()); | 128 | headers.add(HEADER_TENANT_ID, processInstance.getTenantId()); |
| 129 | + Map<String, Object> processVariables = processInstance.getProcessVariables(); | ||
| 102 | addHttpRequestParam(headers, headerSettings, processVariables); | 130 | addHttpRequestParam(headers, headerSettings, processVariables); |
| 103 | return headers; | 131 | return headers; |
| 104 | } | 132 | } |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| @@ -67,7 +67,6 @@ import java.util.*; | @@ -67,7 +67,6 @@ import java.util.*; | ||
| 67 | 67 | ||
| 68 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 68 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 69 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; | 69 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; |
| 70 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; | ||
| 71 | import static cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO.ActivityNode; | 70 | import static cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO.ActivityNode; |
| 72 | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; | 71 | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; |
| 73 | import static cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnModelConstants.START_USER_NODE_ID; | 72 | import static cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnModelConstants.START_USER_NODE_ID; |
| @@ -221,11 +220,6 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -221,11 +220,6 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 221 | List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel, | 220 | List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel, |
| 222 | processDefinitionInfo, | 221 | processDefinitionInfo, |
| 223 | processVariables, activities); | 222 | processVariables, activities); |
| 224 | - // 3.3 如果是发起动作,activityId 为开始节点,不校验审批人自选节点 | ||
| 225 | - if (ObjUtil.equals(reqVO.getActivityId(), BpmnModelConstants.START_USER_NODE_ID)) { | ||
| 226 | - simulateActivityNodes.removeIf(node -> | ||
| 227 | - BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy().equals(node.getCandidateStrategy())); | ||
| 228 | - } | ||
| 229 | 223 | ||
| 230 | // 4. 拼接最终数据 | 224 | // 4. 拼接最终数据 |
| 231 | return buildApprovalDetail(reqVO, bpmnModel, processDefinition, processDefinitionInfo, historicProcessInstance, | 225 | return buildApprovalDetail(reqVO, bpmnModel, processDefinition, processDefinitionInfo, historicProcessInstance, |
| @@ -415,7 +409,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -415,7 +409,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 415 | endActivities.forEach(activity -> { | 409 | endActivities.forEach(activity -> { |
| 416 | // StartEvent:只处理 BPMN 的场景。因为,SIMPLE 情况下,已经有 START_USER_NODE 节点 | 410 | // StartEvent:只处理 BPMN 的场景。因为,SIMPLE 情况下,已经有 START_USER_NODE 节点 |
| 417 | if (ELEMENT_EVENT_START.equals(activity.getActivityType()) | 411 | if (ELEMENT_EVENT_START.equals(activity.getActivityType()) |
| 418 | - && BpmModelTypeEnum.BPMN.getType().equals(processDefinitionInfo.getModelType())) { | 412 | + && BpmModelTypeEnum.BPMN.getType().equals(processDefinitionInfo.getModelType()) |
| 413 | + && !CollUtil.contains(activities, // 特殊:如果已经存在用户手动创建的 START_USER_NODE_ID 节点,则忽略 StartEvent | ||
| 414 | + historicActivity -> historicActivity.getActivityId().equals(START_USER_NODE_ID))) { | ||
| 419 | ActivityNodeTask startTask = new ActivityNodeTask().setId(BpmnModelConstants.START_USER_NODE_ID) | 415 | ActivityNodeTask startTask = new ActivityNodeTask().setId(BpmnModelConstants.START_USER_NODE_ID) |
| 420 | .setAssignee(startUserId).setStatus(BpmTaskStatusEnum.APPROVE.getStatus()); | 416 | .setAssignee(startUserId).setStatus(BpmTaskStatusEnum.APPROVE.getStatus()); |
| 421 | ActivityNode startNode = new ActivityNode().setId(startTask.getId()) | 417 | ActivityNode startNode = new ActivityNode().setId(startTask.getId()) |
| @@ -555,7 +551,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -555,7 +551,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 555 | // 情况一:BPMN 设计器 | 551 | // 情况一:BPMN 设计器 |
| 556 | if (Objects.equals(BpmModelTypeEnum.BPMN.getType(), processDefinitionInfo.getModelType())) { | 552 | if (Objects.equals(BpmModelTypeEnum.BPMN.getType(), processDefinitionInfo.getModelType())) { |
| 557 | List<FlowElement> flowElements = BpmnModelUtils.simulateProcess(bpmnModel, processVariables); | 553 | List<FlowElement> flowElements = BpmnModelUtils.simulateProcess(bpmnModel, processVariables); |
| 558 | - return convertList(flowElements, flowElement -> buildNotRunApproveNodeForBpmn(startUserId, bpmnModel, | 554 | + return convertList(flowElements, flowElement -> buildNotRunApproveNodeForBpmn( |
| 555 | + startUserId, bpmnModel, flowElements, | ||
| 559 | processDefinitionInfo, processVariables, flowElement, runActivityIds)); | 556 | processDefinitionInfo, processVariables, flowElement, runActivityIds)); |
| 560 | } | 557 | } |
| 561 | // 情况二:SIMPLE 设计器 | 558 | // 情况二:SIMPLE 设计器 |
| @@ -563,7 +560,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -563,7 +560,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 563 | BpmSimpleModelNodeVO simpleModel = JsonUtils.parseObject(processDefinitionInfo.getSimpleModel(), | 560 | BpmSimpleModelNodeVO simpleModel = JsonUtils.parseObject(processDefinitionInfo.getSimpleModel(), |
| 564 | BpmSimpleModelNodeVO.class); | 561 | BpmSimpleModelNodeVO.class); |
| 565 | List<BpmSimpleModelNodeVO> simpleNodes = SimpleModelUtils.simulateProcess(simpleModel, processVariables); | 562 | List<BpmSimpleModelNodeVO> simpleNodes = SimpleModelUtils.simulateProcess(simpleModel, processVariables); |
| 566 | - return convertList(simpleNodes, simpleNode -> buildNotRunApproveNodeForSimple(startUserId, bpmnModel, | 563 | + return convertList(simpleNodes, simpleNode -> buildNotRunApproveNodeForSimple( |
| 564 | + startUserId, bpmnModel, | ||
| 567 | processDefinitionInfo, processVariables, simpleNode, runActivityIds)); | 565 | processDefinitionInfo, processVariables, simpleNode, runActivityIds)); |
| 568 | } | 566 | } |
| 569 | throw new IllegalArgumentException("未知设计器类型:" + processDefinitionInfo.getModelType()); | 567 | throw new IllegalArgumentException("未知设计器类型:" + processDefinitionInfo.getModelType()); |
| @@ -618,8 +616,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -618,8 +616,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 618 | return null; | 616 | return null; |
| 619 | } | 617 | } |
| 620 | 618 | ||
| 621 | - private ActivityNode buildNotRunApproveNodeForBpmn(Long startUserId, BpmnModel bpmnModel, | ||
| 622 | - BpmProcessDefinitionInfoDO processDefinitionInfo, Map<String, Object> processVariables, | 619 | + private ActivityNode buildNotRunApproveNodeForBpmn(Long startUserId, BpmnModel bpmnModel, List<FlowElement> flowElements, |
| 620 | + BpmProcessDefinitionInfoDO processDefinitionInfo, | ||
| 621 | + Map<String, Object> processVariables, | ||
| 623 | FlowElement node, Set<String> runActivityIds) { | 622 | FlowElement node, Set<String> runActivityIds) { |
| 624 | if (runActivityIds.contains(node.getId())) { | 623 | if (runActivityIds.contains(node.getId())) { |
| 625 | return null; | 624 | return null; |
| @@ -634,6 +633,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | @@ -634,6 +633,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService | ||
| 634 | 633 | ||
| 635 | // 1. 开始节点 | 634 | // 1. 开始节点 |
| 636 | if (node instanceof StartEvent) { | 635 | if (node instanceof StartEvent) { |
| 636 | + if (CollUtil.contains(flowElements, // 特殊:如果已经存在用户手动创建的 START_USER_NODE_ID 节点,则忽略 StartEvent | ||
| 637 | + flowElement -> flowElement.getId().equals(START_USER_NODE_ID))) { | ||
| 638 | + return null; | ||
| 639 | + } | ||
| 637 | return activityNode.setName(BpmSimpleModelNodeTypeEnum.START_USER_NODE.getName()) | 640 | return activityNode.setName(BpmSimpleModelNodeTypeEnum.START_USER_NODE.getName()) |
| 638 | .setNodeType(BpmSimpleModelNodeTypeEnum.START_USER_NODE.getType()); | 641 | .setNodeType(BpmSimpleModelNodeTypeEnum.START_USER_NODE.getType()); |
| 639 | } | 642 | } |
yudao-module-bpm/src/test/java/cn/iocoder/yudao/module/bpm/service/category/BpmCategoryServiceImplTest.java
| @@ -8,9 +8,11 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category.BpmCa | @@ -8,9 +8,11 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category.BpmCa | ||
| 8 | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO; | 8 | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO; |
| 9 | import cn.iocoder.yudao.module.bpm.dal.mysql.category.BpmCategoryMapper; | 9 | import cn.iocoder.yudao.module.bpm.dal.mysql.category.BpmCategoryMapper; |
| 10 | import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryServiceImpl; | 10 | import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryServiceImpl; |
| 11 | +import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; | ||
| 11 | import jakarta.annotation.Resource; | 12 | import jakarta.annotation.Resource; |
| 12 | import org.junit.jupiter.api.Test; | 13 | import org.junit.jupiter.api.Test; |
| 13 | import org.springframework.context.annotation.Import; | 14 | import org.springframework.context.annotation.Import; |
| 15 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 14 | 16 | ||
| 15 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | 17 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; |
| 16 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; | 18 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; |
| @@ -32,6 +34,9 @@ public class BpmCategoryServiceImplTest extends BaseDbUnitTest { | @@ -32,6 +34,9 @@ public class BpmCategoryServiceImplTest extends BaseDbUnitTest { | ||
| 32 | @Resource | 34 | @Resource |
| 33 | private BpmCategoryServiceImpl categoryService; | 35 | private BpmCategoryServiceImpl categoryService; |
| 34 | 36 | ||
| 37 | + @MockitoBean | ||
| 38 | + private BpmModelService modelService; | ||
| 39 | + | ||
| 35 | @Resource | 40 | @Resource |
| 36 | private BpmCategoryMapper categoryMapper; | 41 | private BpmCategoryMapper categoryMapper; |
| 37 | 42 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/business/CrmBusinessRespVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.AllArgsConstructor; | 6 | import lombok.AllArgsConstructor; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.clue.vo; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.clue.vo; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | import lombok.ToString; | 10 | import lombok.ToString; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/vo/CrmContactRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.contact.vo; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.contact.vo; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | import lombok.ToString; | 10 | import lombok.ToString; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractRespVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.AllArgsConstructor; | 6 | import lombok.AllArgsConstructor; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/customer/CrmCustomerImportExcelVO.java
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect; | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect; | ||
| 5 | import cn.iocoder.yudao.framework.excel.core.convert.AreaConvert; | 5 | import cn.iocoder.yudao.framework.excel.core.convert.AreaConvert; |
| 6 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 6 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 7 | import cn.iocoder.yudao.module.crm.framework.excel.core.AreaExcelColumnSelectFunction; | 7 | import cn.iocoder.yudao.module.crm.framework.excel.core.AreaExcelColumnSelectFunction; |
| 8 | -import com.alibaba.excel.annotation.ExcelProperty; | 8 | +import cn.idev.excel.annotation.ExcelProperty; |
| 9 | import lombok.AllArgsConstructor; | 9 | import lombok.AllArgsConstructor; |
| 10 | import lombok.Builder; | 10 | import lombok.Builder; |
| 11 | import lombok.Data; | 11 | import lombok.Data; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/customer/CrmCustomerRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.customer; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.customer.vo.customer; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/followup/vo/CrmFollowUpRecordRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.followup.vo; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.crm.controller.admin.followup.vo; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessRespVO; | 4 | import cn.iocoder.yudao.module.crm.controller.admin.business.vo.business.CrmBusinessRespVO; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -61,4 +61,4 @@ public class CrmFollowUpRecordRespVO { | @@ -61,4 +61,4 @@ public class CrmFollowUpRecordRespVO { | ||
| 61 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | 61 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 62 | private LocalDateTime createTime; | 62 | private LocalDateTime createTime; |
| 63 | 63 | ||
| 64 | -} | ||
| 65 | \ No newline at end of file | 64 | \ No newline at end of file |
| 65 | +} |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/operatelog/vo/CrmOperateLogRespVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.operatelog.vo; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.operatelog.vo; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/product/CrmProductController.java
| @@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductDO; | @@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductDO; | ||
| 14 | import cn.iocoder.yudao.module.crm.enums.product.CrmProductStatusEnum; | 14 | import cn.iocoder.yudao.module.crm.enums.product.CrmProductStatusEnum; |
| 15 | import cn.iocoder.yudao.module.crm.service.product.CrmProductService; | 15 | import cn.iocoder.yudao.module.crm.service.product.CrmProductService; |
| 16 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | 16 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 17 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 17 | import io.swagger.v3.oas.annotations.Operation; | 18 | import io.swagger.v3.oas.annotations.Operation; |
| 18 | import io.swagger.v3.oas.annotations.Parameter; | 19 | import io.swagger.v3.oas.annotations.Parameter; |
| 19 | import io.swagger.v3.oas.annotations.tags.Tag; | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -70,6 +71,7 @@ public class CrmProductController { | @@ -70,6 +71,7 @@ public class CrmProductController { | ||
| 70 | @Operation(summary = "获得产品") | 71 | @Operation(summary = "获得产品") |
| 71 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 72 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 72 | @PreAuthorize("@ss.hasPermission('crm:product:query')") | 73 | @PreAuthorize("@ss.hasPermission('crm:product:query')") |
| 74 | + @TransMethodResult | ||
| 73 | public CommonResult<CrmProductRespVO> getProduct(@RequestParam("id") Long id) { | 75 | public CommonResult<CrmProductRespVO> getProduct(@RequestParam("id") Long id) { |
| 74 | CrmProductDO product = productService.getProduct(id); | 76 | CrmProductDO product = productService.getProduct(id); |
| 75 | return success(BeanUtils.toBean(product, CrmProductRespVO.class)); | 77 | return success(BeanUtils.toBean(product, CrmProductRespVO.class)); |
| @@ -86,6 +88,7 @@ public class CrmProductController { | @@ -86,6 +88,7 @@ public class CrmProductController { | ||
| 86 | @GetMapping("/page") | 88 | @GetMapping("/page") |
| 87 | @Operation(summary = "获得产品分页") | 89 | @Operation(summary = "获得产品分页") |
| 88 | @PreAuthorize("@ss.hasPermission('crm:product:query')") | 90 | @PreAuthorize("@ss.hasPermission('crm:product:query')") |
| 91 | + @TransMethodResult | ||
| 89 | public CommonResult<PageResult<CrmProductRespVO>> getProductPage(@Valid CrmProductPageReqVO pageVO) { | 92 | public CommonResult<PageResult<CrmProductRespVO>> getProductPage(@Valid CrmProductPageReqVO pageVO) { |
| 90 | PageResult<CrmProductDO> pageResult = productService.getProductPage(pageVO); | 93 | PageResult<CrmProductDO> pageResult = productService.getProductPage(pageVO); |
| 91 | return success(BeanUtils.toBean(pageResult, CrmProductRespVO.class)); | 94 | return success(BeanUtils.toBean(pageResult, CrmProductRespVO.class)); |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/product/vo/category/CrmProductCategoryListReqVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.product.vo.category; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.product.vo.category; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelProperty; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/product/vo/product/CrmProductRespVO.java
| @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductCategoryDO; | 5 | import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductCategoryDO; |
| 6 | import cn.iocoder.yudao.module.crm.enums.DictTypeConstants; | 6 | import cn.iocoder.yudao.module.crm.enums.DictTypeConstants; |
| 7 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 8 | -import com.alibaba.excel.annotation.ExcelProperty; | 7 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 8 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 9 | import com.fhs.core.trans.anno.Trans; | 9 | import com.fhs.core.trans.anno.Trans; |
| 10 | import com.fhs.core.trans.constant.TransType; | 10 | import com.fhs.core.trans.constant.TransType; |
| 11 | import com.fhs.core.trans.vo.VO; | 11 | import com.fhs.core.trans.vo.VO; |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/plan/CrmReceivablePlanRespVO.java
| 1 | package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan; | 1 | package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.receivable.CrmReceivableRespVO; | 3 | import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.receivable.CrmReceivableRespVO; |
| 4 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 5 | -import com.alibaba.excel.annotation.ExcelProperty; | 4 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 5 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 6 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| 8 | 8 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/receivable/CrmReceivableRespVO.java
| @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | ||
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO; | 5 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO; |
| 6 | import cn.iocoder.yudao.module.crm.enums.DictTypeConstants; | 6 | import cn.iocoder.yudao.module.crm.enums.DictTypeConstants; |
| 7 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 8 | -import com.alibaba.excel.annotation.ExcelProperty; | 7 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 8 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 9 | import io.swagger.v3.oas.annotations.media.Schema; | 9 | import io.swagger.v3.oas.annotations.media.Schema; |
| 10 | import lombok.Data; | 10 | import lombok.Data; |
| 11 | 11 |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contact/CrmContactServiceImpl.java
| @@ -159,10 +159,10 @@ public class CrmContactServiceImpl implements CrmContactService { | @@ -159,10 +159,10 @@ public class CrmContactServiceImpl implements CrmContactService { | ||
| 159 | // 2. 删除联系人 | 159 | // 2. 删除联系人 |
| 160 | contactMapper.deleteById(id); | 160 | contactMapper.deleteById(id); |
| 161 | 161 | ||
| 162 | - // 4.1 删除数据权限 | ||
| 163 | - permissionService.deletePermission(CrmBizTypeEnum.CRM_CONTACT.getType(), id); | ||
| 164 | - // 4.2 删除商机关联 | 162 | + // 4.1 删除商机关联 |
| 165 | contactBusinessService.deleteContactBusinessByContactId(id); | 163 | contactBusinessService.deleteContactBusinessByContactId(id); |
| 164 | + // 4.2 删除数据权限 | ||
| 165 | + permissionService.deletePermission(CrmBizTypeEnum.CRM_CONTACT.getType(), id); | ||
| 166 | 166 | ||
| 167 | // 记录操作日志上下文 | 167 | // 记录操作日志上下文 |
| 168 | LogRecordContext.putVariable("contactName", contact.getName()); | 168 | LogRecordContext.putVariable("contactName", contact.getName()); |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/util/CrmPermissionUtils.java
| @@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.crm.util; | @@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.crm.util; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.extra.spring.SpringUtil; | 4 | import cn.hutool.extra.spring.SpringUtil; |
| 5 | +import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi; | ||
| 5 | import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; | 6 | import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; |
| 6 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; | 7 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 7 | import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum; | 8 | import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum; |
| 8 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; | 9 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 9 | -import cn.iocoder.yudao.module.system.api.permission.PermissionApi; | ||
| 10 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | 10 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 11 | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | 11 | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| 12 | import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; | 12 | import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; |
| @@ -32,7 +32,7 @@ public class CrmPermissionUtils { | @@ -32,7 +32,7 @@ public class CrmPermissionUtils { | ||
| 32 | * @return 是/否 | 32 | * @return 是/否 |
| 33 | */ | 33 | */ |
| 34 | public static boolean isCrmAdmin() { | 34 | public static boolean isCrmAdmin() { |
| 35 | - PermissionApi permissionApi = SpringUtil.getBean(PermissionApi.class); | 35 | + PermissionCommonApi permissionApi = SpringUtil.getBean(PermissionCommonApi.class); |
| 36 | return permissionApi.hasAnyRoles(getLoginUserId(), RoleCodeEnum.CRM_ADMIN.getCode()); | 36 | return permissionApi.hasAnyRoles(getLoginUserId(), RoleCodeEnum.CRM_ADMIN.getCode()); |
| 37 | } | 37 | } |
| 38 | 38 |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/vo/account/ErpAccountRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.account; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | 4 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -47,4 +47,4 @@ public class ErpAccountRespVO { | @@ -47,4 +47,4 @@ public class ErpAccountRespVO { | ||
| 47 | @ExcelProperty("创建时间") | 47 | @ExcelProperty("创建时间") |
| 48 | private LocalDateTime createTime; | 48 | private LocalDateTime createTime; |
| 49 | 49 | ||
| 50 | -} | ||
| 51 | \ No newline at end of file | 50 | \ No newline at end of file |
| 51 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/vo/payment/ErpFinancePaymentRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.payment; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -96,4 +96,4 @@ public class ErpFinancePaymentRespVO { | @@ -96,4 +96,4 @@ public class ErpFinancePaymentRespVO { | ||
| 96 | 96 | ||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | -} | ||
| 100 | \ No newline at end of file | 99 | \ No newline at end of file |
| 100 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/finance/vo/receipt/ErpFinanceReceiptRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.receipt; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.finance.vo.receipt; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -96,4 +96,4 @@ public class ErpFinanceReceiptRespVO { | @@ -96,4 +96,4 @@ public class ErpFinanceReceiptRespVO { | ||
| 96 | 96 | ||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | -} | ||
| 100 | \ No newline at end of file | 99 | \ No newline at end of file |
| 100 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/vo/category/ErpProductCategoryRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.product.vo.category; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.product.vo.category; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 | ||
| @@ -44,4 +44,4 @@ public class ErpProductCategoryRespVO { | @@ -44,4 +44,4 @@ public class ErpProductCategoryRespVO { | ||
| 44 | @ExcelProperty("创建时间") | 44 | @ExcelProperty("创建时间") |
| 45 | private LocalDateTime createTime; | 45 | private LocalDateTime createTime; |
| 46 | 46 | ||
| 47 | -} | ||
| 48 | \ No newline at end of file | 47 | \ No newline at end of file |
| 48 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/vo/product/ErpProductRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| @@ -73,4 +73,4 @@ public class ErpProductRespVO { | @@ -73,4 +73,4 @@ public class ErpProductRespVO { | ||
| 73 | @ExcelProperty("创建时间") | 73 | @ExcelProperty("创建时间") |
| 74 | private LocalDateTime createTime; | 74 | private LocalDateTime createTime; |
| 75 | 75 | ||
| 76 | -} | ||
| 77 | \ No newline at end of file | 76 | \ No newline at end of file |
| 77 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/vo/unit/ErpProductUnitRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.product.vo.unit; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.product.vo.unit; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | 4 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -31,4 +31,4 @@ public class ErpProductUnitRespVO { | @@ -31,4 +31,4 @@ public class ErpProductUnitRespVO { | ||
| 31 | @ExcelProperty("创建时间") | 31 | @ExcelProperty("创建时间") |
| 32 | private LocalDateTime createTime; | 32 | private LocalDateTime createTime; |
| 33 | 33 | ||
| 34 | -} | ||
| 35 | \ No newline at end of file | 34 | \ No newline at end of file |
| 35 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/purchase/vo/in/ErpPurchaseInRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -142,4 +142,4 @@ public class ErpPurchaseInRespVO { | @@ -142,4 +142,4 @@ public class ErpPurchaseInRespVO { | ||
| 142 | 142 | ||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | -} | ||
| 146 | \ No newline at end of file | 145 | \ No newline at end of file |
| 146 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -149,4 +149,4 @@ public class ErpPurchaseOrderRespVO { | @@ -149,4 +149,4 @@ public class ErpPurchaseOrderRespVO { | ||
| 149 | 149 | ||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | -} | ||
| 153 | \ No newline at end of file | 152 | \ No newline at end of file |
| 153 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/purchase/vo/returns/ErpPurchaseReturnRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.returns; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -142,4 +142,4 @@ public class ErpPurchaseReturnRespVO { | @@ -142,4 +142,4 @@ public class ErpPurchaseReturnRespVO { | ||
| 142 | 142 | ||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | -} | ||
| 146 | \ No newline at end of file | 145 | \ No newline at end of file |
| 146 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/purchase/vo/supplier/ErpSupplierRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.supplier; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.supplier; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 | ||
| @@ -81,4 +81,4 @@ public class ErpSupplierRespVO { | @@ -81,4 +81,4 @@ public class ErpSupplierRespVO { | ||
| 81 | @ExcelProperty("创建时间") | 81 | @ExcelProperty("创建时间") |
| 82 | private LocalDateTime createTime; | 82 | private LocalDateTime createTime; |
| 83 | 83 | ||
| 84 | -} | ||
| 85 | \ No newline at end of file | 84 | \ No newline at end of file |
| 85 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/vo/customer/ErpCustomerRespVO.java
| @@ -2,12 +2,9 @@ package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer; | @@ -2,12 +2,9 @@ package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.customer; | ||
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | -import java.util.*; | ||
| 6 | -import java.util.*; | ||
| 7 | import java.math.BigDecimal; | 5 | import java.math.BigDecimal; |
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 9 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 10 | -import com.alibaba.excel.annotation.*; | 7 | +import cn.idev.excel.annotation.*; |
| 11 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 8 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 12 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 9 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 13 | 10 | ||
| @@ -81,4 +78,4 @@ public class ErpCustomerRespVO { | @@ -81,4 +78,4 @@ public class ErpCustomerRespVO { | ||
| 81 | @ExcelProperty("创建时间") | 78 | @ExcelProperty("创建时间") |
| 82 | private LocalDateTime createTime; | 79 | private LocalDateTime createTime; |
| 83 | 80 | ||
| 84 | -} | ||
| 85 | \ No newline at end of file | 81 | \ No newline at end of file |
| 82 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/vo/order/ErpSaleOrderRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.order; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -152,4 +152,4 @@ public class ErpSaleOrderRespVO { | @@ -152,4 +152,4 @@ public class ErpSaleOrderRespVO { | ||
| 152 | 152 | ||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | -} | ||
| 156 | \ No newline at end of file | 155 | \ No newline at end of file |
| 156 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/vo/out/ErpSaleOutRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.out; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.out; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -145,4 +145,4 @@ public class ErpSaleOutRespVO { | @@ -145,4 +145,4 @@ public class ErpSaleOutRespVO { | ||
| 145 | 145 | ||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | -} | ||
| 149 | \ No newline at end of file | 148 | \ No newline at end of file |
| 149 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/sale/vo/returns/ErpSaleReturnRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.returns; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.sale.vo.returns; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.NotNull; | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | import lombok.Data; | 7 | import lombok.Data; |
| @@ -145,4 +145,4 @@ public class ErpSaleReturnRespVO { | @@ -145,4 +145,4 @@ public class ErpSaleReturnRespVO { | ||
| 145 | 145 | ||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | -} | ||
| 149 | \ No newline at end of file | 148 | \ No newline at end of file |
| 149 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/check/ErpStockCheckRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.check; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import jakarta.validation.constraints.NotNull; | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| @@ -108,4 +108,4 @@ public class ErpStockCheckRespVO { | @@ -108,4 +108,4 @@ public class ErpStockCheckRespVO { | ||
| 108 | 108 | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | -} | ||
| 112 | \ No newline at end of file | 111 | \ No newline at end of file |
| 112 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/in/ErpStockInRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -107,4 +107,4 @@ public class ErpStockInRespVO { | @@ -107,4 +107,4 @@ public class ErpStockInRespVO { | ||
| 107 | 107 | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | -} | ||
| 111 | \ No newline at end of file | 110 | \ No newline at end of file |
| 111 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/move/ErpStockMoveRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.move; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.move; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -104,4 +104,4 @@ public class ErpStockMoveRespVO { | @@ -104,4 +104,4 @@ public class ErpStockMoveRespVO { | ||
| 104 | 104 | ||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | -} | ||
| 108 | \ No newline at end of file | 107 | \ No newline at end of file |
| 108 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/out/ErpStockOutRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -107,4 +107,4 @@ public class ErpStockOutRespVO { | @@ -107,4 +107,4 @@ public class ErpStockOutRespVO { | ||
| 107 | 107 | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | -} | ||
| 111 | \ No newline at end of file | 110 | \ No newline at end of file |
| 111 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/record/ErpStockRecordRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.record; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.record; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.erp.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.erp.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 | ||
| @@ -84,4 +84,4 @@ public class ErpStockRecordRespVO { | @@ -84,4 +84,4 @@ public class ErpStockRecordRespVO { | ||
| 84 | @ExcelProperty("创建人") | 84 | @ExcelProperty("创建人") |
| 85 | private String creatorName; | 85 | private String creatorName; |
| 86 | 86 | ||
| 87 | -} | ||
| 88 | \ No newline at end of file | 87 | \ No newline at end of file |
| 88 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/stock/ErpStockRespVO.java
| 1 | package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.stock; | 1 | package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.stock; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| @@ -46,4 +46,4 @@ public class ErpStockRespVO { | @@ -46,4 +46,4 @@ public class ErpStockRespVO { | ||
| 46 | @ExcelProperty("仓库名称") | 46 | @ExcelProperty("仓库名称") |
| 47 | private String warehouseName; | 47 | private String warehouseName; |
| 48 | 48 | ||
| 49 | -} | ||
| 50 | \ No newline at end of file | 49 | \ No newline at end of file |
| 50 | +} |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/stock/vo/warehouse/ErpWarehouseRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.warehouse; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.warehouse; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.system.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 | ||
| @@ -61,4 +61,4 @@ public class ErpWarehouseRespVO { | @@ -61,4 +61,4 @@ public class ErpWarehouseRespVO { | ||
| 61 | @ExcelProperty("创建时间") | 61 | @ExcelProperty("创建时间") |
| 62 | private LocalDateTime createTime; | 62 | private LocalDateTime createTime; |
| 63 | 63 | ||
| 64 | -} | ||
| 65 | \ No newline at end of file | 64 | \ No newline at end of file |
| 65 | +} |
yudao-module-infra/pom.xml
| @@ -92,6 +92,7 @@ | @@ -92,6 +92,7 @@ | ||
| 92 | <dependency> | 92 | <dependency> |
| 93 | <groupId>de.codecentric</groupId> | 93 | <groupId>de.codecentric</groupId> |
| 94 | <artifactId>spring-boot-admin-starter-server</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> | 94 | <artifactId>spring-boot-admin-starter-server</artifactId> <!-- 实现 Spring Boot Admin Server 服务端 --> |
| 95 | + <optional>true</optional> | ||
| 95 | </dependency> | 96 | </dependency> |
| 96 | 97 | ||
| 97 | <!-- 三方云服务相关 --> | 98 | <!-- 三方云服务相关 --> |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java
| 1 | package cn.iocoder.yudao.module.infra.api.websocket; | 1 | package cn.iocoder.yudao.module.infra.api.websocket; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.websocket.core.sender.WebSocketMessageSender; | 3 | import cn.iocoder.yudao.framework.websocket.core.sender.WebSocketMessageSender; |
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 4 | import org.springframework.stereotype.Component; | 5 | import org.springframework.stereotype.Component; |
| 5 | 6 | ||
| 6 | -import jakarta.annotation.Resource; | ||
| 7 | - | ||
| 8 | /** | 7 | /** |
| 9 | * WebSocket 发送器的 API 实现类 | 8 | * WebSocket 发送器的 API 实现类 |
| 10 | * | 9 | * |
| @@ -13,7 +12,8 @@ import jakarta.annotation.Resource; | @@ -13,7 +12,8 @@ import jakarta.annotation.Resource; | ||
| 13 | @Component | 12 | @Component |
| 14 | public class WebSocketSenderApiImpl implements WebSocketSenderApi { | 13 | public class WebSocketSenderApiImpl implements WebSocketSenderApi { |
| 15 | 14 | ||
| 16 | - @Resource | 15 | + @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") |
| 16 | + @Autowired(required = false) // 由于 yudao.websocket.enable 配置项,可以关闭 WebSocket 的功能,所以这里只能不强制注入 | ||
| 17 | private WebSocketMessageSender webSocketMessageSender; | 17 | private WebSocketMessageSender webSocketMessageSender; |
| 18 | 18 | ||
| 19 | @Override | 19 | @Override |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -43,4 +43,4 @@ public class Demo01ContactRespVO { | @@ -43,4 +43,4 @@ public class Demo01ContactRespVO { | ||
| 43 | @ExcelProperty("创建时间") | 43 | @ExcelProperty("创建时间") |
| 44 | private LocalDateTime createTime; | 44 | private LocalDateTime createTime; |
| 45 | 45 | ||
| 46 | -} | ||
| 47 | \ No newline at end of file | 46 | \ No newline at end of file |
| 47 | +} |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo02/vo/Demo02CategoryRespVO.java
| 1 | package cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo; | 1 | package cn.iocoder.yudao.module.infra.controller.admin.demo.demo02.vo; |
| 2 | 2 | ||
| 3 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | -import com.alibaba.excel.annotation.ExcelProperty; | 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
| 7 | 7 | ||
| @@ -28,4 +28,4 @@ public class Demo02CategoryRespVO { | @@ -28,4 +28,4 @@ public class Demo02CategoryRespVO { | ||
| 28 | @ExcelProperty("创建时间") | 28 | @ExcelProperty("创建时间") |
| 29 | private LocalDateTime createTime; | 29 | private LocalDateTime createTime; |
| 30 | 30 | ||
| 31 | -} | ||
| 32 | \ No newline at end of file | 31 | \ No newline at end of file |
| 32 | +} |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -39,4 +39,4 @@ public class Demo03StudentErpRespVO { | @@ -39,4 +39,4 @@ public class Demo03StudentErpRespVO { | ||
| 39 | @ExcelProperty("创建时间") | 39 | @ExcelProperty("创建时间") |
| 40 | private LocalDateTime createTime; | 40 | private LocalDateTime createTime; |
| 41 | 41 | ||
| 42 | -} | ||
| 43 | \ No newline at end of file | 42 | \ No newline at end of file |
| 43 | +} |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -39,4 +39,4 @@ public class Demo03StudentInnerRespVO { | @@ -39,4 +39,4 @@ public class Demo03StudentInnerRespVO { | ||
| 39 | @ExcelProperty("创建时间") | 39 | @ExcelProperty("创建时间") |
| 40 | private LocalDateTime createTime; | 40 | private LocalDateTime createTime; |
| 41 | 41 | ||
| 42 | -} | ||
| 43 | \ No newline at end of file | 42 | \ No newline at end of file |
| 43 | +} |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalRespVO.java
| @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo; | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 6 | -import com.alibaba.excel.annotation.ExcelProperty; | 5 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 6 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 8 | import lombok.Data; |
| 9 | 9 | ||
| @@ -39,4 +39,4 @@ public class Demo03StudentNormalRespVO { | @@ -39,4 +39,4 @@ public class Demo03StudentNormalRespVO { | ||
| 39 | @ExcelProperty("创建时间") | 39 | @ExcelProperty("创建时间") |
| 40 | private LocalDateTime createTime; | 40 | private LocalDateTime createTime; |
| 41 | 41 | ||
| 42 | -} | ||
| 43 | \ No newline at end of file | 42 | \ No newline at end of file |
| 43 | +} |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
| @@ -43,7 +43,7 @@ public class FileController { | @@ -43,7 +43,7 @@ public class FileController { | ||
| 43 | 43 | ||
| 44 | @PostMapping("/upload") | 44 | @PostMapping("/upload") |
| 45 | @Operation(summary = "上传文件", description = "模式一:后端上传文件") | 45 | @Operation(summary = "上传文件", description = "模式一:后端上传文件") |
| 46 | - public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception { | 46 | + public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception { |
| 47 | MultipartFile file = uploadReqVO.getFile(); | 47 | MultipartFile file = uploadReqVO.getFile(); |
| 48 | byte[] content = IoUtil.readBytes(file.getInputStream()); | 48 | byte[] content = IoUtil.readBytes(file.getInputStream()); |
| 49 | return success(fileService.createFile(content, file.getOriginalFilename(), | 49 | return success(fileService.createFile(content, file.getOriginalFilename(), |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import jakarta.validation.constraints.NotNull; | 9 | import jakarta.validation.constraints.NotNull; |
| 10 | import lombok.Data; | 10 | import lombok.Data; |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; | 5 | import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | -import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | 6 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 8 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
| @@ -139,85 +139,85 @@ public class CodegenEngine { | @@ -139,85 +139,85 @@ public class CodegenEngine { | ||
| 139 | vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 139 | vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 140 | // VUE3_VBEN2_ANTD_SCHEMA | 140 | // VUE3_VBEN2_ANTD_SCHEMA |
| 141 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/data.ts"), | 141 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/data.ts"), |
| 142 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/${classNameVar}.data.ts")) | 142 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/${classNameVar}.data.ts")) |
| 143 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/index.vue"), | 143 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/index.vue"), |
| 144 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/index.vue")) | 144 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/index.vue")) |
| 145 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/form.vue"), | 145 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("views/form.vue"), |
| 146 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/${simpleClassName}Modal.vue")) | 146 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/${simpleClassName}Modal.vue")) |
| 147 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("api/api.ts"), | 147 | .put(CodegenFrontTypeEnum.VUE3_VBEN2_ANTD_SCHEMA.getType(), vue3VbenTemplatePath("api/api.ts"), |
| 148 | - vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 148 | + vue3VbenFilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 149 | // VUE3_VBEN5_ANTD_SCHEMA | 149 | // VUE3_VBEN5_ANTD_SCHEMA |
| 150 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/data.ts"), | 150 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/data.ts"), |
| 151 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/data.ts")) | 151 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/data.ts")) |
| 152 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/index.vue"), | 152 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/index.vue"), |
| 153 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/index.vue")) | 153 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/index.vue")) |
| 154 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/form.vue"), | 154 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/form.vue"), |
| 155 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) | 155 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) |
| 156 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("api/api.ts"), | 156 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("api/api.ts"), |
| 157 | - vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 157 | + vue3VbenFilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 158 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 | 158 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 |
| 159 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 159 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 160 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 | 160 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 161 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 161 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 162 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 | 162 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 163 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 163 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 164 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 | 164 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 165 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 165 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 166 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 | 166 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_SCHEMA.getType(), vue3Vben5AntdSchemaTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 167 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 167 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 168 | // VUE3_VBEN5_ANTD | 168 | // VUE3_VBEN5_ANTD |
| 169 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/index.vue"), | 169 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/index.vue"), |
| 170 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/index.vue")) | 170 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/index.vue")) |
| 171 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/form.vue"), | 171 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/form.vue"), |
| 172 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) | 172 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) |
| 173 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("api/api.ts"), | 173 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("api/api.ts"), |
| 174 | - vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 174 | + vue3VbenFilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 175 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 | 175 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 |
| 176 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 176 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 177 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 | 177 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 178 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 178 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 179 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 | 179 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 180 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 180 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 181 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 | 181 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 182 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 182 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 183 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 | 183 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_ANTD_GENERAL.getType(), vue3Vben5AntdGeneralTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 184 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 184 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 185 | // VUE3_VBEN5_EP_SCHEMA | 185 | // VUE3_VBEN5_EP_SCHEMA |
| 186 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/data.ts"), | 186 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/data.ts"), |
| 187 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/data.ts")) | 187 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/data.ts")) |
| 188 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/index.vue"), | 188 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/index.vue"), |
| 189 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/index.vue")) | 189 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/index.vue")) |
| 190 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/form.vue"), | 190 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/form.vue"), |
| 191 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) | 191 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) |
| 192 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("api/api.ts"), | 192 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("api/api.ts"), |
| 193 | - vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 193 | + vue3VbenFilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 194 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 | 194 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 |
| 195 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 195 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 196 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 | 196 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 197 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 197 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 198 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 | 198 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 199 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 199 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 200 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 | 200 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 201 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 201 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 202 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 | 202 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_SCHEMA.getType(), vue3Vben5EpSchemaTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 203 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 203 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 204 | // VUE3_VBEN5_EP | 204 | // VUE3_VBEN5_EP |
| 205 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/index.vue"), | 205 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/index.vue"), |
| 206 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/index.vue")) | 206 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/index.vue")) |
| 207 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/form.vue"), | 207 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/form.vue"), |
| 208 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) | 208 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/form.vue")) |
| 209 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("api/api.ts"), | 209 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("api/api.ts"), |
| 210 | - vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) | 210 | + vue3VbenFilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 211 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 | 211 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_normal.vue"), // 特殊:主子表专属逻辑 |
| 212 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 212 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 213 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 | 213 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 214 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 214 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 215 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 | 215 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/form_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 216 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) | 216 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-form.vue")) |
| 217 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 | 217 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/list_sub_inner.vue"), // 特殊:主子表专属逻辑 |
| 218 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 218 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 219 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 | 219 | .put(CodegenFrontTypeEnum.VUE3_VBEN5_EP_GENERAL.getType(), vue3Vben5EpGeneralTemplatePath("views/modules/list_sub_erp.vue"), // 特殊:主子表专属逻辑 |
| 220 | - vue3FilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) | 220 | + vue3VbenFilePath("views/${table.moduleName}/${table.businessName}/modules/${subSimpleClassName_strikeCase}-list.vue")) |
| 221 | .build(); | 221 | .build(); |
| 222 | 222 | ||
| 223 | @Resource | 223 | @Resource |
| @@ -614,6 +614,11 @@ public class CodegenEngine { | @@ -614,6 +614,11 @@ public class CodegenEngine { | ||
| 614 | "src/" + path; | 614 | "src/" + path; |
| 615 | } | 615 | } |
| 616 | 616 | ||
| 617 | + private static String vue3VbenFilePath(String path) { | ||
| 618 | + return "yudao-ui-${sceneEnum.basePackage}-vben/" + // 顶级目录 | ||
| 619 | + "src/" + path; | ||
| 620 | + } | ||
| 621 | + | ||
| 617 | private static String vue3VbenTemplatePath(String path) { | 622 | private static String vue3VbenTemplatePath(String path) { |
| 618 | return "codegen/vue3_vben/" + path + ".vm"; | 623 | return "codegen/vue3_vben/" + path + ".vm"; |
| 619 | } | 624 | } |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
| @@ -40,11 +40,16 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { | @@ -40,11 +40,16 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { | ||
| 40 | ApiErrorLogDO apiErrorLog = BeanUtils.toBean(createDTO, ApiErrorLogDO.class) | 40 | ApiErrorLogDO apiErrorLog = BeanUtils.toBean(createDTO, ApiErrorLogDO.class) |
| 41 | .setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); | 41 | .setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); |
| 42 | apiErrorLog.setRequestParams(StrUtils.maxLength(apiErrorLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH)); | 42 | apiErrorLog.setRequestParams(StrUtils.maxLength(apiErrorLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH)); |
| 43 | - if (TenantContextHolder.getTenantId() != null) { | ||
| 44 | - apiErrorLogMapper.insert(apiErrorLog); | ||
| 45 | - } else { | ||
| 46 | - // 极端情况下,上下文中没有租户时,此时忽略租户上下文,避免插入失败! | ||
| 47 | - TenantUtils.executeIgnore(() -> apiErrorLogMapper.insert(apiErrorLog)); | 43 | + try { |
| 44 | + if (TenantContextHolder.getTenantId() != null) { | ||
| 45 | + apiErrorLogMapper.insert(apiErrorLog); | ||
| 46 | + } else { | ||
| 47 | + // 极端情况下,上下文中没有租户时,此时忽略租户上下文,避免插入失败! | ||
| 48 | + TenantUtils.executeIgnore(() -> apiErrorLogMapper.insert(apiErrorLog)); | ||
| 49 | + } | ||
| 50 | + } catch (Exception ex) { | ||
| 51 | + // 兜底处理,目前只有 yudao-cloud 会发生:https://gitee.com/yudaocode/yudao-cloud-mini/issues/IC1O0A | ||
| 52 | + log.error("[createApiErrorLog][记录时({}) 发生异常]", createDTO, ex); | ||
| 48 | } | 53 | } |
| 49 | } | 54 | } |
| 50 | 55 |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/websocket/DemoWebSocketMessageListener.java
| @@ -6,11 +6,10 @@ import cn.iocoder.yudao.framework.websocket.core.sender.WebSocketMessageSender; | @@ -6,11 +6,10 @@ import cn.iocoder.yudao.framework.websocket.core.sender.WebSocketMessageSender; | ||
| 6 | import cn.iocoder.yudao.framework.websocket.core.util.WebSocketFrameworkUtils; | 6 | import cn.iocoder.yudao.framework.websocket.core.util.WebSocketFrameworkUtils; |
| 7 | import cn.iocoder.yudao.module.infra.websocket.message.DemoReceiveMessage; | 7 | import cn.iocoder.yudao.module.infra.websocket.message.DemoReceiveMessage; |
| 8 | import cn.iocoder.yudao.module.infra.websocket.message.DemoSendMessage; | 8 | import cn.iocoder.yudao.module.infra.websocket.message.DemoSendMessage; |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 10 | import org.springframework.web.socket.WebSocketSession; | 11 | import org.springframework.web.socket.WebSocketSession; |
| 11 | 12 | ||
| 12 | -import jakarta.annotation.Resource; | ||
| 13 | - | ||
| 14 | /** | 13 | /** |
| 15 | * WebSocket 示例:单发消息 | 14 | * WebSocket 示例:单发消息 |
| 16 | * | 15 | * |
| @@ -19,7 +18,8 @@ import jakarta.annotation.Resource; | @@ -19,7 +18,8 @@ import jakarta.annotation.Resource; | ||
| 19 | @Component | 18 | @Component |
| 20 | public class DemoWebSocketMessageListener implements WebSocketMessageListener<DemoSendMessage> { | 19 | public class DemoWebSocketMessageListener implements WebSocketMessageListener<DemoSendMessage> { |
| 21 | 20 | ||
| 22 | - @Resource | 21 | + @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") |
| 22 | + @Autowired(required = false) // 由于 yudao.websocket.enable 配置项,可以关闭 WebSocket 的功能,所以这里只能不强制注入 | ||
| 23 | private WebSocketMessageSender webSocketMessageSender; | 23 | private WebSocketMessageSender webSocketMessageSender; |
| 24 | 24 | ||
| 25 | @Override | 25 | @Override |
yudao-module-infra/src/main/resources/codegen/java/controller/vo/respVO.vm
| @@ -19,7 +19,7 @@ import java.time.LocalDateTime; | @@ -19,7 +19,7 @@ import java.time.LocalDateTime; | ||
| 19 | #end | 19 | #end |
| 20 | #end | 20 | #end |
| 21 | ## 处理 Excel 导出 | 21 | ## 处理 Excel 导出 |
| 22 | -import com.alibaba.excel.annotation.*; | 22 | +import cn.idev.excel.annotation.*; |
| 23 | #foreach ($column in $columns) | 23 | #foreach ($column in $columns) |
| 24 | #if ("$!column.dictType" != "")## 有设置数据字典 | 24 | #if ("$!column.dictType" != "")## 有设置数据字典 |
| 25 | import ${DictFormatClassName}; | 25 | import ${DictFormatClassName}; |
| @@ -50,4 +50,4 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO { | @@ -50,4 +50,4 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO { | ||
| 50 | 50 | ||
| 51 | #end | 51 | #end |
| 52 | #end | 52 | #end |
| 53 | -} | ||
| 54 | \ No newline at end of file | 53 | \ No newline at end of file |
| 54 | +} |
yudao-module-infra/src/main/resources/codegen/java/dal/do.vm
| @@ -15,7 +15,7 @@ import ${BaseDOClassName}; | @@ -15,7 +15,7 @@ import ${BaseDOClassName}; | ||
| 15 | ## 处理 Excel 导出 + Schema 注解(仅 DO 模式) | 15 | ## 处理 Excel 导出 + Schema 注解(仅 DO 模式) |
| 16 | #if ($voType == 20) | 16 | #if ($voType == 20) |
| 17 | import io.swagger.v3.oas.annotations.media.Schema; | 17 | import io.swagger.v3.oas.annotations.media.Schema; |
| 18 | -import com.alibaba.excel.annotation.*; | 18 | +import cn.idev.excel.annotation.*; |
| 19 | #foreach ($column in $columns) | 19 | #foreach ($column in $columns) |
| 20 | #if ("$!column.dictType" != "")## 有设置数据字典 | 20 | #if ("$!column.dictType" != "")## 有设置数据字典 |
| 21 | import ${DictFormatClassName}; | 21 | import ${DictFormatClassName}; |
| @@ -100,4 +100,4 @@ public class ${table.className}DO extends BaseDO { | @@ -100,4 +100,4 @@ public class ${table.className}DO extends BaseDO { | ||
| 100 | #end | 100 | #end |
| 101 | #end | 101 | #end |
| 102 | 102 | ||
| 103 | -} | ||
| 104 | \ No newline at end of file | 103 | \ No newline at end of file |
| 104 | +} |
yudao-module-infra/src/main/resources/codegen/java/test/serviceTest.vm
| @@ -2,7 +2,6 @@ package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; | @@ -2,7 +2,6 @@ package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; | ||
| 2 | 2 | ||
| 3 | import org.junit.jupiter.api.Disabled; | 3 | import org.junit.jupiter.api.Disabled; |
| 4 | import org.junit.jupiter.api.Test; | 4 | import org.junit.jupiter.api.Test; |
| 5 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 6 | 5 | ||
| 7 | import ${jakartaPackage}.annotation.Resource; | 6 | import ${jakartaPackage}.annotation.Resource; |
| 8 | 7 |
yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
| @@ -138,6 +138,7 @@ watch( | @@ -138,6 +138,7 @@ watch( | ||
| 138 | () => props.${subJoinColumn.javaField}, | 138 | () => props.${subJoinColumn.javaField}, |
| 139 | (val: number) => { | 139 | (val: number) => { |
| 140 | if (!val) { | 140 | if (!val) { |
| 141 | + list.value = [] // 清空列表 | ||
| 141 | return | 142 | return |
| 142 | } | 143 | } |
| 143 | queryParams.${subJoinColumn.javaField} = val | 144 | queryParams.${subJoinColumn.javaField} = val |
yudao-module-infra/src/main/resources/codegen/vue3/views/index.vue.vm
| @@ -353,6 +353,7 @@ const handleDelete = async (id: number) => { | @@ -353,6 +353,7 @@ const handleDelete = async (id: number) => { | ||
| 353 | // 发起删除 | 353 | // 发起删除 |
| 354 | await ${simpleClassName}Api.delete${simpleClassName}(id) | 354 | await ${simpleClassName}Api.delete${simpleClassName}(id) |
| 355 | message.success(t('common.delSuccess')) | 355 | message.success(t('common.delSuccess')) |
| 356 | + currentRow.value = {} | ||
| 356 | // 刷新列表 | 357 | // 刷新列表 |
| 357 | await getList() | 358 | await getList() |
| 358 | } catch {} | 359 | } catch {} |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImplTest.java
| @@ -24,8 +24,8 @@ import com.baomidou.mybatisplus.generator.config.po.TableField; | @@ -24,8 +24,8 @@ import com.baomidou.mybatisplus.generator.config.po.TableField; | ||
| 24 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; | 24 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| 25 | import jakarta.annotation.Resource; | 25 | import jakarta.annotation.Resource; |
| 26 | import org.junit.jupiter.api.Test; | 26 | import org.junit.jupiter.api.Test; |
| 27 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 28 | import org.springframework.context.annotation.Import; | 27 | import org.springframework.context.annotation.Import; |
| 28 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 29 | 29 | ||
| 30 | import java.util.Arrays; | 30 | import java.util.Arrays; |
| 31 | import java.util.Collections; | 31 | import java.util.Collections; |
| @@ -60,15 +60,15 @@ public class CodegenServiceImplTest extends BaseDbUnitTest { | @@ -60,15 +60,15 @@ public class CodegenServiceImplTest extends BaseDbUnitTest { | ||
| 60 | @Resource | 60 | @Resource |
| 61 | private CodegenColumnMapper codegenColumnMapper; | 61 | private CodegenColumnMapper codegenColumnMapper; |
| 62 | 62 | ||
| 63 | - @MockBean | 63 | + @MockitoBean |
| 64 | private DatabaseTableService databaseTableService; | 64 | private DatabaseTableService databaseTableService; |
| 65 | 65 | ||
| 66 | - @MockBean | 66 | + @MockitoBean |
| 67 | private CodegenBuilder codegenBuilder; | 67 | private CodegenBuilder codegenBuilder; |
| 68 | - @MockBean | 68 | + @MockitoBean |
| 69 | private CodegenEngine codegenEngine; | 69 | private CodegenEngine codegenEngine; |
| 70 | 70 | ||
| 71 | - @MockBean | 71 | + @MockitoBean |
| 72 | private CodegenProperties codegenProperties; | 72 | private CodegenProperties codegenProperties; |
| 73 | 73 | ||
| 74 | @Test | 74 | @Test |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java
| @@ -11,14 +11,14 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; | @@ -11,14 +11,14 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; | ||
| 11 | import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; | 11 | import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; |
| 12 | import com.baomidou.dynamic.datasource.creator.DataSourceProperty; | 12 | import com.baomidou.dynamic.datasource.creator.DataSourceProperty; |
| 13 | import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; | 13 | import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; |
| 14 | +import jakarta.annotation.Resource; | ||
| 14 | import org.junit.jupiter.api.BeforeEach; | 15 | import org.junit.jupiter.api.BeforeEach; |
| 15 | import org.junit.jupiter.api.Test; | 16 | import org.junit.jupiter.api.Test; |
| 16 | import org.mockito.MockedStatic; | 17 | import org.mockito.MockedStatic; |
| 17 | import org.mockito.stubbing.Answer; | 18 | import org.mockito.stubbing.Answer; |
| 18 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 19 | import org.springframework.context.annotation.Import; | 19 | import org.springframework.context.annotation.Import; |
| 20 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 20 | 21 | ||
| 21 | -import jakarta.annotation.Resource; | ||
| 22 | import java.util.List; | 22 | import java.util.List; |
| 23 | 23 | ||
| 24 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | 24 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| @@ -46,10 +46,10 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { | @@ -46,10 +46,10 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { | ||
| 46 | @Resource | 46 | @Resource |
| 47 | private DataSourceConfigMapper dataSourceConfigMapper; | 47 | private DataSourceConfigMapper dataSourceConfigMapper; |
| 48 | 48 | ||
| 49 | - @MockBean | 49 | + @MockitoBean |
| 50 | private AES aes; | 50 | private AES aes; |
| 51 | 51 | ||
| 52 | - @MockBean | 52 | + @MockitoBean |
| 53 | private DynamicDataSourceProperties dynamicDataSourceProperties; | 53 | private DynamicDataSourceProperties dynamicDataSourceProperties; |
| 54 | 54 | ||
| 55 | @BeforeEach | 55 | @BeforeEach |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImplTest.java
| @@ -5,12 +5,12 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; | @@ -5,12 +5,12 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; | ||
| 5 | import com.baomidou.mybatisplus.generator.config.po.TableField; | 5 | import com.baomidou.mybatisplus.generator.config.po.TableField; |
| 6 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; | 6 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| 7 | import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; | 7 | import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; |
| 8 | +import jakarta.annotation.Resource; | ||
| 8 | import org.apache.ibatis.type.JdbcType; | 9 | import org.apache.ibatis.type.JdbcType; |
| 9 | import org.junit.jupiter.api.Test; | 10 | import org.junit.jupiter.api.Test; |
| 10 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 11 | import org.springframework.context.annotation.Import; | 11 | import org.springframework.context.annotation.Import; |
| 12 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 12 | 13 | ||
| 13 | -import jakarta.annotation.Resource; | ||
| 14 | import java.util.List; | 14 | import java.util.List; |
| 15 | 15 | ||
| 16 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | 16 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| @@ -24,7 +24,7 @@ public class DatabaseTableServiceImplTest extends BaseDbUnitTest { | @@ -24,7 +24,7 @@ public class DatabaseTableServiceImplTest extends BaseDbUnitTest { | ||
| 24 | @Resource | 24 | @Resource |
| 25 | private DatabaseTableServiceImpl databaseTableService; | 25 | private DatabaseTableServiceImpl databaseTableService; |
| 26 | 26 | ||
| 27 | - @MockBean | 27 | + @MockitoBean |
| 28 | private DataSourceConfigService dataSourceConfigService; | 28 | private DataSourceConfigService dataSourceConfigService; |
| 29 | 29 | ||
| 30 | @Test | 30 | @Test |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java
| @@ -4,24 +4,24 @@ import cn.hutool.core.date.DatePattern; | @@ -4,24 +4,24 @@ import cn.hutool.core.date.DatePattern; | ||
| 4 | import cn.hutool.core.date.LocalDateTimeUtil; | 4 | import cn.hutool.core.date.LocalDateTimeUtil; |
| 5 | import cn.hutool.core.map.MapUtil; | 5 | import cn.hutool.core.map.MapUtil; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | ||
| 8 | +import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; | ||
| 10 | +import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; | ||
| 11 | +import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; | ||
| 7 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | 12 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; |
| 8 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; | 13 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; |
| 9 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; | 14 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; |
| 10 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; | 15 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; |
| 11 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; | 16 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; |
| 12 | import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; | 17 | import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; |
| 13 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | ||
| 14 | -import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; | ||
| 15 | -import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; | ||
| 16 | -import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; | ||
| 17 | -import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; | 18 | +import jakarta.annotation.Resource; |
| 19 | +import jakarta.validation.Validator; | ||
| 18 | import lombok.Data; | 20 | import lombok.Data; |
| 19 | import org.junit.jupiter.api.Test; | 21 | import org.junit.jupiter.api.Test; |
| 20 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 21 | import org.springframework.context.annotation.Import; | 22 | import org.springframework.context.annotation.Import; |
| 23 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 22 | 24 | ||
| 23 | -import jakarta.annotation.Resource; | ||
| 24 | -import jakarta.validation.Validator; | ||
| 25 | import java.io.Serializable; | 25 | import java.io.Serializable; |
| 26 | import java.time.LocalDateTime; | 26 | import java.time.LocalDateTime; |
| 27 | import java.util.Map; | 27 | import java.util.Map; |
| @@ -53,9 +53,9 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { | @@ -53,9 +53,9 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { | ||
| 53 | @Resource | 53 | @Resource |
| 54 | private FileConfigMapper fileConfigMapper; | 54 | private FileConfigMapper fileConfigMapper; |
| 55 | 55 | ||
| 56 | - @MockBean | 56 | + @MockitoBean |
| 57 | private Validator validator; | 57 | private Validator validator; |
| 58 | - @MockBean | 58 | + @MockitoBean |
| 59 | private FileClientFactory fileClientFactory; | 59 | private FileClientFactory fileClientFactory; |
| 60 | 60 | ||
| 61 | @Test | 61 | @Test |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java
| @@ -12,8 +12,8 @@ import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | @@ -12,8 +12,8 @@ import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | ||
| 12 | import jakarta.annotation.Resource; | 12 | import jakarta.annotation.Resource; |
| 13 | import org.junit.jupiter.api.BeforeEach; | 13 | import org.junit.jupiter.api.BeforeEach; |
| 14 | import org.junit.jupiter.api.Test; | 14 | import org.junit.jupiter.api.Test; |
| 15 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 16 | import org.springframework.context.annotation.Import; | 15 | import org.springframework.context.annotation.Import; |
| 16 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| 17 | 17 | ||
| 18 | import java.time.LocalDateTime; | 18 | import java.time.LocalDateTime; |
| 19 | import java.util.concurrent.atomic.AtomicReference; | 19 | import java.util.concurrent.atomic.AtomicReference; |
| @@ -35,7 +35,7 @@ public class FileServiceImplTest extends BaseDbUnitTest { | @@ -35,7 +35,7 @@ public class FileServiceImplTest extends BaseDbUnitTest { | ||
| 35 | @Resource | 35 | @Resource |
| 36 | private FileMapper fileMapper; | 36 | private FileMapper fileMapper; |
| 37 | 37 | ||
| 38 | - @MockBean | 38 | + @MockitoBean |
| 39 | private FileConfigService fileConfigService; | 39 | private FileConfigService fileConfigService; |
| 40 | 40 | ||
| 41 | @BeforeEach | 41 | @BeforeEach |
yudao-module-infra/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImplTest.java
| @@ -10,13 +10,12 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO; | @@ -10,13 +10,12 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO; | ||
| 10 | import cn.iocoder.yudao.module.infra.dal.mysql.job.JobMapper; | 10 | import cn.iocoder.yudao.module.infra.dal.mysql.job.JobMapper; |
| 11 | import cn.iocoder.yudao.module.infra.enums.job.JobStatusEnum; | 11 | import cn.iocoder.yudao.module.infra.enums.job.JobStatusEnum; |
| 12 | import cn.iocoder.yudao.module.infra.job.job.JobLogCleanJob; | 12 | import cn.iocoder.yudao.module.infra.job.job.JobLogCleanJob; |
| 13 | +import jakarta.annotation.Resource; | ||
| 13 | import org.junit.jupiter.api.Test; | 14 | import org.junit.jupiter.api.Test; |
| 14 | import org.mockito.MockedStatic; | 15 | import org.mockito.MockedStatic; |
| 15 | import org.quartz.SchedulerException; | 16 | import org.quartz.SchedulerException; |
| 16 | -import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 17 | import org.springframework.context.annotation.Import; | 17 | import org.springframework.context.annotation.Import; |
| 18 | - | ||
| 19 | -import jakarta.annotation.Resource; | 18 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; |
| 20 | 19 | ||
| 21 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | 20 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 22 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | 21 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| @@ -36,10 +35,10 @@ public class JobServiceImplTest extends BaseDbUnitTest { | @@ -36,10 +35,10 @@ public class JobServiceImplTest extends BaseDbUnitTest { | ||
| 36 | private JobServiceImpl jobService; | 35 | private JobServiceImpl jobService; |
| 37 | @Resource | 36 | @Resource |
| 38 | private JobMapper jobMapper; | 37 | private JobMapper jobMapper; |
| 39 | - @MockBean | 38 | + @MockitoBean |
| 40 | private SchedulerManager schedulerManager; | 39 | private SchedulerManager schedulerManager; |
| 41 | 40 | ||
| 42 | - @MockBean | 41 | + @MockitoBean |
| 43 | private JobLogCleanJob jobLogCleanJob; | 42 | private JobLogCleanJob jobLogCleanJob; |
| 44 | 43 | ||
| 45 | @Test | 44 | @Test |
yudao-module-infra/src/test/resources/codegen/windows10/vue2_master_erp/java/InfraStudentRespVO
| @@ -6,7 +6,7 @@ import java.util.*; | @@ -6,7 +6,7 @@ import java.util.*; | ||
| 6 | import java.util.*; | 6 | import java.util.*; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 7 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 9 | -import com.alibaba.excel.annotation.*; | 9 | +import cn.idev.excel.annotation.*; |
| 10 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 10 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 11 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 11 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 12 | 12 | ||
| @@ -57,4 +57,4 @@ public class InfraStudentRespVO { | @@ -57,4 +57,4 @@ public class InfraStudentRespVO { | ||
| 57 | @ExcelProperty("创建时间") | 57 | @ExcelProperty("创建时间") |
| 58 | private LocalDateTime createTime; | 58 | private LocalDateTime createTime; |
| 59 | 59 | ||
| 60 | -} | ||
| 61 | \ No newline at end of file | 60 | \ No newline at end of file |
| 61 | +} |