mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 01:25:28 +08:00
Pre Merge pull request !855 from AprilWind/future/6.X
This commit is contained in:
commit
b94490fc1c
@ -92,17 +92,15 @@ public class AuthController {
|
|||||||
LoginVo loginVo = IAuthStrategy.login(body, client, grantType);
|
LoginVo loginVo = IAuthStrategy.login(body, client, grantType);
|
||||||
|
|
||||||
Long userId = LoginHelper.getUserId();
|
Long userId = LoginHelper.getUserId();
|
||||||
scheduledExecutorService.schedule(() -> {
|
scheduledExecutorService.schedule(() -> messageService.publishMessage(
|
||||||
messageService.publishMessage(
|
List.of(userId),
|
||||||
List.of(userId),
|
PushPayloadDTO.of(
|
||||||
PushPayloadDTO.of(
|
PushTypeEnum.MESSAGE,
|
||||||
PushTypeEnum.MESSAGE,
|
PushSourceEnum.BACKEND,
|
||||||
PushSourceEnum.BACKEND,
|
DateUtils.getTodayHour(new Date()) + "好,欢迎登录 RuoYi-Vue-Plus 后台管理系统",
|
||||||
DateUtils.getTodayHour(new Date()) + "好,欢迎登录 RuoYi-Vue-Plus 后台管理系统",
|
null
|
||||||
null
|
)
|
||||||
)
|
), 5, TimeUnit.SECONDS);
|
||||||
);
|
|
||||||
}, 5, TimeUnit.SECONDS);
|
|
||||||
return R.ok(loginVo);
|
return R.ok(loginVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +111,7 @@ public class AuthController {
|
|||||||
* @return 跳转地址
|
* @return 跳转地址
|
||||||
*/
|
*/
|
||||||
@GetMapping("/binding/{source}")
|
@GetMapping("/binding/{source}")
|
||||||
public R<String> authBinding(@PathVariable("source") String source) {
|
public R<String> authBinding(@PathVariable String source) {
|
||||||
SocialLoginConfigProperties obj = socialProperties.getType().get(source);
|
SocialLoginConfigProperties obj = socialProperties.getType().get(source);
|
||||||
if (ObjectUtil.isNull(obj)) {
|
if (ObjectUtil.isNull(obj)) {
|
||||||
return R.fail(source + "平台账号暂不支持");
|
return R.fail(source + "平台账号暂不支持");
|
||||||
|
|||||||
@ -46,25 +46,22 @@ import java.util.function.Supplier;
|
|||||||
@Service
|
@Service
|
||||||
public class SysLoginService {
|
public class SysLoginService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 最大重试次数。
|
|
||||||
*/
|
|
||||||
@Value("${user.password.maxRetryCount}")
|
|
||||||
private Integer maxRetryCount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 锁定时间。
|
|
||||||
*/
|
|
||||||
@Value("${user.password.lockTime}")
|
|
||||||
private Integer lockTime;
|
|
||||||
|
|
||||||
private final ISysPermissionService permissionService;
|
private final ISysPermissionService permissionService;
|
||||||
private final ISysSocialService sysSocialService;
|
private final ISysSocialService sysSocialService;
|
||||||
private final ISysRoleService roleService;
|
private final ISysRoleService roleService;
|
||||||
private final ISysDeptService deptService;
|
private final ISysDeptService deptService;
|
||||||
private final ISysPostService postService;
|
private final ISysPostService postService;
|
||||||
private final SysUserMapper userMapper;
|
private final SysUserMapper userMapper;
|
||||||
|
/**
|
||||||
|
* 最大重试次数。
|
||||||
|
*/
|
||||||
|
@Value("${user.password.maxRetryCount}")
|
||||||
|
private Integer maxRetryCount;
|
||||||
|
/**
|
||||||
|
* 锁定时间。
|
||||||
|
*/
|
||||||
|
@Value("${user.password.lockTime}")
|
||||||
|
private Integer lockTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定第三方用户
|
* 绑定第三方用户
|
||||||
@ -159,19 +156,20 @@ public class SysLoginService {
|
|||||||
loginUser.setDeptName(deptOpt.map(SysDeptVo::getDeptName).orElse(StringUtils.EMPTY));
|
loginUser.setDeptName(deptOpt.map(SysDeptVo::getDeptName).orElse(StringUtils.EMPTY));
|
||||||
loginUser.setDeptCategory(deptOpt.map(SysDeptVo::getDeptCategory).orElse(StringUtils.EMPTY));
|
loginUser.setDeptCategory(deptOpt.map(SysDeptVo::getDeptCategory).orElse(StringUtils.EMPTY));
|
||||||
}
|
}
|
||||||
ThreadUtils.virtualInvokeAll(() -> {
|
ThreadUtils.virtualInvokeAll(
|
||||||
loginUser.setMenuPermission(permissionService.getMenuPermission(userId));
|
() -> loginUser.setMenuPermission(permissionService.getMenuPermission(userId)),
|
||||||
}, () -> {
|
() -> loginUser.setRolePermission(permissionService.getRolePermission(userId)),
|
||||||
loginUser.setRolePermission(permissionService.getRolePermission(userId));
|
() -> {
|
||||||
}, () -> {
|
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
|
||||||
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
|
List<RoleDTO> roleDtos = BeanUtil.copyToList(roles, RoleDTO.class);
|
||||||
List<RoleDTO> roleDtos = BeanUtil.copyToList(roles, RoleDTO.class);
|
loginUser.setRoles(roleDtos);
|
||||||
loginUser.setRoles(roleDtos);
|
loginUser.setDataScopeRoleMap(permissionService.getDataScopeRoleMap(roleDtos));
|
||||||
loginUser.setDataScopeRoleMap(permissionService.getDataScopeRoleMap(roleDtos));
|
},
|
||||||
}, () -> {
|
() -> {
|
||||||
List<SysPostVo> posts = postService.selectPostsByUserId(userId);
|
List<SysPostVo> posts = postService.selectPostsByUserId(userId);
|
||||||
loginUser.setPosts(BeanUtil.copyToList(posts, PostDTO.class));
|
loginUser.setPosts(BeanUtil.copyToList(posts, PostDTO.class));
|
||||||
});
|
}
|
||||||
|
);
|
||||||
return loginUser;
|
return loginUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,9 +98,8 @@ public class ThreadPoolConfig {
|
|||||||
* @param t 任务执行过程中抛出的异常
|
* @param t 任务执行过程中抛出的异常
|
||||||
*/
|
*/
|
||||||
public static void printException(Runnable r, Throwable t) {
|
public static void printException(Runnable r, Throwable t) {
|
||||||
if (t == null && r instanceof Future<?>) {
|
if (t == null && r instanceof Future<?> future) {
|
||||||
try {
|
try {
|
||||||
Future<?> future = (Future<?>) r;
|
|
||||||
if (future.isDone()) {
|
if (future.isDone()) {
|
||||||
future.get();
|
future.get();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import java.lang.reflect.Method;
|
|||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class ReflectUtils extends ReflectUtil {
|
public class ReflectUtils extends ReflectUtil {
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,6 @@ public enum EncodeType {
|
|||||||
/**
|
/**
|
||||||
* 16进制编码
|
* 16进制编码
|
||||||
*/
|
*/
|
||||||
HEX;
|
HEX
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,9 +33,8 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
* 构造加密响应包装器。
|
* 构造加密响应包装器。
|
||||||
*
|
*
|
||||||
* @param response 原始响应
|
* @param response 原始响应
|
||||||
* @throws IOException 创建输出流异常
|
|
||||||
*/
|
*/
|
||||||
public EncryptResponseBodyWrapper(HttpServletResponse response) throws IOException {
|
public EncryptResponseBodyWrapper(HttpServletResponse response) {
|
||||||
super(response);
|
super(response);
|
||||||
this.byteArrayOutputStream = new ByteArrayOutputStream();
|
this.byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
this.servletOutputStream = this.getOutputStream();
|
this.servletOutputStream = this.getOutputStream();
|
||||||
@ -116,7 +115,6 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
* @param publicKey RSA公钥 (用于加密 AES 秘钥)
|
* @param publicKey RSA公钥 (用于加密 AES 秘钥)
|
||||||
* @param headerFlag 请求头标志
|
* @param headerFlag 请求头标志
|
||||||
* @return 加密内容
|
* @return 加密内容
|
||||||
* @throws IOException
|
|
||||||
*/
|
*/
|
||||||
public String getEncryptContent(HttpServletResponse servletResponse, String publicKey, String headerFlag) throws IOException {
|
public String getEncryptContent(HttpServletResponse servletResponse, String publicKey, String headerFlag) throws IOException {
|
||||||
// 生成秘钥
|
// 生成秘钥
|
||||||
@ -147,7 +145,7 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
* @return 响应输出流
|
* @return 响应输出流
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ServletOutputStream getOutputStream() throws IOException {
|
public ServletOutputStream getOutputStream() {
|
||||||
return new ServletOutputStream() {
|
return new ServletOutputStream() {
|
||||||
/**
|
/**
|
||||||
* 判断响应输出流是否可写。
|
* 判断响应输出流是否可写。
|
||||||
@ -173,10 +171,9 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
* 写入单个字节到响应缓存。
|
* 写入单个字节到响应缓存。
|
||||||
*
|
*
|
||||||
* @param b 待写入字节
|
* @param b 待写入字节
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void write(int b) throws IOException {
|
public void write(int b) {
|
||||||
byteArrayOutputStream.write(b);
|
byteArrayOutputStream.write(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,10 +194,9 @@ public class EncryptResponseBodyWrapper extends HttpServletResponseWrapper {
|
|||||||
* @param b 待写入字节数组
|
* @param b 待写入字节数组
|
||||||
* @param off 起始偏移量
|
* @param off 起始偏移量
|
||||||
* @param len 写入长度
|
* @param len 写入长度
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void write(byte[] b, int off, int len) throws IOException {
|
public void write(byte[] b, int off, int len) {
|
||||||
byteArrayOutputStream.write(b, off, len);
|
byteArrayOutputStream.write(b, off, len);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public class DefaultExcelListener<T> extends AnalysisEventListener<T> implements
|
|||||||
* @param context Excel 上下文
|
* @param context Excel 上下文
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onException(Exception exception, AnalysisContext context) throws Exception {
|
public void onException(Exception exception, AnalysisContext context) {
|
||||||
String errMsg = null;
|
String errMsg = null;
|
||||||
if (exception instanceof ExcelDataConvertException excelDataConvertException) {
|
if (exception instanceof ExcelDataConvertException excelDataConvertException) {
|
||||||
// 如果是某一个单元格的转换异常 能获取到具体行号
|
// 如果是某一个单元格的转换异常 能获取到具体行号
|
||||||
|
|||||||
@ -615,9 +615,8 @@ public final class ExcelBuilder<T> {
|
|||||||
*
|
*
|
||||||
* @param filename 文件名
|
* @param filename 文件名
|
||||||
* @param response HTTP 响应
|
* @param response HTTP 响应
|
||||||
* @throws UnsupportedEncodingException 文件名编码异常
|
|
||||||
*/
|
*/
|
||||||
private static void resetResponse(String filename, HttpServletResponse response) throws UnsupportedEncodingException {
|
private static void resetResponse(String filename, HttpServletResponse response) {
|
||||||
FileUtils.setAttachmentResponseHeader(response, encodingFilename(filename));
|
FileUtils.setAttachmentResponseHeader(response, encodingFilename(filename));
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,16 +109,20 @@ public class JsonValueEnhancer {
|
|||||||
* @param visited 已访问对象集合,用于避免循环引用
|
* @param visited 已访问对象集合,用于避免循环引用
|
||||||
*/
|
*/
|
||||||
private void collectValue(Object value, JsonEnhancementContext context, IdentityHashMap<Object, Boolean> visited) {
|
private void collectValue(Object value, JsonEnhancementContext context, IdentityHashMap<Object, Boolean> visited) {
|
||||||
if (value == null) {
|
switch (value) {
|
||||||
return;
|
case null -> {
|
||||||
}
|
return;
|
||||||
if (value instanceof Map<?, ?> map) {
|
}
|
||||||
map.values().forEach(child -> collectValue(child, context, visited));
|
case Map<?, ?> map -> {
|
||||||
return;
|
map.values().forEach(child -> collectValue(child, context, visited));
|
||||||
}
|
return;
|
||||||
if (value instanceof Iterable<?> iterable) {
|
}
|
||||||
iterable.forEach(child -> collectValue(child, context, visited));
|
case Iterable<?> iterable -> {
|
||||||
return;
|
iterable.forEach(child -> collectValue(child, context, visited));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (value.getClass().isArray()) {
|
if (value.getClass().isArray()) {
|
||||||
int length = Array.getLength(value);
|
int length = Array.getLength(value);
|
||||||
|
|||||||
@ -142,9 +142,8 @@ public class LogAspect {
|
|||||||
* @param log 日志
|
* @param log 日志
|
||||||
* @param operLog 操作日志
|
* @param operLog 操作日志
|
||||||
* @param jsonResult 返回结果
|
* @param jsonResult 返回结果
|
||||||
* @throws Exception 异常
|
|
||||||
*/
|
*/
|
||||||
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLogEvent operLog, Object jsonResult) throws Exception {
|
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, OperLogEvent operLog, Object jsonResult) {
|
||||||
// 设置action动作
|
// 设置action动作
|
||||||
operLog.setBusinessType(log.businessType().ordinal());
|
operLog.setBusinessType(log.businessType().ordinal());
|
||||||
// 设置标题
|
// 设置标题
|
||||||
@ -168,9 +167,8 @@ public class LogAspect {
|
|||||||
* @param joinPoint 切点
|
* @param joinPoint 切点
|
||||||
* @param operLog 操作日志
|
* @param operLog 操作日志
|
||||||
* @param excludeParamNames 排除参数名
|
* @param excludeParamNames 排除参数名
|
||||||
* @throws Exception 异常
|
|
||||||
*/
|
*/
|
||||||
private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception {
|
private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) {
|
||||||
Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
||||||
String requestMethod = operLog.getRequestMethod();
|
String requestMethod = operLog.getRequestMethod();
|
||||||
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
|
if (MapUtil.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name())) {
|
||||||
|
|||||||
@ -718,7 +718,7 @@ public final class LambdaQueryBuilder<T> implements LambdaQueryCondition<T, Lamb
|
|||||||
* @return 当前查询构造辅助对象
|
* @return 当前查询构造辅助对象
|
||||||
*/
|
*/
|
||||||
public LambdaQueryBuilder<T> allEq(BiPredicate<SFunction<T, ?>, Object> filter, Map<?, ?> params, boolean null2IsNull) {
|
public LambdaQueryBuilder<T> allEq(BiPredicate<SFunction<T, ?>, Object> filter, Map<?, ?> params, boolean null2IsNull) {
|
||||||
wrapper.allEq(true, (BiPredicate) filter, (Map) params, null2IsNull);
|
wrapper.allEq(true, filter, (Map) params, null2IsNull);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -732,7 +732,7 @@ public final class LambdaQueryBuilder<T> implements LambdaQueryCondition<T, Lamb
|
|||||||
* @return 当前查询构造辅助对象
|
* @return 当前查询构造辅助对象
|
||||||
*/
|
*/
|
||||||
public LambdaQueryBuilder<T> allEq(boolean condition, BiPredicate<SFunction<T, ?>, Object> filter, Map<?, ?> params, boolean null2IsNull) {
|
public LambdaQueryBuilder<T> allEq(boolean condition, BiPredicate<SFunction<T, ?>, Object> filter, Map<?, ?> params, boolean null2IsNull) {
|
||||||
wrapper.allEq(condition, (BiPredicate) filter, (Map) params, null2IsNull);
|
wrapper.allEq(condition, filter, (Map) params, null2IsNull);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,7 +1368,6 @@ public final class LambdaQueryBuilder<T> implements LambdaQueryCondition<T, Lamb
|
|||||||
*
|
*
|
||||||
* @return 聚合查询包装器
|
* @return 聚合查询包装器
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private AggregateLambdaQueryWrapper<T> aggregateWrapper() {
|
private AggregateLambdaQueryWrapper<T> aggregateWrapper() {
|
||||||
return (AggregateLambdaQueryWrapper<T>) wrapper;
|
return (AggregateLambdaQueryWrapper<T>) wrapper;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import org.apache.ibatis.session.RowBounds;
|
|||||||
import org.dromara.common.mybatis.handler.PlusDataPermissionHandler;
|
import org.dromara.common.mybatis.handler.PlusDataPermissionHandler;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,10 +48,9 @@ public class PlusDataPermissionInterceptor extends BaseMultiTableInnerIntercepto
|
|||||||
* @param rowBounds 分页对象
|
* @param rowBounds 分页对象
|
||||||
* @param resultHandler 结果处理器
|
* @param resultHandler 结果处理器
|
||||||
* @param boundSql 绑定的 SQL 对象
|
* @param boundSql 绑定的 SQL 对象
|
||||||
* @throws SQLException 如果发生 SQL 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
|
public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) {
|
||||||
// 检查是否需要忽略数据权限处理
|
// 检查是否需要忽略数据权限处理
|
||||||
if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) {
|
if (InterceptorIgnoreHelper.willIgnoreDataPermission(ms.getId())) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -222,11 +222,9 @@ public abstract class AbstractOssClientImpl implements OssClient {
|
|||||||
@Override
|
@Override
|
||||||
public <T> T doCustomUpload(AsyncRequestBody body, Consumer<PutObjectRequest.Builder> putObjectRequestBuilderConsumer, Collection<TransferListener> transferListeners, BiFunction<CompletedUpload, Throwable, T> handleAsyncAction) {
|
public <T> T doCustomUpload(AsyncRequestBody body, Consumer<PutObjectRequest.Builder> putObjectRequestBuilderConsumer, Collection<TransferListener> transferListeners, BiFunction<CompletedUpload, Throwable, T> handleAsyncAction) {
|
||||||
try {
|
try {
|
||||||
return s3TransferManager.upload(uploadRequestBuilder -> {
|
return s3TransferManager.upload(uploadRequestBuilder -> uploadRequestBuilder.requestBody(body)
|
||||||
uploadRequestBuilder.requestBody(body)
|
.putObjectRequest(putObjectRequestBuilderConsumer)
|
||||||
.putObjectRequest(putObjectRequestBuilderConsumer)
|
.transferListeners(transferListeners))
|
||||||
.transferListeners(transferListeners);
|
|
||||||
})
|
|
||||||
.completionFuture()
|
.completionFuture()
|
||||||
.handleAsync(handleAsyncAction)
|
.handleAsync(handleAsyncAction)
|
||||||
.join();
|
.join();
|
||||||
@ -506,14 +504,12 @@ public abstract class AbstractOssClientImpl implements OssClient {
|
|||||||
String md5Digest = options.getMd5Digest();
|
String md5Digest = options.getMd5Digest();
|
||||||
Map<String, String> metadata = options.getMetadata();
|
Map<String, String> metadata = options.getMetadata();
|
||||||
Collection<TransferListener> transferListeners = options.getTransferListeners();
|
Collection<TransferListener> transferListeners = options.getTransferListeners();
|
||||||
HandleAsyncResult<PutObjectResponse> result = doCustomUpload(body, builder -> {
|
HandleAsyncResult<PutObjectResponse> result = doCustomUpload(body, builder -> builder.bucket(bucket)
|
||||||
builder.bucket(bucket)
|
.key(key)
|
||||||
.key(key)
|
.contentMD5(md5Digest)
|
||||||
.contentMD5(md5Digest)
|
.contentType(contentType)
|
||||||
.contentType(contentType)
|
.contentLength(contentLength)
|
||||||
.contentLength(contentLength)
|
.metadata(metadata), transferListeners);
|
||||||
.metadata(metadata);
|
|
||||||
}, transferListeners);
|
|
||||||
if (result.isFailure()) {
|
if (result.isFailure()) {
|
||||||
throw toStorageException(result.error());
|
throw toStorageException(result.error());
|
||||||
}
|
}
|
||||||
@ -720,10 +716,8 @@ public abstract class AbstractOssClientImpl implements OssClient {
|
|||||||
@Override
|
@Override
|
||||||
public String bucketPresignGetUrl(String bucket, String key, Duration expiredTime) {
|
public String bucketPresignGetUrl(String bucket, String key, Duration expiredTime) {
|
||||||
try {
|
try {
|
||||||
return s3Presigner.presignGetObject(getObjectPresignRequestBuilder -> {
|
return s3Presigner.presignGetObject(getObjectPresignRequestBuilder -> getObjectPresignRequestBuilder.signatureDuration(expiredTime)
|
||||||
getObjectPresignRequestBuilder.signatureDuration(expiredTime)
|
.getObjectRequest(getObjectRequestBuilder -> getObjectRequestBuilder.bucket(bucket).key(key)))
|
||||||
.getObjectRequest(getObjectRequestBuilder -> getObjectRequestBuilder.bucket(bucket).key(key));
|
|
||||||
})
|
|
||||||
.url()
|
.url()
|
||||||
.toExternalForm();
|
.toExternalForm();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -743,10 +737,8 @@ public abstract class AbstractOssClientImpl implements OssClient {
|
|||||||
@Override
|
@Override
|
||||||
public String bucketPresignPutUrl(String bucket, String key, Duration expiredTime, Map<String, String> metadata) {
|
public String bucketPresignPutUrl(String bucket, String key, Duration expiredTime, Map<String, String> metadata) {
|
||||||
try {
|
try {
|
||||||
return s3Presigner.presignPutObject(putObjectPresignRequestBuilder -> {
|
return s3Presigner.presignPutObject(putObjectPresignRequestBuilder -> putObjectPresignRequestBuilder.signatureDuration(expiredTime)
|
||||||
putObjectPresignRequestBuilder.signatureDuration(expiredTime)
|
.putObjectRequest(putObjectRequestBuilder -> putObjectRequestBuilder.bucket(bucket).key(key).metadata(metadata)))
|
||||||
.putObjectRequest(putObjectRequestBuilder -> putObjectRequestBuilder.bucket(bucket).key(key).metadata(metadata));
|
|
||||||
})
|
|
||||||
.url()
|
.url()
|
||||||
.toExternalForm();
|
.toExternalForm();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -1127,10 +1119,9 @@ public abstract class AbstractOssClientImpl implements OssClient {
|
|||||||
/**
|
/**
|
||||||
* 关闭底层 S3 客户端资源。
|
* 关闭底层 S3 客户端资源。
|
||||||
*
|
*
|
||||||
* @throws Exception 关闭资源异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() throws Exception {
|
public void close() {
|
||||||
if (s3TransferManager != null) {
|
if (s3TransferManager != null) {
|
||||||
s3TransferManager.close();
|
s3TransferManager.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ public record HandleAsyncResult<T>(
|
|||||||
* @return 异步处理结果
|
* @return 异步处理结果
|
||||||
*/
|
*/
|
||||||
public static <T> HandleAsyncResult<T> of(T result, Throwable error) {
|
public static <T> HandleAsyncResult<T> of(T result, Throwable error) {
|
||||||
return new HandleAsyncResult<T>(result, error);
|
return new HandleAsyncResult<>(result, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,7 +71,7 @@ public record HandleAsyncResult<T>(
|
|||||||
* @return 异步处理结果
|
* @return 异步处理结果
|
||||||
*/
|
*/
|
||||||
public static <T> HandleAsyncResult<T> success(T result) {
|
public static <T> HandleAsyncResult<T> success(T result) {
|
||||||
return new HandleAsyncResult<T>(result, null);
|
return new HandleAsyncResult<>(result, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,6 +82,6 @@ public record HandleAsyncResult<T>(
|
|||||||
* @return 异步处理结果
|
* @return 异步处理结果
|
||||||
*/
|
*/
|
||||||
public static <T> HandleAsyncResult<T> failure(Throwable error) {
|
public static <T> HandleAsyncResult<T> failure(Throwable error) {
|
||||||
return new HandleAsyncResult<T>(null, error);
|
return new HandleAsyncResult<>(null, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,10 +95,9 @@ public class SseController implements DisposableBean {
|
|||||||
/**
|
/**
|
||||||
* 容器销毁时释放资源占位实现。
|
* 容器销毁时释放资源占位实现。
|
||||||
*
|
*
|
||||||
* @throws Exception 销毁异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void destroy() throws Exception {
|
public void destroy() {
|
||||||
// 销毁时不需要做什么 此方法避免无用操作报错
|
// 销毁时不需要做什么 此方法避免无用操作报错
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class RepeatSubmitAspect {
|
|||||||
* @param repeatSubmit 防重复提交注解
|
* @param repeatSubmit 防重复提交注解
|
||||||
*/
|
*/
|
||||||
@Before("@annotation(repeatSubmit)")
|
@Before("@annotation(repeatSubmit)")
|
||||||
public void doBefore(JoinPoint point, RepeatSubmit repeatSubmit) throws Throwable {
|
public void doBefore(JoinPoint point, RepeatSubmit repeatSubmit) {
|
||||||
// 如果注解不为0 则使用注解数值
|
// 如果注解不为0 则使用注解数值
|
||||||
long interval = repeatSubmit.timeUnit().toMillis(repeatSubmit.interval());
|
long interval = repeatSubmit.timeUnit().toMillis(repeatSubmit.interval());
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class RedisConfig {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* redis集群配置 yml
|
* redis集群配置 yml
|
||||||
*
|
* <p>
|
||||||
* --- # redis 集群配置(单机与集群只能开启一个另一个需要注释掉)
|
* --- # redis 集群配置(单机与集群只能开启一个另一个需要注释掉)
|
||||||
* spring.data:
|
* spring.data:
|
||||||
* redis:
|
* redis:
|
||||||
@ -134,7 +134,7 @@ public class RedisConfig {
|
|||||||
* timeout: 10s
|
* timeout: 10s
|
||||||
* # 是否开启ssl
|
* # 是否开启ssl
|
||||||
* ssl.enabled: false
|
* ssl.enabled: false
|
||||||
*
|
* <p>
|
||||||
* redisson:
|
* redisson:
|
||||||
* # 线程池数量
|
* # 线程池数量
|
||||||
* threads: 16
|
* threads: 16
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import java.util.stream.Stream;
|
|||||||
* @version 3.1.0 新增
|
* @version 3.1.0 新增
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
@SuppressWarnings(value = {"unchecked", "rawtypes"})
|
@SuppressWarnings(value = {"rawtypes"})
|
||||||
public class RedisUtils {
|
public class RedisUtils {
|
||||||
|
|
||||||
private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class);
|
private static final RedissonClient CLIENT = SpringUtils.getBean(RedissonClient.class);
|
||||||
@ -280,9 +280,7 @@ public class RedisUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RBatch batch = CLIENT.createBatch();
|
RBatch batch = CLIENT.createBatch();
|
||||||
collection.forEach(t -> {
|
collection.forEach(t -> batch.getBucket(t.toString()).deleteAsync());
|
||||||
batch.getBucket(t.toString()).deleteAsync();
|
|
||||||
});
|
|
||||||
batch.execute();
|
batch.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -129,9 +129,7 @@ public class SecurityConfig implements WebMvcConfigurer {
|
|||||||
String password = SpringUtils.getProperty("spring.boot.admin.client.password");
|
String password = SpringUtils.getProperty("spring.boot.admin.client.password");
|
||||||
return new SaServletFilter()
|
return new SaServletFilter()
|
||||||
.addInclude("/actuator", "/actuator/**")
|
.addInclude("/actuator", "/actuator/**")
|
||||||
.setAuth(obj -> {
|
.setAuth(obj -> SaHttpBasicUtil.check(username + StringUtils.COLON + password))
|
||||||
SaHttpBasicUtil.check(username + StringUtils.COLON + password);
|
|
||||||
})
|
|
||||||
.setError(e -> {
|
.setError(e -> {
|
||||||
HttpServletResponse response = ServletUtils.getResponse();
|
HttpServletResponse response = ServletUtils.getResponse();
|
||||||
response.setContentType(SaTokenConsts.CONTENT_TYPE_APPLICATION_JSON);
|
response.setContentType(SaTokenConsts.CONTENT_TYPE_APPLICATION_JSON);
|
||||||
|
|||||||
@ -33,7 +33,6 @@ public class SocialUtils {
|
|||||||
* @return 授权响应
|
* @return 授权响应
|
||||||
* @throws AuthException 授权异常
|
* @throws AuthException 授权异常
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static AuthResponse<AuthUser> loginAuth(String source, String code, String state, SocialProperties socialProperties) throws AuthException {
|
public static AuthResponse<AuthUser> loginAuth(String source, String code, String state, SocialProperties socialProperties) throws AuthException {
|
||||||
AuthRequest authRequest = getAuthRequest(source, socialProperties);
|
AuthRequest authRequest = getAuthRequest(source, socialProperties);
|
||||||
AuthCallback callback = new AuthCallback();
|
AuthCallback callback = new AuthCallback();
|
||||||
@ -93,4 +92,3 @@ public class SocialUtils {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,10 +18,9 @@ public class RepeatableFilter implements Filter {
|
|||||||
* 过滤器初始化入口,当前无额外初始化逻辑。
|
* 过滤器初始化入口,当前无额外初始化逻辑。
|
||||||
*
|
*
|
||||||
* @param filterConfig 过滤器配置
|
* @param filterConfig 过滤器配置
|
||||||
* @throws ServletException 过滤器初始化异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init(FilterConfig filterConfig) throws ServletException {
|
public void init(FilterConfig filterConfig) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,10 +44,9 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* 基于缓存的请求体构造字符读取器。
|
* 基于缓存的请求体构造字符读取器。
|
||||||
*
|
*
|
||||||
* @return 可重复读取的字符流
|
* @return 可重复读取的字符流
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BufferedReader getReader() throws IOException {
|
public BufferedReader getReader() {
|
||||||
return new BufferedReader(new InputStreamReader(getInputStream(), StandardCharsets.UTF_8));
|
return new BufferedReader(new InputStreamReader(getInputStream(), StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,20 +54,18 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* 返回基于缓存请求体重新生成的输入流。
|
* 返回基于缓存请求体重新生成的输入流。
|
||||||
*
|
*
|
||||||
* @return 可重复读取的输入流
|
* @return 可重复读取的输入流
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ServletInputStream getInputStream() throws IOException {
|
public ServletInputStream getInputStream() {
|
||||||
final ByteArrayInputStream bais = new ByteArrayInputStream(body);
|
final ByteArrayInputStream bais = new ByteArrayInputStream(body);
|
||||||
return new ServletInputStream() {
|
return new ServletInputStream() {
|
||||||
/**
|
/**
|
||||||
* 读取缓存请求体的下一个字节。
|
* 读取缓存请求体的下一个字节。
|
||||||
*
|
*
|
||||||
* @return 下一个字节
|
* @return 下一个字节
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int read() throws IOException {
|
public int read() {
|
||||||
return bais.read();
|
return bais.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,10 +73,9 @@ public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* 返回缓存请求体剩余可读字节数。
|
* 返回缓存请求体剩余可读字节数。
|
||||||
*
|
*
|
||||||
* @return 剩余字节数
|
* @return 剩余字节数
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int available() throws IOException {
|
public int available() {
|
||||||
return bais.available();
|
return bais.available();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,9 @@ public class XssFilter implements Filter {
|
|||||||
* 初始化过滤器并加载配置中的排除路径。
|
* 初始化过滤器并加载配置中的排除路径。
|
||||||
*
|
*
|
||||||
* @param filterConfig 过滤器配置
|
* @param filterConfig 过滤器配置
|
||||||
* @throws ServletException 过滤器初始化异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init(FilterConfig filterConfig) throws ServletException {
|
public void init(FilterConfig filterConfig) {
|
||||||
if (properties.getExcludeUrls() != null) {
|
if (properties.getExcludeUrls() != null) {
|
||||||
excludes.addAll(properties.getExcludeUrls());
|
excludes.addAll(properties.getExcludeUrls());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,10 +148,9 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* 返回清洗后的 JSON 字节数。
|
* 返回清洗后的 JSON 字节数。
|
||||||
*
|
*
|
||||||
* @return JSON 字节数
|
* @return JSON 字节数
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int available() throws IOException {
|
public int available() {
|
||||||
return jsonBytes.length;
|
return jsonBytes.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,10 +167,9 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
* 读取清洗后的 JSON 流下一个字节。
|
* 读取清洗后的 JSON 流下一个字节。
|
||||||
*
|
*
|
||||||
* @return 下一个字节
|
* @return 下一个字节
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int read() throws IOException {
|
public int read() {
|
||||||
return bis.read();
|
return bis.read();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -146,10 +146,9 @@ public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
|
|||||||
* @param response 当前响应
|
* @param response 当前响应
|
||||||
* @param handler 目标处理器
|
* @param handler 目标处理器
|
||||||
* @param ex 请求处理过程中的异常
|
* @param ex 请求处理过程中的异常
|
||||||
* @throws Exception 拦截器链路抛出的异常
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
|
||||||
StopWatch stopWatch = KEY_CACHE.get();
|
StopWatch stopWatch = KEY_CACHE.get();
|
||||||
if (ObjectUtil.isNotNull(stopWatch)) {
|
if (ObjectUtil.isNotNull(stopWatch)) {
|
||||||
stopWatch.stop();
|
stopWatch.stop();
|
||||||
|
|||||||
@ -40,10 +40,9 @@ public class SecurityConfig {
|
|||||||
*
|
*
|
||||||
* @param httpSecurity Spring Security 配置对象
|
* @param httpSecurity Spring Security 配置对象
|
||||||
* @return 安全过滤链
|
* @return 安全过滤链
|
||||||
* @throws Exception 构建过滤链异常
|
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) {
|
||||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||||
successHandler.setTargetUrlParameter("redirectTo");
|
successHandler.setTargetUrlParameter("redirectTo");
|
||||||
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
successHandler.setDefaultTargetUrl(adminContextPath + "/");
|
||||||
|
|||||||
@ -25,9 +25,7 @@ public class RedisPubSubController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/pub")
|
@GetMapping("/pub")
|
||||||
public R<Void> pub(String key, String value) {
|
public R<Void> pub(String key, String value) {
|
||||||
RedisUtils.publish(key, value, consumer -> {
|
RedisUtils.publish(key, value, consumer -> System.out.println("发布通道 => " + key + ", 发送值 => " + value));
|
||||||
System.out.println("发布通道 => " + key + ", 发送值 => " + value);
|
|
||||||
});
|
|
||||||
return R.ok("操作成功");
|
return R.ok("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +36,7 @@ public class RedisPubSubController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/sub")
|
@GetMapping("/sub")
|
||||||
public R<Void> sub(String key) {
|
public R<Void> sub(String key) {
|
||||||
RedisUtils.subscribe(key, String.class, msg -> {
|
RedisUtils.subscribe(key, String.class, msg -> System.out.println("订阅通道 => " + key + ", 接收值 => " + msg));
|
||||||
System.out.println("订阅通道 => " + key + ", 接收值 => " + msg);
|
|
||||||
});
|
|
||||||
return R.ok("操作成功");
|
return R.ok("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,8 +104,7 @@ public class TestDemoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("demo:demo:query")
|
@SaCheckPermission("demo:demo:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<TestDemoVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<TestDemoVo> getInfo(@PathVariable @NotNull(message = "主键不能为空") Long id) {
|
||||||
@PathVariable("id") Long id) {
|
|
||||||
return R.ok(testDemoService.queryById(id));
|
return R.ok(testDemoService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,8 +65,7 @@ public class TestTreeController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("demo:tree:query")
|
@SaCheckPermission("demo:tree:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<TestTreeVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<TestTreeVo> getInfo(@PathVariable @NotNull(message = "主键不能为空") Long id) {
|
||||||
@PathVariable("id") Long id) {
|
|
||||||
return R.ok(testTreeService.queryById(id));
|
return R.ok(testTreeService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class GenController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("tool:gen:list")
|
@SaCheckPermission("tool:gen:list")
|
||||||
@GetMapping(value = "/column/{tableId}")
|
@GetMapping(value = "/column/{tableId}")
|
||||||
public R<PageResult<GenTableColumn>> columnList(@PathVariable("tableId") Long tableId) {
|
public R<PageResult<GenTableColumn>> columnList(@PathVariable Long tableId) {
|
||||||
List<GenTableColumn> list = genTableService.selectGenTableColumnListByTableId(tableId);
|
List<GenTableColumn> list = genTableService.selectGenTableColumnListByTableId(tableId);
|
||||||
return R.ok(PageResult.build(list));
|
return R.ok(PageResult.build(list));
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ public class GenController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("tool:gen:preview")
|
@SaCheckPermission("tool:gen:preview")
|
||||||
@GetMapping("/preview/{tableId}")
|
@GetMapping("/preview/{tableId}")
|
||||||
public R<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
|
public R<Map<String, String>> preview(@PathVariable Long tableId) {
|
||||||
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
Map<String, String> dataMap = genTableService.previewCode(tableId);
|
||||||
return R.ok(dataMap);
|
return R.ok(dataMap);
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ public class GenController extends BaseController {
|
|||||||
@SaCheckPermission("tool:gen:code")
|
@SaCheckPermission("tool:gen:code")
|
||||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||||
@GetMapping("/download/{tableId}")
|
@GetMapping("/download/{tableId}")
|
||||||
public void download(HttpServletResponse response, @PathVariable("tableId") Long tableId) throws IOException {
|
public void download(HttpServletResponse response, @PathVariable Long tableId) throws IOException {
|
||||||
byte[] data = genTableService.downloadCode(tableId);
|
byte[] data = genTableService.downloadCode(tableId);
|
||||||
genCode(response, data);
|
genCode(response, data);
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ public class GenController extends BaseController {
|
|||||||
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
||||||
@Lock4j(keys = {"#tableId"}, acquireTimeout = 5000)
|
@Lock4j(keys = {"#tableId"}, acquireTimeout = 5000)
|
||||||
@GetMapping("/synchDb/{tableId}")
|
@GetMapping("/synchDb/{tableId}")
|
||||||
public R<Void> synchDb(@PathVariable("tableId") Long tableId) {
|
public R<Void> synchDb(@PathVariable Long tableId) {
|
||||||
genTableService.synchDb(tableId);
|
genTableService.synchDb(tableId);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -340,7 +340,7 @@ public class GenTableColumn extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
public String readConverterExp() {
|
public String readConverterExp() {
|
||||||
String remarks = StringUtils.substringBetween(this.columnComment, "(", ")");
|
String remarks = StringUtils.substringBetween(this.columnComment, "(", ")");
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (StringUtils.isNotEmpty(remarks)) {
|
if (StringUtils.isNotEmpty(remarks)) {
|
||||||
for (String value : remarks.split(" ")) {
|
for (String value : remarks.split(" ")) {
|
||||||
if (StringUtils.isNotEmpty(value)) {
|
if (StringUtils.isNotEmpty(value)) {
|
||||||
|
|||||||
@ -27,9 +27,8 @@ public class AlipayBillTask {
|
|||||||
*
|
*
|
||||||
* @param jobArgs 任务执行参数
|
* @param jobArgs 任务执行参数
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
* @throws InterruptedException 任务被中断时抛出
|
|
||||||
*/
|
*/
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
|
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||||
// 设置清算日期
|
// 设置清算日期
|
||||||
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
|
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
|
||||||
if (StringUtils.equals(settlementDate, "sysdate")) {
|
if (StringUtils.equals(settlementDate, "sysdate")) {
|
||||||
|
|||||||
@ -26,9 +26,8 @@ public class SummaryBillTask {
|
|||||||
*
|
*
|
||||||
* @param jobArgs 任务执行参数
|
* @param jobArgs 任务执行参数
|
||||||
* @return 汇总执行结果
|
* @return 汇总执行结果
|
||||||
* @throws InterruptedException 任务被中断时抛出
|
|
||||||
*/
|
*/
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
|
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||||
// 获得微信账单
|
// 获得微信账单
|
||||||
BigDecimal wechatAmount = BigDecimal.valueOf(0);
|
BigDecimal wechatAmount = BigDecimal.valueOf(0);
|
||||||
String wechat = (String) jobArgs.getWfContext("wechat");
|
String wechat = (String) jobArgs.getWfContext("wechat");
|
||||||
|
|||||||
@ -27,9 +27,8 @@ public class WechatBillTask {
|
|||||||
*
|
*
|
||||||
* @param jobArgs 任务执行参数
|
* @param jobArgs 任务执行参数
|
||||||
* @return 执行结果
|
* @return 执行结果
|
||||||
* @throws InterruptedException 任务被中断时抛出
|
|
||||||
*/
|
*/
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
|
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||||
// 从上下文中获得清算日期并设置,如果上下文中清算日期
|
// 从上下文中获得清算日期并设置,如果上下文中清算日期
|
||||||
// 是sysdate设置为当前日期;否则取管理页面设置的值
|
// 是sysdate设置为当前日期;否则取管理页面设置的值
|
||||||
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
|
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class CacheController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("monitor:cache:list")
|
@SaCheckPermission("monitor:cache:list")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public R<CacheListInfoVo> getInfo() throws Exception {
|
public R<CacheListInfoVo> getInfo() {
|
||||||
RedisConnection connection = connectionFactory.getConnection();
|
RedisConnection connection = connectionFactory.getConnection();
|
||||||
try {
|
try {
|
||||||
Properties commandStats = connection.commands().info("commandstats");
|
Properties commandStats = connection.commands().info("commandstats");
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class SysLoginInfoController extends BaseController {
|
|||||||
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
@Log(title = "账户解锁", businessType = BusinessType.OTHER)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@GetMapping("/unlock/{userName}")
|
@GetMapping("/unlock/{userName}")
|
||||||
public R<Void> unlock(@PathVariable("userName") String userName) {
|
public R<Void> unlock(@PathVariable String userName) {
|
||||||
String loginName = CacheNames.PWD_ERR_CNT_KEY + userName;
|
String loginName = CacheNames.PWD_ERR_CNT_KEY + userName;
|
||||||
if (RedisUtils.hasKey(loginName)) {
|
if (RedisUtils.hasKey(loginName)) {
|
||||||
RedisUtils.deleteObject(loginName);
|
RedisUtils.deleteObject(loginName);
|
||||||
|
|||||||
@ -126,7 +126,7 @@ public class SysUserOnlineController extends BaseController {
|
|||||||
@Log(title = "在线设备", businessType = BusinessType.FORCE)
|
@Log(title = "在线设备", businessType = BusinessType.FORCE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@DeleteMapping("/myself/{tokenId}")
|
@DeleteMapping("/myself/{tokenId}")
|
||||||
public R<Void> remove(@PathVariable("tokenId") String tokenId) {
|
public R<Void> remove(@PathVariable String tokenId) {
|
||||||
try {
|
try {
|
||||||
// 获取指定账号 id 的 token 集合
|
// 获取指定账号 id 的 token 集合
|
||||||
List<String> keys = StpUtil.getTokenValueListByLoginId(StpUtil.getLoginIdAsString());
|
List<String> keys = StpUtil.getTokenValueListByLoginId(StpUtil.getLoginIdAsString());
|
||||||
|
|||||||
@ -53,11 +53,16 @@ public class SysDeptController extends BaseController {
|
|||||||
* @return 过滤后的部门列表
|
* @return 过滤后的部门列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:dept:list")
|
@SaCheckPermission("system:dept:list")
|
||||||
@GetMapping("/list/exclude/{deptId}")
|
@GetMapping(value = {"/list/exclude", "/list/exclude/{deptId}"})
|
||||||
public R<List<SysDeptVo>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
public R<List<SysDeptVo>> excludeChild(@PathVariable(required = false) Long deptId) {
|
||||||
List<SysDeptVo> depts = deptService.selectDeptList(new SysDeptBo());
|
List<SysDeptVo> depts = deptService.selectDeptList(new SysDeptBo());
|
||||||
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
if (deptId == null) {
|
||||||
|| StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId)));
|
return R.ok(depts);
|
||||||
|
}
|
||||||
|
String deptIdStr = Convert.toStr(deptId);
|
||||||
|
// 过滤掉自身 + 所有子节点
|
||||||
|
depts.removeIf(d -> deptId.equals(d.getDeptId())
|
||||||
|
|| StringUtils.splitList(d.getAncestors()).contains(deptIdStr));
|
||||||
return R.ok(depts);
|
return R.ok(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class SysMenuController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:menu:query")
|
@SaCheckPermission("system:menu:query")
|
||||||
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
|
||||||
public R<MenuTreeSelectVo> roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
|
public R<MenuTreeSelectVo> roleMenuTreeselect(@PathVariable Long roleId) {
|
||||||
List<SysMenuVo> menus = menuService.selectMenuList(LoginHelper.getUserId());
|
List<SysMenuVo> menus = menuService.selectMenuList(LoginHelper.getUserId());
|
||||||
MenuTreeSelectVo selectVo = new MenuTreeSelectVo(
|
MenuTreeSelectVo selectVo = new MenuTreeSelectVo(
|
||||||
menuService.selectMenuListByRoleId(roleId),
|
menuService.selectMenuListByRoleId(roleId),
|
||||||
@ -163,7 +163,7 @@ public class SysMenuController extends BaseController {
|
|||||||
@SaCheckPermission("system:menu:remove")
|
@SaCheckPermission("system:menu:remove")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{menuId}")
|
@DeleteMapping("/{menuId}")
|
||||||
public R<Void> remove(@PathVariable("menuId") Long menuId) {
|
public R<Void> remove(@PathVariable Long menuId) {
|
||||||
if (menuService.hasChildByMenuId(menuId)) {
|
if (menuService.hasChildByMenuId(menuId)) {
|
||||||
return R.warn("存在子菜单,不允许删除");
|
return R.warn("存在子菜单,不允许删除");
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ public class SysMenuController extends BaseController {
|
|||||||
@SaCheckPermission("system:menu:remove")
|
@SaCheckPermission("system:menu:remove")
|
||||||
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/cascade/{menuIds}")
|
@DeleteMapping("/cascade/{menuIds}")
|
||||||
public R<Void> remove(@PathVariable("menuIds") Long[] menuIds) {
|
public R<Void> remove(@PathVariable Long[] menuIds) {
|
||||||
List<Long> menuIdList = List.of(menuIds);
|
List<Long> menuIdList = List.of(menuIds);
|
||||||
if (menuService.hasChildByMenuId(menuIdList)) {
|
if (menuService.hasChildByMenuId(menuIdList)) {
|
||||||
return R.warn("存在子菜单,不允许删除");
|
return R.warn("存在子菜单,不允许删除");
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -83,11 +82,10 @@ public class SysOssController extends BaseController {
|
|||||||
* 下载OSS对象
|
* 下载OSS对象
|
||||||
*
|
*
|
||||||
* @param ossId OSS对象ID
|
* @param ossId OSS对象ID
|
||||||
* @throws IOException IO 异常
|
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:oss:download")
|
@SaCheckPermission("system:oss:download")
|
||||||
@GetMapping("/download/{ossId}")
|
@GetMapping("/download/{ossId}")
|
||||||
public ResponseEntity<byte[]> download(@PathVariable Long ossId) throws IOException {
|
public ResponseEntity<byte[]> download(@PathVariable Long ossId) {
|
||||||
return ossService.download(ossId);
|
return ossService.download(ossId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -275,7 +275,7 @@ public class SysRoleController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:role:list")
|
@SaCheckPermission("system:role:list")
|
||||||
@GetMapping(value = "/deptTree/{roleId}")
|
@GetMapping(value = "/deptTree/{roleId}")
|
||||||
public R<DeptTreeSelectVo> roleDeptTreeselect(@PathVariable("roleId") Long roleId) {
|
public R<DeptTreeSelectVo> roleDeptTreeselect(@PathVariable Long roleId) {
|
||||||
DeptTreeSelectVo selectVo = new DeptTreeSelectVo(
|
DeptTreeSelectVo selectVo = new DeptTreeSelectVo(
|
||||||
deptService.selectDeptListByRoleId(roleId),
|
deptService.selectDeptListByRoleId(roleId),
|
||||||
deptService.selectDeptTreeList(new SysDeptBo()));
|
deptService.selectDeptTreeList(new SysDeptBo()));
|
||||||
|
|||||||
@ -141,7 +141,7 @@ public class SysUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("system:user:query")
|
@SaCheckPermission("system:user:query")
|
||||||
@GetMapping(value = {"/", "/{userId}"})
|
@GetMapping(value = {"/", "/{userId}"})
|
||||||
public R<SysUserInfoVo> getInfo(@PathVariable(value = "userId", required = false) Long userId) {
|
public R<SysUserInfoVo> getInfo(@PathVariable(required = false) Long userId) {
|
||||||
SysUserInfoVo userInfoVo = new SysUserInfoVo();
|
SysUserInfoVo userInfoVo = new SysUserInfoVo();
|
||||||
if (ObjectUtil.isNotNull(userId)) {
|
if (ObjectUtil.isNotNull(userId)) {
|
||||||
userService.checkUserDataScope(userId);
|
userService.checkUserDataScope(userId);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public class SystemApplicationRunner implements ApplicationRunner {
|
|||||||
* @param args 启动参数
|
* @param args 启动参数
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) {
|
||||||
ossConfigService.init();
|
ossConfigService.init();
|
||||||
log.info("初始化OSS配置成功");
|
log.info("初始化OSS配置成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package org.dromara.workflow.service.impl;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||||
|
|||||||
@ -116,49 +116,47 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
||||||
defJson.getNodeList().forEach(nodeJson -> {
|
defJson.getNodeList().forEach(nodeJson -> nodeJson.setPromptContent(
|
||||||
nodeJson.setPromptContent(
|
new PromptContent()
|
||||||
new PromptContent()
|
// 提示信息
|
||||||
// 提示信息
|
.setInfo(
|
||||||
.setInfo(
|
CollUtil.newArrayList(
|
||||||
CollUtil.newArrayList(
|
new PromptContent.InfoItem()
|
||||||
new PromptContent.InfoItem()
|
.setPrefix("任务名称: ")
|
||||||
.setPrefix("任务名称: ")
|
.setContent(nodeJson.getNodeName())
|
||||||
.setContent(nodeJson.getNodeName())
|
.setContentStyle(Map.of(
|
||||||
.setContentStyle(Map.of(
|
"border", "1px solid #d1e9ff",
|
||||||
"border", "1px solid #d1e9ff",
|
"backgroundColor", "#e8f4ff",
|
||||||
"backgroundColor", "#e8f4ff",
|
"padding", "4px 8px",
|
||||||
"padding", "4px 8px",
|
"borderRadius", "4px"
|
||||||
"borderRadius", "4px"
|
))
|
||||||
))
|
.setRowStyle(Map.of(
|
||||||
.setRowStyle(Map.of(
|
"fontWeight", "bold",
|
||||||
"fontWeight", "bold",
|
"margin", "0 0 6px 0",
|
||||||
"margin", "0 0 6px 0",
|
"padding", "0 0 8px 0",
|
||||||
"padding", "0 0 8px 0",
|
"borderBottom", "1px solid #ccc"
|
||||||
"borderBottom", "1px solid #ccc"
|
))
|
||||||
))
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
// 弹窗样式
|
)
|
||||||
.setDialogStyle(MapUtil.mergeAll(
|
// 弹窗样式
|
||||||
"position", "absolute",
|
.setDialogStyle(MapUtil.mergeAll(
|
||||||
"backgroundColor", "#fff",
|
"position", "absolute",
|
||||||
"border", "1px solid #ccc",
|
"backgroundColor", "#fff",
|
||||||
"borderRadius", "4px",
|
"border", "1px solid #ccc",
|
||||||
"boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)",
|
"borderRadius", "4px",
|
||||||
"padding", "8px 12px",
|
"boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||||
"fontSize", "14px",
|
"padding", "8px 12px",
|
||||||
"zIndex", "1000",
|
"fontSize", "14px",
|
||||||
"maxWidth", "500px",
|
"zIndex", "1000",
|
||||||
"maxHeight", "300px",
|
"maxWidth", "500px",
|
||||||
"overflowY", "auto",
|
"maxHeight", "300px",
|
||||||
"overflowX", "hidden",
|
"overflowY", "auto",
|
||||||
"color", "#333",
|
"overflowX", "hidden",
|
||||||
"pointerEvents", "auto",
|
"color", "#333",
|
||||||
"scrollbarWidth", "thin"
|
"pointerEvents", "auto",
|
||||||
))
|
"scrollbarWidth", "thin"
|
||||||
);
|
))
|
||||||
});
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -149,14 +149,12 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
switch (messageTypeEnum) {
|
switch (messageTypeEnum) {
|
||||||
case SYSTEM_MESSAGE -> {
|
case SYSTEM_MESSAGE -> // 站内消息直接携带前端路由,消息盒子点击后可按路径分流。
|
||||||
// 站内消息直接携带前端路由,消息盒子点击后可按路径分流。
|
|
||||||
messageService.publishMessage(userIds, PushPayloadDTO.of(
|
messageService.publishMessage(userIds, PushPayloadDTO.of(
|
||||||
PushTypeEnum.MESSAGE,
|
PushTypeEnum.MESSAGE,
|
||||||
PushSourceEnum.WORKFLOW,
|
PushSourceEnum.WORKFLOW,
|
||||||
message, null, path
|
message, null, path
|
||||||
));
|
));
|
||||||
}
|
|
||||||
case EMAIL_MESSAGE -> MailBuilder.of().to(emails).subject(subject).text(message).send();
|
case EMAIL_MESSAGE -> MailBuilder.of().to(emails).subject(subject).text(message).send();
|
||||||
case SMS_MESSAGE -> {
|
case SMS_MESSAGE -> {
|
||||||
// LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
// LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user