Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
Overview
Overview
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
yx-qc-change-flow
yanxuan-qc-change-system
Commits
ffc569e6
Commit
ffc569e6
authored
Dec 11, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 行动工单提交变更执行,变更工单自动提交
parent
42a2aa4a
Pipeline
#86794
passed with stages
in 1 minute 30 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
87 deletions
+0
-87
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+0
-87
ChangeSubFlowBiz.java
...netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
+0
-0
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
ffc569e6
...
@@ -1707,93 +1707,6 @@ public class ChangeFlowBiz {
...
@@ -1707,93 +1707,6 @@ public class ChangeFlowBiz {
return
nextNodeId
;
return
nextNodeId
;
}
}
void
submitMainFlowAfterAllSubFlowsApproved
(
Long
changeRecordId
)
{
// 查询主工单
ChangeRecord
changeRecord
=
changeRecordMapper
.
selectByPrimaryKey
(
changeRecordId
);
if
(
changeRecord
==
null
)
{
log
.
error
(
"[submitMainFlowAfterAllSubFlowsApproved] 主工单不存在,changeRecordId:{}"
,
changeRecordId
);
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"主工单不存在"
);
}
// 验证主工单当前节点
String
currentNode
=
changeRecord
.
getFlowNode
();
if
(!
ChangeFlowEnum
.
NEW_CHANGE_FLOW_CONFIRM_EXEC_PLAN
.
getNodeId
().
equals
(
currentNode
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
NODE_ERROR
,
String
.
format
(
"主工单当前节点不是确认变更方案节点,无法流转。当前节点:%s"
,
currentNode
));
}
try
{
Long
flowId
=
changeRecord
.
getFlowId
();
String
uid
=
RequestLocalBean
.
getUid
();
// 获取工单详情
FlowDataDTO
flowDataDTO
=
flowService
.
flowDetail
(
flowId
.
toString
());
if
(
flowDataDTO
==
null
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
DETAIL_FLOW_ERROR
,
"工单查询错误,不存在"
);
}
// 构建提交内容
Map
<
String
,
Object
>
content
=
new
HashMap
<>(
CommonConstants
.
INIT_HASH_MAP_SIZE
);
content
.
put
(
"updateTime"
,
System
.
currentTimeMillis
());
content
.
put
(
CommonConstants
.
FLOW_OPERATION_KEY
,
FlowOperationTypeEnum
.
PASS
.
getValue
());
// 使用paramMap控制流转方向(所有子单审批通过)
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"type"
,
FlowTransitionType
.
TYPE_APPROVED
);
// 流转主工单到部门负责人审批节点
String
ownerApproveNodeId
=
flowService
.
submitFlowWithParamMap
(
flowId
.
toString
(),
flowDataDTO
,
uid
,
ChangeFlowEnum
.
NEW_CHANGE_FLOW
.
getTopoId
(),
JSON
.
toJSONString
(
content
),
paramMap
,
FlowxOperationEnum
.
SUBMIT
.
getName
(),
"所有子单审批通过,主工单流转"
,
changeRecord
.
getCreateTime
());
changeRecord
.
setFlowNode
(
ownerApproveNodeId
);
changeRecord
.
setState
(
ChangeStatusEnum
.
WAIT_DEPT_LEADER_APPROVE
.
getStatus
());
changeRecord
.
setUpdateTime
(
DateUtils
.
getCurrentTime
());
// 获取变更负责人的上级领导并设置为审批人
String
changeCommander
=
changeRecord
.
getChangeCommander
();
if
(
StringUtils
.
isBlank
(
changeCommander
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"变更负责人邮箱不能为空"
);
}
String
leaderEmail
=
departmentLeaderBiz
.
getDepartmentLeader
(
changeCommander
);
if
(
StringUtils
.
isBlank
(
leaderEmail
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
String
.
format
(
"变更负责人[%s]的部门上级领导不存在"
,
changeCommander
));
}
// 设置审批人为上级领导(JSON 数组格式)
changeRecord
.
setApprover
(
JSON
.
toJSONString
(
Collections
.
singletonList
(
leaderEmail
)));
changeFlowService
.
updateRecord
(
changeRecord
);
log
.
info
(
"[submitMainFlowAfterAllSubFlowsApproved] 主工单流转成功,flowId:{}, nextNodeId:{}, approver:{}"
,
flowId
,
ownerApproveNodeId
,
leaderEmail
);
}
catch
(
Exception
e
)
{
log
.
error
(
"[submitMainFlowAfterAllSubFlowsApproved] 主工单流转失败,changeRecordId:{}"
,
changeRecordId
,
e
);
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
String
.
format
(
"主工单流转失败:%s"
,
e
.
getMessage
()));
}
}
/**
* 检查主工单下所有子单是否都已完成(供主工单流转时调用)
* 条件:status = FINISHED 或 CANCELLED
*
* @param changeRecordId 主工单ID
* @return true 表示所有子单都已完成
*/
public
boolean
checkAllSubFlowsFinishedForMainFlow
(
Long
changeRecordId
)
{
// 查询该主工单下所有子单
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecordMapper
.
selectByChangeRecordId
(
changeRecordId
);
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
return
false
;
}
// 检查是否所有子单都满足条件:状态是 FINISHED 或 CANCELLED
return
allSubFlows
.
stream
().
allMatch
(
subFlow
->
ChangeSubFlowStatusEnum
.
FINISHED
.
getStatus
().
equals
(
subFlow
.
getStatus
())
||
ChangeSubFlowStatusEnum
.
CANCELLED
.
getStatus
().
equals
(
subFlow
.
getStatus
())
);
}
/**
/**
* 验证子单归属于主工单(查询一次,返回所有子单供后续复用)
* 验证子单归属于主工单(查询一次,返回所有子单供后续复用)
*
*
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
View file @
ffc569e6
This diff is collapsed.
Click to expand it.
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