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
02c0b825
Commit
02c0b825
authored
Jun 25, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.5.5' into MVP1.5.5
parents
9405f607
bc362f75
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
317 deletions
+84
-317
EkpOrderController.java
...oud/plus/v1/yifu/order/controller/EkpOrderController.java
+28
-5
TOrderService.java
.../yifu/cloud/plus/v1/yifu/order/service/TOrderService.java
+5
-8
TOrderServiceImpl.java
...ud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
+47
-301
EkpOrderFileTask.java
.../yifu/cloud/plus/v1/yifu/order/util/EkpOrderFileTask.java
+4
-3
No files found.
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/controller/EkpOrderController.java
View file @
02c0b825
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
order
.
controller
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
order
.
controller
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
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.constants.OrderConstants
;
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.util.EkpOrderFileTask
;
import
com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO
;
import
com.yifu.cloud.plus.v1.yifu.order.vo.OrderAddVO
;
...
@@ -10,14 +13,17 @@ import io.swagger.v3.oas.annotations.media.Schema;
...
@@ -10,14 +13,17 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
/**
/**
...
@@ -33,10 +39,8 @@ import java.io.IOException;
...
@@ -33,10 +39,8 @@ import java.io.IOException;
public
class
EkpOrderController
{
public
class
EkpOrderController
{
@Resource
@Resource
private
TOrderService
tOrderService
;
private
TOrderService
tOrderService
;
@Autowired
@Autowired
private
EkpOrderFileTask
ekpOrderFileTask
;
private
EkpOrderFileTask
ekpOrderFileTask
;
/**
/**
* 接收处理ekp订单
* 接收处理ekp订单
*
*
...
@@ -62,8 +66,27 @@ public class EkpOrderController {
...
@@ -62,8 +66,27 @@ public class EkpOrderController {
*/
*/
@Schema
(
description
=
"接收处理ekp附件"
)
@Schema
(
description
=
"接收处理ekp附件"
)
@PostMapping
(
value
=
"/receiveOrderNew"
)
@PostMapping
(
value
=
"/receiveOrderNew"
)
public
R
receiveOrder
(
OrderAttVo
vo
)
{
public
R
receiveOrder
(
OrderAttVo
vo
)
throws
IOException
{
ekpOrderFileTask
.
receiveOrderNew
(
vo
);
if
(
Common
.
isEmpty
(
vo
.
getOrderNo
())){
return
R
.
failed
(
OrderConstants
.
ORDER_NO_IS_EMPTY
);
}
if
(
ArrayUtils
.
isNotEmpty
(
vo
.
getFile
())){
if
(
vo
.
getFile
().
length
>
CommonConstants
.
TWENTY_INT
){
return
R
.
failed
(
OrderConstants
.
ENCLOSURE_SIZE_ERROR
);
}
String
fileName
;
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
);
}
fileName
=
System
.
currentTimeMillis
()
+
"_"
+
multipartFile
.
getOriginalFilename
();
ekpOrderFileTask
.
receiveOrderNew
(
multipartFile
.
getInputStream
(),
vo
.
getFile1
(),
vo
.
getOrderNo
(),
fileName
,
multipartFile
.
getOriginalFilename
());
}
}
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/TOrderService.java
View file @
02c0b825
...
@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.order.vo.*;
...
@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -99,27 +100,23 @@ public interface TOrderService extends IService<TOrder> {
...
@@ -99,27 +100,23 @@ public interface TOrderService extends IService<TOrder> {
*/
*/
R
receiveOrder
(
OrderAddVO
vo
)
throws
IOException
;
R
receiveOrder
(
OrderAddVO
vo
)
throws
IOException
;
/**
/**
* 接收处理ekp
附件
* 接收处理ekp
订单回复
*
*
* @author licancan
* @author licancan
* @param vo
* @param vo
* @return {@link R}
* @return {@link R}
* @throws IOException
* @throws IOException
*/
*/
R
receiveOrderNew
(
OrderAttVo
vo
)
throws
IOException
;
R
receiveOrderReply
(
OrderReplyAddVO
vo
)
throws
IOException
;
/**
/**
* 接收处理ekp
订单回复
* 接收处理ekp
附件
*
*
* @author licancan
* @author licancan
* @param vo
* @return {@link R}
* @return {@link R}
* @throws IOException
* @throws IOException
*/
*/
R
receiveOrderReply
(
OrderReplyAddVO
vo
)
throws
IOException
;
void
receiveOrderNew
(
InputStream
inputStream
,
String
file1
,
String
orderNo
,
String
fileName
,
String
originalFileName
)
throws
IOException
;
/**
/**
* 订单作废
* 订单作废
...
...
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/service/impl/TOrderServiceImpl.java
View file @
02c0b825
This diff is collapsed.
Click to expand it.
yifu-order/yifu-order-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/order/util/EkpOrderFileTask.java
View file @
02c0b825
...
@@ -8,6 +8,7 @@ import org.springframework.scheduling.annotation.Async;
...
@@ -8,6 +8,7 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
/**
/**
* @Author fxj
* @Author fxj
...
@@ -28,12 +29,12 @@ public class EkpOrderFileTask {
...
@@ -28,12 +29,12 @@ public class EkpOrderFileTask {
* @return
* @return
**/
**/
@Async
@Async
public
void
receiveOrderNew
(
OrderAttVo
vo
){
public
void
receiveOrderNew
(
InputStream
inputStream
,
String
file1
,
String
orderNo
,
String
fileName
,
String
originalFileName
){
synchronized
(
this
){
synchronized
(
this
){
try
{
try
{
orderService
.
receiveOrderNew
(
vo
);
orderService
.
receiveOrderNew
(
inputStream
,
file1
,
orderNo
,
fileName
,
originalFileName
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"订单附件
删除
异常:"
,
e
);
log
.
error
(
"订单附件
上传
异常:"
,
e
);
}
}
}
}
}
}
...
...
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