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
783707bb
Commit
783707bb
authored
Jan 15, 2026
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug: 催办
parent
ae196541
Pipeline
#88125
passed with stages
in 1 minute 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
30 deletions
+27
-30
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+27
-30
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
783707bb
...
@@ -2310,39 +2310,36 @@ public class ChangeFlowBiz {
...
@@ -2310,39 +2310,36 @@ public class ChangeFlowBiz {
public
void
urge
(
Long
flowId
)
{
public
void
urge
(
Long
flowId
)
{
log
.
info
(
"[urge] 开始催办,flowId:{}"
,
flowId
);
log
.
info
(
"[urge] 开始催办,flowId:{}"
,
flowId
);
// 1. 通过列表接口查询工单,复用已有的超期判断逻辑
// 通过详情接口查询工单
ChangeFlowListQueryReq
queryReq
=
new
ChangeFlowListQueryReq
();
ChangeFlowVO
changeFlowVO
=
detail
(
flowId
);
queryReq
.
setFlowId
(
flowId
);
ChangeFlowListVO
listResult
=
query
(
1
,
1
,
queryReq
);
if
(
listResult
==
null
||
CollectionUtils
.
isEmpty
(
listResult
.
getChangeFlowList
()))
{
// 查询主工单信息(用于buildChangeEndTime和后续邮件参数)
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
DETAIL_FLOW_ERROR
,
"工单不存在"
);
ChangeRecord
changeRecord
=
changeFlowService
.
getByFlowId
(
flowId
);
}
// 查询该主单下的所有行动工单
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecordService
.
getByChangeRecordIds
(
Collections
.
singletonList
(
changeFlowVO
.
getId
()));
ChangeFlowVO
changeFlowVO
=
listResult
.
getChangeFlowList
().
get
(
0
);
// 构建 subFlowRecordsMap 并计算 isOverdue
Map
<
Long
,
List
<
ChangeSubFlowRecord
>>
subFlowRecordsMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
allSubFlows
))
{
subFlowRecordsMap
=
allSubFlows
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
ChangeSubFlowRecord:
:
getChangeRecordId
));
}
buildChangeEndTime
(
changeRecord
,
changeFlowVO
,
subFlowRecordsMap
);
//
2.
判断是否超期
// 判断是否超期
if
(
changeFlowVO
.
getIsOverdue
()
==
null
||
!
changeFlowVO
.
getIsOverdue
())
{
if
(
changeFlowVO
.
getIsOverdue
()
==
null
||
!
changeFlowVO
.
getIsOverdue
())
{
log
.
info
(
"[urge] 工单未超期,无需催办,flowId:{}"
,
flowId
);
log
.
info
(
"[urge] 工单未超期,无需催办,flowId:{}"
,
flowId
);
return
;
return
;
}
}
// 3. 查询主工单信息
ChangeRecord
changeRecord
=
changeFlowService
.
getByFlowId
(
flowId
);
if
(
changeRecord
==
null
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
DETAIL_FLOW_ERROR
,
"工单不存在"
);
}
// 4. 查询该主单下的所有行动工单
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecordService
.
getByChangeRecordIds
(
Collections
.
singletonList
(
changeRecord
.
getId
()));
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
log
.
info
(
"[urge] 该主单下没有行动工单,flowId:{}"
,
flowId
);
log
.
info
(
"[urge] 该主单下没有行动工单,flowId:{}"
,
flowId
);
return
;
return
;
}
}
//
5.
批量查询所有行动工单对应的行动项
// 批量查询所有行动工单对应的行动项
Set
<
Long
>
allSubFlowRecordIds
=
allSubFlows
.
stream
()
Set
<
Long
>
allSubFlowRecordIds
=
allSubFlows
.
stream
()
.
map
(
ChangeSubFlowRecord:
:
getId
)
.
map
(
ChangeSubFlowRecord:
:
getId
)
.
collect
(
Collectors
.
toSet
());
.
collect
(
Collectors
.
toSet
());
...
@@ -2354,7 +2351,7 @@ public class ChangeFlowBiz {
...
@@ -2354,7 +2351,7 @@ public class ChangeFlowBiz {
.
filter
(
exec
->
exec
.
getSubFlowRecordId
()
!=
null
)
.
filter
(
exec
->
exec
.
getSubFlowRecordId
()
!=
null
)
.
collect
(
Collectors
.
groupingBy
(
ChangeExecRecord:
:
getSubFlowRecordId
));
.
collect
(
Collectors
.
groupingBy
(
ChangeExecRecord:
:
getSubFlowRecordId
));
//
6.
过滤出未完结、未取消且超期的行动工单
// 过滤出未完结、未取消且超期的行动工单
Long
currentTime
=
DateUtils
.
getCurrentTime
();
Long
currentTime
=
DateUtils
.
getCurrentTime
();
List
<
ChangeSubFlowRecord
>
overdueSubFlows
=
allSubFlows
.
stream
()
List
<
ChangeSubFlowRecord
>
overdueSubFlows
=
allSubFlows
.
stream
()
.
filter
(
subFlow
->
{
.
filter
(
subFlow
->
{
...
@@ -2392,7 +2389,7 @@ public class ChangeFlowBiz {
...
@@ -2392,7 +2389,7 @@ public class ChangeFlowBiz {
return
;
return
;
}
}
//
7.
对每个超期的行动工单单独发送催办邮件
// 对每个超期的行动工单单独发送催办邮件
int
sentCount
=
0
;
int
sentCount
=
0
;
for
(
ChangeSubFlowRecord
overdueSubFlow
:
overdueSubFlows
)
{
for
(
ChangeSubFlowRecord
overdueSubFlow
:
overdueSubFlows
)
{
String
execUserEmail
=
overdueSubFlow
.
getChangeExecUserEmail
();
String
execUserEmail
=
overdueSubFlow
.
getChangeExecUserEmail
();
...
@@ -2410,10 +2407,10 @@ public class ChangeFlowBiz {
...
@@ -2410,10 +2407,10 @@ public class ChangeFlowBiz {
// 行动工单ID
// 行动工单ID
param
.
put
(
"changeId"
,
overdueSubFlow
.
getSubFlowId
());
param
.
put
(
"changeId"
,
overdueSubFlow
.
getSubFlowId
());
// 主工单ID(用于跳转)
// 主工单ID(用于跳转)
param
.
put
(
"mainFlowId"
,
change
Record
.
getFlowId
());
param
.
put
(
"mainFlowId"
,
change
FlowVO
.
getFlowId
());
param
.
put
(
"changeSubject"
,
ChangeSubjectEnum
.
getChangeSubjectEnum
(
change
Record
.
getChangeSubject
()).
getDesc
());
param
.
put
(
"changeSubject"
,
ChangeSubjectEnum
.
getChangeSubjectEnum
(
change
FlowVO
.
getChangeSubject
()).
getDesc
());
param
.
put
(
"changeContent"
,
change
Record
.
getChangeContent
());
param
.
put
(
"changeContent"
,
change
FlowVO
.
getChangeContent
());
param
.
put
(
"changeReason"
,
change
Record
.
getChangeReason
());
param
.
put
(
"changeReason"
,
change
FlowVO
.
getChangeReason
());
// 行动工单执行人信息
// 行动工单执行人信息
IusUserInfoRsp
execUser
=
iusService
.
queryUserInfo
(
execUserEmail
);
IusUserInfoRsp
execUser
=
iusService
.
queryUserInfo
(
execUserEmail
);
...
@@ -2422,9 +2419,9 @@ public class ChangeFlowBiz {
...
@@ -2422,9 +2419,9 @@ public class ChangeFlowBiz {
param
.
put
(
"changeExecDepartment"
,
overdueSubFlow
.
getChangeExecDepartment
());
param
.
put
(
"changeExecDepartment"
,
overdueSubFlow
.
getChangeExecDepartment
());
// 获取变更负责人信息
// 获取变更负责人信息
IusUserInfoRsp
commanderUser
=
iusService
.
queryUserInfo
(
change
Record
.
getChangeCommander
());
IusUserInfoRsp
commanderUser
=
iusService
.
queryUserInfo
(
change
FlowVO
.
getChangeCommander
());
param
.
put
(
"changeCommander"
,
commanderUser
==
null
?
change
Record
.
getChangeCommander
()
:
commanderUser
.
getName
());
param
.
put
(
"changeCommander"
,
commanderUser
==
null
?
change
FlowVO
.
getChangeCommander
()
:
commanderUser
.
getName
());
param
.
put
(
"changeCommanderEmail"
,
change
Record
.
getChangeCommander
());
param
.
put
(
"changeCommanderEmail"
,
change
FlowVO
.
getChangeCommander
());
// 行动项列表
// 行动项列表
List
<
Map
<
String
,
Object
>>
execProjectList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
execProjectList
=
new
ArrayList
<>();
...
@@ -2442,7 +2439,7 @@ public class ChangeFlowBiz {
...
@@ -2442,7 +2439,7 @@ public class ChangeFlowBiz {
param
.
put
(
"flowUrl"
,
overdueSubFlow
.
getSubFlowId
());
param
.
put
(
"flowUrl"
,
overdueSubFlow
.
getSubFlowId
());
// 邮件标题:使用行动工单ID
// 邮件标题:使用行动工单ID
String
subjectParam
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
change
Record
.
getChangeSubject
()).
getDesc
()
String
subjectParam
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
change
FlowVO
.
getChangeSubject
()).
getDesc
()
+
overdueSubFlow
.
getSubFlowId
();
+
overdueSubFlow
.
getSubFlowId
();
// 收件人:该行动工单的执行人(只发送给行动人,不抄送)
// 收件人:该行动工单的执行人(只发送给行动人,不抄送)
...
...
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