Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
1d0f8556
Commit
1d0f8556
authored
May 09, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
execl 导出调整
parent
4611cced
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
175 additions
and
0 deletions
+175
-0
OrderExportController.java
...e/order/controller/admin/order/OrderExportController.java
+175
-0
No files found.
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/order/OrderExportController.java
View file @
1d0f8556
...
...
@@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSONObject;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -25,7 +26,10 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
...
...
@@ -54,6 +58,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -75,11 +80,168 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
}
public
void
caseStatus
(
List
<
Integer
>
status
,
OrderQueryDTO
query
){
if
(
CollectionUtils
.
isNotEmpty
(
status
)
&&
status
.
size
()>
0
)
{
List
<
Integer
>
statusList
=
new
ArrayList
<>()
;
status
.
forEach
(
statu
->{
if
(
statu
>
10000
){
combinedState
(
statu
,
query
,
statusList
);
}
});
statusList
.
stream
().
distinct
();
List
<
Integer
>
list
=
new
ArrayList
<>()
;
list
.
addAll
(
status
.
stream
().
filter
(
s
->
s
<
10000
).
collect
(
Collectors
.
toList
()))
;
list
.
addAll
(
statusList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
query
.
setStatusList
(
list
)
;
}
else
if
(
CollectionUtils
.
isNotEmpty
(
status
)
&&
status
.
size
()==
0
){
status
=
null
;
}
}
private
void
combinedState
(
Integer
asStatus
,
OrderQueryDTO
query
,
List
<
Integer
>
statusList
)
{
switch
(
asStatus
)
{
case
12325
:
//this.status = 12;
statusList
.
add
(
12
);
query
.
setShipmentState
(
325
);
break
;
case
10501
:
// 空运待出
//this.status = 5;
statusList
.
add
(
5
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setAirShipment
(
1
);
//this.auditType = 0;
if
(
CollectionUtils
.
isEmpty
(
query
.
getAuditType
())){
List
<
Integer
>
audits
=
new
ArrayList
<>();
query
.
setAuditType
(
audits
)
;
query
.
getAuditType
().
add
(
0
)
;
}
else
{
query
.
getAuditType
().
add
(
0
)
;
}
//this.abnormalState = 0;
if
(
CollectionUtils
.
isEmpty
(
query
.
getAbnormalState
())){
List
<
Integer
>
audits
=
new
ArrayList
<>();
query
.
setAbnormalState
(
audits
);
query
.
getAbnormalState
().
add
(
0
)
;
}
else
{
query
.
getAbnormalState
().
add
(
0
)
;
}
break
;
case
10502
:
// 空运可出
//this.status = 5;
statusList
.
add
(
5
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setAirShipment
(
12
)
;
// 可出、备货中
break
;
case
10503
:
// 空运已备货
//this.status = 5;
statusList
.
add
(
5
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setAirShipment
(
4
)
;
// 已备货
break
;
case
10504
:
// 待排单
//this.status = 5;
statusList
.
add
(
5
);
if
(
Objects
.
nonNull
(
query
.
getTransportId
())
&&
query
.
getTransportId
()
==
3
)
{
// 空运无需判断备货状态 可出、备货中、已备货
query
.
setAirShipment
(
10
)
;
}
else
{
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
query
.
setAirShipment
(
20
)
;
}
//this.auditType = 0;
if
(
CollectionUtils
.
isEmpty
(
query
.
getAuditType
())){
List
<
Integer
>
audits
=
new
ArrayList
<>();
query
.
setAuditType
(
audits
)
;
query
.
getAuditType
().
add
(
0
);
}
else
{
query
.
getAuditType
().
add
(
0
)
;
}
//this.abnormalState = 0;
if
(
CollectionUtils
.
isEmpty
(
query
.
getAbnormalState
())){
List
<
Integer
>
audits
=
new
ArrayList
<>();
query
.
setAbnormalState
(
audits
);
query
.
getAbnormalState
().
add
(
0
)
;
}
else
{
query
.
getAbnormalState
().
add
(
0
)
;
}
break
;
case
132411
:
// 空运已出货
//this.status = 32;
statusList
.
add
(
32
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setShipmentState
(
411
);
break
;
case
132412
:
// 空运已出仓
//this.status = 32;
statusList
.
add
(
32
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setShipmentState
(
412
);
break
;
case
132409
:
// 空运已理货
//this.status = 32;
statusList
.
add
(
32
);
// 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setShipmentState
(
409
);
break
;
case
118428
:
// 空运已到港
//this.status = 18;
statusList
.
add
(
18
);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if
(
Objects
.
nonNull
(
query
.
getTransportId
())){
query
.
setTransportId
(
3
);
}
query
.
setShipmentState
(
428
);
break
;
}
}
@GetMapping
(
"dept/search"
)
@ApiOperation
(
value
=
"参数搜索导出部门订单管理 Excel"
,
notes
=
"参数搜索和指定部门订单导出管理"
)
...
...
@@ -96,6 +258,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -114,6 +277,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -131,6 +295,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -148,6 +313,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -166,6 +332,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -186,6 +353,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -206,6 +374,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -226,6 +395,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -246,6 +416,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -268,6 +439,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -290,6 +462,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -312,6 +485,7 @@ public class OrderExportController {
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
reqDTO
.
setLang
(
I18nMessage
.
getLang
());
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
fileMakeApi
.
sendFileMake
(
reqDTO
);
return
success
(
true
);
...
...
@@ -350,6 +524,7 @@ public class OrderExportController {
reqDTO
.
setFileSuffix
(
"xlsx"
);
reqDTO
.
setTemporaryFile
(
true
);
reqDTO
.
setUserType
(
2
);
caseStatus
(
query
.
getStatus
(),
query
);
reqDTO
.
setRequestParams
(
JSONObject
.
toJSONString
(
query
));
return
success
(
true
);
}
...
...
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