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
60fef344
Commit
60fef344
authored
Dec 15, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 取消变更
parent
e5f1d1ed
Pipeline
#86924
passed with stages
in 1 minute 38 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+23
-4
FlowxOperationEnum.java
.../mail/yanxuan/change/common/enums/FlowxOperationEnum.java
+5
-1
ChangeFlowCancelReq.java
...anxuan/change/dal/meta/model/req/ChangeFlowCancelReq.java
+7
-0
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
60fef344
...
...
@@ -835,8 +835,22 @@ public class ChangeFlowBiz {
// 查询工单有效性
ChangeRecord
changeRecord
=
getFlowInfo
(
flowId
);
String
currentNodeId
=
changeRecord
.
getFlowNode
();
log
.
info
(
"[cancel] nodeId:{}
"
,
currentNodeId
);
log
.
info
(
"[cancel] nodeId:{}
, type:{}"
,
currentNodeId
,
req
.
getType
()
);
// 判断是取消还是终止(type 默认值为 CANCEL)
String
operationType
=
req
.
getType
();
boolean
isTermination
=
"TERMINATION"
.
equalsIgnoreCase
(
operationType
);
// 取消和终止都需要检查:节点不是9999(结束节点)且状态不是完结
Integer
currentState
=
changeRecord
.
getState
();
if
(
ChangeFlowEnum
.
NEW_END
.
getNodeId
().
equals
(
currentNodeId
)
||
ChangeStatusEnum
.
FINISHED
.
getStatus
().
equals
(
currentState
))
{
String
errorMsg
=
isTermination
?
"已完结的工单不能终止"
:
"已完结的工单不能取消"
;
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
errorMsg
);
}
// 取消:检查允许的节点
if
(!
isTermination
)
{
List
<
String
>
allowedCancelNodes
=
Arrays
.
asList
(
ChangeFlowEnum
.
NEW_CHANGE_FLOW_START
.
getNodeId
(),
ChangeFlowEnum
.
NEW_CHANGE_FLOW_OWNER_APPROVE
.
getNodeId
(),
...
...
@@ -845,6 +859,10 @@ public class ChangeFlowBiz {
ChangeFlowEnum
.
NEW_CHANGE_FLOW_CONFIRM
.
getNodeId
()
);
this
.
checkNode
(
currentNodeId
,
allowedCancelNodes
);
log
.
info
(
"[cancel] 取消变更,flowId:{}, nodeId:{}"
,
flowId
,
currentNodeId
);
}
else
{
log
.
info
(
"[cancel] 终止变更,flowId:{}, nodeId:{}, state:{}"
,
flowId
,
currentNodeId
,
currentState
);
}
String
uid
=
RequestLocalBean
.
getUid
();
String
changeCommander
=
changeRecord
.
getChangeCommander
();
...
...
@@ -856,14 +874,15 @@ public class ChangeFlowBiz {
if
(
flowDataDTO
==
null
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
DETAIL_FLOW_ERROR
,
"工单查询错误,不存在"
);
}
// 工单流转:使用 paramMap 方式,type=2 表示
回退
// 工单流转:使用 paramMap 方式,type=2 表示
取消/终止
Map
<
String
,
Object
>
content
=
buildFlowContent
(
FlowOperationTypeEnum
.
REFUSE
);
Map
<
String
,
Object
>
cancelParamMap
=
new
HashMap
<>();
cancelParamMap
.
put
(
"type"
,
FlowTransitionType
.
TYPE_CANCEL
);
String
operationName
=
isTermination
?
FlowxOperationEnum
.
TERMINATION
.
getName
()
:
FlowxOperationEnum
.
CANCEL
.
getName
();
String
nextNodeId
=
flowService
.
submitFlowWithParamMap
(
String
.
valueOf
(
flowId
),
flowDataDTO
,
uid
,
ChangeFlowEnum
.
NEW_CHANGE_FLOW
.
getTopoId
(),
JSON
.
toJSONString
(
content
),
cancelParamMap
,
FlowxOperationEnum
.
CANCEL
.
getName
(),
"取消变更"
,
changeRecord
.
getCreateTime
());
log
.
info
(
"[cancel] flowId:{}, nextNodeId:{}
"
,
flowId
,
nextNodeId
);
operationName
,
operationName
,
changeRecord
.
getCreateTime
());
log
.
info
(
"[cancel] flowId:{}, nextNodeId:{}
, operationType:{}"
,
flowId
,
nextNodeId
,
operationType
);
// 填充更新数据
changeRecord
.
setFlowNode
(
nextNodeId
);
changeRecord
.
setState
(
ChangeStatusEnum
.
CANCEL
.
getStatus
());
...
...
yanxuan-qc-change-system-common/src/main/java/com/netease/mail/yanxuan/change/common/enums/FlowxOperationEnum.java
View file @
60fef344
...
...
@@ -35,7 +35,11 @@ public enum FlowxOperationEnum {
/**
* 取消变更
*/
CANCEL
(
8
,
"取消变更"
);
CANCEL
(
8
,
"取消变更"
),
/**
* 终止变更
*/
TERMINATION
(
9
,
"终止变更"
);
/**
* 类型
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/meta/model/req/ChangeFlowCancelReq.java
View file @
60fef344
...
...
@@ -28,4 +28,10 @@ public class ChangeFlowCancelReq {
@NotBlank
(
message
=
"取消原因不能为空"
)
@Size
(
max
=
200
,
message
=
"取消原因限制200字"
)
private
String
cancelReason
;
/**
* 操作类型:CANCEL-取消,TERMINATION-终止
* 默认值为 CANCEL,保持向后兼容
*/
private
String
type
=
"CANCEL"
;
}
\ No newline at end of file
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