Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
852c9f53
Commit
852c9f53
authored
Sep 27, 2023
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微调
parent
e67b7742
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
56 行增加
和
13 行删除
+56
-13
WorkProcessServiceImpl.java
jyzb-process/src/main/java/com/junmp/junmpProcess/service/Bussiness/impl/WorkProcessServiceImpl.java
+52
-13
TaskDetailVO.java
jyzb-process/src/main/java/com/junmp/junmpProcess/vo/TaskDetailVO.java
+4
-0
没有找到文件。
jyzb-process/src/main/java/com/junmp/junmpProcess/service/Bussiness/impl/WorkProcessServiceImpl.java
View file @
852c9f53
...
...
@@ -23,6 +23,7 @@ import com.junmp.junmpProcess.dto.*;
import
com.junmp.junmpProcess.dto.json.*
;
import
com.junmp.junmpProcess.entity.ProcessTemplates
;
import
com.junmp.junmpProcess.exception.WorkFlowException
;
import
com.junmp.junmpProcess.mapper.OrgUserMapper
;
import
com.junmp.junmpProcess.mapper.ProcessTemplatesMapper
;
import
com.junmp.junmpProcess.mapper.TemplateGroupMapper
;
import
com.junmp.junmpProcess.service.Bussiness.WorkProcessService
;
...
...
@@ -55,6 +56,7 @@ import org.flowable.engine.history.HistoricProcessInstanceQuery;
import
org.flowable.engine.impl.persistence.entity.ExecutionEntity
;
import
org.flowable.engine.repository.Deployment
;
import
org.flowable.engine.repository.ProcessDefinition
;
import
org.flowable.engine.runtime.ActivityInstance
;
import
org.flowable.engine.runtime.Execution
;
import
org.flowable.engine.runtime.ProcessInstance
;
import
org.flowable.engine.runtime.ProcessInstanceBuilder
;
...
...
@@ -93,7 +95,8 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
private
RepositoryService
repositoryService
;
@Autowired
protected
ManagementService
managementService
;
@Resource
private
OrgUserMapper
orgUserMapper
;
@Resource
private
RuntimeService
runtimeService
;
@Resource
...
...
@@ -681,6 +684,7 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
// {
// return ApiRes.failure("流程不存在或已挂起");
// }
ProcessInstance
processInstance
=
processInstanceBuilder
.
processDefinitionId
(
processInstanceDto
.
getProcessDefinitionId
())
.
variable
(
"initiator"
,
StartUser
.
getUserId
())
...
...
@@ -688,7 +692,8 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
.
businessStatus
(
BUSINESS_STATUS_1
)
.
start
();
//手动完成第一个任务
// Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
Task
task
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
singleResult
();
task
.
setAssignee
(
StartUser
.
getUserId
().
toString
());
// Object ts=new Object();
// if(task!=null){
// taskService.complete(task.getId());
...
...
@@ -727,6 +732,13 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
taskDetailVO
.
setName
(
"流程开始"
);
taskDetailVO
.
setCreateTime
(
historicActivityInstance
.
getStartTime
());
taskDetailVO
.
setEndTime
(
historicActivityInstance
.
getEndTime
());
// List<Comment> comments = commentsMap.get(historicActivityInstance.getTaskId());
// taskDetailVO.setComment(comments.get(0).getFullMessage());
if
(
historicActivityInstance
.
getAssignee
()!=
null
)
{
List
<
UserListDTO
>
userList
=
orgUserMapper
.
QueryUserWithParentOrg
(
historicActivityInstance
.
getAssignee
());
taskDetailVO
.
setUserId
(
userList
.
get
(
0
).
getUserID
());
taskDetailVO
.
setUserName
(
userList
.
get
(
0
).
getRealName
());}
taskDetailVOS
.
add
(
taskDetailVO
);
// taskDetailVO.setSignImage();
...
...
@@ -741,6 +753,12 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
taskDetailVO
.
setName
(
"流程结束"
);
taskDetailVO
.
setCreateTime
(
historicActivityInstance
.
getStartTime
());
taskDetailVO
.
setEndTime
(
historicActivityInstance
.
getEndTime
());
// List<Comment> comments = commentsMap.get(historicActivityInstance.getTaskId());
// taskDetailVO.setComment(comments.get(0).getFullMessage());
if
(
historicActivityInstance
.
getAssignee
()!=
null
)
{
List
<
UserListDTO
>
userList
=
orgUserMapper
.
QueryUserWithParentOrg
(
historicActivityInstance
.
getAssignee
());
taskDetailVO
.
setUserId
(
userList
.
get
(
0
).
getUserID
());
taskDetailVO
.
setUserName
(
userList
.
get
(
0
).
getRealName
());}
taskDetailVOS
.
add
(
taskDetailVO
);
}
else
if
(
"userTask"
.
equals
(
historicActivityInstance
.
getActivityType
())){
...
...
@@ -748,8 +766,14 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
if
(
CollUtil
.
isNotEmpty
(
comments
)){
for
(
Comment
comment
:
comments
)
{
if
(
"opinion"
.
equals
(
comment
.
getType
())){
TaskDetailVO
taskDetailVO
=
new
TaskDetailVO
();
taskDetailVO
.
setTaskId
(
historicActivityInstance
.
getTaskId
());
if
(
historicActivityInstance
.
getAssignee
()!=
null
)
{
List
<
UserListDTO
>
userList
=
orgUserMapper
.
QueryUserWithParentOrg
(
historicActivityInstance
.
getAssignee
());
taskDetailVO
.
setUserId
(
userList
.
get
(
0
).
getUserID
());
taskDetailVO
.
setUserName
(
userList
.
get
(
0
).
getRealName
());}
taskDetailVO
.
setActivityId
(
historicActivityInstance
.
getActivityId
());
taskDetailVO
.
setName
(
historicActivityInstance
.
getActivityName
());
taskDetailVO
.
setCreateTime
(
historicActivityInstance
.
getStartTime
());
...
...
@@ -757,20 +781,25 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
// taskDetailVO.setComment(comment.getFullMessage());
List
<
Attachment
>
attachments
=
attachmentMap
.
get
(
historicActivityInstance
.
getTaskId
());
List
<
AttachmentVO
>
attachmentVOList
=
new
ArrayList
<>();
for
(
Attachment
attachment
:
attachments
)
{
AttachmentVO
attachmentVO
=
new
AttachmentVO
();
attachmentVO
.
setId
(
attachment
.
getId
());
attachmentVO
.
setName
(
attachment
.
getName
());
attachmentVO
.
setUrl
(
attachment
.
getUrl
());
attachmentVOList
.
add
(
attachmentVO
);
if
(
attachments
!=
null
)
{
for
(
Attachment
attachment
:
attachments
)
{
AttachmentVO
attachmentVO
=
new
AttachmentVO
();
attachmentVO
.
setId
(
attachment
.
getId
());
attachmentVO
.
setName
(
attachment
.
getName
());
attachmentVO
.
setUrl
(
attachment
.
getUrl
());
attachmentVOList
.
add
(
attachmentVO
);
}
}
for
(
Comment
comment1
:
comments
)
{
if
(
"sign"
.
equals
(
comment1
.
getType
())){
taskDetailVO
.
setSignImage
(
comment1
.
getFullMessage
());
}
}
taskDetailVO
.
setComment
(
comments
.
get
(
0
).
getFullMessage
());
taskDetailVO
.
setAttachmentVOList
(
attachmentVOList
);
taskDetailVOS
.
add
(
taskDetailVO
);
}
...
...
@@ -1640,15 +1669,25 @@ public class WorkProcessServiceImpl extends ServiceImpl<ProcessTemplatesMapper,
if
(
flag
)
{
return
"流程已结束"
;
}
Execution
execution
=
runtimeService
.
createExecutionQuery
().
executionId
(
processInstanceId
).
singleResult
();
String
activityId
=
execution
.
getActivityId
();
if
(
StringUtils
.
isBlank
(
activityId
))
{
List
<
ActivityInstance
>
list
=
runtimeService
.
createActivityInstanceQuery
().
processInstanceId
(
processInstanceId
).
activityType
(
"userTask"
).
unfinished
().
orderByActivityInstanceStartTime
().
desc
().
list
();
if
(
CollUtil
.
isEmpty
(
list
)){
return
""
;
}
else
{
}
else
{
String
activityId
=
list
.
get
(
0
).
getActivityId
();
BpmnModel
bpmnModel
=
repositoryService
.
getBpmnModel
(
processDefinitionId
);
FlowElement
flowElement
=
bpmnModel
.
getMainProcess
().
getFlowElement
(
activityId
);
return
flowElement
.
getName
();
}
// Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();
// String activityId = execution.getActivityId();
// if (StringUtils.isBlank(activityId)) {
// return "";
// } else {
// BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
// FlowElement flowElement = bpmnModel.getMainProcess().getFlowElement(activityId);
// return flowElement.getName();
// }
}
...
...
jyzb-process/src/main/java/com/junmp/junmpProcess/vo/TaskDetailVO.java
View file @
852c9f53
package
com
.
junmp
.
junmpProcess
.
vo
;
import
com.junmp.junmpProcess.dto.json.UserInfo
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -17,6 +18,9 @@ public class TaskDetailVO {
private
Date
createTime
;
private
Date
endTime
;
private
String
signImage
;
private
String
comment
;
private
String
userId
;
private
String
userName
;
private
List
<
AttachmentVO
>
attachmentVOList
;
private
List
<
OptionVO
>
optionVOList
;
private
List
<
CommentVO
>
commentVOList
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论