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
胡园园
yanxuan-qc-change-system
Commits
9bee8ce6
Commit
9bee8ce6
authored
Dec 26, 2022
by
“zcwang”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:必传文件判断
parent
02bc13b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+14
-12
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
9bee8ce6
...
...
@@ -557,9 +557,8 @@ public class ChangeFlowBiz {
Assert
.
notNull
(
changeConfig
,
"二级变更类型不存在"
);
Integer
needFile
=
changeConfig
.
getNeedFile
();
if
(
NeedFileEnum
.
NEED
.
getStatus
().
equals
(
needFile
))
{
List
<
ChangeFlowFile
>
fileList
=
changeFlowSubmitReq
.
getChangeFiles
();
fileList
.
addAll
(
changeFlowSubmitReq
.
getUploadFiles
());
if
(
CollectionUtils
.
isEmpty
(
fileList
))
{
List
<
ChangeFlowFile
>
uploadFiles
=
changeFlowSubmitReq
.
getUploadFiles
();
if
(
CollectionUtils
.
isEmpty
(
uploadFiles
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"必须上传资料"
);
}
}
...
...
@@ -601,17 +600,20 @@ public class ChangeFlowBiz {
// 更新附件,覆盖操作,先删除,后插入
Integer
fileCount
=
changeFileService
.
deleteByChangeRecordId
(
changeRecord
.
getId
());
log
.
debug
(
"[CHANGE_FLOW_SUBMIT] delete fileCount:{}"
,
fileCount
);
List
<
ChangeF
lowFile
>
files
=
changeFlowSubmitReq
.
getChangeFiles
();
if
(
CollectionUtils
.
isNotEmpty
(
files
))
{
List
<
ChangeFile
>
changeFiles
=
buildChangeFileRecord
(
changeRecord
.
getId
(),
files
,
FileTypeEnum
.
CHANGE
.
getType
());
changeFiles
.
forEach
(
file
->
changeFileService
.
saveRecord
(
file
));
List
<
ChangeF
ile
>
allFiles
=
new
ArrayList
<>
();
List
<
ChangeFlowFile
>
changeFiles
=
changeFlowSubmitReq
.
getChangeFiles
();
if
(
CollectionUtils
.
isNotEmpty
(
changeFiles
))
{
allFiles
.
addAll
(
buildChangeFileRecord
(
changeRecord
.
getId
(),
changeFiles
,
FileTypeEnum
.
CHANGE
.
getType
()
));
}
// 保存附件,根据配置看是否必传
List
<
ChangeFlowFile
>
uploadFiles
=
changeFlowSubmitReq
.
getUploadFiles
();
if
(
CollectionUtils
.
isNotEmpty
(
uploadFiles
))
{
List
<
ChangeFile
>
changeFiles
=
buildChangeFileRecord
(
changeRecord
.
getId
(),
uploadFiles
,
FileTypeEnum
.
UPLOAD
.
getType
());
changeFiles
.
forEach
(
file
->
changeFileService
.
saveRecord
(
file
));
allFiles
.
addAll
(
buildChangeFileRecord
(
changeRecord
.
getId
(),
uploadFiles
,
FileTypeEnum
.
UPLOAD
.
getType
()));
}
log
.
debug
(
"[CHANGE_FLOW_SUBMIT] files:{}, uploadFiles:{}"
,
JSON
.
toJSONString
(
files
),
if
(
CollectionUtils
.
isNotEmpty
(
allFiles
))
{
allFiles
.
forEach
(
file
->
changeFileService
.
saveRecord
(
file
));
}
log
.
debug
(
"[CHANGE_FLOW_SUBMIT] files:{}, uploadFiles:{}"
,
JSON
.
toJSONString
(
allFiles
),
JSON
.
toJSONString
(
uploadFiles
));
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"changeId"
,
changeRecord
.
getFlowId
());
...
...
@@ -670,8 +672,8 @@ public class ChangeFlowBiz {
List
<
ChangeFlowFile
>
finialFiles
=
changeFlowSubmitReq
.
getChangeResultFiles
();
if
(
CollectionUtils
.
isNotEmpty
(
finialFiles
))
{
changeFileService
.
deleteByChangeRecordIdAndType
(
changeRecord
.
getId
(),
FileTypeEnum
.
CHANGE_RESULT_INFO
);
List
<
ChangeFile
>
changeFiles
=
buildChangeFileRecord
(
changeRecord
.
getId
(),
finialFiles
,
FileTypeEnum
.
CHANGE_RESULT_INFO
.
getType
());
changeFiles
.
forEach
(
file
->
changeFileService
.
saveRecord
(
file
));
List
<
ChangeFile
>
finialFileList
=
buildChangeFileRecord
(
changeRecord
.
getId
(),
finialFiles
,
FileTypeEnum
.
CHANGE_RESULT_INFO
.
getType
());
finialFileList
.
forEach
(
file
->
changeFileService
.
saveRecord
(
file
));
}
switch
(
changeResultStatus
)
{
case
FINISH_ALL:
...
...
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