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
41de0331
Commit
41de0331
authored
Dec 01, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 行动项必填项校验
parent
ca25c1d0
Pipeline
#86381
failed with stages
in 57 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
28 deletions
+21
-28
ChangeExecRecordBiz.java
...ease/mail/yanxuan/change/biz/biz/ChangeExecRecordBiz.java
+0
-28
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+21
-0
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeExecRecordBiz.java
View file @
41de0331
package
com
.
netease
.
mail
.
yanxuan
.
change
.
biz
.
biz
;
import
com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory
;
import
com.netease.mail.yanxuan.change.common.bean.ResponseCode
;
import
com.netease.mail.yanxuan.change.common.util.DateUtils
;
import
com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord
;
import
com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeExecConfigReq
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -34,30 +30,6 @@ public class ChangeExecRecordBiz {
List
<
ChangeExecConfigReq
>
changeExecProjectList
,
String
subFlowId
,
Long
subFlowRecordId
)
{
// 校验列表不为空
if
(
CollectionUtils
.
isEmpty
(
changeExecProjectList
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项列表不能为空"
);
}
// 校验每个行动项的必填字段
changeExecProjectList
.
forEach
(
c
->
{
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecUser
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更行动人不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecUserEmail
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更行动人邮箱不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeRiskDesc
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更风险描述不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecProject
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中行动项内容不能为空"
);
}
if
(
c
.
getChangeExecFinishTime
()
==
null
||
c
.
getChangeExecFinishTime
()
<=
0
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更完成时间不能为空"
);
}
});
return
changeExecProjectList
.
stream
().
map
(
c
->
{
ChangeExecRecord
changeExecRecord
=
new
ChangeExecRecord
();
changeExecRecord
.
setChangeRecordId
(
changeRecordId
);
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
41de0331
...
...
@@ -249,10 +249,31 @@ public class ChangeFlowBiz {
changeFlowCreateReq
.
setChangeDepartment
(
changeConfig
.
getChangeDepartment
());
// 变更行动项不可为空,最多20项
List
<
ChangeExecConfigReq
>
changeExecProject
=
changeFlowCreateReq
.
getChangeExecProject
();
if
(
CollectionUtils
.
isEmpty
(
changeExecProject
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项列表不能为空"
);
}
Assert
.
isTrue
(
changeExecProject
.
size
()
<=
appConfig
.
getChangeExecLimit
(),
"变更行动方案配置数超限"
);
// 校验变更行动方案中是否有重复的变更行动人
validateDuplicateChangeExecUser
(
changeExecProject
);
// 校验每个行动项的必填字段
changeExecProject
.
forEach
(
c
->
{
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecUser
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更行动人不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecUserEmail
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更行动人邮箱不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeRiskDesc
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更风险描述不能为空"
);
}
if
(
StringUtils
.
isBlank
(
c
.
getChangeExecProject
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中行动项内容不能为空"
);
}
if
(
c
.
getChangeExecFinishTime
()
==
null
||
c
.
getChangeExecFinishTime
()
<=
0
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更完成时间不能为空"
);
}
});
// 结束时间不可晚于第二天定时任务执行时间
Long
tomorrowSpecificTime
=
DateUtils
.
getTomorrowSpecificTime
(
"00:00:00"
);
Assert
.
isTrue
(
changeFlowCreateReq
.
getChangeConfirmResultTime
()
>=
tomorrowSpecificTime
,
"时间不可晚于下次执行时间"
);
...
...
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