Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
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
pseer
gxpt_ht
Commits
09801629
Commit
09801629
authored
Jun 12, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化订单导出
parent
8187d59e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+25
-23
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
09801629
...
...
@@ -47,6 +47,7 @@ import share.system.service.*;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -680,36 +681,37 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
List
<
SOrder
>
sOrders
=
selectSOrderList
(
sOrder
);
List
<
SOrderVo
>
sOrderVos
=
convertDosToVos
(
sOrders
);
List
<
SaobeiApiLog
>
saobeiApiLogs
=
saobeiApiLogService
.
list
();
//list转HashMap
List
<
SConsumerCoupon
>
sConsumerCoupons
=
consumerCouponService
.
queryList
();
Map
<
Long
,
SConsumerCoupon
>
map
=
sConsumerCoupons
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumerCoupon:
:
getId
,
Function
.
identity
()));
List
<
SCoupon
>
list
=
sCouponService
.
list
();
Map
<
Long
,
SCoupon
>
sCouponMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
SCoupon:
:
getId
,
Function
.
identity
()));
if
(
CollectionUtils
.
isNotEmpty
(
sOrderVos
))
{
for
(
SOrderVo
item
:
sOrderVos
)
{
sConsumerCoupons
.
stream
().
filter
(
sConsumerCoupon
->
sConsumerCoupon
.
getId
().
equals
(
item
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumerCoupon
->
{
item
.
setCouponPayPrice
(
sConsumerCoupon
.
getCouponPayPrice
());
item
.
setPlatformType
(
sConsumerCoupon
.
getPlatformType
());
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getDealgroupId
()))
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getDealgroupId
()));
}
else
{
list
.
stream
().
filter
(
sCoupon
->
sCoupon
.
getId
().
equals
(
sConsumerCoupon
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumer
->
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumer
.
getDealgroupId
()));
});
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getTiktokSkuId
()))
{
item
.
setCouponSkuId
(
sConsumerCoupon
.
getTiktokSkuId
());
}
else
{
list
.
stream
().
filter
(
sCoupon
->
sCoupon
.
getId
().
equals
(
sConsumerCoupon
.
getCouponId
())).
findFirst
().
ifPresent
(
sConsumer
->
{
item
.
setCouponSkuId
(
sConsumer
.
getTiktokSkuId
());
});
sOrderVos
.
stream
().
forEach
(
item
->
{
if
(
ObjectUtil
.
isNotEmpty
(
item
.
getCouponId
()))
{
SConsumerCoupon
sConsumerCoupon
=
map
.
get
(
item
.
getCouponId
());
if
(
ObjectUtil
.
isNotEmpty
(
sConsumerCoupon
))
{
item
.
setCouponPayPrice
(
sConsumerCoupon
.
getCouponPayPrice
());
item
.
setPlatformType
(
sConsumerCoupon
.
getPlatformType
());
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getDealgroupId
()))
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sConsumerCoupon
.
getDealgroupId
()));
}
else
{
item
.
setCouponSkuId
(
String
.
valueOf
(
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
()).
getDealgroupId
()));
}
}
else
if
(
sConsumerCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(!
ObjectUtils
.
isEmpty
(
sConsumerCoupon
.
getTiktokSkuId
()))
{
item
.
setCouponSkuId
(
sConsumerCoupon
.
getTiktokSkuId
());
}
else
{
item
.
setCouponSkuId
(
sCouponMap
.
get
(
sConsumerCoupon
.
getCouponId
()).
getTiktokSkuId
());
}
}
}
}
);
}
if
(
StringUtils
.
isNoneEmpty
(
item
.
getOutTradeNo
()))
{
item
.
setOutTradeNo
(
saobeiApiLogs
.
stream
().
filter
(
s
->
s
.
getTerminalTrace
().
equals
(
item
.
getOutTradeNo
())).
findFirst
().
orElse
(
null
).
getOutTradeNo
());
item
.
setOutTradeNo
(
saobeiApiLogs
.
stream
().
filter
(
saobeiApiLog
->
saobeiApiLog
.
getTerminalTrace
().
equals
(
item
.
getOutTradeNo
())).
findFirst
().
orElse
(
null
).
getOutTradeNo
());
}
}
}
);
}
sOrderVos
.
sort
(
Comparator
.
comparing
(
SOrderVo:
:
getCreateTime
).
reversed
());
return
sOrderVos
;
...
...
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