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
325bc44b
Commit
325bc44b
authored
Jun 25, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目订单 附件上传
parent
bc362f75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
22 deletions
+4
-22
TOrderServiceImpl.java
...ud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
+4
-22
No files found.
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
View file @
325bc44b
...
@@ -553,30 +553,12 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
...
@@ -553,30 +553,12 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
tOrderHandlerService
.
saveBatch
(
list
);
tOrderHandlerService
.
saveBatch
(
list
);
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
())){
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
())){
String
fileName
;
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//filePath不传默认存储空间的根目录
//支持的附件格式
//支持的附件格式
String
key
=
fileName
;
getObjectR
(
multipartFile
.
getInputStream
(),
vo
.
getOrderNo
(),
fileName
,
multipartFile
.
getOriginalFilename
(),
CommonConstants
.
ZERO_INT
);
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
order
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
ZERO_INT
);
orderEnclosure
.
setEnclosureAddress
(
key
);
orderEnclosure
.
setDeleteFlag
(
CommonConstants
.
ZERO_INT
);
try
{
tOrderEnclosureService
.
save
(
orderEnclosure
);
}
catch
(
Exception
e
)
{
log
.
error
(
"订单接收OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"failed:"
+
e
.
getMessage
());
}
}
else
{
return
R
.
failed
(
OrderConstants
.
OPERATE_FAILED
);
}
}
}
}
}
...
@@ -682,7 +664,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
...
@@ -682,7 +664,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
* @throws IOException
* @throws IOException
*/
*/
@Override
@Override
public
void
receiveOrderNew
(
InputStream
inputStream
,
String
file1
,
String
orderNo
,
String
fileName
,
String
originalFileName
){
public
void
receiveOrderNew
(
InputStream
inputStream
,
String
file1
,
String
orderNo
,
String
fileName
,
String
originalFileName
){
R
<
Object
>
e
;
R
<
Object
>
e
;
if
(
file1
.
equals
(
"fileOne"
))
{
if
(
file1
.
equals
(
"fileOne"
))
{
getObjectR
(
inputStream
,
orderNo
,
fileName
,
originalFileName
,
CommonConstants
.
TWO_INTEGER
);
getObjectR
(
inputStream
,
orderNo
,
fileName
,
originalFileName
,
CommonConstants
.
TWO_INTEGER
);
...
...
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