mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-10-10 03:56:39 +08:00
Compare commits
5 Commits
f868de1b7b
...
74d257a610
Author | SHA1 | Date | |
---|---|---|---|
|
74d257a610 | ||
|
cb8fa6ff9a | ||
|
c157012807 | ||
|
ffa01bdb3a | ||
|
3fa572f0a8 |
20
pom.xml
20
pom.xml
@ -14,7 +14,7 @@
|
||||
|
||||
<properties>
|
||||
<revision>5.4.0</revision>
|
||||
<spring-boot.version>3.4.6</spring-boot.version>
|
||||
<spring-boot.version>3.4.7</spring-boot.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
@ -23,12 +23,12 @@
|
||||
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
||||
<fastexcel.version>1.2.0</fastexcel.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<satoken.version>1.42.0</satoken.version>
|
||||
<satoken.version>1.44.0</satoken.version>
|
||||
<mybatis-plus.version>3.5.12</mybatis-plus.version>
|
||||
<p6spy.version>3.9.1</p6spy.version>
|
||||
<hutool.version>5.8.35</hutool.version>
|
||||
<hutool.version>5.8.38</hutool.version>
|
||||
<spring-boot-admin.version>3.4.7</spring-boot-admin.version>
|
||||
<redisson.version>3.45.1</redisson.version>
|
||||
<redisson.version>3.50.0</redisson.version>
|
||||
<lock4j.version>2.2.7</lock4j.version>
|
||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||
<snailjob.version>1.5.0</snailjob.version>
|
||||
@ -41,21 +41,21 @@
|
||||
<ip2region.version>2.7.0</ip2region.version>
|
||||
|
||||
<!-- OSS 配置 -->
|
||||
<aws.sdk.version>2.28.22</aws.sdk.version>
|
||||
<aws.sdk.version>2.31.67</aws.sdk.version>
|
||||
<!-- SMS 配置 -->
|
||||
<sms4j.version>3.3.4</sms4j.version>
|
||||
<!-- 限制框架中的fastjson版本 -->
|
||||
<fastjson.version>1.2.83</fastjson.version>
|
||||
<!-- 面向运行时的D-ORM依赖 -->
|
||||
<anyline.version>8.7.2-20250101</anyline.version>
|
||||
<anyline.version>8.7.2-20250603</anyline.version>
|
||||
<!-- 工作流配置 -->
|
||||
<warm-flow.version>1.7.4</warm-flow.version>
|
||||
|
||||
<!-- 插件版本 -->
|
||||
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
||||
<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
|
||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
|
||||
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
|
||||
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
|
||||
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
|
||||
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
|
||||
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
|
||||
<!-- 打包默认跳过测试 -->
|
||||
<skipTests>true</skipTests>
|
||||
|
@ -158,6 +158,6 @@ public class UserActionListener implements SaTokenListener {
|
||||
* 每次Token续期时触发
|
||||
*/
|
||||
@Override
|
||||
public void doRenewTimeout(String tokenValue, Object loginId, long timeout) {
|
||||
public void doRenewTimeout(String loginType, Object loginId, String tokenValue, long timeout) {
|
||||
}
|
||||
}
|
||||
|
@ -52,14 +52,6 @@ public interface UserService {
|
||||
*/
|
||||
String selectEmailById(Long userId);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户详细信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 用户详细信息
|
||||
*/
|
||||
UserDTO selectUserDtoById(Long userId);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户列表
|
||||
*
|
||||
|
@ -22,6 +22,11 @@ import java.util.Date;
|
||||
@Slf4j
|
||||
public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
/**
|
||||
* 如果用户不存在默认注入-1代表无用户
|
||||
*/
|
||||
private static final Long DEFAULT_USER_ID = -1L;
|
||||
|
||||
/**
|
||||
* 插入填充方法,用于在插入数据时自动填充实体对象中的创建时间、更新时间、创建人、更新人等信息
|
||||
*
|
||||
@ -45,6 +50,11 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
baseEntity.setCreateBy(userId);
|
||||
baseEntity.setUpdateBy(userId);
|
||||
baseEntity.setCreateDept(ObjectUtils.notNull(baseEntity.getCreateDept(), loginUser.getDeptId()));
|
||||
} else {
|
||||
// 填充创建人、更新人和创建部门信息
|
||||
baseEntity.setCreateBy(DEFAULT_USER_ID);
|
||||
baseEntity.setUpdateBy(DEFAULT_USER_ID);
|
||||
baseEntity.setCreateDept(ObjectUtils.notNull(baseEntity.getCreateDept(), DEFAULT_USER_ID));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -74,6 +84,8 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
if (ObjectUtil.isNotNull(userId)) {
|
||||
baseEntity.setUpdateBy(userId);
|
||||
} else {
|
||||
baseEntity.setUpdateBy(DEFAULT_USER_ID);
|
||||
}
|
||||
} else {
|
||||
this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date());
|
||||
@ -93,7 +105,6 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
||||
try {
|
||||
loginUser = LoginHelper.getLoginUser();
|
||||
} catch (Exception e) {
|
||||
log.warn("自动注入警告 => 用户未登录");
|
||||
return null;
|
||||
}
|
||||
return loginUser;
|
||||
|
@ -16,7 +16,9 @@ import java.util.function.Function;
|
||||
*
|
||||
* @author Lion Li
|
||||
* @version 3.6.0 新增
|
||||
* @deprecated redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用
|
||||
*/
|
||||
@Deprecated
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class QueueUtils {
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
package org.dromara.demo.controller.queue;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.QueueUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.api.RBoundedBlockingQueue;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.QueueUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -20,7 +18,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Lion Li
|
||||
* @version 3.6.0
|
||||
* @deprecated redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用
|
||||
*/
|
||||
@Deprecated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.dromara.demo.controller.queue;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
@ -23,8 +22,9 @@ import java.util.concurrent.TimeUnit;
|
||||
*
|
||||
* @author Lion Li
|
||||
* @version 3.6.0
|
||||
* @deprecated redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用
|
||||
*/
|
||||
@SaIgnore
|
||||
@Deprecated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
|
@ -8,7 +8,9 @@ import lombok.NoArgsConstructor;
|
||||
*
|
||||
* @author Lion Li
|
||||
* @version 3.6.0
|
||||
* @deprecated redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用
|
||||
*/
|
||||
@Deprecated
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PriorityDemo implements Comparable<PriorityDemo> {
|
||||
|
@ -19,7 +19,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*
|
||||
* @author Lion Li
|
||||
* @version 3.6.0
|
||||
* @deprecated redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用
|
||||
*/
|
||||
@Deprecated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
|
@ -302,8 +302,8 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
tableColumn.setColumnComment(column.getComment());
|
||||
tableColumn.setColumnType(column.getOriginType().toLowerCase());
|
||||
tableColumn.setSort(column.getPosition());
|
||||
tableColumn.setIsRequired(column.isNullable() == 0 ? "1" : "0");
|
||||
tableColumn.setIsIncrement(column.isAutoIncrement() == -1 ? "0" : "1");
|
||||
tableColumn.setIsRequired(column.isNullable() ? "1" : "0");
|
||||
tableColumn.setIsIncrement(column.isAutoIncrement() ? "0" : "1");
|
||||
tableColumns.add(tableColumn);
|
||||
});
|
||||
return tableColumns;
|
||||
|
@ -623,23 +623,6 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
return ObjectUtils.notNullGetter(sysUser, SysUser::getEmail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户详细信息
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 用户详细信息
|
||||
*/
|
||||
@Override
|
||||
public UserDTO selectUserDtoById(Long userId) {
|
||||
SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper<SysUser>()
|
||||
.select(SysUser::getUserId, SysUser::getDeptId, SysUser::getUserName,
|
||||
SysUser::getNickName, SysUser::getUserType, SysUser::getEmail,
|
||||
SysUser::getPhonenumber, SysUser::getSex, SysUser::getStatus,
|
||||
SysUser::getCreateTime)
|
||||
.eq(SysUser::getUserId, userId));
|
||||
return BeanUtil.toBean(sysUser, UserDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户列表
|
||||
*
|
||||
|
@ -73,4 +73,9 @@ public interface FlowConstant {
|
||||
*/
|
||||
String MESSAGE_NOTICE = "messageNotice";
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
String WF_TASK_STATUS = "wf_task_status";
|
||||
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ public interface IFlwDefinitionService {
|
||||
*/
|
||||
TableDataInfo<FlowDefinitionVo> unPublishList(FlowDefinition flowDefinition, PageQuery pageQuery);
|
||||
|
||||
|
||||
/**
|
||||
* 发布流程定义
|
||||
*
|
||||
|
@ -26,12 +26,6 @@ public class CategoryNameTranslationImpl implements TranslationInterface<String>
|
||||
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
Long id = null;
|
||||
if (key instanceof String categoryId) {
|
||||
id = Convert.toLong(categoryId);
|
||||
} else if (key instanceof Long categoryId) {
|
||||
id = categoryId;
|
||||
}
|
||||
return flwCategoryService.selectCategoryNameById(id);
|
||||
return flwCategoryService.selectCategoryNameById(Convert.toLong(key));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.workflow.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -8,24 +9,26 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.dto.UserDTO;
|
||||
import org.dromara.common.core.service.DeptService;
|
||||
import org.dromara.common.core.service.DictService;
|
||||
import org.dromara.common.core.service.UserService;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.ServletUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.warm.flow.core.dto.DefJson;
|
||||
import org.dromara.warm.flow.core.dto.NodeJson;
|
||||
import org.dromara.warm.flow.core.dto.PromptContent;
|
||||
import org.dromara.warm.flow.core.enums.NodeType;
|
||||
import org.dromara.warm.flow.core.utils.MapUtil;
|
||||
import org.dromara.warm.flow.orm.entity.FlowHisTask;
|
||||
import org.dromara.warm.flow.orm.mapper.FlowHisTaskMapper;
|
||||
import org.dromara.warm.flow.ui.service.ChartExtService;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.common.constant.FlowConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 流程图提示信息
|
||||
@ -41,6 +44,7 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
private final UserService userService;
|
||||
private final DeptService deptService;
|
||||
private final FlowHisTaskMapper flowHisTaskMapper;
|
||||
private final DictService dictService;
|
||||
|
||||
/**
|
||||
* 设置流程图提示信息
|
||||
@ -51,7 +55,7 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
public void execute(DefJson defJson) {
|
||||
// 临时修复 后续版本将通过defjson获取流程实例ID
|
||||
String[] parts = ServletUtils.getRequest().getRequestURI().split("/");
|
||||
Long instanceId = Long.valueOf(parts[parts.length - 1]);
|
||||
Long instanceId = Convert.toLong(parts[parts.length - 1]);
|
||||
|
||||
// 根据流程实例ID查询所有相关的历史任务列表
|
||||
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(instanceId);
|
||||
@ -60,28 +64,25 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
}
|
||||
|
||||
// 按节点编号(nodeCode)对历史任务进行分组
|
||||
Map<String, List<FlowHisTask>> groupedByNode = flowHisTasks.stream()
|
||||
.collect(Collectors.groupingBy(FlowHisTask::getNodeCode));
|
||||
Map<String, List<FlowHisTask>> groupedByNode = StreamUtils.groupByKey(flowHisTasks, FlowHisTask::getNodeCode);
|
||||
|
||||
// 批量查询所有审批人的用户信息
|
||||
List<UserDTO> userDTOList = userService.selectListByIds(
|
||||
flowHisTasks.stream()
|
||||
.map(task -> Long.valueOf(task.getApprover()))
|
||||
.distinct()
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
List<UserDTO> userDTOList = userService.selectListByIds(StreamUtils.toList(flowHisTasks, e -> Convert.toLong(e.getApprover())));
|
||||
|
||||
// 将查询到的用户列表转换为以用户ID为key的映射
|
||||
Map<Long, UserDTO> userMap = userDTOList.stream()
|
||||
.collect(Collectors.toMap(UserDTO::getUserId, user -> user));
|
||||
Map<Long, UserDTO> userMap = StreamUtils.toIdentityMap(userDTOList, UserDTO::getUserId);
|
||||
|
||||
Map<String, String> dictType = dictService.getAllDictByDictType(FlowConstant.WF_TASK_STATUS);
|
||||
|
||||
// 遍历流程定义中的每个节点,调用处理方法,将对应节点的任务列表及用户信息传入,生成扩展提示内容
|
||||
for (NodeJson nodeJson : defJson.getNodeList()) {
|
||||
// 获取当前节点对应的历史任务列表,如果没有则返回空列表避免空指针
|
||||
List<FlowHisTask> taskList = groupedByNode.getOrDefault(nodeJson.getNodeCode(), Collections.emptyList());
|
||||
|
||||
List<FlowHisTask> taskList = groupedByNode.get(nodeJson.getNodeCode());
|
||||
if (CollUtil.isEmpty(taskList)) {
|
||||
continue;
|
||||
}
|
||||
// 处理当前节点的扩展信息,包括构建审批人提示内容等
|
||||
this.processNodeExtInfo(nodeJson, taskList, userMap);
|
||||
this.processNodeExtInfo(nodeJson, taskList, userMap, dictType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,29 +93,49 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
*/
|
||||
@Override
|
||||
public void initPromptContent(DefJson defJson) {
|
||||
ChartExtService.super.initPromptContent(defJson);
|
||||
// 为每个节点设置统一的提示框样式
|
||||
defJson.getNodeList().forEach(nodeJson ->
|
||||
nodeJson.getPromptContent()
|
||||
.setDialogStyle(
|
||||
Map.ofEntries(
|
||||
Map.entry("position", "absolute"),
|
||||
Map.entry("backgroundColor", "#fff"),
|
||||
Map.entry("border", "1px solid #ccc"),
|
||||
Map.entry("borderRadius", "4px"),
|
||||
Map.entry("boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)"),
|
||||
Map.entry("padding", "8px 12px"),
|
||||
Map.entry("fontSize", "14px"),
|
||||
Map.entry("zIndex", 1000),
|
||||
Map.entry("maxWidth", "500px"),
|
||||
Map.entry("overflowY", "visible"),
|
||||
Map.entry("overflowX", "hidden"),
|
||||
Map.entry("color", "#333"),
|
||||
Map.entry("pointerEvents", "auto"),
|
||||
Map.entry("scrollbarWidth", "thin")
|
||||
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
||||
defJson.getNodeList().forEach(nodeJson -> {
|
||||
nodeJson.setPromptContent(
|
||||
new PromptContent()
|
||||
// 提示信息
|
||||
.setInfo(
|
||||
CollUtil.newArrayList(
|
||||
new PromptContent.InfoItem()
|
||||
.setPrefix("任务名称: ")
|
||||
.setContent(nodeJson.getNodeName())
|
||||
.setContentStyle(Map.of(
|
||||
"border", "1px solid #d1e9ff",
|
||||
"backgroundColor", "#e8f4ff",
|
||||
"padding", "4px 8px",
|
||||
"borderRadius", "4px"
|
||||
))
|
||||
.setRowStyle(Map.of(
|
||||
"fontWeight", "bold",
|
||||
"margin", "0 0 6px 0",
|
||||
"padding", "0 0 8px 0",
|
||||
"borderBottom", "1px solid #ccc"
|
||||
))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
// 弹窗样式
|
||||
.setDialogStyle(MapUtil.mergeAll(
|
||||
"position", "absolute",
|
||||
"backgroundColor", "#fff",
|
||||
"border", "1px solid #ccc",
|
||||
"borderRadius", "4px",
|
||||
"boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
"padding", "8px 12px",
|
||||
"fontSize", "14px",
|
||||
"zIndex", "1000",
|
||||
"maxWidth", "500px",
|
||||
"overflowY", "visible",
|
||||
"overflowX", "hidden",
|
||||
"color", "#333",
|
||||
"pointerEvents", "auto",
|
||||
"scrollbarWidth", "thin"
|
||||
))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,23 +144,20 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
* @param nodeJson 当前节点对象
|
||||
* @param taskList 当前节点对应的历史审批任务列表
|
||||
*/
|
||||
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, UserDTO> userMap) {
|
||||
if (CollUtil.isEmpty(taskList)) {
|
||||
return;
|
||||
}
|
||||
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, UserDTO> userMap, Map<String, String> dictType) {
|
||||
|
||||
// 获取节点提示内容对象中的 info 列表,用于追加提示项
|
||||
List<PromptContent.InfoItem> info = nodeJson.getPromptContent().getInfo();
|
||||
|
||||
// 遍历所有任务记录,构建提示内容
|
||||
for (FlowHisTask task : taskList) {
|
||||
UserDTO userDTO = userMap.get(Long.valueOf(task.getApprover()));
|
||||
UserDTO userDTO = userMap.get(Convert.toLong(task.getApprover()));
|
||||
if (ObjectUtil.isEmpty(userDTO)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 查询用户所属部门名称
|
||||
String deptName = deptService.selectDeptNameByIds(String.valueOf(userDTO.getDeptId()));
|
||||
String deptName = deptService.selectDeptNameByIds(Convert.toStr(userDTO.getDeptId()));
|
||||
|
||||
// 添加标题项,如:👤 张三(市场部)
|
||||
info.add(new PromptContent.InfoItem()
|
||||
@ -157,6 +175,7 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
|
||||
// 添加具体信息项:账号、耗时、时间
|
||||
info.add(buildInfoItem("用户账号", userDTO.getUserName()));
|
||||
info.add(buildInfoItem("审批状态", dictType.get(task.getFlowStatus())));
|
||||
info.add(buildInfoItem("审批耗时", DateUtils.getTimeDifference(task.getUpdateTime(), task.getCreateTime())));
|
||||
info.add(buildInfoItem("办理时间", DateUtils.formatDateTime(task.getUpdateTime())));
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.workflow.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -239,10 +240,10 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
try {
|
||||
String[] parts = storageId.split(StrUtil.COLON, 2);
|
||||
if (parts.length < 2) {
|
||||
return Pair.of(TaskAssigneeEnum.USER, Long.valueOf(parts[0]));
|
||||
return Pair.of(TaskAssigneeEnum.USER, Convert.toLong(parts[0]));
|
||||
} else {
|
||||
TaskAssigneeEnum type = TaskAssigneeEnum.fromCode(parts[0] + StrUtil.COLON);
|
||||
return Pair.of(type, Long.valueOf(parts[1]));
|
||||
return Pair.of(type, Convert.toLong(parts[1]));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("解析 storageId 失败,格式非法:{},错误信息:{}", storageId, e.getMessage());
|
||||
|
@ -717,7 +717,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
for (Map.Entry<Long, List<User>> entry : listMap.entrySet()) {
|
||||
List<User> value = entry.getValue();
|
||||
if (CollUtil.isNotEmpty(value)) {
|
||||
List<UserDTO> userDtoList = userService.selectListByIds(StreamUtils.toList(value, e -> Long.valueOf(e.getProcessedBy())));
|
||||
List<UserDTO> userDtoList = userService.selectListByIds(StreamUtils.toList(value, e -> Convert.toLong(e.getProcessedBy())));
|
||||
map.put(entry.getKey(), userDtoList);
|
||||
}
|
||||
}
|
||||
@ -736,7 +736,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
||||
if (CollUtil.isEmpty(userList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return userService.selectListByIds(StreamUtils.toList(userList, e -> Long.valueOf(e.getProcessedBy())));
|
||||
return userService.selectListByIds(StreamUtils.toList(userList, e -> Convert.toLong(e.getProcessedBy())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +145,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
@EventListener(condition = "#processEvent.flowCode.startsWith('leave')")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("当前任务执行了{}", processEvent.toString());
|
||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
||||
TestLeave testLeave = baseMapper.selectById(Convert.toLong(processEvent.getBusinessId()));
|
||||
testLeave.setStatus(processEvent.getStatus());
|
||||
// 用于例如审批附件 审批意见等 存储到业务表内 自行根据业务实现存储流程
|
||||
Map<String, Object> params = processEvent.getParams();
|
||||
@ -188,7 +188,7 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.startsWith('leave')")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,当前任务执行了{}", processDeleteEvent.toString());
|
||||
TestLeave testLeave = baseMapper.selectById(Long.valueOf(processDeleteEvent.getBusinessId()));
|
||||
TestLeave testLeave = baseMapper.selectById(Convert.toLong(processDeleteEvent.getBusinessId()));
|
||||
if (ObjectUtil.isNull(testLeave)) {
|
||||
return;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ create table FLOW_NODE
|
||||
VERSION VARCHAR2(20),
|
||||
CREATE_TIME DATE,
|
||||
UPDATE_TIME DATE,
|
||||
EXT VARCHAR2(500),
|
||||
EXT CLOB,
|
||||
DEL_FLAG VARCHAR2(1) default '0',
|
||||
TENANT_ID VARCHAR2(40),
|
||||
PERMISSION_FLAG VARCHAR2(200)
|
||||
@ -88,10 +88,10 @@ comment on column FLOW_NODE.FORM_PATH is '审批表单路径';
|
||||
comment on column FLOW_NODE.VERSION is '版本';
|
||||
comment on column FLOW_NODE.CREATE_TIME is '创建时间';
|
||||
comment on column FLOW_NODE.UPDATE_TIME is '更新时间';
|
||||
comment on column FLOW_NODE.EXT is '扩展属性';
|
||||
comment on column FLOW_NODE.EXT is '节点扩展属性';
|
||||
comment on column FLOW_NODE.DEL_FLAG is '删除标志';
|
||||
comment on column FLOW_NODE.TENANT_ID is '租户id';
|
||||
comment on column FLOW_NODE.PERMISSION_FLAG is '权限标识(权限类型:权限标识,可以多个,用逗号隔开)';
|
||||
comment on column FLOW_NODE.PERMISSION_FLAG is '权限标识(权限类型:权限标识,可以多个,用@@隔开)';
|
||||
|
||||
create table FLOW_SKIP
|
||||
(
|
||||
@ -179,7 +179,7 @@ create table FLOW_TASK
|
||||
NODE_CODE VARCHAR2(100),
|
||||
NODE_NAME VARCHAR2(100),
|
||||
NODE_TYPE NUMBER(1),
|
||||
FLOW_STATUS VARCHAR2(20),
|
||||
FLOW_STATUS VARCHAR2(20),
|
||||
FORM_CUSTOM VARCHAR2(1) default 'N',
|
||||
FORM_PATH VARCHAR2(100),
|
||||
CREATE_TIME DATE,
|
||||
@ -226,7 +226,7 @@ create table FLOW_HIS_TASK
|
||||
FORM_PATH VARCHAR2(100),
|
||||
MESSAGE VARCHAR2(500),
|
||||
VARIABLE CLOB,
|
||||
EXT VARCHAR2(500),
|
||||
EXT CLOB,
|
||||
CREATE_TIME DATE,
|
||||
UPDATE_TIME DATE,
|
||||
DEL_FLAG VARCHAR2(1) default '0',
|
||||
|
@ -47,7 +47,7 @@ CREATE TABLE flow_node
|
||||
definition_id int8 NOT NULL, -- 流程定义id
|
||||
node_code varchar(100) NOT NULL, -- 流程节点编码
|
||||
node_name varchar(100) NULL, -- 流程节点名称
|
||||
permission_flag varchar(200) NULL, -- 权限标识(权限类型:权限标识,可以多个,用逗号隔开)
|
||||
permission_flag varchar(200) NULL, -- 权限标识(权限类型:权限标识,可以多个,用@@隔开)
|
||||
node_ratio numeric(6, 3) NULL, -- 流程签署比例值
|
||||
coordinate varchar(100) NULL, -- 坐标
|
||||
any_node_skip varchar(100) NULL, -- 任意结点跳转
|
||||
@ -60,7 +60,7 @@ CREATE TABLE flow_node
|
||||
"version" varchar(20) NOT NULL, -- 版本
|
||||
create_time timestamp NULL, -- 创建时间
|
||||
update_time timestamp NULL, -- 更新时间
|
||||
ext varchar(500) NULL, -- 扩展属性
|
||||
ext text NULL, -- 扩展属性
|
||||
del_flag bpchar(1) NULL DEFAULT '0':: character varying, -- 删除标志
|
||||
tenant_id varchar(40) NULL, -- 租户id
|
||||
CONSTRAINT flow_node_pkey PRIMARY KEY (id)
|
||||
@ -72,7 +72,7 @@ COMMENT ON COLUMN flow_node.node_type IS '节点类型(0开始节点 1中间
|
||||
COMMENT ON COLUMN flow_node.definition_id IS '流程定义id';
|
||||
COMMENT ON COLUMN flow_node.node_code IS '流程节点编码';
|
||||
COMMENT ON COLUMN flow_node.node_name IS '流程节点名称';
|
||||
COMMENT ON COLUMN flow_node.permission_flag IS '权限标识(权限类型:权限标识,可以多个,用逗号隔开)';
|
||||
COMMENT ON COLUMN flow_node.permission_flag IS '权限标识(权限类型:权限标识,可以多个,用@@隔开)';
|
||||
COMMENT ON COLUMN flow_node.node_ratio IS '流程签署比例值';
|
||||
COMMENT ON COLUMN flow_node.coordinate IS '坐标';
|
||||
COMMENT ON COLUMN flow_node.any_node_skip IS '任意结点跳转';
|
||||
@ -85,7 +85,7 @@ COMMENT ON COLUMN flow_node.form_path IS '审批表单路径';
|
||||
COMMENT ON COLUMN flow_node."version" IS '版本';
|
||||
COMMENT ON COLUMN flow_node.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN flow_node.update_time IS '更新时间';
|
||||
COMMENT ON COLUMN flow_node.ext IS '扩展属性';
|
||||
COMMENT ON COLUMN flow_node.ext IS '节点扩展属性';
|
||||
COMMENT ON COLUMN flow_node.del_flag IS '删除标志';
|
||||
COMMENT ON COLUMN flow_node.tenant_id IS '租户id';
|
||||
|
||||
@ -172,7 +172,7 @@ CREATE TABLE flow_task
|
||||
node_code varchar(100) NOT NULL, -- 节点编码
|
||||
node_name varchar(100) NULL, -- 节点名称
|
||||
node_type int2 NOT NULL, -- 节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)
|
||||
flow_status varchar(20) NOT NULL, -- 流程状态(0待提交 1审批中 2 审批通过 8已完成 9已退回 10失效)
|
||||
flow_status varchar(20) NOT NULL, -- 流程状态(0待提交 1审批中 2 审批通过 8已完成 9已退回 10失效)
|
||||
form_custom bpchar(1) NULL DEFAULT 'N':: character varying, -- 审批表单是否自定义(Y是 N否)
|
||||
form_path varchar(100) NULL, -- 审批表单路径
|
||||
create_time timestamp NULL, -- 创建时间
|
||||
@ -215,7 +215,7 @@ CREATE TABLE flow_his_task
|
||||
flow_status varchar(20) NOT NULL, -- 流程状态(0待提交 1审批中 2 审批通过 8已完成 9已退回 10失效)
|
||||
form_custom bpchar(1) NULL DEFAULT 'N':: character varying, -- 审批表单是否自定义(Y是 N否)
|
||||
form_path varchar(100) NULL, -- 审批表单路径
|
||||
ext varchar(500) NULL, -- 扩展字段,预留给业务系统使用
|
||||
ext text NULL, -- 扩展字段,预留给业务系统使用
|
||||
message varchar(500) NULL, -- 审批意见
|
||||
variable text NULL, -- 任务变量
|
||||
create_time timestamp NULL, -- 创建时间
|
||||
@ -265,7 +265,6 @@ CREATE TABLE flow_user
|
||||
);
|
||||
CREATE INDEX user_processed_type ON flow_user USING btree (processed_by, type);
|
||||
CREATE INDEX user_associated_idx ON FLOW_USER USING btree (associated);
|
||||
|
||||
COMMENT ON TABLE flow_user IS '流程用户表';
|
||||
|
||||
COMMENT ON COLUMN flow_user.id IS '主键id';
|
||||
|
@ -96,7 +96,7 @@ CREATE TABLE `flow_task`
|
||||
`node_code` varchar(100) NOT NULL COMMENT '节点编码',
|
||||
`node_name` varchar(100) DEFAULT NULL COMMENT '节点名称',
|
||||
`node_type` tinyint(1) NOT NULL COMMENT '节点类型(0开始节点 1中间节点 2结束节点 3互斥网关 4并行网关)',
|
||||
`flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||
`flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)',
|
||||
`form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)',
|
||||
`form_path` varchar(100) DEFAULT NULL COMMENT '审批表单路径',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
|
@ -162,7 +162,7 @@ CREATE TABLE flow_node (
|
||||
version nvarchar(20) NOT NULL,
|
||||
create_time datetime2(7) NULL,
|
||||
update_time datetime2(7) NULL,
|
||||
ext nvarchar(500) NULL,
|
||||
ext nvarchar(max) NULL,
|
||||
del_flag nchar(1) DEFAULT('0') NULL,
|
||||
tenant_id nvarchar(40) NULL,
|
||||
CONSTRAINT PK__flow_nod__3213E83F372470DE PRIMARY KEY CLUSTERED (id)
|
||||
@ -208,7 +208,7 @@ EXEC sp_addextendedproperty
|
||||
GO
|
||||
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'权限标识(权限类型:权限标识,可以多个,用逗号隔开)',
|
||||
'MS_Description', N'权限标识(权限类型:权限标识,可以多个,用@@隔开)',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'flow_node',
|
||||
'COLUMN', N'permission_flag'
|
||||
@ -299,12 +299,13 @@ EXEC sp_addextendedproperty
|
||||
GO
|
||||
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'扩展属性',
|
||||
'MS_Description', N'节点扩展属性',
|
||||
'SCHEMA', N'dbo',
|
||||
'TABLE', N'flow_node',
|
||||
'COLUMN', N'ext'
|
||||
GO
|
||||
|
||||
|
||||
EXEC sp_addextendedproperty
|
||||
'MS_Description', N'删除标志',
|
||||
'SCHEMA', N'dbo',
|
||||
@ -731,7 +732,7 @@ CREATE TABLE flow_his_task (
|
||||
form_path nvarchar(100) NULL,
|
||||
message nvarchar(500) NULL,
|
||||
variable nvarchar(max) NULL,
|
||||
ext nvarchar(500) NULL,
|
||||
ext nvarchar(max) NULL,
|
||||
create_time datetime2(7) NULL,
|
||||
update_time datetime2(7) NULL,
|
||||
del_flag nchar(1) DEFAULT('0') NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user