Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2024-12-25 18:50:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0bccd01352b3ac94e37d6e6273f801a9a452e061
0bccd013
1 parent
bda20f35
biz-customer | 修改 | 附件校验逻辑调整
mt 2024年12月25日18:50:01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
server/biz-customer/src/main/java/com/fedex/connect/customer/validate/controller/biz/AttachmentValidate.java
server/biz-customer/src/main/java/com/fedex/connect/customer/validate/controller/biz/AttachmentValidate.java
View file @
0bccd01
...
...
@@ -34,21 +34,21 @@ public class AttachmentValidate {
*/
public
void
validateFile
(
MultipartFile
[]
files
,
ConsignmentBo
consignmentBo
){
//文件为空
if
(
Objects
.
isNull
(
files
)
||
files
.
length
==
DigitConstants
.
DIGIT_ZERO
||
Objects
.
isNull
(
consignmentBo
)
if
(
Objects
.
isNull
(
consignmentBo
)
||
Objects
.
isNull
(
consignmentBo
.
getAttachmentBizTypeList
())){
responseUtils
.
fail
(
ResponseCode
.
MESSAGE_CODE_30006
);
}
//上传最大文件个数限制
if
(
files
.
length
>
CustomerConstant
.
VALIDATE_KEYS
.
UPLOAD_FILE_MAX_TOTAL
){
if
(
Objects
.
nonNull
(
files
)
&&
files
.
length
>
CustomerConstant
.
VALIDATE_KEYS
.
UPLOAD_FILE_MAX_TOTAL
){
responseUtils
.
fail
(
ResponseCode
.
MESSAGE_CODE_30007
,
CustomerConstant
.
VALIDATE_KEYS
.
UPLOAD_FILE_MAX_TOTAL
);
}
//上传总文件大小限制
List
<
Long
>
fileSizeList
=
new
ArrayList
<>();
for
(
MultipartFile
file
:
files
){
if
(
Objects
.
nonNull
(
files
))
{
for
(
MultipartFile
file
:
files
)
{
fileSizeList
.
add
(
file
.
getSize
());
}
}
//总文件大小
Long
totalSize
=
Utils
.
listOf
(
fileSizeList
).
stream
().
filter
(
Objects:
:
nonNull
)
.
mapToLong
(
f
->
Optional
.
ofNullable
(
f
).
orElse
(
0L
)).
sum
();
...
...
Please
register
or
login
to post a comment