Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
45abf238
Commit
45abf238
authored
Sep 13, 2022
by
zhaji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"feature-zhaJi:修复sonar中的bug"
parent
79c324fb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+5
-0
TInsuranceEnclosureServiceImpl.java
...ervice/insurance/impl/TInsuranceEnclosureServiceImpl.java
+3
-4
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
45abf238
...
...
@@ -1111,6 +1111,11 @@ public class InsurancesConstants {
*/
public
static
final
String
SUCCESS_LIST
=
"successList"
;
/**
* OSS文件上传接口异常:
*/
public
static
final
String
OSS_ERROR
=
"OSS文件上传接口异常:"
;
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceEnclosureServiceImpl.java
View file @
45abf238
...
...
@@ -63,15 +63,14 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
if
(
file
.
getSize
()
>
(
CommonConstants
.
FIFTY_INT
*
CommonConstants
.
BYTE
*
CommonConstants
.
BYTE
)){
return
R
.
failed
(
InsurancesConstants
.
INSURANCE_ENCLOSURE_SIZE_ERROR
);
}
String
enclosureName
=
Objects
.
requireNonNull
(
file
.
getOriginalFilename
()).
substring
(
0
,
file
.
getOriginalFilename
().
lastIndexOf
(
"."
));
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
file
.
getOriginalFilename
();
String
fileName
=
System
.
currentTimeMillis
()
+
CommonConstants
.
DOWN_LINE_STRING
+
file
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
""
;
if
(!
Common
.
isNotNull
(
filePath
))
{
key
=
fileName
;
}
else
{
key
=
filePath
+
"/"
+
fileName
;
key
=
filePath
+
CommonConstants
.
SLASH_SPLIT_LINE_STRING
+
fileName
;
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
...
...
@@ -92,7 +91,7 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
try
{
this
.
save
(
insuranceEnclosure
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
log
.
error
(
InsurancesConstants
.
OSS_ERROR
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"failed:"
+
e
.
getMessage
());
}
...
...
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