Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zrch-risk-39
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
zrch-risk-39
Commits
673558c4
提交
673558c4
authored
4月 14, 2026
作者:
whydesc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--工作流驳回修改
上级
1f1c527f
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
190 行增加
和
11 行删除
+190
-11
TodoIndex.vue
...-39/src/views/flowable/task/todo/components/TodoIndex.vue
+4
-1
StPlanManList.vue
zrch-risk-client-39/src/views/project/plan/StPlanManList.vue
+1
-1
ProcessConstants.java
...cg/modules/flowable/common/constant/ProcessConstants.java
+32
-0
FlowDefinitionServiceImpl.java
...ules/flowable/service/impl/FlowDefinitionServiceImpl.java
+38
-5
FlowTaskServiceImpl.java
...cg/modules/flowable/service/impl/FlowTaskServiceImpl.java
+115
-4
没有找到文件。
zrch-risk-client-39/src/views/flowable/task/todo/components/TodoIndex.vue
浏览文件 @
673558c4
...
...
@@ -538,7 +538,10 @@
if
(
!
showApprovalUi
.
value
)
{
await
complete
(
submitData
);
const
result
=
await
complete
(
submitData
);
message
.
success
(
'任务结束成功'
);
emit
(
'success'
,
result
);
emit
(
'callback'
);
return
false
;
}
...
...
zrch-risk-client-39/src/views/project/plan/StPlanManList.vue
浏览文件 @
673558c4
...
...
@@ -408,7 +408,7 @@
if
(
needStartFlow
&&
record
.
deployId
)
{
try
{
const
formData
=
{
dataId
,
dataName
:
'id'
};
const
formData
=
{
dataId
,
dataName
:
'id'
,
tasktitle
:
record
.
projectName
};
const
startResRaw
=
await
definitionStartByDeployId
(
record
.
deployId
,
formData
);
const
startRes
=
pickStartResult
(
startResRaw
);
...
...
zrch-risk-server-39/jeecg-module-system/jeecg-module-flowable/src/main/java/org/jeecg/modules/flowable/common/constant/ProcessConstants.java
浏览文件 @
673558c4
...
...
@@ -83,5 +83,37 @@ public class ProcessConstants {
*/
public
static
final
String
PROCESS_ISAPPROVE
=
"isApprove"
;
/**
* 节点类型-发起
*/
public
static
final
String
TASK_TYPE_START
=
"发起"
;
/**
* 节点类型-参与
*/
public
static
final
String
TASK_TYPE_HAND
=
"参与"
;
/**
* 操作类型-转阅
*/
public
static
final
String
OPTION_TYPE_READ
=
"转阅"
;
/**
* 操作类型-审批
*/
public
static
final
String
OPTION_TYPE_APPROVE
=
"审批"
;
/**
* 操作类型-办理
*/
public
static
final
String
OPTION_TYPE_HAND
=
"办理"
;
/**
* 操作类型-转办
*/
public
static
final
String
OPTION_TYPE_ASSIGN
=
"转办"
;
/**
* 操作类型-驳回
*/
public
static
final
String
OPTION_TYPE_REJECT
=
"驳回"
;
}
zrch-risk-server-39/jeecg-module-system/jeecg-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowDefinitionServiceImpl.java
浏览文件 @
673558c4
...
...
@@ -22,9 +22,11 @@ import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessS
import
org.jeecg.modules.flowable.apithird.entity.SysUser
;
import
org.jeecg.modules.flowable.apithird.service.IFlowThirdService
;
import
org.jeecg.modules.flowable.common.constant.ProcessConstants
;
import
org.jeecg.modules.flowable.domain.dto.FlowNextDto
;
import
org.jeecg.modules.flowable.domain.dto.FlowProcDefDto
;
import
org.jeecg.modules.flowable.factory.FlowServiceFactory
;
import
org.jeecg.modules.flowable.service.IFlowDefinitionService
;
import
org.jeecg.modules.flowable.service.IFlowTaskService
;
import
org.jeecg.modules.stm.my.entity.MyTaskFlowHis
;
import
org.jeecg.modules.stm.my.service.IMyTaskFlowHisService
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -57,6 +59,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
private
IMyTaskFlowHisService
myTaskFlowHisService
;
private
static
final
String
BPMN_FILE_SUFFIX
=
".bpmn"
;
@Override
...
...
@@ -363,7 +366,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
String
curdate
=
sdf
.
format
(
cdate
);
try
{
String
flowname
=
""
;
ProcessDefinition
processDefinition
=
repositoryService
.
createProcessDefinitionQuery
()
.
deploymentId
(
DeployId
)
// 替换为你的deploymentId
.
singleResult
();
...
...
@@ -371,6 +374,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
if
(
processDefinition
!=
null
)
{
procDefId
=
processDefinition
.
getId
();
// 使用 procDefId
flowname
=
processDefinition
.
getName
();
}
...
...
@@ -390,11 +394,35 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
// 流程发起时 跳过发起人节点
ProcessInstance
processInstance
=
runtimeService
.
startProcessInstanceById
(
procDefId
,
variables
);
Task
task
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getProcessInstanceId
()).
active
().
singleResult
();
String
OptionType
=
""
;
Boolean
isnodeisApprove
=
false
;
FlowNextDto
flowtDto
=
flowTaskService
.
getFlowNodeType
(
task
.
getId
());
if
(
flowtDto
!=
null
){
isnodeisApprove
=
flowtDto
.
isNodeisApprove
();
}
if
(
isnodeisApprove
){
OptionType
=
ProcessConstants
.
OPTION_TYPE_APPROVE
;
//审核
}
else
{
OptionType
=
ProcessConstants
.
OPTION_TYPE_HAND
;
//办理
}
result
.
put
(
"deployId"
,
DeployId
);
result
.
put
(
"taskId"
,
task
.
getId
());
result
.
put
(
"procInsId"
,
task
.
getProcessInstanceId
());
result
.
put
(
"executionId"
,
task
.
getExecutionId
());
result
.
put
(
"instanceId"
,
task
.
getProcessInstanceId
());
//需要返回 节点审批设置
if
(
isnodeisApprove
){
result
.
put
(
"nodeisApprove"
,
flowtDto
.
isNodeisApprove
());
}
else
{
result
.
put
(
"nodeisApprove"
,
false
);
}
String
Title
=
task
.
getName
();
//
...
...
@@ -413,15 +441,19 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
if
(
flowForm
!=
null
){
String
zdmc
=
""
;
String
zdval
=
""
;
String
tasktitle
=
""
;
if
(
variables
.
get
(
"dataName"
)==
null
){
Map
zdv
=(
Map
)
variables
.
get
(
"_value"
);
zdmc
=(
String
)
zdv
.
get
(
"dataName"
);
zdval
=
zdv
.
get
(
"dataId"
).
toString
();
tasktitle
=(
String
)
zdv
.
get
(
"tasktitle"
);
}
else
{
zdmc
=(
String
)
variables
.
get
(
"dataName"
);
zdval
=
variables
.
get
(
"dataId"
).
toString
();
tasktitle
=(
String
)
variables
.
get
(
"tasktitle"
);
}
...
...
@@ -469,11 +501,12 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
taskFlowHis
.
setOptionTime
(
cdate
);
taskFlowHis
.
setOptionId
(
sysUser
.
getId
());
taskFlowHis
.
setOptionType
(
"操作类型"
);
taskFlowHis
.
setTaskType
(
"发起"
);
//发起 办理 转办 结束
taskFlowHis
.
setOptionType
(
OptionType
);
//审核 转办 转阅
taskFlowHis
.
setTaskType
(
ProcessConstants
.
TASK_TYPE_START
);
//发起 参与
taskFlowHis
.
setTaskName
(
task
.
getName
());
taskFlowHis
.
setTaskTitle
(
"标题"
);
taskFlowHis
.
setFlowName
(
""
);
taskFlowHis
.
setTaskTitle
(
tasktitle
);
taskFlowHis
.
setFlowName
(
flowname
);
myTaskFlowHisService
.
save
(
taskFlowHis
);
...
...
zrch-risk-server-39/jeecg-module-system/jeecg-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
浏览文件 @
673558c4
...
...
@@ -126,14 +126,33 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
if
(
Objects
.
isNull
(
task
))
{
return
Result
.
error
(
"任务不存在"
);
}
String
OptionType
=
""
;
Boolean
isnodeisApprove
=
false
;
FlowNextDto
flowtDto
=
getFlowNodeType
(
task
.
getId
());
if
(
flowtDto
!=
null
){
isnodeisApprove
=
flowtDto
.
isNodeisApprove
();
}
if
(
isnodeisApprove
){
OptionType
=
ProcessConstants
.
OPTION_TYPE_APPROVE
;
//审核
}
else
{
OptionType
=
ProcessConstants
.
OPTION_TYPE_HAND
;
//办理
}
// 根据流程定义ID查询流程定义对象
ProcessDefinition
processDefinition
=
repositoryService
.
createProcessDefinitionQuery
()
.
processDefinitionId
(
task
.
getProcessDefinitionId
())
.
singleResult
();
String
deploymentId
=
""
;
String
flowname
=
""
;
if
(
processDefinition
!=
null
)
{
// 获取部署ID - 这就是你想要的deployId
deploymentId
=
processDefinition
.
getDeploymentId
();
flowname
=
processDefinition
.
getName
();
}
...
...
@@ -146,6 +165,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
Map
<
String
,
Object
>
formValues
=
getProcessVariables
(
taskVo
.
getTaskId
());
String
zdmc
=
""
;
String
zdval
=
""
;
String
tasktitle
=
""
;
if
(
formValues
.
get
(
"dataName"
)==
null
){
if
(
formValues
.
get
(
"_value"
)!=
null
)
{
...
...
@@ -153,11 +173,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
Map
zdv
=
(
Map
)
formValues
.
get
(
"_value"
);
zdmc
=
(
String
)
zdv
.
get
(
"dataName"
);
zdval
=
zdv
.
get
(
"dataId"
).
toString
();
tasktitle
=
(
String
)
zdv
.
get
(
"tasktitle"
);
}
}
else
{
zdmc
=(
String
)
formValues
.
get
(
"dataName"
);
zdval
=
formValues
.
get
(
"dataId"
).
toString
();
tasktitle
=(
String
)
formValues
.
get
(
"tasktitle"
);
}
...
...
@@ -205,11 +227,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskFlowHis
.
setOptionTime
(
cdate
);
taskFlowHis
.
setOptionId
(
loginUser
.
getId
());
taskFlowHis
.
setOptionType
(
"操作类型"
);
taskFlowHis
.
setTaskType
(
"节点类型"
);
//发起 办理 转办 结束
taskFlowHis
.
setOptionType
(
OptionType
);
//审核 转办 转阅
taskFlowHis
.
setTaskType
(
ProcessConstants
.
TASK_TYPE_HAND
);
//发起 参与
taskFlowHis
.
setTaskName
(
task
.
getName
());
taskFlowHis
.
setTaskTitle
(
"标题"
);
taskFlowHis
.
setFlowName
(
""
);
taskFlowHis
.
setTaskTitle
(
tasktitle
);
taskFlowHis
.
setFlowName
(
flowname
);
myTaskFlowHisService
.
save
(
taskFlowHis
);
...
...
@@ -356,6 +379,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
public
void
taskReject
(
FlowTaskVo
flowTaskVo
)
{
if
(
taskService
.
createTaskQuery
().
taskId
(
flowTaskVo
.
getTaskId
()).
singleResult
().
isSuspended
())
{
throw
new
CustomException
(
"任务处于挂起状态!"
);
}
...
...
@@ -449,6 +473,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}));
// 设置驳回意见
currentTaskIds
.
forEach
(
item
->
taskService
.
addComment
(
item
,
task
.
getProcessInstanceId
(),
FlowComment
.
REJECT
.
getType
(),
flowTaskVo
.
getComment
()));
// 1. 获取当前运行的任务(源节点)
Task
sourceTask
=
taskService
.
createTaskQuery
().
taskId
(
task
.
getId
()).
singleResult
();
// 获取流程实例ID(可以从 sourceTask 中获取)
String
processInstanceId
=
sourceTask
.
getProcessInstanceId
();
try
{
// 如果父级任务多于 1 个,说明当前节点不是并行节点,原因为不考虑多对多情况
...
...
@@ -465,6 +493,83 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
.
processInstanceId
(
task
.
getProcessInstanceId
())
.
moveActivityIdsToSingleActivityId
(
currentIds
,
targetIds
.
get
(
0
)).
changeState
();
}
// 根据流程定义ID查询流程定义对象
/**
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(task.getProcessDefinitionId())
.singleResult();
*/
String
deploymentId
=
""
;
String
flowname
=
""
;
if
(
processDefinition
!=
null
)
{
// 获取部署ID - 这就是你想要的deployId
deploymentId
=
processDefinition
.
getDeploymentId
();
flowname
=
processDefinition
.
getName
();
}
// 查询该流程实例下最新的运行中任务,即驳回后的新任务
Task
newTask
=
taskService
.
createTaskQuery
()
.
processInstanceId
(
processInstanceId
)
.
active
()
// 只查询未完成的任务
.
singleResult
();
// 单节点流程通常只有一个当前任务
Long
tformId
=
Long
.
parseLong
(
newTask
.
getFormKey
());
FlowForm
sysForm
=
flowFormService
.
getById
(
tformId
);
// 假设有这个方法
// 获取任务关联的本地变量
Map
<
String
,
Object
>
formValues
=
taskService
.
getVariables
(
newTask
.
getId
());
String
zdmc
=
""
;
String
zdval
=
""
;
String
tasktitle
=
""
;
String
userType
=
""
;
String
approvalId
=
""
;
if
(
formValues
.
get
(
"dataName"
)==
null
){
if
(
formValues
.
get
(
"_value"
)!=
null
)
{
Map
zdv
=
(
Map
)
formValues
.
get
(
"_value"
);
zdmc
=
(
String
)
zdv
.
get
(
"dataName"
);
zdval
=
zdv
.
get
(
"dataId"
).
toString
();
tasktitle
=
(
String
)
zdv
.
get
(
"tasktitle"
);
userType
=
(
String
)
zdv
.
get
(
"approvalType"
);
approvalId
=
zdv
.
get
(
"approval"
).
toString
();
}
}
else
{
zdmc
=(
String
)
formValues
.
get
(
"dataName"
);
zdval
=
formValues
.
get
(
"dataId"
).
toString
();
tasktitle
=(
String
)
formValues
.
get
(
"tasktitle"
);
userType
=(
String
)
formValues
.
get
(
"approvalType"
);
approvalId
=
formValues
.
get
(
"approval"
).
toString
();
}
//写入待办
//有了以上信息,可以向相关表写入 相关信息了
MyTaskFlow
taskFlow
=
new
MyTaskFlow
();
taskFlow
.
setTaskId
(
newTask
.
getId
());
taskFlow
.
setProcDefId
(
newTask
.
getProcessDefinitionId
());
taskFlow
.
setProcInsId
(
newTask
.
getProcessInstanceId
());
taskFlow
.
setExecutionId
(
newTask
.
getExecutionId
());
if
(
zdval
!=
null
&&!
zdval
.
equals
(
""
)){
taskFlow
.
setTargetId
(
zdval
);
}
taskFlow
.
setDeployId
(
deploymentId
);
taskFlow
.
setFormTableName
(
sysForm
.
getFormTableName
());
if
(
userType
.
equals
(
"user"
))
{
taskFlow
.
setUid
(
approvalId
);
}
else
{
taskFlow
.
setRoleid
(
approvalId
);
}
taskFlow
.
setTaskDefinitionKey
(
newTask
.
getTaskDefinitionKey
());
myTaskFlowService
.
save
(
taskFlow
);
}
catch
(
FlowableObjectNotFoundException
e
)
{
throw
new
CustomException
(
"未找到流程实例,流程可能已发生变化"
);
}
catch
(
FlowableException
e
)
{
...
...
@@ -2521,6 +2626,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
assignReadTask
(
FlowTaskVo
flowTaskVo
)
{
// 删除指定的历史流程实例
//historyService.deleteHistoricProcessInstance("778a6343-330f-11f1-a134-02423b4bce10");
// 删除指定的流程实例,需要传入流程实例ID和删除原因
//runtimeService.deleteProcessInstance("14e72dca-3324-11f1-8430-02423b4bce10", "测试数据清理");
SysUser
loginUser
=
iFlowThirdService
.
getLoginUser
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论