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
babb796c
Commit
babb796c
authored
Jan 10, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.联调buig
parent
6790f81b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
JgChangeRegistrationNameServiceImpl.java
...biz/service/impl/JgChangeRegistrationNameServiceImpl.java
+21
-8
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgChangeRegistrationNameServiceImpl.java
View file @
babb796c
...
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationNameDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
...
...
@@ -137,6 +138,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
List
<
String
>
roleListNext
=
new
ArrayList
<>();
List
<
String
>
roleListAll
=
new
ArrayList
<>();
String
applyNo
=
applyNoList
.
get
(
0
);
String
nextUserIds
=
""
;
if
(
"1"
.
equals
(
submitType
))
{
// 发起流程
try
{
...
...
@@ -153,6 +155,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
instanceId
=
processTasks
.
get
(
0
).
getProcessInstance
().
getId
();
nextTaskId
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getId
();
taskName
[
0
]
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getName
();
List
<
WorkflowResultDto
>
workflowResultDtos
=
commonService
.
buildWorkFlowInfo
(
processTasks
);
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
...
...
@@ -177,9 +181,11 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
dto
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
dto
.
setUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setCreateUserId
(
RequestContext
.
getExeUserId
());
dto
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
this
.
save
(
dto
);
// 创建代办
this
.
createTaskModel
(
dto
,
taskName
[
0
],
submitType
);
this
.
createTaskModel
(
dto
,
taskName
[
0
],
submitType
,
nextUserIds
);
}
private
void
buildRoleList
(
List
<
ProcessTaskDTO
>
processTasks
,
List
<
String
>
roleListNext
,
List
<
String
>
roleListAll
)
{
...
...
@@ -192,7 +198,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
});
}
private
void
createTaskModel
(
JgChangeRegistrationName
dto
,
String
taskName
,
String
submitType
)
{
private
void
createTaskModel
(
JgChangeRegistrationName
dto
,
String
taskName
,
String
submitType
,
String
nextUserIds
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
"1"
.
equals
(
submitType
))
{
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
...
...
@@ -210,7 +216,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
taskModelDto
.
setStartUserId
(
dto
.
getCreateUserId
());
taskModelDto
.
setStartUser
(
reginParams
.
getUserModel
().
getRealName
());
taskModelDto
.
setStartUserCompanyName
(
dto
.
getUseUnitName
());
taskModelDto
.
setNextExecuteUser
(
dto
.
getNextExecutorIds
()
);
taskModelDto
.
setNextExecuteUser
(
nextUserIds
);
taskModelDto
.
setStartDate
(
dto
.
getCreateDate
());
taskModelDto
.
setModel
(
dto
);
commonService
.
buildTaskModel
(
Collections
.
singletonList
(
taskModelDto
));
...
...
@@ -259,6 +265,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
String
nextTaskId
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getId
();
String
taskName
=
processTasks
.
get
(
0
).
getNextTask
().
get
(
0
).
getName
();
this
.
buildRoleList
(
processTasks
,
roleListNext
,
roleListAll
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
commonService
.
buildWorkFlowInfo
(
processTasks
);
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
jgChangeRegistrationNameDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListAll
));
jgChangeRegistrationNameDto
.
setInstanceId
(
instanceId
);
jgChangeRegistrationNameDto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
...
...
@@ -266,7 +274,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
// 创建待办
JgChangeRegistrationName
bean
=
new
JgChangeRegistrationName
();
BeanUtil
.
copyProperties
(
jgChangeRegistrationNameDto
,
bean
);
createTaskModel
(
bean
,
taskName
,
"1"
);
createTaskModel
(
bean
,
taskName
,
"1"
,
nextUserIds
);
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
throw
new
BadRequest
(
"提交失败"
+
e
.
getMessage
());
...
...
@@ -277,6 +285,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
String
nextTaskId
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
();
String
taskName
=
processTaskDTO
.
getNextTask
().
get
(
0
).
getName
();
this
.
buildRoleList
(
Collections
.
singletonList
(
processTaskDTO
),
roleListNext
,
roleListAll
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
));
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
// 查询下节点任务
if
(!
ObjectUtils
.
isEmpty
(
jgChangeRegistrationName
.
getInstanceStatus
()))
{
jgChangeRegistrationName
.
setInstanceStatus
(
jgChangeRegistrationName
.
getInstanceStatus
()
+
","
+
String
.
join
(
""
,
roleListNext
));
...
...
@@ -287,7 +297,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
jgChangeRegistrationName
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
jgChangeRegistrationName
.
setAuditStatus
(
String
.
valueOf
(
WorkFlowStatusEnum
.
UNIT_RENAME_RECEIVE
.
getPass
()));
jgChangeRegistrationName
.
setNextTaskId
(
nextTaskId
);
executeOneStep
(
jgChangeRegistrationName
);
executeOneStep
(
jgChangeRegistrationName
,
taskName
,
nextUserIds
);
}
BeanUtils
.
copyProperties
(
jgChangeRegistrationNameDto
,
jgChangeRegistrationName
);
...
...
@@ -300,11 +310,12 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
return
jgChangeRegistrationNameDto
;
}
private
void
executeOneStep
(
JgChangeRegistrationName
jgChangeRegistrationName
)
{
private
void
executeOneStep
(
JgChangeRegistrationName
jgChangeRegistrationName
,
String
taskName
,
String
nextUserIds
)
{
// 先更新之前的待办
TaskV2Model
taskV2Model
=
updateTaskModel
(
jgChangeRegistrationName
);
// 再插入新代办、数据待定
taskV2Model
.
setExecuteUserIds
(
jgChangeRegistrationName
.
getNextExecutorIds
());
taskV2Model
.
setTaskName
(
taskName
);
taskV2Model
.
setExecuteUserIds
(
nextUserIds
);
Systemctl
.
taskV2Client
.
create
(
taskV2Model
);
}
...
...
@@ -410,6 +421,8 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
}
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
this
.
buildRoleList
(
Collections
.
singletonList
(
processTaskDTO
),
roleListNext
,
roleListAll
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
));
String
nextUserIds
=
workflowResultDtos
.
get
(
0
).
getNextExecutorUserIds
();
jgChangeRegistrationName
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListNext
));
jgChangeRegistrationName
.
setPromoter
(
RequestContext
.
getExeUserId
());
jgChangeRegistrationName
.
setInstanceId
(
instanceId
);
...
...
@@ -427,7 +440,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
jgChangeRegistrationName
.
setPromoter
(
null
);
}
// 更新上一步待办、创建待办
executeOneStep
(
jgChangeRegistrationName
);
executeOneStep
(
jgChangeRegistrationName
,
taskName
,
nextUserIds
);
}
else
{
jgChangeRegistrationName
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgChangeRegistrationName
.
setAuditPassDate
(
new
Date
());
...
...
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