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
1e1d0a80
Commit
1e1d0a80
authored
Mar 07, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加人工处理流程执行
parent
0596a358
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
226 additions
and
4 deletions
+226
-4
ManualProcessingEnum.java
...n/amos/boot/module/ugp/api/Enum/ManualProcessingEnum.java
+21
-0
PipeController.java
...n/amos/boot/module/ugp/biz/controller/PipeController.java
+81
-0
QualityProblemController.java
...t/module/ugp/biz/controller/QualityProblemController.java
+22
-0
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+100
-4
application.properties
...-module-ugp-biz/src/main/resources/application.properties
+2
-0
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ManualProcessingEnum.java
0 → 100644
View file @
1e1d0a80
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
ManualProcessingEnum
{
问题自动录入
(
""
,
"问题自动录入"
,
"整改书待提交"
),
问题录入
(
""
,
"问题录入"
,
"整改书待提交"
),
提交整改书
(
"1"
,
"提交整改书"
,
"整改待审批"
),
整改审批
(
"2"
,
"整改审批"
,
"整改书待提交"
),
流程结束
(
"3"
,
"流程结束"
,
""
);
private
final
String
status
;
private
final
String
name
;
private
final
String
detail
;
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/PipeController.java
View file @
1e1d0a80
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -13,6 +14,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Pipe
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IPipeService
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.IPipeServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -22,6 +24,10 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -187,5 +193,80 @@ public class PipeController extends BaseController {
Page
<
Map
<
String
,
Object
>>
operationalLogs
=
pipeService
.
getOperationalLogs
(
mapPage
,
sequenceNbr
,
type
);
return
ResponseHelper
.
buildResponse
(
operationalLogs
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getFlowChart"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通用流程操作日志查询"
,
notes
=
"通用流程操作日志查询"
)
public
ResponseModel
<
Object
>
getFlowChart
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
"https://img0.baidu.com/it/u=887570163,3972811143&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/test"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通用流程操作日志查询"
,
notes
=
"通用流程操作日志查询"
)
public
ResponseModel
<
Object
>
test
(
@RequestParam
(
"id"
)
String
instanceId
)
{
try
{
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult1
.
get
(
"data"
)));
String
instanceId1
=
((
Map
)
ajaxResult1
.
get
(
"data"
)).
get
(
"id"
).
toString
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/test1"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通用流程操作日志查询"
,
notes
=
"通用流程操作日志查询"
)
public
ResponseModel
<
Object
>
test1
(
@RequestParam
(
"id"
)
String
instanceId
)
{
try
{
//执行流程
TaskResultDTO
dto1
=
new
TaskResultDTO
();
dto1
.
setResult
(
"1"
);
dto1
.
setResultCode
(
"condition"
);
dto1
.
setTaskId
(
instanceId
);
// HashMap<String, Object> var = new HashMap<>();
// var.put("condition", 0);
// dto1.setVariable(var);
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult1
.
get
(
"data"
)));
String
instanceId1
=
((
Map
)
ajaxResult1
.
get
(
"data"
)).
get
(
"id"
).
toString
();
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
completeByTask
(
instanceId1
,
dto1
);
if
(
ObjectUtils
.
isEmpty
(
ajaxResult
)){
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/test2"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通用流程操作日志查询"
,
notes
=
"通用流程操作日志查询"
)
public
ResponseModel
<
Object
>
test2
(
@RequestParam
(
"id"
)
String
instanceId
)
{
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"rengongchuliliucheng"
);
dto
.
setBusinessKey
(
"1"
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
2
);
map
.
put
(
"condition"
,
1
);
dto
.
setVariables
(
map
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
if
(
ObjectUtils
.
isEmpty
(
ajaxResult
)){
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/QualityProblemController.java
View file @
1e1d0a80
...
...
@@ -203,4 +203,26 @@ public class QualityProblemController extends BaseController {
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
qualityProblemStatistics
()
{
return
ResponseHelper
.
buildResponse
(
qualityProblemServiceImpl
.
qualityProblemStatistics
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/manualProcessingStart"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"启动人工处置流程"
,
notes
=
"启动人工处置流程"
)
public
ResponseModel
<
Object
>
manualProcessingStart
(
@RequestBody
QualityProblem
qualityProblem
,
@RequestParam
(
"status"
)
String
status
,
@RequestParam
(
"type"
)
String
type
)
{
return
ResponseHelper
.
buildResponse
(
problemInitiationService
.
manualProcessingStart
(
qualityProblem
,
status
,
type
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/manualProcessingExecute"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行人工处置流程"
,
notes
=
"执行人工处置流程"
)
public
ResponseModel
<
String
>
manualProcessingExecute
(
@RequestBody
QualityProblem
qualityProblem
,
@RequestParam
(
"status"
)
String
status
,
@RequestParam
(
"instanceId"
)
String
instanceId
)
{
problemInitiationService
.
manualProcessingExecute
(
instanceId
,
qualityProblem
,
status
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
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 @
1e1d0a80
...
...
@@ -3,13 +3,12 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.TaskTypeEnum
;
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.mapper.ProcessRelationMapper
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
...
@@ -21,6 +20,8 @@ import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.*
;
...
...
@@ -55,6 +56,8 @@ public class ProblemInitiationServiceImpl {
@Autowired
InstallNoticeMsgServiceImpl
installNoticeMsgService
;
@Autowired
ProcessRelationMapper
processRelationMapper
;
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
private
String
problemDefinitionKey
;
...
...
@@ -71,6 +74,10 @@ public class ProblemInitiationServiceImpl {
@Value
(
"${constructionRoleId}"
)
private
String
constructionRoleId
;
@Value
(
"${params.work.flow.manualProcessingKey}"
)
private
String
manualProcessingKey
;
public
String
start
(
QualityProblem
qualityProblem
)
{
String
instanceId
=
null
;
//启动流程
...
...
@@ -433,4 +440,93 @@ public class ProblemInitiationServiceImpl {
QualityProblem
quality
=
qualityProblemService
.
getById
(
sequenceNbr
);
qualityProblem
.
setStatus
(
quality
.
getStatus
());
}
@Transactional
public
QualityProblem
manualProcessingStart
(
QualityProblem
qualityProblem
,
String
status
,
String
type
){
String
instanceId
=
null
;
JSONObject
dataObject
=
null
;
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
manualProcessingKey
);
dto
.
setBusinessKey
(
"1"
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
type
);
map
.
put
(
"condition"
,
status
);
dto
.
setVariables
(
map
);
// 启动人工处置流程
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
.
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
;
}
@Transactional
public
String
manualProcessingExecute
(
String
instanceId
,
QualityProblem
qualityProblem
,
String
status
){
JSONObject
dataObject
=
null
;
try
{
//执行流程
TaskResultDTO
dto1
=
new
TaskResultDTO
();
dto1
.
setResult
(
status
);
dto1
.
setResultCode
(
"condition"
);
dto1
.
setTaskId
(
instanceId
);
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
if
(!
ObjectUtils
.
isEmpty
((
Map
)
ajaxResult1
.
get
(
"data"
))){
String
instanceId1
=
((
Map
)
ajaxResult1
.
get
(
"data"
)).
get
(
"id"
).
toString
();
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
completeByTask
(
instanceId1
,
dto1
);
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
}
// 更新问题状态
if
(!
ObjectUtils
.
isEmpty
(
dataObject
)
&&
!
ObjectUtils
.
isEmpty
(
dataObject
.
get
(
"name"
))){
if
(
ManualProcessingEnum
.
问题录入
.
getName
().
equals
(
dataObject
.
get
(
"name"
))
||
ManualProcessingEnum
.
问题自动录入
.
getName
().
equals
(
dataObject
.
get
(
"name"
))){
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
问题录入
.
getDetail
());
}
else
if
(
ManualProcessingEnum
.
提交整改书
.
getName
().
equals
(
dataObject
.
get
(
"name"
))){
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
提交整改书
.
getDetail
());
}
else
if
(
ManualProcessingEnum
.
整改审批
.
getName
().
equals
(
dataObject
.
get
(
"name"
))){
if
(
"1"
.
equals
(
status
)){
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
流程结束
.
getName
());
}
else
{
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
整改审批
.
getDetail
());
}
}
}
else
{
qualityProblem
.
setStatus
(
ManualProcessingEnum
.
流程结束
.
getName
());
}
qualityProblemService
.
updateById
(
qualityProblem
);
// 更新关联表数据
ProcessRelation
processRelation
=
new
ProcessRelation
();
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
)
{
e
.
printStackTrace
();
}
return
"ok"
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/resources/application.properties
View file @
1e1d0a80
...
...
@@ -28,6 +28,8 @@ fire-rescue=123
params.work.flow.processDefinitionKey
=
xiangmulixiangliucheng
params.work.flow.problemDefinitionKey
=
zhiliangwentiliucheng
# ¼˹
params.work.flow.manualProcessingKey
=
rengongchuliliucheng
amos.secret.key
=
qaz
...
...
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