Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
a4966412
提交
a4966412
编写于
4月 01, 2021
作者:
tangyaolong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
办结已办接口实现
上级
28791241
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
124 行增加
和
1 行删除
+124
-1
WFCoreService.java
...izlab/core/workflow/extensions/service/WFCoreService.java
+17
-1
WFCoreMapper.java
...in/java/cn/ibizlab/core/workflow/mapper/WFCoreMapper.java
+4
-0
WFCoreMapper.xml
...rc/main/resources/mapper/workflow/wfcore/WFCoreMapper.xml
+83
-0
WFCoreResource.java
...n/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
+20
-0
未找到文件。
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/extensions/service/WFCoreService.java
浏览文件 @
a4966412
...
...
@@ -422,6 +422,10 @@ public class WFCoreService
context
.
getSearchCond
().
in
(
"DefinitionKey"
,
keys
);
if
(
TaskType
.
READ
==
type
)
tasks
=
searchMyUnreadTask
(
context
);
else
if
(
TaskType
.
DONE
==
type
)
tasks
=
searchMyDoneTask
(
context
);
else
if
(
TaskType
.
FINISH
==
type
)
tasks
=
searchMyFinishTask
(
context
);
else
tasks
=
searchMyTask
(
context
);
if
(!
ObjectUtils
.
isEmpty
(
tasks
)){
...
...
@@ -448,6 +452,18 @@ public class WFCoreService
return
new
PageImpl
<
WFTask
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
private
Page
<
WFTask
>
searchMyDoneTask
(
WFTaskSearchContext
context
)
{
context
.
setSort
(
"createtime,desc"
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
WFTask
>
pages
=
wfCoreMapper
.
searchMyDoneTask
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
WFTask
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
private
Page
<
WFTask
>
searchMyFinishTask
(
WFTaskSearchContext
context
)
{
context
.
setSort
(
"createtime,desc"
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
WFTask
>
pages
=
wfCoreMapper
.
searchMyFinishTask
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
WFTask
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
public
List
<
String
>
getBusinessKeys
(
String
system
,
String
appname
,
String
entity
,
String
processDefinitionKey
,
String
taskDefinitionKey
,
String
userId
)
{
List
<
String
>
businessKeys
=
new
ArrayList
<>();
...
...
@@ -1784,13 +1800,13 @@ public class WFCoreService
if
(
sourceTask
!=
null
)
{
//1.生成子任务
task
=
(
TaskEntity
)
taskService
.
newTask
();
task
.
setParentTaskId
(
sourceTask
.
getId
());
task
.
setCategory
(
sourceTask
.
getCategory
());
task
.
setDescription
(
sourceTask
.
getDescription
());
task
.
setTenantId
(
sourceTask
.
getTenantId
());
task
.
setAssignee
(
sourceTask
.
getAssignee
());
task
.
setName
(
sourceTask
.
getName
());
task
.
setProcessDefinitionId
(
sourceTask
.
getProcessDefinitionId
());
task
.
setProcessInstanceId
(
sourceTask
.
getProcessInstanceId
());
task
.
setTaskDefinitionKey
(
sourceTask
.
getTaskDefinitionKey
());
task
.
setTaskDefinitionId
(
sourceTask
.
getTaskDefinitionId
());
task
.
setPriority
(
sourceTask
.
getPriority
());
...
...
ibzwf-core/src/main/java/cn/ibizlab/core/workflow/mapper/WFCoreMapper.java
浏览文件 @
a4966412
...
...
@@ -23,5 +23,9 @@ public interface WFCoreMapper {
Page
<
WFTask
>
searchUnReadTask
(
IPage
page
,
@Param
(
"srf"
)
WFTaskSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
WFTask
>
wrapper
)
;
Page
<
WFTask
>
searchMyDoneTask
(
IPage
page
,
@Param
(
"srf"
)
WFTaskSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
WFTask
>
wrapper
)
;
Page
<
WFTask
>
searchMyFinishTask
(
IPage
page
,
@Param
(
"srf"
)
WFTaskSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
WFTask
>
wrapper
)
;
Object
readTask
(
@Param
(
"et"
)
Map
param
);
}
ibzwf-core/src/main/resources/mapper/workflow/wfcore/WFCoreMapper.xml
浏览文件 @
a4966412
...
...
@@ -81,5 +81,88 @@
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<select
id=
"searchMyDoneTask"
parameterType=
"cn.ibizlab.core.workflow.filter.WFTaskSearchContext"
resultType=
"cn.ibizlab.core.workflow.domain.WFTask"
>
<![CDATA[
SELECT
T1.TaskId AS Id,
T1.DefinitionId AS ProcessDefinitionId,
T1.DefinitionName AS ProcessDefinitionName,
T1.DefinitionKey AS ProcessDefinitionKey,
T1.InstanceId AS ProcessInstanceId,
T1.TaskName AS NAME,
T1.TaskDefinitionKey,
T1.BusinessKey AS ProcessInstanceBusinessKey,
T1.Description,
T1.CreateTime
FROM
(
SELECT DISTINCT
RES.ID_ AS TaskId,
RES.PROC_DEF_ID_ AS DefinitionId,
ARP.NAME_ AS DefinitionName,
ARP.KEY_ AS DefinitionKey,
RES.PROC_INST_ID_ AS InstanceId,
RES.NAME_ AS TaskName,
RES.TASK_DEF_KEY_ AS TaskDefinitionKey,
RES.CATEGORY_ AS BusinessKey,
RES.DESCRIPTION_ AS Description,
RES.START_TIME_ AS CreateTime
FROM
ACT_HI_TASKINST RES
INNER JOIN ACT_HI_PROCINST HPI ON RES.PROC_INST_ID_ = HPI.ID_
INNER JOIN ACT_RE_PROCDEF ARP ON RES.PROC_DEF_ID_ = arp.ID_
WHERE
RES.END_TIME_ IS NOT NULL
AND HPI.END_TIME_ IS NULL
AND RES.ASSIGNEE_ IS NULL
AND EXISTS ( SELECT LINK.ID_ FROM ACT_HI_IDENTITYLINK LINK WHERE LINK.TASK_ID_ = RES.ID_ AND ( LINK.USER_ID_ = #{srf.sessioncontext.srfuserid} ) )
) t1
]]>
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<select
id=
"searchMyFinishTask"
parameterType=
"cn.ibizlab.core.workflow.filter.WFTaskSearchContext"
resultType=
"cn.ibizlab.core.workflow.domain.WFTask"
>
<![CDATA[
SELECT
T1.TaskId AS Id,
T1.DefinitionId AS ProcessDefinitionId,
T1.DefinitionName AS ProcessDefinitionName,
T1.DefinitionKey AS ProcessDefinitionKey,
T1.InstanceId AS ProcessInstanceId,
T1.TaskName AS NAME,
T1.TaskDefinitionKey,
T1.BusinessKey AS ProcessInstanceBusinessKey,
T1.Description,
T1.CreateTime
FROM
(
SELECT DISTINCT
RES.ID_ AS TaskId,
RES.PROC_DEF_ID_ AS DefinitionId,
ARP.NAME_ AS DefinitionName,
ARP.KEY_ AS DefinitionKey,
RES.PROC_INST_ID_ AS InstanceId,
RES.NAME_ AS TaskName,
RES.TASK_DEF_KEY_ AS TaskDefinitionKey,
RES.CATEGORY_ AS BusinessKey,
RES.DESCRIPTION_ AS Description,
RES.START_TIME_ AS CreateTime
FROM
ACT_HI_TASKINST RES
INNER JOIN ACT_HI_PROCINST HPI ON RES.PROC_INST_ID_ = HPI.ID_
INNER JOIN ACT_RE_PROCDEF ARP ON RES.PROC_DEF_ID_ = arp.ID_
WHERE
RES.END_TIME_ IS NOT NULL
AND HPI.END_TIME_ IS NOT NULL
AND RES.ASSIGNEE_ IS NULL
AND EXISTS ( SELECT LINK.ID_ FROM ACT_HI_IDENTITYLINK LINK WHERE LINK.TASK_ID_ = RES.ID_ AND ( LINK.USER_ID_ = #{srf.sessioncontext.srfuserid} ) )
) t1
]]>
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
</mapper>
\ No newline at end of file
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/extensions/WFCoreResource.java
浏览文件 @
a4966412
...
...
@@ -68,6 +68,20 @@ public class WFCoreResource
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
READ
));
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据流程步骤查询我的已办主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{dynainstid}/{entity}/tasks/done"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getDoneByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
DONE
));
}
@ApiOperation
(
value
=
"getBusinessKeys"
,
tags
=
{
"String"
},
notes
=
"根据流程步骤查询我的办结主键清单"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-user-{userId}/{dynainstid}/{entity}/tasks/finish"
)
public
ResponseEntity
<
Map
<
String
,
Map
<
String
,
Object
>>>
getFinishByUserId
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"userId"
)
String
userId
,
@PathVariable
(
"entity"
)
String
entity
,
@PathVariable
(
"dynainstid"
)
String
dynainstid
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfCoreService
.
getDynaBusinessKeys
(
system
,
""
,
entity
,
dynainstid
,
userId
,
TaskType
.
FINISH
));
}
@ApiOperation
(
value
=
"标记任务已读"
,
tags
=
{
"工作流标记任务已读"
},
notes
=
"标记任务已读"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-app-{appname}/{entity}/{businessKey}/tasks/{taskId}/read"
)
public
ResponseEntity
<
Boolean
>
readTask
(
@PathVariable
(
"system"
)
String
system
,
@PathVariable
(
"appname"
)
String
appname
,
...
...
@@ -155,6 +169,12 @@ public class WFCoreResource
return
ResponseEntity
.
ok
(
wfCoreService
.
sendBack
(
taskId
));
}
// @ApiOperation(value = "delegatetask", tags = {"delegatetask" }, notes = "委派任务")
// @RequestMapping(method = RequestMethod.POST, value = "/{system}-app-{appname}/{entity}/{businessKey}/tasks/{taskId}/{delegateuser}/delegate")
// public ResponseEntity<Boolean> delegatetask(@PathVariable("taskId") String taskId,@PathVariable("delegateuser") String delegateuser){
// return ResponseEntity.ok(wfCoreService.delegateTask(taskId,delegateuser));
// }
//@PreAuthorize("hasPermission(#entity,'WFSTART',this.getEntity())")
@ApiOperation
(
value
=
"wfsubmitbatch"
,
tags
=
{
"SubmitBatch"
},
notes
=
"批量工作流执行步骤"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/ways/{sequenceFlowId}/submit"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录