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 | 32 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 33 | 33 | |
| 34 | 34 | <properties> |
| 35 | - <revision>2.6.1-SNAPSHOT</revision> | |
| 35 | + <revision>2025.08-SNAPSHOT</revision> | |
| 36 | 36 | <!-- Maven 相关 --> |
| 37 | 37 | <java.version>17</java.version> |
| 38 | 38 | <maven.compiler.source>${java.version}</maven.compiler.source> | ... | ... |
yudao-dependencies/pom.xml
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 15 | |
| 16 | 16 | <properties> |
| 17 | - <revision>2.6.1-SNAPSHOT</revision> | |
| 17 | + <revision>2025.08-SNAPSHOT</revision> | |
| 18 | 18 | <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version> |
| 19 | 19 | <!-- 统一依赖管理 --> |
| 20 | 20 | <spring.boot.version>3.4.5</spring.boot.version> |
| ... | ... | @@ -24,9 +24,9 @@ |
| 24 | 24 | <!-- DB 相关 --> |
| 25 | 25 | <druid.version>1.2.24</druid.version> |
| 26 | 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 | 29 | <dynamic-datasource.version>4.3.1</dynamic-datasource.version> |
| 29 | - <mybatis-plus-join.version>1.4.13</mybatis-plus-join.version> | |
| 30 | 30 | <easy-trans.version>3.0.6</easy-trans.version> |
| 31 | 31 | <redisson.version>3.41.0</redisson.version> |
| 32 | 32 | <dm8.jdbc.version>8.1.3.140</dm8.jdbc.version> |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | <mapstruct.version>1.6.3</mapstruct.version> |
| 55 | 55 | <hutool-5.version>5.8.35</hutool-5.version> |
| 56 | 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 | 58 | <velocity.version>2.4.1</velocity.version> |
| 59 | 59 | <fastjson.version>1.2.83</fastjson.version> |
| 60 | 60 | <guava.version>33.4.8-jre</guava.version> |
| ... | ... | @@ -69,8 +69,6 @@ |
| 69 | 69 | <pf4j-spring.version>0.9.0</pf4j-spring.version> |
| 70 | 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 | 72 | <awssdk.version>2.30.14</awssdk.version> |
| 75 | 73 | <justauth.version>1.16.7</justauth.version> |
| 76 | 74 | <justauth-starter.version>1.4.0</justauth-starter.version> |
| ... | ... | @@ -480,20 +478,11 @@ |
| 480 | 478 | </dependency> |
| 481 | 479 | |
| 482 | 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 | 484 | </dependency> |
| 485 | + | |
| 497 | 486 | <dependency> |
| 498 | 487 | <groupId>org.apache.tika</groupId> |
| 499 | 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 | 26 | */ |
| 27 | 27 | private Integer code; |
| 28 | 28 | /** |
| 29 | - * 返回数据 | |
| 30 | - */ | |
| 31 | - private T data; | |
| 32 | - /** | |
| 33 | 29 | * 错误提示,用户可阅读 |
| 34 | 30 | * |
| 35 | 31 | * @see ErrorCode#getMsg() () |
| 36 | 32 | */ |
| 37 | 33 | private String msg; |
| 34 | + /** | |
| 35 | + * 返回数据 | |
| 36 | + */ | |
| 37 | + private T data; | |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 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 | 11 | @Data |
| 12 | 12 | public final class PageResult<T> implements Serializable { |
| 13 | 13 | |
| 14 | - @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 15 | - private List<T> list; | |
| 16 | - | |
| 17 | 14 | @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED) |
| 18 | 15 | private Long total; |
| 19 | 16 | |
| 17 | + @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 18 | + private List<T> list; | |
| 19 | + | |
| 20 | 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 | 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 | 25 | * 构建异步刷新的 LoadingCache 对象 |
| 19 | 26 | * |
| 20 | 27 | * 注意:如果你的缓存和 ThreadLocal 有关系,要么自己处理 ThreadLocal 的传递,要么使用 {@link #buildCache(Duration, CacheLoader)} 方法 |
| ... | ... | @@ -29,6 +36,7 @@ public class CacheUtils { |
| 29 | 36 | */ |
| 30 | 37 | public static <K, V> LoadingCache<K, V> buildAsyncReloadingCache(Duration duration, CacheLoader<K, V> loader) { |
| 31 | 38 | return CacheBuilder.newBuilder() |
| 39 | + .maximumSize(CACHE_MAX_SIZE) | |
| 32 | 40 | // 只阻塞当前数据加载线程,其他线程返回旧值 |
| 33 | 41 | .refreshAfterWrite(duration) |
| 34 | 42 | // 通过 asyncReloading 实现全异步加载,包括 refreshAfterWrite 被阻塞的加载线程 |
| ... | ... | @@ -43,7 +51,11 @@ public class CacheUtils { |
| 43 | 51 | * @return LoadingCache 对象 |
| 44 | 52 | */ |
| 45 | 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 | 74 | * 创建指定时间 |
| 75 | 75 | * |
| 76 | 76 | * @param year 年 |
| 77 | - * @param mouth 月 | |
| 77 | + * @param month 月 | |
| 78 | 78 | * @param day 日 |
| 79 | 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 | 88 | * @param year 年 |
| 89 | - * @param mouth 月 | |
| 89 | + * @param month 月 | |
| 90 | 90 | * @param day 日 |
| 91 | 91 | * @param hour 小时 |
| 92 | 92 | * @param minute 分钟 |
| 93 | 93 | * @param second 秒 |
| 94 | 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 | 97 | int hour, int minute, int second) { |
| 98 | 98 | Calendar calendar = Calendar.getInstance(); |
| 99 | 99 | calendar.set(Calendar.YEAR, year); |
| 100 | - calendar.set(Calendar.MONTH, mouth - 1); | |
| 100 | + calendar.set(Calendar.MONTH, month - 1); | |
| 101 | 101 | calendar.set(Calendar.DAY_OF_MONTH, day); |
| 102 | 102 | calendar.set(Calendar.HOUR_OF_DAY, hour); |
| 103 | 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 | 69 | * 创建指定时间 |
| 70 | 70 | * |
| 71 | 71 | * @param year 年 |
| 72 | - * @param mouth 月 | |
| 72 | + * @param month 月 | |
| 73 | 73 | * @param day 日 |
| 74 | 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 | 18 | */ |
| 19 | 19 | @AutoConfiguration |
| 20 | 20 | @ConditionalOnClass(LoginUser.class) |
| 21 | -@ConditionalOnBean(value = {PermissionCommonApi.class, DeptDataPermissionRuleCustomizer.class}) | |
| 21 | +@ConditionalOnBean(value = {DeptDataPermissionRuleCustomizer.class}) | |
| 22 | 22 | public class YudaoDeptDataPermissionAutoConfiguration { |
| 23 | 23 | |
| 24 | 24 | @Bean | ... | ... |
yudao-framework/yudao-spring-boot-starter-excel/pom.xml
| ... | ... | @@ -42,18 +42,19 @@ |
| 42 | 42 | |
| 43 | 43 | <!-- 工具类相关 --> |
| 44 | 44 | <dependency> |
| 45 | - <groupId>com.alibaba</groupId> | |
| 46 | - <artifactId>easyexcel</artifactId> | |
| 45 | + <groupId>cn.idev.excel</groupId> | |
| 46 | + <artifactId>fastexcel</artifactId> | |
| 47 | 47 | </dependency> |
| 48 | 48 | |
| 49 | 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 | 53 | </dependency> |
| 53 | 54 | |
| 54 | 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 | 58 | </dependency> |
| 58 | 59 | |
| 59 | 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 | 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 | 3 | import cn.hutool.core.convert.Convert; |
| 4 | 4 | import cn.iocoder.yudao.framework.ip.core.Area; |
| 5 | 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 | 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 | 3 | import cn.hutool.core.convert.Convert; |
| 4 | 4 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; |
| 5 | 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 | 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 | 1 | package cn.iocoder.yudao.framework.excel.core.convert; |
| 2 | 2 | |
| 3 | 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 | 11 | * Excel Json 转换器 | ... | ... |
yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/MoneyConvert.java
| 1 | 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 | 9 | import java.math.BigDecimal; |
| 10 | 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 | 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 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.lang.Assert; |
| 5 | 5 | import cn.hutool.core.util.ObjectUtil; |
| 6 | -import cn.hutool.core.util.ReflectUtil; | |
| 7 | 6 | import cn.hutool.core.util.StrUtil; |
| 8 | 7 | import cn.hutool.extra.spring.SpringUtil; |
| 9 | 8 | import cn.hutool.poi.excel.ExcelUtil; |
| ... | ... | @@ -11,12 +10,12 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; |
| 11 | 10 | import cn.iocoder.yudao.framework.dict.core.DictFrameworkUtils; |
| 12 | 11 | import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect; |
| 13 | 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 | 19 | import lombok.extern.slf4j.Slf4j; |
| 21 | 20 | import org.apache.poi.hssf.usermodel.HSSFDataValidation; |
| 22 | 21 | import org.apache.poi.ss.usermodel.*; |
| ... | ... | @@ -87,7 +86,7 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { |
| 87 | 86 | |
| 88 | 87 | /** |
| 89 | 88 | * 判断字段是否是静态的、最终的、 transient 的 |
| 90 | - * 原因:EasyExcel 默认是忽略 static final 或 transient 的字段,所以需要判断 | |
| 89 | + * 原因:FastExcel 默认是忽略 static final 或 transient 的字段,所以需要判断 | |
| 91 | 90 | * |
| 92 | 91 | * @param field 字段 |
| 93 | 92 | * @return 是否是静态的、最终的、transient 的 |
| ... | ... | @@ -185,4 +184,4 @@ public class SelectSheetWriteHandler implements SheetWriteHandler { |
| 185 | 184 | writeSheetHolder.getSheet().addValidationData(validation); |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | -} | |
| 189 | 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 | 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 | 5 | import cn.iocoder.yudao.framework.common.util.http.HttpUtils; |
| 6 | +import cn.iocoder.yudao.framework.excel.core.handler.ColumnWidthMatchStyleStrategy; | |
| 4 | 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 | 8 | import jakarta.servlet.http.HttpServletResponse; |
| 9 | 9 | import org.springframework.web.multipart.MultipartFile; |
| 10 | 10 | |
| ... | ... | @@ -32,9 +32,9 @@ public class ExcelUtils { |
| 32 | 32 | public static <T> void write(HttpServletResponse response, String filename, String sheetName, |
| 33 | 33 | Class<T> head, List<T> data) throws IOException { |
| 34 | 34 | // 输出 Excel |
| 35 | - EasyExcel.write(response.getOutputStream(), head) | |
| 35 | + FastExcelFactory.write(response.getOutputStream(), head) | |
| 36 | 36 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| 37 | - .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 | |
| 37 | + .registerWriteHandler(new ColumnWidthMatchStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度 | |
| 38 | 38 | .registerWriteHandler(new SelectSheetWriteHandler(head)) // 基于固定 sheet 实现下拉框 |
| 39 | 39 | .registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度 |
| 40 | 40 | .sheet(sheetName).doWrite(data); |
| ... | ... | @@ -44,7 +44,7 @@ public class ExcelUtils { |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 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 | 48 | .autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理 |
| 49 | 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 | 44 | <dependency> |
| 45 | 45 | <groupId>io.opentracing</groupId> |
| 46 | 46 | <artifactId>opentracing-util</artifactId> |
| 47 | + <optional>true</optional> | |
| 47 | 48 | </dependency> |
| 48 | 49 | <dependency> |
| 49 | 50 | <groupId>org.apache.skywalking</groupId> |
| 50 | 51 | <artifactId>apm-toolkit-trace</artifactId> |
| 52 | + <optional>true</optional> | |
| 51 | 53 | </dependency> |
| 52 | 54 | <dependency> |
| 53 | 55 | <groupId>org.apache.skywalking</groupId> |
| 54 | 56 | <artifactId>apm-toolkit-logback-1.x</artifactId> |
| 57 | + <optional>true</optional> | |
| 55 | 58 | </dependency> |
| 56 | 59 | <dependency> |
| 57 | 60 | <groupId>org.apache.skywalking</groupId> |
| 58 | 61 | <artifactId>apm-toolkit-opentracing</artifactId> |
| 62 | + <optional>true</optional> | |
| 59 | 63 | </dependency> |
| 60 | 64 | |
| 61 | 65 | <!-- Micrometer 对 Prometheus 的支持 --> |
| 62 | 66 | <dependency> |
| 63 | 67 | <groupId>io.micrometer</groupId> |
| 64 | 68 | <artifactId>micrometer-registry-prometheus</artifactId> |
| 69 | + <optional>true</optional> | |
| 65 | 70 | </dependency> |
| 66 | 71 | |
| 67 | 72 | <dependency> |
| 68 | 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 | 76 | </dependency> |
| 71 | 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 | 3 | import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect; |
| 5 | 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 | 9 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 7 | 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| 8 | 11 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| ... | ... | @@ -16,30 +19,32 @@ import org.springframework.context.annotation.Bean; |
| 16 | 19 | * @author mashu |
| 17 | 20 | */ |
| 18 | 21 | @AutoConfiguration |
| 19 | -@ConditionalOnClass({BizTraceAspect.class}) | |
| 22 | +@ConditionalOnClass(name = { | |
| 23 | + "org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer", | |
| 24 | + "io.opentracing.Tracer" | |
| 25 | +}) | |
| 20 | 26 | @EnableConfigurationProperties(TracerProperties.class) |
| 21 | 27 | @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) |
| 22 | 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 | 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 | 118 | |
| 119 | 119 | @Override |
| 120 | 120 | public <X> MPJLambdaWrapperX<T> orderByDesc(SFunction<X, ?> column) { |
| 121 | - //noinspection unchecked | |
| 122 | 121 | super.orderByDesc(true, column); |
| 123 | 122 | return this; |
| 124 | 123 | } |
| ... | ... | @@ -208,7 +207,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | 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 | 211 | super.selectCount(column, alias); |
| 213 | 212 | return this; |
| 214 | 213 | } |
| ... | ... | @@ -226,7 +225,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 226 | 225 | } |
| 227 | 226 | |
| 228 | 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 | 229 | super.selectSum(column, alias); |
| 231 | 230 | return this; |
| 232 | 231 | } |
| ... | ... | @@ -244,7 +243,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 244 | 243 | } |
| 245 | 244 | |
| 246 | 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 | 247 | super.selectMax(column, alias); |
| 249 | 248 | return this; |
| 250 | 249 | } |
| ... | ... | @@ -262,7 +261,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 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 | 265 | super.selectMin(column, alias); |
| 267 | 266 | return this; |
| 268 | 267 | } |
| ... | ... | @@ -280,7 +279,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 280 | 279 | } |
| 281 | 280 | |
| 282 | 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 | 283 | super.selectAvg(column, alias); |
| 285 | 284 | return this; |
| 286 | 285 | } |
| ... | ... | @@ -298,7 +297,7 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> { |
| 298 | 297 | } |
| 299 | 298 | |
| 300 | 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 | 301 | super.selectLen(column, alias); |
| 303 | 302 | return this; |
| 304 | 303 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/pom.xml
| ... | ... | @@ -53,7 +53,13 @@ |
| 53 | 53 | <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> |
| 54 | 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 | 63 | <dependency> |
| 58 | 64 | <groupId>org.jsoup</groupId> |
| 59 | 65 | <artifactId>jsoup</artifactId> | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/CacheRequestBodyFilter.java
| 1 | 1 | package cn.iocoder.yudao.framework.web.core.filter; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.util.StrUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 4 | 5 | import org.springframework.web.filter.OncePerRequestFilter; |
| 5 | 6 | |
| ... | ... | @@ -16,6 +17,14 @@ import java.io.IOException; |
| 16 | 17 | */ |
| 17 | 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 | 28 | @Override |
| 20 | 29 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) |
| 21 | 30 | throws IOException, ServletException { |
| ... | ... | @@ -24,7 +33,13 @@ public class CacheRequestBodyFilter extends OncePerRequestFilter { |
| 24 | 33 | |
| 25 | 34 | @Override |
| 26 | 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 | 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 | 5 | import cn.hutool.core.map.MapUtil; |
| 6 | 6 | import cn.hutool.core.util.ObjUtil; |
| 7 | 7 | import cn.hutool.core.util.StrUtil; |
| 8 | -import cn.hutool.extra.servlet.JakartaServletUtil; | |
| 9 | 8 | import cn.iocoder.yudao.framework.common.biz.infra.logger.ApiErrorLogCommonApi; |
| 10 | 9 | import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; |
| 11 | 10 | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| ... | ... | @@ -17,6 +16,7 @@ import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
| 17 | 16 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 18 | 17 | import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; |
| 19 | 18 | import com.fasterxml.jackson.databind.exc.InvalidFormatException; |
| 19 | +import com.google.common.util.concurrent.UncheckedExecutionException; | |
| 20 | 20 | import jakarta.servlet.http.HttpServletRequest; |
| 21 | 21 | import jakarta.validation.ConstraintViolation; |
| 22 | 22 | import jakarta.validation.ConstraintViolationException; |
| ... | ... | @@ -111,6 +111,9 @@ public class GlobalExceptionHandler { |
| 111 | 111 | if (ex instanceof AccessDeniedException) { |
| 112 | 112 | return accessDeniedExceptionHandler(request, (AccessDeniedException) ex); |
| 113 | 113 | } |
| 114 | + if (ex instanceof UncheckedExecutionException && ex.getCause() != ex) { | |
| 115 | + return allExceptionHandler(request, ex.getCause()); | |
| 116 | + } | |
| 114 | 117 | return defaultExceptionHandler(request, ex); |
| 115 | 118 | } |
| 116 | 119 | |
| ... | ... | @@ -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 | 283 | * 处理业务异常 ServiceException |
| 271 | 284 | * |
| 272 | 285 | * 例如说,商品库存不足,用户手机号已存在。 |
| ... | ... | @@ -344,12 +357,12 @@ public class GlobalExceptionHandler { |
| 344 | 357 | errorLog.setApplicationName(applicationName); |
| 345 | 358 | errorLog.setRequestUrl(request.getRequestURI()); |
| 346 | 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 | 362 | errorLog.setRequestParams(JsonUtils.toJsonString(requestParams)); |
| 350 | 363 | errorLog.setRequestMethod(request.getMethod()); |
| 351 | 364 | errorLog.setUserAgent(ServletUtils.getUserAgent(request)); |
| 352 | - errorLog.setUserIp(JakartaServletUtil.getClientIP(request)); | |
| 365 | + errorLog.setUserIp(ServletUtils.getClientIP(request)); | |
| 353 | 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 | 5 | import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; |
| 6 | 6 | import cn.iocoder.yudao.framework.xss.core.filter.XssFilter; |
| 7 | 7 | import cn.iocoder.yudao.framework.xss.core.json.XssStringJsonDeserializer; |
| 8 | -import com.fasterxml.jackson.databind.ObjectMapper; | |
| 9 | 8 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 10 | 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; |
| 11 | 10 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| ... | ... | @@ -42,13 +41,13 @@ public class YudaoXssAutoConfiguration implements WebMvcConfigurer { |
| 42 | 41 | */ |
| 43 | 42 | @Bean |
| 44 | 43 | @ConditionalOnMissingBean(name = "xssJacksonCustomizer") |
| 45 | - @ConditionalOnBean(ObjectMapper.class) | |
| 46 | 44 | @ConditionalOnProperty(value = "yudao.xss.enable", havingValue = "true") |
| 47 | 45 | public Jackson2ObjectMapperBuilderCustomizer xssJacksonCustomizer(XssProperties properties, |
| 48 | 46 | PathMatcher pathMatcher, |
| 49 | 47 | XssCleaner xssCleaner) { |
| 50 | 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 | 12 | import cn.iocoder.yudao.module.ai.dal.dataobject.chat.AiChatConversationDO; |
| 13 | 13 | import cn.iocoder.yudao.module.ai.service.chat.AiChatConversationService; |
| 14 | 14 | import cn.iocoder.yudao.module.ai.service.chat.AiChatMessageService; |
| 15 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 15 | 16 | import io.swagger.v3.oas.annotations.Operation; |
| 16 | 17 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | 18 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -54,6 +55,7 @@ public class AiChatConversationController { |
| 54 | 55 | |
| 55 | 56 | @GetMapping("/my-list") |
| 56 | 57 | @Operation(summary = "获得【我的】聊天对话列表") |
| 58 | + @TransMethodResult | |
| 57 | 59 | public CommonResult<List<AiChatConversationRespVO>> getChatConversationMyList() { |
| 58 | 60 | List<AiChatConversationDO> list = chatConversationService.getChatConversationListByUserId(getLoginUserId()); |
| 59 | 61 | return success(BeanUtils.toBean(list, AiChatConversationRespVO.class)); |
| ... | ... | @@ -62,6 +64,7 @@ public class AiChatConversationController { |
| 62 | 64 | @GetMapping("/get-my") |
| 63 | 65 | @Operation(summary = "获得【我的】聊天对话") |
| 64 | 66 | @Parameter(name = "id", required = true, description = "对话编号", example = "1024") |
| 67 | + @TransMethodResult | |
| 65 | 68 | public CommonResult<AiChatConversationRespVO> getChatConversationMy(@RequestParam("id") Long id) { |
| 66 | 69 | AiChatConversationDO conversation = chatConversationService.getChatConversation(id); |
| 67 | 70 | if (conversation != null && ObjUtil.notEqual(conversation.getUserId(), getLoginUserId())) { |
| ... | ... | @@ -90,6 +93,7 @@ public class AiChatConversationController { |
| 90 | 93 | @GetMapping("/page") |
| 91 | 94 | @Operation(summary = "获得对话分页", description = "用于【对话管理】菜单") |
| 92 | 95 | @PreAuthorize("@ss.hasPermission('ai:chat-conversation:query')") |
| 96 | + @TransMethodResult | |
| 93 | 97 | public CommonResult<PageResult<AiChatConversationRespVO>> getChatConversationPage(AiChatConversationPageReqVO pageReqVO) { |
| 94 | 98 | PageResult<AiChatConversationDO> pageResult = chatConversationService.getChatConversationPage(pageReqVO); |
| 95 | 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 | 10 | import cn.iocoder.yudao.module.ai.controller.admin.model.vo.chatRole.AiChatRoleSaveReqVO; |
| 11 | 11 | import cn.iocoder.yudao.module.ai.dal.dataobject.model.AiChatRoleDO; |
| 12 | 12 | import cn.iocoder.yudao.module.ai.service.model.AiChatRoleService; |
| 13 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 13 | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 15 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | 16 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -35,6 +36,7 @@ public class AiChatRoleController { |
| 35 | 36 | |
| 36 | 37 | @GetMapping("/my-page") |
| 37 | 38 | @Operation(summary = "获得【我的】聊天角色分页") |
| 39 | + @TransMethodResult | |
| 38 | 40 | public CommonResult<PageResult<AiChatRoleRespVO>> getChatRoleMyPage(@Valid AiChatRolePageReqVO pageReqVO) { |
| 39 | 41 | PageResult<AiChatRoleDO> pageResult = chatRoleService.getChatRoleMyPage(pageReqVO, getLoginUserId()); |
| 40 | 42 | return success(BeanUtils.toBean(pageResult, AiChatRoleRespVO.class)); |
| ... | ... | @@ -43,6 +45,7 @@ public class AiChatRoleController { |
| 43 | 45 | @GetMapping("/get-my") |
| 44 | 46 | @Operation(summary = "获得【我的】聊天角色") |
| 45 | 47 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 48 | + @TransMethodResult | |
| 46 | 49 | public CommonResult<AiChatRoleRespVO> getChatRoleMy(@RequestParam("id") Long id) { |
| 47 | 50 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); |
| 48 | 51 | if (ObjUtil.notEqual(chatRole.getUserId(), getLoginUserId())) { |
| ... | ... | @@ -108,6 +111,7 @@ public class AiChatRoleController { |
| 108 | 111 | @Operation(summary = "获得聊天角色") |
| 109 | 112 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 110 | 113 | @PreAuthorize("@ss.hasPermission('ai:chat-role:query')") |
| 114 | + @TransMethodResult | |
| 111 | 115 | public CommonResult<AiChatRoleRespVO> getChatRole(@RequestParam("id") Long id) { |
| 112 | 116 | AiChatRoleDO chatRole = chatRoleService.getChatRole(id); |
| 113 | 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 | 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 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | 6 | |
| ... | ... | @@ -27,4 +27,4 @@ public class BpmProcessExpressionRespVO { |
| 27 | 27 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 28 | 28 | private LocalDateTime createTime; |
| 29 | 29 | |
| 30 | -} | |
| 31 | 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 | 40 | ErrorCode PROCESS_INSTANCE_START_USER_SELECT_ASSIGNEES_NOT_EXISTS = new ErrorCode(1_009_004_004, "任务({})的候选人({})不存在"); |
| 41 | 41 | ErrorCode PROCESS_INSTANCE_START_USER_CAN_START = new ErrorCode(1_009_004_005, "发起流程失败,你没有权限发起该流程"); |
| 42 | 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 | 44 | ErrorCode PROCESS_INSTANCE_APPROVE_USER_SELECT_ASSIGNEES_NOT_CONFIG = new ErrorCode(1_009_004_007, "下一个任务({})的审批人未配置"); |
| 45 | 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 | 58 | ErrorCode TASK_SIGN_DELETE_NO_PARENT = new ErrorCode(1_009_005_012, "任务减签失败,被减签的任务必须是通过加签生成的任务"); |
| 59 | 59 | ErrorCode TASK_TRANSFER_FAIL_USER_REPEAT = new ErrorCode(1_009_005_013, "任务转办失败,转办人和当前审批人为同一人"); |
| 60 | 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 | 61 | ErrorCode TASK_SIGNATURE_NOT_EXISTS = new ErrorCode(1_009_005_015, "签名不能为空!"); |
| 63 | 62 | ErrorCode TASK_REASON_REQUIRE = new ErrorCode(1_009_005_016, "审批意见不能为空!"); |
| 64 | 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 | 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| 8 | 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; |
| 9 | 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 | 11 | import org.flowable.engine.delegate.DelegateExecution; |
| 15 | 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 | 16 | import java.util.List; |
| 19 | 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 | 26 | @Setter |
| 30 | -public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehavior { | |
| 27 | +public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceBehavior { | |
| 31 | 28 | |
| 32 | 29 | private BpmTaskCandidateInvoker taskCandidateInvoker; |
| 33 | 30 | |
| 34 | - public BpmParallelMultiInstanceBehavior(Activity activity, | |
| 35 | - AbstractBpmnActivityBehavior innerActivityBehavior) { | |
| 31 | + public BpmSequentialMultiInstanceBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior) { | |
| 36 | 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 | 40 | @Override |
| 50 | 41 | protected int resolveNrOfInstances(DelegateExecution execution) { |
| ... | ... | @@ -58,8 +49,9 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav |
| 58 | 49 | super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); |
| 59 | 50 | |
| 60 | 51 | // 第二步,获取任务的所有处理人 |
| 52 | + // 不使用 execution.getVariable 原因:目前依次审批任务回退后 collectionVariable 变量没有清理, 如果重新进入该任务不会重新分配审批人 | |
| 61 | 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 | 55 | if (assigneeUserIds == null) { |
| 64 | 56 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); |
| 65 | 57 | if (CollUtil.isEmpty(assigneeUserIds)) { |
| ... | ... | @@ -88,4 +80,19 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav |
| 88 | 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 | 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 8 | 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 | 11 | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO; |
| 10 | 12 | import cn.iocoder.yudao.module.bpm.enums.definition.BpmHttpRequestParamTypeEnum; |
| 11 | 13 | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; |
| 12 | 14 | import com.fasterxml.jackson.core.type.TypeReference; |
| 13 | 15 | import lombok.extern.slf4j.Slf4j; |
| 14 | 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 | 18 | import org.springframework.util.LinkedMultiValueMap; |
| 19 | 19 | import org.springframework.util.MultiValueMap; |
| 20 | 20 | import org.springframework.web.client.RestClientException; |
| ... | ... | @@ -26,7 +26,7 @@ import java.util.Map; |
| 26 | 26 | |
| 27 | 27 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 28 | 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 | 32 | * 工作流发起 HTTP 请求工具类 |
| ... | ... | @@ -42,7 +42,6 @@ public class BpmHttpRequestUtils { |
| 42 | 42 | List<BpmSimpleModelNodeVO.HttpRequestParam> bodyParams, |
| 43 | 43 | Boolean handleResponse, |
| 44 | 44 | List<KeyValue<String, String>> response) { |
| 45 | - RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class); | |
| 46 | 45 | BpmProcessInstanceService processInstanceService = SpringUtils.getBean(BpmProcessInstanceService.class); |
| 47 | 46 | |
| 48 | 47 | // 1.1 设置请求头 |
| ... | ... | @@ -51,6 +50,7 @@ public class BpmHttpRequestUtils { |
| 51 | 50 | MultiValueMap<String, String> body = buildHttpBody(processInstance, bodyParams); |
| 52 | 51 | |
| 53 | 52 | // 2. 发起请求 |
| 53 | + RestTemplate restTemplate = SpringUtils.getBean(RestTemplate.class); | |
| 54 | 54 | ResponseEntity<String> responseEntity = sendHttpRequest(url, headers, body, restTemplate); |
| 55 | 55 | |
| 56 | 56 | // 3. 处理返回 |
| ... | ... | @@ -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 | 109 | public static ResponseEntity<String> sendHttpRequest(String url, |
| 82 | 110 | MultiValueMap<String, String> headers, |
| 83 | - MultiValueMap<String, String> body, | |
| 111 | + Object body, | |
| 84 | 112 | RestTemplate restTemplate) { |
| 85 | - HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(body, headers); | |
| 113 | + HttpEntity<Object> requestEntity = new HttpEntity<>(body, headers); | |
| 86 | 114 | ResponseEntity<String> responseEntity; |
| 87 | 115 | try { |
| 88 | 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 | 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 | 122 | return responseEntity; |
| 95 | 123 | } |
| 96 | 124 | |
| 97 | 125 | public static MultiValueMap<String, String> buildHttpHeaders(ProcessInstance processInstance, |
| 98 | 126 | List<BpmSimpleModelNodeVO.HttpRequestParam> headerSettings) { |
| 99 | - Map<String, Object> processVariables = processInstance.getProcessVariables(); | |
| 100 | 127 | MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); |
| 101 | 128 | headers.add(HEADER_TENANT_ID, processInstance.getTenantId()); |
| 129 | + Map<String, Object> processVariables = processInstance.getProcessVariables(); | |
| 102 | 130 | addHttpRequestParam(headers, headerSettings, processVariables); |
| 103 | 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 | 67 | |
| 68 | 68 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 69 | 69 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; |
| 70 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; | |
| 71 | 70 | import static cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmApprovalDetailRespVO.ActivityNode; |
| 72 | 71 | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; |
| 73 | 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 | 220 | List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel, |
| 222 | 221 | processDefinitionInfo, |
| 223 | 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 | 224 | // 4. 拼接最终数据 |
| 231 | 225 | return buildApprovalDetail(reqVO, bpmnModel, processDefinition, processDefinitionInfo, historicProcessInstance, |
| ... | ... | @@ -415,7 +409,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 415 | 409 | endActivities.forEach(activity -> { |
| 416 | 410 | // StartEvent:只处理 BPMN 的场景。因为,SIMPLE 情况下,已经有 START_USER_NODE 节点 |
| 417 | 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 | 415 | ActivityNodeTask startTask = new ActivityNodeTask().setId(BpmnModelConstants.START_USER_NODE_ID) |
| 420 | 416 | .setAssignee(startUserId).setStatus(BpmTaskStatusEnum.APPROVE.getStatus()); |
| 421 | 417 | ActivityNode startNode = new ActivityNode().setId(startTask.getId()) |
| ... | ... | @@ -555,7 +551,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 555 | 551 | // 情况一:BPMN 设计器 |
| 556 | 552 | if (Objects.equals(BpmModelTypeEnum.BPMN.getType(), processDefinitionInfo.getModelType())) { |
| 557 | 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 | 556 | processDefinitionInfo, processVariables, flowElement, runActivityIds)); |
| 560 | 557 | } |
| 561 | 558 | // 情况二:SIMPLE 设计器 |
| ... | ... | @@ -563,7 +560,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 563 | 560 | BpmSimpleModelNodeVO simpleModel = JsonUtils.parseObject(processDefinitionInfo.getSimpleModel(), |
| 564 | 561 | BpmSimpleModelNodeVO.class); |
| 565 | 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 | 565 | processDefinitionInfo, processVariables, simpleNode, runActivityIds)); |
| 568 | 566 | } |
| 569 | 567 | throw new IllegalArgumentException("未知设计器类型:" + processDefinitionInfo.getModelType()); |
| ... | ... | @@ -618,8 +616,9 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 618 | 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 | 622 | FlowElement node, Set<String> runActivityIds) { |
| 624 | 623 | if (runActivityIds.contains(node.getId())) { |
| 625 | 624 | return null; |
| ... | ... | @@ -634,6 +633,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 634 | 633 | |
| 635 | 634 | // 1. 开始节点 |
| 636 | 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 | 640 | return activityNode.setName(BpmSimpleModelNodeTypeEnum.START_USER_NODE.getName()) |
| 638 | 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 | 8 | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO; |
| 9 | 9 | import cn.iocoder.yudao.module.bpm.dal.mysql.category.BpmCategoryMapper; |
| 10 | 10 | import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryServiceImpl; |
| 11 | +import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; | |
| 11 | 12 | import jakarta.annotation.Resource; |
| 12 | 13 | import org.junit.jupiter.api.Test; |
| 13 | 14 | import org.springframework.context.annotation.Import; |
| 15 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | |
| 14 | 16 | |
| 15 | 17 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; |
| 16 | 18 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; |
| ... | ... | @@ -32,6 +34,9 @@ public class BpmCategoryServiceImplTest extends BaseDbUnitTest { |
| 32 | 34 | @Resource |
| 33 | 35 | private BpmCategoryServiceImpl categoryService; |
| 34 | 36 | |
| 37 | + @MockitoBean | |
| 38 | + private BpmModelService modelService; | |
| 39 | + | |
| 35 | 40 | @Resource |
| 36 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import lombok.AllArgsConstructor; |
| 7 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | import lombok.ToString; | ... | ... |
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contract/vo/contract/CrmContractRespVO.java
| 1 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import lombok.AllArgsConstructor; |
| 7 | 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 | 5 | import cn.iocoder.yudao.framework.excel.core.convert.AreaConvert; |
| 6 | 6 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 7 | 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 | 9 | import lombok.AllArgsConstructor; |
| 10 | 10 | import lombok.Builder; |
| 11 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -61,4 +61,4 @@ public class CrmFollowUpRecordRespVO { |
| 61 | 61 | @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 62 | 62 | private LocalDateTime createTime; |
| 63 | 63 | |
| 64 | -} | |
| 65 | 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
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 | 14 | import cn.iocoder.yudao.module.crm.enums.product.CrmProductStatusEnum; |
| 15 | 15 | import cn.iocoder.yudao.module.crm.service.product.CrmProductService; |
| 16 | 16 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 17 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 17 | 18 | import io.swagger.v3.oas.annotations.Operation; |
| 18 | 19 | import io.swagger.v3.oas.annotations.Parameter; |
| 19 | 20 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -70,6 +71,7 @@ public class CrmProductController { |
| 70 | 71 | @Operation(summary = "获得产品") |
| 71 | 72 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 72 | 73 | @PreAuthorize("@ss.hasPermission('crm:product:query')") |
| 74 | + @TransMethodResult | |
| 73 | 75 | public CommonResult<CrmProductRespVO> getProduct(@RequestParam("id") Long id) { |
| 74 | 76 | CrmProductDO product = productService.getProduct(id); |
| 75 | 77 | return success(BeanUtils.toBean(product, CrmProductRespVO.class)); |
| ... | ... | @@ -86,6 +88,7 @@ public class CrmProductController { |
| 86 | 88 | @GetMapping("/page") |
| 87 | 89 | @Operation(summary = "获得产品分页") |
| 88 | 90 | @PreAuthorize("@ss.hasPermission('crm:product:query')") |
| 91 | + @TransMethodResult | |
| 89 | 92 | public CommonResult<PageResult<CrmProductRespVO>> getProductPage(@Valid CrmProductPageReqVO pageVO) { |
| 90 | 93 | PageResult<CrmProductDO> pageResult = productService.getProductPage(pageVO); |
| 91 | 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
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 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 5 | import cn.iocoder.yudao.module.crm.dal.dataobject.product.CrmProductCategoryDO; |
| 6 | 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 | 9 | import com.fhs.core.trans.anno.Trans; |
| 10 | 10 | import com.fhs.core.trans.constant.TransType; |
| 11 | 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 | 1 | package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.plan; |
| 2 | 2 | |
| 3 | 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 | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | 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 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 5 | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO; |
| 6 | 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 | 9 | import io.swagger.v3.oas.annotations.media.Schema; |
| 10 | 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 | 159 | // 2. 删除联系人 |
| 160 | 160 | contactMapper.deleteById(id); |
| 161 | 161 | |
| 162 | - // 4.1 删除数据权限 | |
| 163 | - permissionService.deletePermission(CrmBizTypeEnum.CRM_CONTACT.getType(), id); | |
| 164 | - // 4.2 删除商机关联 | |
| 162 | + // 4.1 删除商机关联 | |
| 165 | 163 | contactBusinessService.deleteContactBusinessByContactId(id); |
| 164 | + // 4.2 删除数据权限 | |
| 165 | + permissionService.deletePermission(CrmBizTypeEnum.CRM_CONTACT.getType(), id); | |
| 166 | 166 | |
| 167 | 167 | // 记录操作日志上下文 |
| 168 | 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 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.extra.spring.SpringUtil; |
| 5 | +import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi; | |
| 5 | 6 | import cn.iocoder.yudao.module.crm.dal.dataobject.permission.CrmPermissionDO; |
| 6 | 7 | import cn.iocoder.yudao.module.crm.enums.common.CrmBizTypeEnum; |
| 7 | 8 | import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum; |
| 8 | 9 | import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum; |
| 9 | -import cn.iocoder.yudao.module.system.api.permission.PermissionApi; | |
| 10 | 10 | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| 11 | 11 | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| 12 | 12 | import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; |
| ... | ... | @@ -32,7 +32,7 @@ public class CrmPermissionUtils { |
| 32 | 32 | * @return 是/否 |
| 33 | 33 | */ |
| 34 | 34 | public static boolean isCrmAdmin() { |
| 35 | - PermissionApi permissionApi = SpringUtil.getBean(PermissionApi.class); | |
| 35 | + PermissionCommonApi permissionApi = SpringUtil.getBean(PermissionCommonApi.class); | |
| 36 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -47,4 +47,4 @@ public class ErpAccountRespVO { |
| 47 | 47 | @ExcelProperty("创建时间") |
| 48 | 48 | private LocalDateTime createTime; |
| 49 | 49 | |
| 50 | -} | |
| 51 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -96,4 +96,4 @@ public class ErpFinancePaymentRespVO { |
| 96 | 96 | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | -} | |
| 100 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -96,4 +96,4 @@ public class ErpFinanceReceiptRespVO { |
| 96 | 96 | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | -} | |
| 100 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| ... | ... | @@ -44,4 +44,4 @@ public class ErpProductCategoryRespVO { |
| 44 | 44 | @ExcelProperty("创建时间") |
| 45 | 45 | private LocalDateTime createTime; |
| 46 | 46 | |
| 47 | -} | |
| 48 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| ... | ... | @@ -73,4 +73,4 @@ public class ErpProductRespVO { |
| 73 | 73 | @ExcelProperty("创建时间") |
| 74 | 74 | private LocalDateTime createTime; |
| 75 | 75 | |
| 76 | -} | |
| 77 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -31,4 +31,4 @@ public class ErpProductUnitRespVO { |
| 31 | 31 | @ExcelProperty("创建时间") |
| 32 | 32 | private LocalDateTime createTime; |
| 33 | 33 | |
| 34 | -} | |
| 35 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -142,4 +142,4 @@ public class ErpPurchaseInRespVO { |
| 142 | 142 | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | -} | |
| 146 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -149,4 +149,4 @@ public class ErpPurchaseOrderRespVO { |
| 149 | 149 | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | -} | |
| 153 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -142,4 +142,4 @@ public class ErpPurchaseReturnRespVO { |
| 142 | 142 | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | -} | |
| 146 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| ... | ... | @@ -81,4 +81,4 @@ public class ErpSupplierRespVO { |
| 81 | 81 | @ExcelProperty("创建时间") |
| 82 | 82 | private LocalDateTime createTime; |
| 83 | 83 | |
| 84 | -} | |
| 85 | 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 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 6 | -import java.util.*; | |
| 7 | 5 | import java.math.BigDecimal; |
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | 6 | import java.time.LocalDateTime; |
| 10 | -import com.alibaba.excel.annotation.*; | |
| 7 | +import cn.idev.excel.annotation.*; | |
| 11 | 8 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 12 | 9 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 13 | 10 | |
| ... | ... | @@ -81,4 +78,4 @@ public class ErpCustomerRespVO { |
| 81 | 78 | @ExcelProperty("创建时间") |
| 82 | 79 | private LocalDateTime createTime; |
| 83 | 80 | |
| 84 | -} | |
| 85 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -152,4 +152,4 @@ public class ErpSaleOrderRespVO { |
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | -} | |
| 156 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -145,4 +145,4 @@ public class ErpSaleOutRespVO { |
| 145 | 145 | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -} | |
| 149 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import jakarta.validation.constraints.NotNull; |
| 7 | 7 | import lombok.Data; |
| ... | ... | @@ -145,4 +145,4 @@ public class ErpSaleReturnRespVO { |
| 145 | 145 | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -} | |
| 149 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | 9 | import lombok.Data; |
| ... | ... | @@ -108,4 +108,4 @@ public class ErpStockCheckRespVO { |
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | -} | |
| 112 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -107,4 +107,4 @@ public class ErpStockInRespVO { |
| 107 | 107 | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -} | |
| 111 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -104,4 +104,4 @@ public class ErpStockMoveRespVO { |
| 104 | 104 | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | -} | |
| 108 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -107,4 +107,4 @@ public class ErpStockOutRespVO { |
| 107 | 107 | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -} | |
| 111 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| ... | ... | @@ -84,4 +84,4 @@ public class ErpStockRecordRespVO { |
| 84 | 84 | @ExcelProperty("创建人") |
| 85 | 85 | private String creatorName; |
| 86 | 86 | |
| 87 | -} | |
| 88 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| ... | ... | @@ -46,4 +46,4 @@ public class ErpStockRespVO { |
| 46 | 46 | @ExcelProperty("仓库名称") |
| 47 | 47 | private String warehouseName; |
| 48 | 48 | |
| 49 | -} | |
| 50 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| ... | ... | @@ -61,4 +61,4 @@ public class ErpWarehouseRespVO { |
| 61 | 61 | @ExcelProperty("创建时间") |
| 62 | 62 | private LocalDateTime createTime; |
| 63 | 63 | |
| 64 | -} | |
| 65 | 64 | \ No newline at end of file |
| 65 | +} | ... | ... |
yudao-module-infra/pom.xml
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/api/websocket/WebSocketSenderApiImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.api.websocket; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.websocket.core.sender.WebSocketMessageSender; |
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 4 | 5 | import org.springframework.stereotype.Component; |
| 5 | 6 | |
| 6 | -import jakarta.annotation.Resource; | |
| 7 | - | |
| 8 | 7 | /** |
| 9 | 8 | * WebSocket 发送器的 API 实现类 |
| 10 | 9 | * |
| ... | ... | @@ -13,7 +12,8 @@ import jakarta.annotation.Resource; |
| 13 | 12 | @Component |
| 14 | 13 | public class WebSocketSenderApiImpl implements WebSocketSenderApi { |
| 15 | 14 | |
| 16 | - @Resource | |
| 15 | + @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") | |
| 16 | + @Autowired(required = false) // 由于 yudao.websocket.enable 配置项,可以关闭 WebSocket 的功能,所以这里只能不强制注入 | |
| 17 | 17 | private WebSocketMessageSender webSocketMessageSender; |
| 18 | 18 | |
| 19 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -43,4 +43,4 @@ public class Demo01ContactRespVO { |
| 43 | 43 | @ExcelProperty("创建时间") |
| 44 | 44 | private LocalDateTime createTime; |
| 45 | 45 | |
| 46 | -} | |
| 47 | 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 | 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 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| ... | ... | @@ -28,4 +28,4 @@ public class Demo02CategoryRespVO { |
| 28 | 28 | @ExcelProperty("创建时间") |
| 29 | 29 | private LocalDateTime createTime; |
| 30 | 30 | |
| 31 | -} | |
| 32 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -39,4 +39,4 @@ public class Demo03StudentErpRespVO { |
| 39 | 39 | @ExcelProperty("创建时间") |
| 40 | 40 | private LocalDateTime createTime; |
| 41 | 41 | |
| 42 | -} | |
| 43 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -39,4 +39,4 @@ public class Demo03StudentInnerRespVO { |
| 39 | 39 | @ExcelProperty("创建时间") |
| 40 | 40 | private LocalDateTime createTime; |
| 41 | 41 | |
| 42 | -} | |
| 43 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 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 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 8 | import lombok.Data; |
| 9 | 9 | |
| ... | ... | @@ -39,4 +39,4 @@ public class Demo03StudentNormalRespVO { |
| 39 | 39 | @ExcelProperty("创建时间") |
| 40 | 40 | private LocalDateTime createTime; |
| 41 | 41 | |
| 42 | -} | |
| 43 | 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 | 43 | |
| 44 | 44 | @PostMapping("/upload") |
| 45 | 45 | @Operation(summary = "上传文件", description = "模式一:后端上传文件") |
| 46 | - public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception { | |
| 46 | + public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception { | |
| 47 | 47 | MultipartFile file = uploadReqVO.getFile(); |
| 48 | 48 | byte[] content = IoUtil.readBytes(file.getInputStream()); |
| 49 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 9 | import jakarta.validation.constraints.NotNull; |
| 10 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 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 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | 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 | 139 | vue3FilePath("api/${table.moduleName}/${table.businessName}/index.ts")) |
| 140 | 140 | // VUE3_VBEN2_ANTD_SCHEMA |
| 141 | 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 | 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 | 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 | 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 | 149 | // VUE3_VBEN5_ANTD_SCHEMA |
| 150 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 168 | // VUE3_VBEN5_ANTD |
| 169 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 185 | // VUE3_VBEN5_EP_SCHEMA |
| 186 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 204 | // VUE3_VBEN5_EP |
| 205 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 221 | .build(); |
| 222 | 222 | |
| 223 | 223 | @Resource |
| ... | ... | @@ -614,6 +614,11 @@ public class CodegenEngine { |
| 614 | 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 | 622 | private static String vue3VbenTemplatePath(String path) { |
| 618 | 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 | 40 | ApiErrorLogDO apiErrorLog = BeanUtils.toBean(createDTO, ApiErrorLogDO.class) |
| 41 | 41 | .setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); |
| 42 | 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 | 6 | import cn.iocoder.yudao.framework.websocket.core.util.WebSocketFrameworkUtils; |
| 7 | 7 | import cn.iocoder.yudao.module.infra.websocket.message.DemoReceiveMessage; |
| 8 | 8 | import cn.iocoder.yudao.module.infra.websocket.message.DemoSendMessage; |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | 10 | import org.springframework.stereotype.Component; |
| 10 | 11 | import org.springframework.web.socket.WebSocketSession; |
| 11 | 12 | |
| 12 | -import jakarta.annotation.Resource; | |
| 13 | - | |
| 14 | 13 | /** |
| 15 | 14 | * WebSocket 示例:单发消息 |
| 16 | 15 | * |
| ... | ... | @@ -19,7 +18,8 @@ import jakarta.annotation.Resource; |
| 19 | 18 | @Component |
| 20 | 19 | public class DemoWebSocketMessageListener implements WebSocketMessageListener<DemoSendMessage> { |
| 21 | 20 | |
| 22 | - @Resource | |
| 21 | + @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") | |
| 22 | + @Autowired(required = false) // 由于 yudao.websocket.enable 配置项,可以关闭 WebSocket 的功能,所以这里只能不强制注入 | |
| 23 | 23 | private WebSocketMessageSender webSocketMessageSender; |
| 24 | 24 | |
| 25 | 25 | @Override | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/controller/vo/respVO.vm
| ... | ... | @@ -19,7 +19,7 @@ import java.time.LocalDateTime; |
| 19 | 19 | #end |
| 20 | 20 | #end |
| 21 | 21 | ## 处理 Excel 导出 |
| 22 | -import com.alibaba.excel.annotation.*; | |
| 22 | +import cn.idev.excel.annotation.*; | |
| 23 | 23 | #foreach ($column in $columns) |
| 24 | 24 | #if ("$!column.dictType" != "")## 有设置数据字典 |
| 25 | 25 | import ${DictFormatClassName}; |
| ... | ... | @@ -50,4 +50,4 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO { |
| 50 | 50 | |
| 51 | 51 | #end |
| 52 | 52 | #end |
| 53 | -} | |
| 54 | 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 | 15 | ## 处理 Excel 导出 + Schema 注解(仅 DO 模式) |
| 16 | 16 | #if ($voType == 20) |
| 17 | 17 | import io.swagger.v3.oas.annotations.media.Schema; |
| 18 | -import com.alibaba.excel.annotation.*; | |
| 18 | +import cn.idev.excel.annotation.*; | |
| 19 | 19 | #foreach ($column in $columns) |
| 20 | 20 | #if ("$!column.dictType" != "")## 有设置数据字典 |
| 21 | 21 | import ${DictFormatClassName}; |
| ... | ... | @@ -100,4 +100,4 @@ public class ${table.className}DO extends BaseDO { |
| 100 | 100 | #end |
| 101 | 101 | #end |
| 102 | 102 | |
| 103 | -} | |
| 104 | 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 | 2 | |
| 3 | 3 | import org.junit.jupiter.api.Disabled; |
| 4 | 4 | import org.junit.jupiter.api.Test; |
| 5 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 6 | 5 | |
| 7 | 6 | import ${jakartaPackage}.annotation.Resource; |
| 8 | 7 | ... | ... |
yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
yudao-module-infra/src/main/resources/codegen/vue3/views/index.vue.vm
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 | 24 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| 25 | 25 | import jakarta.annotation.Resource; |
| 26 | 26 | import org.junit.jupiter.api.Test; |
| 27 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 28 | 27 | import org.springframework.context.annotation.Import; |
| 28 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | |
| 29 | 29 | |
| 30 | 30 | import java.util.Arrays; |
| 31 | 31 | import java.util.Collections; |
| ... | ... | @@ -60,15 +60,15 @@ public class CodegenServiceImplTest extends BaseDbUnitTest { |
| 60 | 60 | @Resource |
| 61 | 61 | private CodegenColumnMapper codegenColumnMapper; |
| 62 | 62 | |
| 63 | - @MockBean | |
| 63 | + @MockitoBean | |
| 64 | 64 | private DatabaseTableService databaseTableService; |
| 65 | 65 | |
| 66 | - @MockBean | |
| 66 | + @MockitoBean | |
| 67 | 67 | private CodegenBuilder codegenBuilder; |
| 68 | - @MockBean | |
| 68 | + @MockitoBean | |
| 69 | 69 | private CodegenEngine codegenEngine; |
| 70 | 70 | |
| 71 | - @MockBean | |
| 71 | + @MockitoBean | |
| 72 | 72 | private CodegenProperties codegenProperties; |
| 73 | 73 | |
| 74 | 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 | 11 | import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; |
| 12 | 12 | import com.baomidou.dynamic.datasource.creator.DataSourceProperty; |
| 13 | 13 | import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; |
| 14 | +import jakarta.annotation.Resource; | |
| 14 | 15 | import org.junit.jupiter.api.BeforeEach; |
| 15 | 16 | import org.junit.jupiter.api.Test; |
| 16 | 17 | import org.mockito.MockedStatic; |
| 17 | 18 | import org.mockito.stubbing.Answer; |
| 18 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 19 | 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 | 22 | import java.util.List; |
| 23 | 23 | |
| 24 | 24 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| ... | ... | @@ -46,10 +46,10 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { |
| 46 | 46 | @Resource |
| 47 | 47 | private DataSourceConfigMapper dataSourceConfigMapper; |
| 48 | 48 | |
| 49 | - @MockBean | |
| 49 | + @MockitoBean | |
| 50 | 50 | private AES aes; |
| 51 | 51 | |
| 52 | - @MockBean | |
| 52 | + @MockitoBean | |
| 53 | 53 | private DynamicDataSourceProperties dynamicDataSourceProperties; |
| 54 | 54 | |
| 55 | 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 | 5 | import com.baomidou.mybatisplus.generator.config.po.TableField; |
| 6 | 6 | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| 7 | 7 | import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; |
| 8 | +import jakarta.annotation.Resource; | |
| 8 | 9 | import org.apache.ibatis.type.JdbcType; |
| 9 | 10 | import org.junit.jupiter.api.Test; |
| 10 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 11 | 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 | 14 | import java.util.List; |
| 15 | 15 | |
| 16 | 16 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| ... | ... | @@ -24,7 +24,7 @@ public class DatabaseTableServiceImplTest extends BaseDbUnitTest { |
| 24 | 24 | @Resource |
| 25 | 25 | private DatabaseTableServiceImpl databaseTableService; |
| 26 | 26 | |
| 27 | - @MockBean | |
| 27 | + @MockitoBean | |
| 28 | 28 | private DataSourceConfigService dataSourceConfigService; |
| 29 | 29 | |
| 30 | 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 | 4 | import cn.hutool.core.date.LocalDateTimeUtil; |
| 5 | 5 | import cn.hutool.core.map.MapUtil; |
| 6 | 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 | 12 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; |
| 8 | 13 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; |
| 9 | 14 | import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; |
| 10 | 15 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; |
| 11 | 16 | import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; |
| 12 | 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 | 20 | import lombok.Data; |
| 19 | 21 | import org.junit.jupiter.api.Test; |
| 20 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 21 | 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 | 25 | import java.io.Serializable; |
| 26 | 26 | import java.time.LocalDateTime; |
| 27 | 27 | import java.util.Map; |
| ... | ... | @@ -53,9 +53,9 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { |
| 53 | 53 | @Resource |
| 54 | 54 | private FileConfigMapper fileConfigMapper; |
| 55 | 55 | |
| 56 | - @MockBean | |
| 56 | + @MockitoBean | |
| 57 | 57 | private Validator validator; |
| 58 | - @MockBean | |
| 58 | + @MockitoBean | |
| 59 | 59 | private FileClientFactory fileClientFactory; |
| 60 | 60 | |
| 61 | 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 | 12 | import jakarta.annotation.Resource; |
| 13 | 13 | import org.junit.jupiter.api.BeforeEach; |
| 14 | 14 | import org.junit.jupiter.api.Test; |
| 15 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 16 | 15 | import org.springframework.context.annotation.Import; |
| 16 | +import org.springframework.test.context.bean.override.mockito.MockitoBean; | |
| 17 | 17 | |
| 18 | 18 | import java.time.LocalDateTime; |
| 19 | 19 | import java.util.concurrent.atomic.AtomicReference; |
| ... | ... | @@ -35,7 +35,7 @@ public class FileServiceImplTest extends BaseDbUnitTest { |
| 35 | 35 | @Resource |
| 36 | 36 | private FileMapper fileMapper; |
| 37 | 37 | |
| 38 | - @MockBean | |
| 38 | + @MockitoBean | |
| 39 | 39 | private FileConfigService fileConfigService; |
| 40 | 40 | |
| 41 | 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 | 10 | import cn.iocoder.yudao.module.infra.dal.mysql.job.JobMapper; |
| 11 | 11 | import cn.iocoder.yudao.module.infra.enums.job.JobStatusEnum; |
| 12 | 12 | import cn.iocoder.yudao.module.infra.job.job.JobLogCleanJob; |
| 13 | +import jakarta.annotation.Resource; | |
| 13 | 14 | import org.junit.jupiter.api.Test; |
| 14 | 15 | import org.mockito.MockedStatic; |
| 15 | 16 | import org.quartz.SchedulerException; |
| 16 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 17 | 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 | 20 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 22 | 21 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| ... | ... | @@ -36,10 +35,10 @@ public class JobServiceImplTest extends BaseDbUnitTest { |
| 36 | 35 | private JobServiceImpl jobService; |
| 37 | 36 | @Resource |
| 38 | 37 | private JobMapper jobMapper; |
| 39 | - @MockBean | |
| 38 | + @MockitoBean | |
| 40 | 39 | private SchedulerManager schedulerManager; |
| 41 | 40 | |
| 42 | - @MockBean | |
| 41 | + @MockitoBean | |
| 43 | 42 | private JobLogCleanJob jobLogCleanJob; |
| 44 | 43 | |
| 45 | 44 | @Test | ... | ... |
yudao-module-infra/src/test/resources/codegen/windows10/vue2_master_erp/java/InfraStudentRespVO
| ... | ... | @@ -6,7 +6,7 @@ import java.util.*; |
| 6 | 6 | import java.util.*; |
| 7 | 7 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 8 | import java.time.LocalDateTime; |
| 9 | -import com.alibaba.excel.annotation.*; | |
| 9 | +import cn.idev.excel.annotation.*; | |
| 10 | 10 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 11 | 11 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 12 | 12 | |
| ... | ... | @@ -57,4 +57,4 @@ public class InfraStudentRespVO { |
| 57 | 57 | @ExcelProperty("创建时间") |
| 58 | 58 | private LocalDateTime createTime; |
| 59 | 59 | |
| 60 | -} | |
| 61 | 60 | \ No newline at end of file |
| 61 | +} | ... | ... |