mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-03-13 07:34:29 +08:00
Compare commits
28 Commits
e0a00cfe98
...
v5.2.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
015b406001 | ||
|
|
6c950c9569 | ||
|
|
3ce3ffca05 | ||
|
|
d3ccc43d68 | ||
|
|
4c96440686 | ||
|
|
8d8d76364b | ||
|
|
82af98c205 | ||
|
|
fdbe8c2395 | ||
|
|
59715b1e02 | ||
|
|
f2ec530065 | ||
|
|
ac89cb46f5 | ||
|
|
abfa995a32 | ||
|
|
51cfbef887 | ||
|
|
7171ed1508 | ||
|
|
6727f3e6a4 | ||
|
|
81006c758a | ||
|
|
01025c4024 | ||
|
|
517277132e | ||
|
|
dc5c92ee2d | ||
|
|
57e142e160 | ||
|
|
c563afed59 | ||
|
|
556cf87f0e | ||
|
|
098d3347a0 | ||
|
|
08d4493994 | ||
|
|
367d739e2d | ||
|
|
d6688a367d | ||
|
|
0b331796e2 | ||
|
|
456620b638 |
@@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="ruoyi-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.2.2" />
|
||||
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.2.3" />
|
||||
<option name="buildOnly" value="true" />
|
||||
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-monitor-admin/Dockerfile" />
|
||||
</settings>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="演示机">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="ruoyi/ruoyi-server:5.2.2" />
|
||||
<option name="imageTag" value="ruoyi/ruoyi-server:5.2.3" />
|
||||
<option name="buildOnly" value="true" />
|
||||
<option name="sourceFilePath" value="ruoyi-admin/Dockerfile" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
</component>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<configuration default="false" name="ruoyi-snailjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
|
||||
<deployment type="dockerfile">
|
||||
<settings>
|
||||
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.2.2" />
|
||||
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.2.3" />
|
||||
<option name="buildOnly" value="true" />
|
||||
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-snailjob-server/Dockerfile" />
|
||||
</settings>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
[](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/master/LICENSE)
|
||||
[](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
|
||||
<br>
|
||||
[](https://gitee.com/dromara/RuoYi-Vue-Plus)
|
||||
[](https://gitee.com/dromara/RuoYi-Vue-Plus)
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
|
||||
14
pom.xml
14
pom.xml
@@ -13,8 +13,8 @@
|
||||
<description>RuoYi-Vue-Plus多租户管理系统</description>
|
||||
|
||||
<properties>
|
||||
<revision>5.2.2</revision>
|
||||
<spring-boot.version>3.2.10</spring-boot.version>
|
||||
<revision>5.2.3</revision>
|
||||
<spring-boot.version>3.2.11</spring-boot.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
@@ -28,11 +28,11 @@
|
||||
<p6spy.version>3.9.1</p6spy.version>
|
||||
<hutool.version>5.8.31</hutool.version>
|
||||
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
|
||||
<redisson.version>3.36.0</redisson.version>
|
||||
<redisson.version>3.37.0</redisson.version>
|
||||
<lock4j.version>2.2.7</lock4j.version>
|
||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||
<snailjob.version>1.1.2</snailjob.version>
|
||||
<mapstruct-plus.version>1.4.4</mapstruct-plus.version>
|
||||
<mapstruct-plus.version>1.4.5</mapstruct-plus.version>
|
||||
<mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
|
||||
<lombok.version>1.18.34</lombok.version>
|
||||
<bouncycastle.version>1.76</bouncycastle.version>
|
||||
@@ -41,14 +41,14 @@
|
||||
<ip2region.version>2.7.0</ip2region.version>
|
||||
|
||||
<!-- OSS 配置 -->
|
||||
<aws.sdk.version>2.25.15</aws.sdk.version>
|
||||
<aws.crt.version>0.29.13</aws.crt.version>
|
||||
<aws.sdk.version>2.28.22</aws.sdk.version>
|
||||
<aws.crt.version>0.31.3</aws.crt.version>
|
||||
<!-- SMS 配置 -->
|
||||
<sms4j.version>3.3.3</sms4j.version>
|
||||
<!-- 限制框架中的fastjson版本 -->
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<!-- 面向运行时的D-ORM依赖 -->
|
||||
<anyline.version>8.7.2-20240930</anyline.version>
|
||||
<anyline.version>8.7.2-20241022</anyline.version>
|
||||
<!--工作流配置-->
|
||||
<flowable.version>7.0.1</flowable.version>
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ snail-job:
|
||||
namespace: ${spring.profiles.active}
|
||||
# 随主应用端口飘逸
|
||||
port: 2${server.port}
|
||||
# 客户端ip指定
|
||||
host:
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
|
||||
@@ -28,6 +28,8 @@ snail-job:
|
||||
namespace: ${spring.profiles.active}
|
||||
# 随主应用端口飘逸
|
||||
port: 2${server.port}
|
||||
# 客户端ip指定
|
||||
host:
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<revision>5.2.2</revision>
|
||||
<revision>5.2.3</revision>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
@@ -17,7 +17,10 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -34,7 +37,7 @@ public class EncryptorManager {
|
||||
/**
|
||||
* 缓存加密器
|
||||
*/
|
||||
Map<EncryptContext, IEncryptor> encryptorMap = new ConcurrentHashMap<>();
|
||||
Map<Integer, IEncryptor> encryptorMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 类加密字段缓存
|
||||
@@ -67,11 +70,12 @@ public class EncryptorManager {
|
||||
* @param encryptContext 加密执行者需要的相关配置参数
|
||||
*/
|
||||
public IEncryptor registAndGetEncryptor(EncryptContext encryptContext) {
|
||||
if (encryptorMap.containsKey(encryptContext)) {
|
||||
return encryptorMap.get(encryptContext);
|
||||
int key = encryptContext.hashCode();
|
||||
if (encryptorMap.containsKey(key)) {
|
||||
return encryptorMap.get(key);
|
||||
}
|
||||
IEncryptor encryptor = ReflectUtil.newInstance(encryptContext.getAlgorithm().getClazz(), encryptContext);
|
||||
encryptorMap.put(encryptContext, encryptor);
|
||||
encryptorMap.put(key, encryptor);
|
||||
return encryptor;
|
||||
}
|
||||
|
||||
@@ -81,7 +85,7 @@ public class EncryptorManager {
|
||||
* @param encryptContext 加密执行者需要的相关配置参数
|
||||
*/
|
||||
public void removeEncryptor(EncryptContext encryptContext) {
|
||||
this.encryptorMap.remove(encryptContext);
|
||||
this.encryptorMap.remove(encryptContext.hashCode());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -159,8 +159,7 @@ public class LogAspect {
|
||||
private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception {
|
||||
Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
||||
String requestMethod = operLog.getRequestMethod();
|
||||
if (MapUtil.isEmpty(paramsMap)
|
||||
&& HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)) {
|
||||
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
|
||||
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
||||
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
|
||||
} else {
|
||||
|
||||
@@ -62,8 +62,8 @@ public class DataBaseHelper {
|
||||
// charindex(',100,' , ',0,100,101,') <> 0
|
||||
return "charindex(',%s,' , ','+%s+',') <> 0".formatted(var, var2);
|
||||
} else if (dataBasyType == DataBaseType.POSTGRE_SQL) {
|
||||
// (select position(',100,' in ',0,100,101,')) <> 0
|
||||
return "(select position(',%s,' in ','||%s||',')) <> 0".formatted(var, var2);
|
||||
// (select strpos(',0,100,101,' , ',100,')) <> 0
|
||||
return "(select strpos(','||%s||',' , ',%s,')) <> 0".formatted(var2, var);
|
||||
} else if (dataBasyType == DataBaseType.ORACLE) {
|
||||
// instr(',0,100,101,' , ',100,') <> 0
|
||||
return "instr(','||%s||',' , ',%s,') <> 0".formatted(var2, var);
|
||||
|
||||
@@ -15,12 +15,12 @@ import org.dromara.common.oss.properties.OssProperties;
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
import software.amazon.awssdk.core.ResponseInputStream;
|
||||
import software.amazon.awssdk.core.async.AsyncRequestBody;
|
||||
import software.amazon.awssdk.core.async.AsyncResponseTransformer;
|
||||
import software.amazon.awssdk.core.async.BlockingInputStreamAsyncRequestBody;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.s3.S3AsyncClient;
|
||||
import software.amazon.awssdk.services.s3.S3Configuration;
|
||||
import software.amazon.awssdk.services.s3.crt.S3CrtHttpConfiguration;
|
||||
import software.amazon.awssdk.services.s3.model.GetObjectResponse;
|
||||
import software.amazon.awssdk.services.s3.model.NoSuchBucketException;
|
||||
import software.amazon.awssdk.services.s3.model.S3Exception;
|
||||
@@ -83,8 +83,8 @@ public class OssClient {
|
||||
StaticCredentialsProvider credentialsProvider = StaticCredentialsProvider.create(
|
||||
AwsBasicCredentials.create(properties.getAccessKey(), properties.getSecretKey()));
|
||||
|
||||
//MinIO 使用 HTTPS 限制使用域名访问,站点填域名。需要启用路径样式访问
|
||||
boolean isStyle = !StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE);
|
||||
//使用对象存储服务时要求明确配置访问样式(路径样式或虚拟托管样式)。需要启用路径样式访问
|
||||
boolean isStyle = true;
|
||||
|
||||
//创建AWS基于 CRT 的 S3 客户端
|
||||
this.client = S3AsyncClient.crtBuilder()
|
||||
@@ -95,6 +95,9 @@ public class OssClient {
|
||||
.minimumPartSizeInBytes(10 * 1025 * 1024L)
|
||||
.checksumValidationEnabled(false)
|
||||
.forcePathStyle(isStyle)
|
||||
.httpConfiguration(S3CrtHttpConfiguration.builder()
|
||||
.connectionTimeout(Duration.ofSeconds(60)) // 设置连接超时
|
||||
.build())
|
||||
.build();
|
||||
|
||||
//AWS基于 CRT 的 S3 AsyncClient 实例用作 S3 传输管理器的底层客户端
|
||||
@@ -178,7 +181,9 @@ public class OssClient {
|
||||
.key(key)
|
||||
.contentMD5(StringUtils.isNotEmpty(md5Digest) ? md5Digest : null)
|
||||
.contentType(contentType)
|
||||
.acl(getAccessPolicy().getObjectCannedACL())
|
||||
// 用于设置对象的访问控制列表(ACL)。不同云厂商对ACL的支持和实现方式有所不同,
|
||||
// 因此根据具体的云服务提供商,你可能需要进行不同的配置(自行开启,阿里云有acl权限配置,腾讯云没有acl权限配置)
|
||||
//.acl(getAccessPolicy().getObjectCannedACL())
|
||||
.build())
|
||||
.addTransferListener(LoggingTransferListener.create())
|
||||
.source(filePath).build());
|
||||
@@ -215,7 +220,10 @@ public class OssClient {
|
||||
}
|
||||
try {
|
||||
// 创建异步请求体(length如果为空会报错)
|
||||
BlockingInputStreamAsyncRequestBody body = AsyncRequestBody.forBlockingInputStream(length);
|
||||
BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder()
|
||||
.contentLength(length)
|
||||
.subscribeTimeout(Duration.ofSeconds(30))
|
||||
.build();
|
||||
|
||||
// 使用 transferManager 进行上传
|
||||
Upload upload = transferManager.upload(
|
||||
@@ -224,7 +232,9 @@ public class OssClient {
|
||||
y -> y.bucket(properties.getBucketName())
|
||||
.key(key)
|
||||
.contentType(contentType)
|
||||
.acl(getAccessPolicy().getObjectCannedACL())
|
||||
// 用于设置对象的访问控制列表(ACL)。不同云厂商对ACL的支持和实现方式有所不同,
|
||||
// 因此根据具体的云服务提供商,你可能需要进行不同的配置(自行开启,阿里云有acl权限配置,腾讯云没有acl权限配置)
|
||||
//.acl(getAccessPolicy().getObjectCannedACL())
|
||||
.build())
|
||||
.build());
|
||||
|
||||
|
||||
@@ -19,23 +19,21 @@ import org.springframework.context.annotation.Bean;
|
||||
@EnableConfigurationProperties(XssProperties.class)
|
||||
public class FilterConfig {
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Bean
|
||||
@ConditionalOnProperty(value = "xss.enabled", havingValue = "true")
|
||||
public FilterRegistrationBean xssFilterRegistration(XssProperties xssProperties) {
|
||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||
public FilterRegistrationBean<XssFilter> xssFilterRegistration() {
|
||||
FilterRegistrationBean<XssFilter> registration = new FilterRegistrationBean<>();
|
||||
registration.setDispatcherTypes(DispatcherType.REQUEST);
|
||||
registration.setFilter(new XssFilter());
|
||||
registration.addUrlPatterns("/*");
|
||||
registration.setName("xssFilter");
|
||||
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
||||
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE + 1);
|
||||
return registration;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Bean
|
||||
public FilterRegistrationBean someFilterRegistration() {
|
||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||
public FilterRegistrationBean<RepeatableFilter> someFilterRegistration() {
|
||||
FilterRegistrationBean<RepeatableFilter> registration = new FilterRegistrationBean<>();
|
||||
registration.setFilter(new RepeatableFilter());
|
||||
registration.addUrlPatterns("/*");
|
||||
registration.setName("repeatableFilter");
|
||||
|
||||
@@ -14,6 +14,7 @@ import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* XSS过滤处理
|
||||
@@ -28,6 +29,33 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
super(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name) {
|
||||
String value = super.getParameter(name);
|
||||
if (value != null) {
|
||||
return HtmlUtil.cleanHtmlTag(value).trim();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
Map<String, String[]> valueMap = super.getParameterMap();
|
||||
for (Map.Entry<String, String[]> entry : valueMap.entrySet()) {
|
||||
String[] values = entry.getValue();
|
||||
if (values != null) {
|
||||
int length = values.length;
|
||||
String[] escapseValues = new String[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
// 防xss攻击和过滤前后空格
|
||||
escapseValues[i] = HtmlUtil.cleanHtmlTag(values[i]).trim();
|
||||
}
|
||||
valueMap.put(entry.getKey(), escapseValues);
|
||||
}
|
||||
}
|
||||
return valueMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
String[] values = super.getParameterValues(name);
|
||||
@@ -40,7 +68,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
}
|
||||
return escapseValues;
|
||||
}
|
||||
return super.getParameterValues(name);
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -176,7 +176,7 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
||||
log.error(e.getMessage());
|
||||
String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
||||
String message = StreamUtils.join(e.getBindingResult().getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", ");
|
||||
return R.fail(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.dromara.common.web.interceptor;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -64,9 +65,11 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
||||
StopWatch stopWatch = KEY_CACHE.get();
|
||||
stopWatch.stop();
|
||||
log.info("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime());
|
||||
KEY_CACHE.remove();
|
||||
if (ObjectUtil.isNotNull(stopWatch)) {
|
||||
stopWatch.stop();
|
||||
log.info("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime());
|
||||
KEY_CACHE.remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,13 +56,13 @@ public interface GenConstants {
|
||||
* 数据库时间类型
|
||||
*/
|
||||
String[] COLUMNTYPE_TIME = {"datetime", "time", "date", "timestamp", "year", "interval",
|
||||
"smalldatetime", "datetime2", "datetimeoffset"};
|
||||
"smalldatetime", "datetime2", "datetimeoffset", "timestamptz"};
|
||||
|
||||
/**
|
||||
* 数据库数字类型
|
||||
*/
|
||||
String[] COLUMNTYPE_NUMBER = {"tinyint", "smallint", "mediumint", "int", "int2", "int4", "int8", "number", "integer",
|
||||
"bit", "bigint", "float", "double", "decimal", "numeric", "real", "double precision",
|
||||
"bit", "bigint", "float", "float4", "float8", "double", "decimal", "numeric", "real", "double precision",
|
||||
"smallserial", "serial", "bigserial", "money", "smallmoney"};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.dromara.system.service.impl;
|
||||
|
||||
import cn.dev33.satoken.secure.BCrypt;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -203,7 +204,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
String numbers = RandomUtil.randomNumbers(6);
|
||||
// 判断是否存在,如果存在则重新生成
|
||||
if (tenantIds.contains(numbers)) {
|
||||
generateTenantId(tenantIds);
|
||||
return generateTenantId(tenantIds);
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
@@ -413,33 +414,36 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
Map<String, SysDictData> map = StreamUtils.toIdentityMap(dataListTenant, SysDictData::getDictValue);
|
||||
for (SysDictData dictData : dataList) {
|
||||
if (!map.containsKey(dictData.getDictValue())) {
|
||||
SysDictData data = BeanUtil.toBean(dictData, SysDictData.class);
|
||||
// 设置字典编码为 null
|
||||
dictData.setDictCode(null);
|
||||
dictData.setTenantId(tenantId);
|
||||
dictData.setCreateTime(null);
|
||||
dictData.setUpdateTime(null);
|
||||
data.setDictCode(null);
|
||||
data.setTenantId(tenantId);
|
||||
data.setCreateTime(null);
|
||||
data.setUpdateTime(null);
|
||||
set.add(tenantId);
|
||||
saveDataList.add(dictData);
|
||||
saveDataList.add(data);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dictType.setDictId(null);
|
||||
dictType.setTenantId(tenantId);
|
||||
dictType.setCreateTime(null);
|
||||
dictType.setUpdateTime(null);
|
||||
SysDictType type = BeanUtil.toBean(dictType, SysDictType.class);
|
||||
type.setDictId(null);
|
||||
type.setTenantId(tenantId);
|
||||
type.setCreateTime(null);
|
||||
type.setUpdateTime(null);
|
||||
set.add(tenantId);
|
||||
saveTypeList.add(dictType);
|
||||
saveTypeList.add(type);
|
||||
if (CollUtil.isNotEmpty(dataList)) {
|
||||
// 筛选出 dictType 对应的 data
|
||||
for (SysDictData dictData : dataList) {
|
||||
SysDictData data = BeanUtil.toBean(dictData, SysDictData.class);
|
||||
// 设置字典编码为 null
|
||||
dictData.setDictCode(null);
|
||||
dictData.setTenantId(tenantId);
|
||||
dictData.setCreateTime(null);
|
||||
dictData.setUpdateTime(null);
|
||||
data.setDictCode(null);
|
||||
data.setTenantId(tenantId);
|
||||
data.setCreateTime(null);
|
||||
data.setUpdateTime(null);
|
||||
set.add(tenantId);
|
||||
saveDataList.add(data);
|
||||
}
|
||||
saveDataList.addAll(dataList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,11 +142,16 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.key=='leave1' && #processTaskEvent.taskDefinitionKey=='Activity_14633hx'")
|
||||
@EventListener(condition = "#processTaskEvent.key.startsWith('leave')")
|
||||
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("当前任务执行了{}", processTaskEvent.toString());
|
||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
|
||||
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
baseMapper.updateById(testLeave);
|
||||
// 所有demo案例的申请人节点id
|
||||
String[] ids = {"Activity_14633hx", "Activity_19b1i4j", "Activity_0uscrk3",
|
||||
"Activity_0uscrk3", "Activity_0x6b71j", "Activity_0zy3g6j", "Activity_06a55t0"};
|
||||
if (StringUtils.equalsAny(processTaskEvent.getTaskDefinitionKey(), ids)) {
|
||||
log.info("当前任务执行了{}", processTaskEvent.toString());
|
||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
|
||||
testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
baseMapper.updateById(testLeave);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class WfDefinitionConfigServiceImpl implements IWfDefinitionConfigService
|
||||
baseMapper.delete(new LambdaQueryWrapper<WfDefinitionConfig>().eq(WfDefinitionConfig::getTableName, bo.getTableName()));
|
||||
add.setTableName(add.getTableName().toLowerCase());
|
||||
boolean flag = baseMapper.insertOrUpdate(add);
|
||||
if (baseMapper.insertOrUpdate(add)) {
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.dromara.workflow.domain.ActHiProcinst;
|
||||
import org.dromara.workflow.service.IActHiProcinstService;
|
||||
import org.dromara.workflow.service.IActProcessInstanceService;
|
||||
import org.dromara.workflow.utils.WorkflowUtils;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -24,9 +24,9 @@ import java.util.Map;
|
||||
public class WorkflowServiceImpl implements WorkflowService {
|
||||
|
||||
@Autowired(required = false)
|
||||
private RuntimeService runtimeService;
|
||||
private final IActProcessInstanceService iActProcessInstanceService;
|
||||
private final IActHiProcinstService iActHiProcinstService;
|
||||
private TaskService taskService;
|
||||
private final IActProcessInstanceService actProcessInstanceService;
|
||||
private final IActHiProcinstService actHiProcinstService;
|
||||
/**
|
||||
* 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息
|
||||
*
|
||||
@@ -35,7 +35,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteRunAndHisInstance(List<String> businessKeys) {
|
||||
return iActProcessInstanceService.deleteRunAndHisInstance(businessKeys);
|
||||
return actProcessInstanceService.deleteRunAndHisInstance(businessKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public void setVariable(String taskId, String variableName, Object value) {
|
||||
runtimeService.setVariable(taskId, variableName, value);
|
||||
taskService.setVariable(taskId, variableName, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public void setVariables(String taskId, Map<String, Object> variables) {
|
||||
runtimeService.setVariables(taskId, variables);
|
||||
taskService.setVariables(taskId, variables);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public void setVariableLocal(String taskId, String variableName, Object value) {
|
||||
runtimeService.setVariableLocal(taskId, variableName, value);
|
||||
taskService.setVariableLocal(taskId, variableName, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public void setVariablesLocal(String taskId, Map<String, Object> variables) {
|
||||
runtimeService.setVariablesLocal(taskId, variables);
|
||||
taskService.setVariablesLocal(taskId, variables);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ public class WorkflowServiceImpl implements WorkflowService {
|
||||
*/
|
||||
@Override
|
||||
public String getInstanceIdByBusinessKey(String businessKey) {
|
||||
ActHiProcinst actHiProcinst = iActHiProcinstService.selectByBusinessKey(businessKey);
|
||||
ActHiProcinst actHiProcinst = actHiProcinstService.selectByBusinessKey(businessKey);
|
||||
if (actHiProcinst == null) {
|
||||
return StrUtil.EMPTY;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ services:
|
||||
network_mode: "host"
|
||||
|
||||
ruoyi-server1:
|
||||
image: ruoyi/ruoyi-server:5.2.2
|
||||
image: ruoyi/ruoyi-server:5.2.3
|
||||
container_name: ruoyi-server1
|
||||
environment:
|
||||
# 时区上海
|
||||
@@ -115,7 +115,7 @@ services:
|
||||
network_mode: "host"
|
||||
|
||||
ruoyi-server2:
|
||||
image: ruoyi/ruoyi-server:5.2.2
|
||||
image: ruoyi/ruoyi-server:5.2.3
|
||||
container_name: ruoyi-server2
|
||||
environment:
|
||||
# 时区上海
|
||||
@@ -130,7 +130,7 @@ services:
|
||||
network_mode: "host"
|
||||
|
||||
ruoyi-monitor-admin:
|
||||
image: ruoyi/ruoyi-monitor-admin:5.2.2
|
||||
image: ruoyi/ruoyi-monitor-admin:5.2.3
|
||||
container_name: ruoyi-monitor-admin
|
||||
environment:
|
||||
# 时区上海
|
||||
@@ -142,7 +142,7 @@ services:
|
||||
network_mode: "host"
|
||||
|
||||
ruoyi-snailjob-server:
|
||||
image: ruoyi/ruoyi-snailjob-server:5.2.2
|
||||
image: ruoyi/ruoyi-snailjob-server:5.2.3
|
||||
container_name: ruoyi-snailjob-server
|
||||
environment:
|
||||
# 时区上海
|
||||
|
||||
Reference in New Issue
Block a user