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
498a3295
Commit
498a3295
authored
Dec 03, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 行动工单流程流转
parent
348b8f2c
Pipeline
#86432
passed with stages
in 1 minute 24 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
10 deletions
+104
-10
ChangeSubFlowBiz.java
...netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
+77
-9
AppConfig.java
...com/netease/mail/yanxuan/change/biz/config/AppConfig.java
+10
-0
ChangeSubFlowRecord.java
...e/mail/yanxuan/change/dal/entity/ChangeSubFlowRecord.java
+5
-0
ChangeSubFlowSubmitReq.java
...uan/change/dal/meta/model/req/ChangeSubFlowSubmitReq.java
+10
-0
ChangeSubFlowRecordMapper.xml
...in/resources/mybatis/mapper/ChangeSubFlowRecordMapper.xml
+2
-1
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
View file @
498a3295
package
com
.
netease
.
mail
.
yanxuan
.
change
.
biz
.
biz
;
import
com.alibaba.fastjson.JSON
;
import
com.netease.mail.yanxuan.change.biz.config.AppConfig
;
import
com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory
;
import
com.netease.mail.yanxuan.change.biz.service.ChangeFlowExecService
;
import
com.netease.mail.yanxuan.change.biz.service.ChangeFlowService
;
...
...
@@ -92,6 +93,9 @@ public class ChangeSubFlowBiz {
@Autowired
private
IusService
iusService
;
@Autowired
private
AppConfig
appConfig
;
public
String
createAndSubmit
(
@Valid
ChangeSubFlowCreateReq
changeSubFlowCreateReq
)
{
String
uid
=
RequestLocalBean
.
getUid
();
...
...
@@ -241,19 +245,55 @@ public class ChangeSubFlowBiz {
}
subFlowRecord
.
setApprover
(
leaderEmail
);
changeSubFlowRecordService
.
update
(
subFlowRecord
);
return
nextNodeId
;
case
CHANGE_SUB_FLOW_SUBMIT:
// 审批行动方案节点,直接提交到执行节点
String
execNodeId
=
flowService
.
submitFlow
(
subFlowId
,
flowDataDTO
,
uid
,
// 检查是否需要审批:如果需要审批,则停留在当前节点等待审批
if
(
needApprove
(
expectedDepartment
))
{
log
.
info
(
"[CHANGE_SUB_FLOW_START] 部门[{}]需要审批,等待上级审批"
,
expectedDepartment
);
return
nextNodeId
;
}
// 不需要审批,自动提交到下一节点
log
.
info
(
"[CHANGE_SUB_FLOW_START] 部门[{}]不需要审批,自动跳过审批"
,
expectedDepartment
);
String
autoNextNodeId
=
flowService
.
submitFlow
(
subFlowId
,
flowDataDTO
,
uid
,
ChangeFlowEnum
.
CHANGE_SUB_FLOW
.
getTopoId
(),
JSON
.
toJSONString
(
content
),
true
,
FlowxOperationEnum
.
SUBMIT
.
getName
(),
"提交工单"
,
subFlowRecord
.
getCreateTime
());
// 更新行动工单节点ID
subFlowRecord
.
setSubFlowNode
(
execNodeId
);
// TODO: 根据业务逻辑设置状态 subFlowRecord.setStatus(...)
FlowxOperationEnum
.
SUBMIT
.
getName
(),
"自动审批通过"
,
subFlowRecord
.
getCreateTime
());
subFlowRecord
.
setSubFlowNode
(
autoNextNodeId
);
subFlowRecord
.
setStatus
(
ChangeSubFlowStatusEnum
.
WAIT_APPROVE_CHANGE_PLAN
.
getStatus
());
subFlowRecord
.
setUpdateTime
(
DateUtils
.
getCurrentTime
());
changeSubFlowRecordService
.
update
(
subFlowRecord
);
return
autoNextNodeId
;
case
CHANGE_SUB_FLOW_SUBMIT:
// 审批行动方案节点
Boolean
approved
=
changeSubFlowSubmitReq
.
getApproved
();
if
(
approved
==
null
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"审批结果不能为空"
);
}
// 审批不通过时,拒绝原因必填
if
(!
approved
)
{
String
rejectReason
=
changeSubFlowSubmitReq
.
getRejectReason
();
if
(
StringUtils
.
isBlank
(
rejectReason
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"拒绝原因不能为空"
);
}
subFlowRecord
.
setRejectReason
(
rejectReason
);
log
.
info
(
"[CHANGE_SUB_FLOW_SUBMIT] 审批不通过,subFlowId:{}, rejectReason:{}"
,
subFlowId
,
rejectReason
);
}
// 提交工单(根据审批结果流转到不同节点)
String
remark
=
approved
?
"审批通过"
:
"审批不通过"
;
String
approveNodeId
=
flowService
.
submitFlow
(
subFlowId
,
flowDataDTO
,
uid
,
ChangeFlowEnum
.
CHANGE_SUB_FLOW
.
getTopoId
(),
JSON
.
toJSONString
(
content
),
approved
,
FlowxOperationEnum
.
SUBMIT
.
getName
(),
remark
,
subFlowRecord
.
getCreateTime
());
// 更新行动工单
subFlowRecord
.
setSubFlowNode
(
approveNodeId
);
subFlowRecord
.
setStatus
(
approved
?
ChangeSubFlowStatusEnum
.
WAIT_APPROVE_CHANGE_PLAN
.
getStatus
()
:
ChangeSubFlowStatusEnum
.
WAIT_CONFIRM_ACTION_PLAN
.
getStatus
());
subFlowRecord
.
setUpdateTime
(
DateUtils
.
getCurrentTime
());
changeSubFlowRecordService
.
update
(
subFlowRecord
);
return
exec
NodeId
;
return
approve
NodeId
;
case
CHANGE_SUB_FLOW_EXE:
// 执行行动方案节点,直接提交到提交执行结果节点
...
...
@@ -314,6 +354,34 @@ public class ChangeSubFlowBiz {
}
/**
* 判断部门是否应该跳过审批
*
* @param department 部门名称
* @return true 表示应该跳过审批(不在需要审批的部门列表中)
*/
/**
* 判断部门是否需要审批
*
* @param department 部门名称
* @return true 表示需要审批(在配置的部门列表中)
*/
private
boolean
needApprove
(
String
department
)
{
if
(
StringUtils
.
isBlank
(
department
))
{
return
false
;
}
List
<
String
>
needApproveDepts
=
appConfig
.
getNeedApproveDepartments
();
// 如果没有配置或配置为空,默认都不需要审批
if
(
CollectionUtils
.
isEmpty
(
needApproveDepts
))
{
return
false
;
}
// 检查部门是否在需要审批的列表中
return
needApproveDepts
.
stream
()
.
filter
(
StringUtils:
:
isNotBlank
)
.
map
(
String:
:
trim
)
.
anyMatch
(
dept
->
dept
.
equals
(
department
.
trim
()));
}
/**
* 根据变更行动工单ID查询详情
* 说明:展示内容和主单的detail一样,但行动项只展示该变更行动工单下绑定的行动项
*
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/config/AppConfig.java
View file @
498a3295
...
...
@@ -6,6 +6,8 @@
*/
package
com
.
netease
.
mail
.
yanxuan
.
change
.
biz
.
config
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -102,4 +104,11 @@ public class AppConfig {
@Value
(
"${exportLimit:20}"
)
private
Long
exportLimit
;
/**
* 需要审批的部门列表(只有这些部门的行动工单需要审批,其他部门自动通过)
* 配置格式:部门名称列表,逗号分隔,例如:质量部,研发部
*/
@ValueMapping
(
"${change.subflow.need.approve.departments:[]}"
)
private
List
<
String
>
needApproveDepartments
;
}
\ No newline at end of file
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/entity/ChangeSubFlowRecord.java
View file @
498a3295
...
...
@@ -79,6 +79,11 @@ public class ChangeSubFlowRecord {
private
String
changeCommander
;
/**
* 拒绝原因(审批不通过时填写)
*/
private
String
rejectReason
;
/**
* 创建时间
*/
private
Long
createTime
;
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/meta/model/req/ChangeSubFlowSubmitReq.java
View file @
498a3295
...
...
@@ -45,5 +45,15 @@ public class ChangeSubFlowSubmitReq {
* 行动项列表(确认行动方案时使用)
*/
private
List
<
ChangeExecConfigReq
>
changeExecProjectList
;
/**
* 审批是否通过(审批行动方案时使用)
*/
private
Boolean
approved
;
/**
* 拒绝原因(审批不通过时必填)
*/
private
String
rejectReason
;
}
yanxuan-qc-change-system-dal/src/main/resources/mybatis/mapper/ChangeSubFlowRecordMapper.xml
View file @
498a3295
...
...
@@ -11,12 +11,13 @@
<result
column=
"change_exec_user_email"
jdbcType=
"VARCHAR"
property=
"changeExecUserEmail"
/>
<result
column=
"change_exec_department"
jdbcType=
"VARCHAR"
property=
"changeExecDepartment"
/>
<result
column=
"change_commander"
jdbcType=
"VARCHAR"
property=
"changeCommander"
/>
<result
column=
"reject_reason"
jdbcType=
"VARCHAR"
property=
"rejectReason"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"BIGINT"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, change_record_id, sub_flow_id, sub_flow_node, status, approver, change_exec_user_email, change_exec_department, change_commander, create_time, update_time
id, change_record_id, sub_flow_id, sub_flow_node, status, approver, change_exec_user_email, change_exec_department, change_commander,
reject_reason,
create_time, update_time
</sql>
<select
id=
"selectByCondition"
resultMap=
"BaseResultMap"
parameterType=
"com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeSubFlowListQueryReq"
>
...
...
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