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
774ff248
Commit
774ff248
authored
Dec 01, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 行动项必填项校验
parent
41de0331
Pipeline
#86382
failed with stages
in 30 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
32 deletions
+40
-32
ChangeExecRecordBiz.java
...ease/mail/yanxuan/change/biz/biz/ChangeExecRecordBiz.java
+33
-0
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+4
-18
ChangeSubFlowBiz.java
...netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
+3
-14
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeExecRecordBiz.java
View file @
774ff248
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
;
...
...
@@ -49,5 +53,34 @@ public class ChangeExecRecordBiz {
return
changeExecRecord
;
}).
collect
(
Collectors
.
toList
());
}
/**
* 校验行动项的必填字段
*
* @param changeExecProjectList 行动项列表
*/
public
void
validateChangeExecProjectRequiredFields
(
List
<
ChangeExecConfigReq
>
changeExecProjectList
)
{
if
(
CollectionUtils
.
isEmpty
(
changeExecProjectList
))
{
return
;
}
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
,
"行动项中变更完成时间不能为空"
);
}
});
}
}
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
774ff248
...
...
@@ -257,23 +257,7 @@ public class ChangeFlowBiz {
// 校验变更行动方案中是否有重复的变更行动人
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
,
"行动项中变更完成时间不能为空"
);
}
});
changeExecRecordBiz
.
validateChangeExecProjectRequiredFields
(
changeExecProject
);
// 结束时间不可晚于第二天定时任务执行时间
Long
tomorrowSpecificTime
=
DateUtils
.
getTomorrowSpecificTime
(
"00:00:00"
);
Assert
.
isTrue
(
changeFlowCreateReq
.
getChangeConfirmResultTime
()
>=
tomorrowSpecificTime
,
"时间不可晚于下次执行时间"
);
...
...
@@ -661,6 +645,8 @@ public class ChangeFlowBiz {
}
// 校验变更行动方案中是否有重复的变更行动人
validateDuplicateChangeExecUser
(
changeExecProjectList
);
// 校验每个行动项的必填字段
changeExecRecordBiz
.
validateChangeExecProjectRequiredFields
(
changeExecProjectList
);
changeRecord
.
setParentChangeClassId
(
changeFlowSubmitReq
.
getParentChangeClassId
());
changeRecord
.
setSonChangeClassId
(
changeFlowSubmitReq
.
getSonChangeClassId
());
List
<
String
>
execDepartmentList
=
changeExecProjectList
.
stream
().
map
(
ChangeExecConfigReq:
:
getChangeExecDepartment
)
...
...
@@ -686,7 +672,7 @@ public class ChangeFlowBiz {
log
.
debug
(
"[NEW_CHANGE_FLOW_START] delete id:{}, changeExecCount:{}"
,
changeRecord
.
getId
(),
changeExecCount
);
// 保存变更行动方案记录
List
<
ChangeExecRecord
>
changeExecRecords
=
changeExecRecordBiz
.
buildChangeExecRecord
(
changeRecord
.
getId
(),
change
FlowSubmitReq
.
getChangeExecProjectList
()
,
null
,
null
);
change
ExecProjectList
,
null
,
null
);
changeExecRecords
.
forEach
(
exec
->
changeFlowExecService
.
saveRecord
(
exec
));
// 更新附件,覆盖操作,先删除,后插入
Integer
fileCount
=
changeFileService
.
deleteByChangeRecordId
(
changeRecord
.
getId
());
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeSubFlowBiz.java
View file @
774ff248
...
...
@@ -207,22 +207,11 @@ public class ChangeSubFlowBiz {
String
.
format
(
"行动项的部门+人组合必须与子单记录一致。子单记录:部门[%s],行动人[%s];当前行动项:部门[%s],行动人[%s]"
,
expectedDepartment
,
expectedUserEmail
,
dept
,
userEmail
));
}
// 校验必填字段
if
(
StringUtils
.
isBlank
(
execConfig
.
getChangeExecUser
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更行动人不能为空"
);
}
if
(
StringUtils
.
isBlank
(
execConfig
.
getChangeRiskDesc
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更风险描述不能为空"
);
}
if
(
StringUtils
.
isBlank
(
execConfig
.
getChangeExecProject
()))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中行动项内容不能为空"
);
}
if
(
execConfig
.
getChangeExecFinishTime
()
==
null
||
execConfig
.
getChangeExecFinishTime
()
<=
0
)
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"行动项中变更完成时间不能为空"
);
}
});
// 校验所有行动项的必填字段(使用公共方法)
changeExecRecordBiz
.
validateChangeExecProjectRequiredFields
(
changeExecProjectList
);
// 删除子单下所有行动项
changeFlowExecService
.
deleteBySubFlowRecordId
(
subFlowRecord
.
getId
());
...
...
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