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
07091dfc
Commit
07091dfc
authored
Jun 14, 2023
by
wangzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature-wzb :bug修复
parent
02d4e005
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
389 additions
and
271 deletions
+389
-271
OrderAttVo.java
...java/com/yifu/cloud/plus/v1/yifu/order/vo/OrderAttVo.java
+35
-0
EkpOrderController.java
...oud/plus/v1/yifu/order/controller/EkpOrderController.java
+16
-0
TOrderService.java
.../yifu/cloud/plus/v1/yifu/order/service/TOrderService.java
+12
-0
TOrderServiceImpl.java
...ud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
+326
-271
No files found.
yifu-order/yifu-order-api/src/main/java/com/yifu/cloud/plus/v1/yifu/order/vo/OrderAttVo.java
0 → 100644
View file @
07091dfc
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
order
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.Serializable
;
@Data
public
class
OrderAttVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6620652346415180825L
;
/**
* 订单编号
*/
@Schema
(
description
=
"订单编号"
)
private
String
orderNo
;
/**
* 订标识
*/
@Schema
(
description
=
"唯一标识"
)
private
String
file1
;
/**
* 附件
*/
@Schema
(
description
=
"附件"
)
private
MultipartFile
[]
file
;
}
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/controller/EkpOrderController.java
View file @
07091dfc
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.order.controller;
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.order.controller;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.order.service.TOrderService
;
import
com.yifu.cloud.plus.v1.yifu.order.service.TOrderService
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyAddVO
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyAddVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -47,6 +48,21 @@ public class EkpOrderController {
...
@@ -47,6 +48,21 @@ public class EkpOrderController {
return
tOrderService
.
receiveOrder
(
vo
);
return
tOrderService
.
receiveOrder
(
vo
);
}
}
/**
* 接收处理ekp
*
* @author licancan
* @param vo
* @return {@link R}
* @throws IOException
*/
@Schema
(
description
=
"接收处理ekp附件"
)
@PostMapping
(
value
=
"/receiveOrderNew"
)
public
R
receiveOrder
(
OrderAttVo
vo
)
throws
IOException
{
return
tOrderService
.
receiveOrderNew
(
vo
);
}
/**
/**
* 接收处理ekp订单回复
* 接收处理ekp订单回复
*
*
...
...
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/TOrderService.java
View file @
07091dfc
...
@@ -99,6 +99,18 @@ public interface TOrderService extends IService<TOrder> {
...
@@ -99,6 +99,18 @@ public interface TOrderService extends IService<TOrder> {
*/
*/
R
receiveOrder
(
OrderAddVO
vo
)
throws
IOException
;
R
receiveOrder
(
OrderAddVO
vo
)
throws
IOException
;
/**
* 接收处理ekp附件
*
* @author licancan
* @param vo
* @return {@link R}
* @throws IOException
*/
R
receiveOrderNew
(
OrderAttVo
vo
)
throws
IOException
;
/**
/**
* 接收处理ekp订单回复
* 接收处理ekp订单回复
*
*
...
...
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
View file @
07091dfc
...
@@ -573,278 +573,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
...
@@ -573,278 +573,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getWageFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getWageFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
TWO_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getSalaryFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getWageFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
THREE_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getSocialFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getSocialFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
FOUR_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getFundFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getFundFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
FIVE_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getInsuranceFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getInsuranceFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
SIX_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getWithHoldingFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getWithHoldingFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
SEVEN_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getCollectionFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getCollectionFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
EIGHT_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getNoTaxFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getNoTaxFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
NINE_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getOtherFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getOtherFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
TEN_INTEGER
);
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
);
}
}
}
if
(
save
&&
ArrayUtils
.
isNotEmpty
(
vo
.
getSalaryHandoverFile
())){
for
(
MultipartFile
multipartFile
:
vo
.
getOtherFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
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
.
ELEVEN_INTEGER
);
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
);
}
}
}
return
R
.
ok
(
OrderConstants
.
OPERATE_SUCCESS
);
return
R
.
ok
(
OrderConstants
.
OPERATE_SUCCESS
);
}
}
...
@@ -938,6 +667,332 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
...
@@ -938,6 +667,332 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
return
R
.
ok
(
OrderConstants
.
OPERATE_SUCCESS
);
return
R
.
ok
(
OrderConstants
.
OPERATE_SUCCESS
);
}
}
/**
* 接收处理ekp订单回复
*
* @author licancan
* @param vo
* @return {@link R}
* @throws IOException
*/
@Override
public
R
receiveOrderNew
(
OrderAttVo
vo
)
throws
IOException
{
if
(
Common
.
isEmpty
(
vo
.
getOrderNo
())){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EMPTY
);
}
TOrder
one
=
this
.
getOne
(
Wrappers
.<
TOrder
>
query
().
lambda
()
.
eq
(
TOrder:
:
getOrderNo
,
vo
.
getOrderNo
())
.
eq
(
TOrder:
:
getDeleteFlag
,
CommonConstants
.
ZERO_INT
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
())){
if
(
vo
.
getFile
().
length
>
CommonConstants
.
TWENTY_INT
){
return
R
.
failed
(
OrderConstants
.
ENCLOSURE_SIZE_ERROR
);
}
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
if
(!
Common
.
checkInsuranceFile
(
multipartFile
.
getOriginalFilename
())){
return
R
.
failed
(
OrderConstants
.
ENCLOSURE_TYPE_IS_ERROR
);
}
if
(
multipartFile
.
getSize
()
>
(
CommonConstants
.
FIFTY_INT
*
CommonConstants
.
BYTE
*
CommonConstants
.
BYTE
)){
return
R
.
failed
(
OrderConstants
.
ENCLOSURE_SIZE_ERROR
);
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileOne"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
TWO_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileTwo"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
THREE_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileThree"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
FOUR_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileFour"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
FIVE_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileFive"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
SIX_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileSix"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
SEVEN_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileSeven"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
EIGHT_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileEigth"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
NINE_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileNine"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
TEN_INTEGER
);
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
);
}
}
}
}
if
(
vo
.
getFile1
().
equals
(
"fileTen"
))
{
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
()))
{
for
(
MultipartFile
multipartFile
:
vo
.
getFile
())
{
String
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
//filePath不传默认存储空间的根目录
//支持的附件格式
String
key
=
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
multipartFile
.
getInputStream
(),
key
,
null
);
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
TOrderEnclosure
orderEnclosure
=
new
TOrderEnclosure
();
orderEnclosure
.
setOrderNo
(
vo
.
getOrderNo
());
orderEnclosure
.
setEnclosureName
(
multipartFile
.
getOriginalFilename
());
orderEnclosure
.
setEnclosureFlag
(
CommonConstants
.
THREE_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
);
}
}
}
}
return
R
.
ok
(
OrderConstants
.
OPERATE_SUCCESS
);
}
public
R
invalidOrder
(
String
id
)
{
public
R
invalidOrder
(
String
id
)
{
TOrder
one
=
baseMapper
.
selectById
(
id
);
TOrder
one
=
baseMapper
.
selectById
(
id
);
if
(
Common
.
isNotNull
(
one
)
&&
CommonConstants
.
ZERO_INT
!=
one
.
getOrderStatus
())
{
if
(
Common
.
isNotNull
(
one
)
&&
CommonConstants
.
ZERO_INT
!=
one
.
getOrderStatus
())
{
...
...
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