Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
b1e659f4
Commit
b1e659f4
authored
Mar 08, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新人工处理流程执行
parent
afe5a0b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
43 deletions
+48
-43
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+48
-43
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
View file @
b1e659f4
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.*
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProcessRelationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
@@ -57,7 +58,7 @@ public class ProblemInitiationServiceImpl {
...
@@ -57,7 +58,7 @@ public class ProblemInitiationServiceImpl {
InstallNoticeMsgServiceImpl
installNoticeMsgService
;
InstallNoticeMsgServiceImpl
installNoticeMsgService
;
@Autowired
@Autowired
ProcessRelationMapper
processRelationMapper
;
IProcessRelationService
iProcessRelationService
;
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
private
String
problemDefinitionKey
;
private
String
problemDefinitionKey
;
...
@@ -446,48 +447,51 @@ public class ProblemInitiationServiceImpl {
...
@@ -446,48 +447,51 @@ public class ProblemInitiationServiceImpl {
public
QualityProblem
manualProcessingStart
(
QualityProblem
qualityProblem
,
String
status
,
String
type
){
public
QualityProblem
manualProcessingStart
(
QualityProblem
qualityProblem
,
String
status
,
String
type
){
String
instanceId
=
null
;
String
instanceId
=
null
;
JSONObject
dataObject
=
null
;
JSONObject
dataObject
=
null
;
try
{
if
(!
status
.
equals
(
WhetherItPassEnum
.
SAVE
.
getCode
())){
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
// 保存信息启动流程
dto
.
setProcessDefinitionKey
(
manualProcessingKey
);
try
{
dto
.
setBusinessKey
(
"1"
);
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
dto
.
setProcessDefinitionKey
(
manualProcessingKey
);
map
.
put
(
"type"
,
type
);
dto
.
setBusinessKey
(
"1"
);
map
.
put
(
"condition"
,
status
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
dto
.
setVariables
(
map
);
map
.
put
(
"type"
,
type
);
// 启动人工处置流程
map
.
put
(
"condition"
,
status
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
dto
.
setVariables
(
map
);
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
// 启动人工处置流程
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
// 保存问题信息
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
// 问题信息
qualityProblem
.
setComeFrom
(
type
);
qualityProblem
.
setInstanceId
(
instanceId
);
qualityProblem
.
setStatus
(!
ObjectUtils
.
isEmpty
(
dataObject
)
&&
!
ObjectUtils
.
isEmpty
(
dataObject
.
get
(
"name"
))
?
String
.
valueOf
(
dataObject
.
get
(
"name"
))
:
""
);
// 保存或更新问题信息
qualityProblemService
.
saveOrUpdate
(
qualityProblem
);
// 保存执行日志信息
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
projectInitiation
.
setTaskName
(
"流程启动"
);
projectInitiationService
.
save
(
projectInitiation
);
// 保存关联流程信息
iProcessRelationService
.
savePR
(
qualityProblem
.
getInstanceId
(),
qualityProblem
.
getSequenceNbr
(),
ProcessTypeEnum
.
人工处理
.
getName
());
// 执行流程
manualProcessingExecute
(
instanceId
,
qualityProblem
,
status
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
// 保存更新问题信息
qualityProblem
.
setComeFrom
(
type
);
qualityProblem
.
setComeFrom
(
type
);
qualityProblem
.
setInstanceId
(
instanceId
);
qualityProblemService
.
saveOrUpdate
(
qualityProblem
);
qualityProblem
.
setStatus
(!
ObjectUtils
.
isEmpty
(
dataObject
)
&&
!
ObjectUtils
.
isEmpty
(
dataObject
.
get
(
"name"
))
?
String
.
valueOf
(
dataObject
.
get
(
"name"
))
:
""
);
qualityProblemService
.
save
(
qualityProblem
);
//执行流程
manualProcessingExecute
(
instanceId
,
qualityProblem
,
status
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
// 保存执行日志信息
// ProjectInitiation projectInitiation = new ProjectInitiation();
// projectInitiation.setInstanceId(instanceId);
// projectInitiation.setTaskName(QuestionComeFromEnum.getTypeByCode(type));
// projectInitiationService.save(projectInitiation);
// 保存关联流程信息
ProcessRelation
processRelation
=
new
ProcessRelation
();
processRelation
.
setInstanceId
(
instanceId
);
processRelation
.
setDefCode
(
manualProcessingKey
);
processRelation
.
setStatus
(
ManualProcessingEnum
.
提交整改书
.
getDetail
());
processRelation
.
setDefName
(
ProcessTypeEnum
.
人工处理
.
getName
());
processRelation
.
setSourceId
(
qualityProblem
.
getSequenceNbr
());
processRelationMapper
.
insert
(
processRelation
);
return
qualityProblem
;
return
qualityProblem
;
}
}
@Transactional
@Transactional
public
String
manualProcessingExecute
(
String
instanceId
,
QualityProblem
qualityProblem
,
String
status
){
public
String
manualProcessingExecute
(
String
instanceId
,
QualityProblem
qualityProblem
,
String
status
){
JSONObject
dataObject
=
null
;
JSONObject
dataObject
=
null
;
String
taskId
=
null
;
try
{
try
{
//执行流程
//执行流程
TaskResultDTO
dto1
=
new
TaskResultDTO
();
TaskResultDTO
dto1
=
new
TaskResultDTO
();
...
@@ -495,9 +499,9 @@ public class ProblemInitiationServiceImpl {
...
@@ -495,9 +499,9 @@ public class ProblemInitiationServiceImpl {
dto1
.
setResultCode
(
"condition"
);
dto1
.
setResultCode
(
"condition"
);
dto1
.
setTaskId
(
instanceId
);
dto1
.
setTaskId
(
instanceId
);
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
if
(!
ObjectUtils
.
isEmpty
(
(
Map
)
ajaxResult1
.
get
(
"data"
))){
if
(!
ObjectUtils
.
isEmpty
(
ajaxResult1
.
get
(
"data"
))){
String
instanceId1
=
((
Map
)
ajaxResult1
.
get
(
"data"
)).
get
(
"id"
).
toString
();
taskId
=
((
Map
)
ajaxResult1
.
get
(
"data"
)).
get
(
"id"
).
toString
();
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
completeByTask
(
instanceId1
,
dto1
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto1
);
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
}
}
// 更新问题状态
// 更新问题状态
...
@@ -517,13 +521,14 @@ public class ProblemInitiationServiceImpl {
...
@@ -517,13 +521,14 @@ public class ProblemInitiationServiceImpl {
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
流程结束
.
getName
());
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
流程结束
.
getName
());
}
}
qualityProblemService
.
updateById
(
qualityProblem
);
qualityProblemService
.
updateById
(
qualityProblem
);
// 保存执行日志信息
ProjectInitiation
projectInitiation
=
new
ProjectInitiation
();
projectInitiation
.
setInstanceId
(
instanceId
);
projectInitiation
.
setTaskId
(
taskId
);
projectInitiation
.
setTaskName
(
qualityProblem
.
getStatus
());
projectInitiationService
.
save
(
projectInitiation
);
// 更新关联表数据
// 更新关联表数据
ProcessRelation
processRelation
=
new
ProcessRelation
();
iProcessRelationService
.
updateState
(
qualityProblem
.
getInstanceId
());
processRelation
.
setStatus
(
qualityProblem
.
getStatus
());
LambdaQueryWrapper
<
ProcessRelation
>
lambda
=
new
QueryWrapper
<
ProcessRelation
>().
lambda
();
lambda
.
eq
(
ProcessRelation:
:
getInstanceId
,
qualityProblem
.
getInstanceId
());
lambda
.
eq
(
ProcessRelation:
:
getSourceId
,
qualityProblem
.
getSequenceNbr
());
processRelationMapper
.
update
(
processRelation
,
lambda
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment