Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 72351f0c
authored
Jan 11, 2024
by
yangxiujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改上传
1 parent
46375f68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/FileController.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/FileController.java
View file @
72351f0
...
@@ -56,6 +56,7 @@ public class FileController {
...
@@ -56,6 +56,7 @@ public class FileController {
*/
*/
@PostMapping
(
"/file/upload"
)
@PostMapping
(
"/file/upload"
)
public
Result
upload
(
MultipartFile
file
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
public
Result
upload
(
MultipartFile
file
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
long
l
=
System
.
currentTimeMillis
();
String
token
=
request
.
getHeader
(
HttpHeaders
.
AUTHORIZATION
);
String
token
=
request
.
getHeader
(
HttpHeaders
.
AUTHORIZATION
);
if
(
StringUtils
.
isBlank
(
token
))
{
if
(
StringUtils
.
isBlank
(
token
))
{
throw
new
BusinessException
(
"用户未登录"
);
throw
new
BusinessException
(
"用户未登录"
);
...
@@ -83,7 +84,8 @@ public class FileController {
...
@@ -83,7 +84,8 @@ public class FileController {
EasyExcel
.
read
(
file
.
getInputStream
(),
OrderInfoExcelDTO
.
class
EasyExcel
.
read
(
file
.
getInputStream
(),
OrderInfoExcelDTO
.
class
,
new
ContractsListener
(
orderCreateService
,
token
,
response
)).
sheet
().
doRead
();
,
new
ContractsListener
(
orderCreateService
,
token
,
response
)).
sheet
().
doRead
();
long
l1
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"全部时间"
+(
l1
-
l
));
return
Result
.
success
();
return
Result
.
success
();
}
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
72351f0
...
@@ -274,6 +274,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
...
@@ -274,6 +274,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
public
void
saveBatch
(
List
<
OrderInfoExcelDTO
>
cachedDataList
,
String
token
,
ThreadLocal
local
,
HttpServletResponse
response
)
{
public
void
saveBatch
(
List
<
OrderInfoExcelDTO
>
cachedDataList
,
String
token
,
ThreadLocal
local
,
HttpServletResponse
response
)
{
FileRateDTO
fileRateDTO
=
new
FileRateDTO
();
FileRateDTO
fileRateDTO
=
new
FileRateDTO
();
ArrayList
<
OrderInfoErrorExcelDTO
>
errorList
=
(
ArrayList
<
OrderInfoErrorExcelDTO
>)
local
.
get
();
ArrayList
<
OrderInfoErrorExcelDTO
>
errorList
=
(
ArrayList
<
OrderInfoErrorExcelDTO
>)
local
.
get
();
if
(
errorList
==
null
){
errorList
=
new
ArrayList
<
OrderInfoErrorExcelDTO
>();
local
.
set
(
errorList
);
}
Integer
successCount
=
0
;
Integer
successCount
=
0
;
if
(
tokenCount
.
get
(
token
)
!=
null
)
{
if
(
tokenCount
.
get
(
token
)
!=
null
)
{
throw
new
BusinessException
(
"用户正在上传中,请稍后再试"
);
throw
new
BusinessException
(
"用户正在上传中,请稍后再试"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment