mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-10-20 08:53:48 +08:00
Compare commits
7 Commits
5a1523564b
...
a4ad56f0eb
Author | SHA1 | Date | |
---|---|---|---|
|
a4ad56f0eb | ||
|
b9e5914bab | ||
|
553fca28a2 | ||
|
97caabe0a2 | ||
|
122f2770b2 | ||
|
748c95b30f | ||
|
e0672fc753 |
@@ -264,6 +264,7 @@ justauth:
|
|||||||
client-secret: 1f7d08**********5b7**********29e
|
client-secret: 1f7d08**********5b7**********29e
|
||||||
redirect-uri: ${justauth.address}/social-callback?source=gitlab
|
redirect-uri: ${justauth.address}/social-callback?source=gitlab
|
||||||
gitea:
|
gitea:
|
||||||
|
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
|
||||||
# gitea 服务器地址
|
# gitea 服务器地址
|
||||||
server-url: https://demo.gitea.com
|
server-url: https://demo.gitea.com
|
||||||
client-id: 10**********6
|
client-id: 10**********6
|
||||||
|
@@ -266,6 +266,7 @@ justauth:
|
|||||||
client-secret: 1f7d08**********5b7**********29e
|
client-secret: 1f7d08**********5b7**********29e
|
||||||
redirect-uri: ${justauth.address}/social-callback?source=gitlab
|
redirect-uri: ${justauth.address}/social-callback?source=gitlab
|
||||||
gitea:
|
gitea:
|
||||||
|
# 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
|
||||||
# gitea 服务器地址
|
# gitea 服务器地址
|
||||||
server-url: https://demo.gitea.com
|
server-url: https://demo.gitea.com
|
||||||
client-id: 10**********6
|
client-id: 10**********6
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package org.dromara.common.json.config;
|
package org.dromara.common.json.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
@@ -41,10 +40,8 @@ public class JacksonConfig {
|
|||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter));
|
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter));
|
||||||
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
|
||||||
// 自定义 java.util.Date 的反序列化(支持多格式字符串解析)
|
javaTimeModule.addDeserializer(Date.class, new CustomDateDeserializer());
|
||||||
SimpleModule dateModule = new SimpleModule();
|
builder.modules(javaTimeModule);
|
||||||
dateModule.addDeserializer(Date.class, new CustomDateDeserializer());
|
|
||||||
builder.modules(javaTimeModule, dateModule);
|
|
||||||
builder.timeZone(TimeZone.getDefault());
|
builder.timeZone(TimeZone.getDefault());
|
||||||
log.info("初始化 jackson 配置");
|
log.info("初始化 jackson 配置");
|
||||||
};
|
};
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.mybatis.core.page;
|
package org.dromara.common.mybatis.core.page;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.http.HttpStatus;
|
import cn.hutool.http.HttpStatus;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -88,4 +89,19 @@ public class TableDataInfo<T> implements Serializable {
|
|||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据原始数据列表和分页参数,构建表格分页数据对象(用于假分页)
|
||||||
|
*
|
||||||
|
* @param list 原始数据列表(全部数据)
|
||||||
|
* @param page 分页参数对象(包含当前页码、每页大小等)
|
||||||
|
* @return 构造好的分页结果 TableDataInfo<T>
|
||||||
|
*/
|
||||||
|
public static <T> TableDataInfo<T> build(List<T> list, IPage<T> page) {
|
||||||
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
return TableDataInfo.build();
|
||||||
|
}
|
||||||
|
List<T> pageList = CollUtil.page((int) page.getCurrent() - 1, (int) page.getSize(), list);
|
||||||
|
return new TableDataInfo(pageList, list.size());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,6 @@ import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -168,12 +167,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||||||
return gen;
|
return gen;
|
||||||
}).sorted(Comparator.comparing(GenTable::getCreateTime).reversed())
|
}).sorted(Comparator.comparing(GenTable::getCreateTime).reversed())
|
||||||
.toList();
|
.toList();
|
||||||
|
return TableDataInfo.build(tables, pageQuery.build());
|
||||||
IPage<GenTable> page = pageQuery.build();
|
|
||||||
page.setTotal(tables.size());
|
|
||||||
// 手动分页 set数据
|
|
||||||
page.setRecords(CollUtil.page((int) page.getCurrent() - 1, (int) page.getSize(), tables));
|
|
||||||
return TableDataInfo.build(page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,6 +28,6 @@ public interface IFlwTaskAssigneeService {
|
|||||||
* @param storageIds 多个存储标识符字符串(逗号分隔)
|
* @param storageIds 多个存储标识符字符串(逗号分隔)
|
||||||
* @return 合并后的用户列表,去重后返回,非法格式的标识将被跳过
|
* @return 合并后的用户列表,去重后返回,非法格式的标识将被跳过
|
||||||
*/
|
*/
|
||||||
List<UserDTO> fetchUsersByStorageIds(String storageIds);
|
List<UserDTO> fetchUsersByStorageIds(List<String> storageIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -72,10 +72,13 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
|||||||
IFlwTaskAssigneeService taskAssigneeService = SpringUtils.getBean(IFlwTaskAssigneeService.class);
|
IFlwTaskAssigneeService taskAssigneeService = SpringUtils.getBean(IFlwTaskAssigneeService.class);
|
||||||
Map<String, List<User>> userListMap = StreamUtils.groupByKey(userList, User::getType);
|
Map<String, List<User>> userListMap = StreamUtils.groupByKey(userList, User::getType);
|
||||||
for (Map.Entry<String, List<User>> entry : userListMap.entrySet()) {
|
for (Map.Entry<String, List<User>> entry : userListMap.entrySet()) {
|
||||||
List<User> entryValue = entry.getValue();
|
List<String> processedBys = entry.getValue().stream()
|
||||||
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
|
.map(User::getProcessedBy)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
|
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
|
||||||
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageId(processedBys);
|
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageIds(processedBys);
|
||||||
// 转换为 FlowUser 并添加到结果集合
|
// 转换为 FlowUser 并添加到结果集合
|
||||||
if (CollUtil.isNotEmpty(users)) {
|
if (CollUtil.isNotEmpty(users)) {
|
||||||
users.forEach(dto -> {
|
users.forEach(dto -> {
|
||||||
|
@@ -176,7 +176,7 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
|||||||
public List<UserDTO> fetchUsersByStorageId(String storageId) {
|
public List<UserDTO> fetchUsersByStorageId(String storageId) {
|
||||||
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
|
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
|
||||||
if (parsed == null) {
|
if (parsed == null) {
|
||||||
return Collections.emptyList();
|
return List.of();
|
||||||
}
|
}
|
||||||
return this.getUsersByType(parsed.getKey(), Collections.singletonList(parsed.getValue()));
|
return this.getUsersByType(parsed.getKey(), Collections.singletonList(parsed.getValue()));
|
||||||
}
|
}
|
||||||
@@ -190,9 +190,12 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
|||||||
* @return 合并后的用户列表,去重后返回,非法格式的标识将被跳过
|
* @return 合并后的用户列表,去重后返回,非法格式的标识将被跳过
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<UserDTO> fetchUsersByStorageIds(String storageIds) {
|
public List<UserDTO> fetchUsersByStorageIds(List<String> storageIds) {
|
||||||
|
if (CollUtil.isEmpty(storageIds)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
Map<TaskAssigneeEnum, List<Long>> typeIdMap = new EnumMap<>(TaskAssigneeEnum.class);
|
Map<TaskAssigneeEnum, List<Long>> typeIdMap = new EnumMap<>(TaskAssigneeEnum.class);
|
||||||
for (String storageId : storageIds.split(StrUtil.COMMA)) {
|
for (String storageId : storageIds) {
|
||||||
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
|
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
|
||||||
if (parsed != null) {
|
if (parsed != null) {
|
||||||
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());
|
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());
|
||||||
|
@@ -600,7 +600,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|||||||
for (FlowNode flowNode : nextFlowNodes) {
|
for (FlowNode flowNode : nextFlowNodes) {
|
||||||
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
|
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
|
||||||
if (CollUtil.isNotEmpty(t.getPermissionList())) {
|
if (CollUtil.isNotEmpty(t.getPermissionList())) {
|
||||||
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageId(String.join(StringUtils.SEPARATOR, t.getPermissionList()));
|
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(t.getPermissionList());
|
||||||
if (CollUtil.isNotEmpty(users)) {
|
if (CollUtil.isNotEmpty(users)) {
|
||||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
||||||
}
|
}
|
||||||
|
10
script/sql/update/oracle/update_5.3.1-5.4.0.sql
Normal file
10
script/sql/update/oracle/update_5.3.1-5.4.0.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
ALTER TABLE flow_task ADD (flow_status VARCHAR2(20));
|
||||||
|
COMMENT ON COLUMN flow_task.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN flow_instance.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN flow_his_task.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
ALTER TABLE sys_social
|
||||||
|
MODIFY (access_token VARCHAR2(2000 BYTE))
|
||||||
|
MODIFY (refresh_token VARCHAR2(2000 BYTE));
|
10
script/sql/update/postgres/update_5.3.1-5.4.0.sql
Normal file
10
script/sql/update/postgres/update_5.3.1-5.4.0.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
ALTER TABLE flow_task ADD COLUMN flow_status varchar(20);
|
||||||
|
COMMENT ON COLUMN flow_task.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN flow_instance.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
COMMENT ON COLUMN flow_his_task.flow_status IS '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)';
|
||||||
|
|
||||||
|
ALTER TABLE sys_social
|
||||||
|
ALTER COLUMN access_token TYPE varchar(2000),
|
||||||
|
ALTER COLUMN refresh_token TYPE varchar(2000);
|
48
script/sql/update/sqlserver/update_5.3.1-5.4.0.sql
Normal file
48
script/sql/update/sqlserver/update_5.3.1-5.4.0.sql
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
ALTER TABLE flow_task ADD flow_status nvarchar(20) NULL;
|
||||||
|
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_task',
|
||||||
|
'COLUMN', N'flow_status'
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_instance',
|
||||||
|
'COLUMN', N'flow_status')) > 0)
|
||||||
|
EXEC sp_updateextendedproperty
|
||||||
|
'MS_Description', N'流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_instance',
|
||||||
|
'COLUMN', N'flow_status'
|
||||||
|
ELSE
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_instance',
|
||||||
|
'COLUMN', N'flow_status'
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF ((SELECT COUNT(*) FROM ::fn_listextendedproperty('MS_Description',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_his_task',
|
||||||
|
'COLUMN', N'flow_status')) > 0)
|
||||||
|
EXEC sp_updateextendedproperty
|
||||||
|
'MS_Description', N'流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_his_task',
|
||||||
|
'COLUMN', N'flow_status'
|
||||||
|
ELSE
|
||||||
|
EXEC sp_addextendedproperty
|
||||||
|
'MS_Description', N'流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||||
|
'SCHEMA', N'dbo',
|
||||||
|
'TABLE', N'flow_his_task',
|
||||||
|
'COLUMN', N'flow_status'
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- sys_social 表修改列
|
||||||
|
ALTER TABLE sys_social ALTER COLUMN access_token VARCHAR(2000) NOT NULL
|
||||||
|
GO
|
||||||
|
ALTER TABLE sys_social ALTER COLUMN refresh_token VARCHAR(2000) NULL
|
||||||
|
GO
|
@@ -10,4 +10,4 @@ ALTER TABLE `flow_his_task`
|
|||||||
ALTER TABLE `sys_social`
|
ALTER TABLE `sys_social`
|
||||||
MODIFY COLUMN `access_token` varchar(2000) NOT NULL COMMENT '用户的授权令牌' AFTER `avatar`;
|
MODIFY COLUMN `access_token` varchar(2000) NOT NULL COMMENT '用户的授权令牌' AFTER `avatar`;
|
||||||
ALTER TABLE `sys_social`
|
ALTER TABLE `sys_social`
|
||||||
MODIFY COLUMN `refresh_token` varchar(2000) NOT NULL COMMENT '刷新令牌,部分平台可能没有' AFTER `expire_in`;
|
MODIFY COLUMN `refresh_token` varchar(2000) DEFAULT NULL COMMENT '刷新令牌,部分平台可能没有' AFTER `expire_in`;
|
Reference in New Issue
Block a user