Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
1695a097
Commit
1695a097
authored
Nov 18, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租车订单统计
parent
038a7f48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
OrderRentVehicleReceivedStatisticsBiz.java
...form/order/biz/OrderRentVehicleReceivedStatisticsBiz.java
+14
-11
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRentVehicleReceivedStatisticsBiz.java
View file @
1695a097
...
...
@@ -45,21 +45,24 @@ public class OrderRentVehicleReceivedStatisticsBiz extends BaseBiz<OrderRentVehi
List
<
OrderDTO
>
orderDTOS
=
baseOrderBiz
.
selectOrdersByTypeAndTime
(
Arrays
.
asList
(
StatisticsStatusEnum
.
ORDER_RENT_VEHICLE_TYPE
),
startDate
,
endDate
);
Map
<
String
,
Long
>
stateGroupMap
=
orderDTOS
.
stream
().
peek
(
x
->
{
x
.
setStateGroup
(
String
.
format
(
"%d-%d-%d-%d"
,
x
.
getCompanyId
(),
x
.
getOrderOrigin
(),
x
.
getPayWay
()
==
null
?
StatisticsStatusEnum
.
NO_PAY_WAY
:
x
.
getPayWay
(),
x
.
getStatus
()));
})
.
collect
(
Collectors
.
groupingBy
(
OrderDTO:
:
getStateGroup
,
Collectors
.
counting
()));
//订单账目信息
//
List<OrderAccountBo> orderAccountBoList = orderAccountBiz.selectByDate(startDate,endDate);
List
<
OrderAccountBo
>
orderAccountBoList
=
orderAccountBiz
.
selectByDate
(
startDate
,
endDate
);
//数据处理 把 未支付的单的支付方式 设置为 99
Map
<
String
,
List
<
Order
DTO
>>
ordersMap
=
orderDTOS
.
stream
().
peek
(
x
->
{
Map
<
String
,
List
<
Order
AccountBo
>>
ordersMap
=
orderAccountBoList
.
stream
().
peek
(
x
->
{
x
.
setStateGroup
(
String
.
format
(
"%d-%d-%d-%d"
,
x
.
getCompanyId
(),
x
.
getOrderOrigin
(),
x
.
getPayWay
()
==
null
?
StatisticsStatusEnum
.
NO_PAY_WAY
:
x
.
getPayWay
(),
x
.
getStatus
()));
}).
collect
(
Collectors
.
groupingBy
(
Order
DTO
:
:
getStateGroup
,
Collectors
.
toList
()));
}).
collect
(
Collectors
.
groupingBy
(
Order
AccountBo
:
:
getStateGroup
,
Collectors
.
toList
()));
if
(!
ordersMap
.
isEmpty
())
{
Set
<
Map
.
Entry
<
String
,
List
<
OrderDTO
>>>
ordersSet
=
ordersMap
.
entrySet
();
for
(
Map
.
Entry
<
String
,
List
<
OrderDTO
>>
orderEntry
:
ordersSet
)
{
Set
<
Map
.
Entry
<
String
,
List
<
OrderAccountBo
>>>
ordersSet
=
ordersMap
.
entrySet
();
for
(
Map
.
Entry
<
String
,
List
<
OrderAccountBo
>>
orderEntry
:
ordersSet
)
{
String
orderKey
=
orderEntry
.
getKey
();
List
<
Order
DTO
>
orderDTOList
=
orderEntry
.
getValue
();
List
<
Order
AccountBo
>
orderAccountBos
=
orderEntry
.
getValue
();
OrderRentVehicleReceivedStatistics
orderRentVehicleReceivedStatistics
=
StatisticsStatusEnum
.
wrapStatisticsObject
(
startDate
,
orderKey
,
new
OrderRentVehicleReceivedStatistics
());
/*
BigDecimal totalAmount = BigDecimal.ZERO;
BigDecimal
totalAmount
=
BigDecimal
.
ZERO
;
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
;
for
(
OrderAccountBo
orderAccountBo
:
orderAccountBos
)
{
OrderAccountDetail
accountDetailEntity
=
orderAccountBo
.
getAccountDetailEntity
();
...
...
@@ -70,10 +73,10 @@ public class OrderRentVehicleReceivedStatisticsBiz extends BaseBiz<OrderRentVehi
}
}
orderRentVehicleReceivedStatistics
.
setTotalAmount
(
totalAmount
);
long size = orderAccountBos.stream().map(OrderDTO::getId).distinct().count();
orderRentVehicleReceivedStatistics.setTotalQuantity(Integer.valueOf(String.valueOf(size)));*/
}
Long
totalQuantity
=
stateGroupMap
==
null
?
0L
:
stateGroupMap
.
get
(
orderKey
)==
null
?
0L
:
stateGroupMap
.
get
(
orderKey
);
orderRentVehicleReceivedStatistics
.
setTotalQuantity
(
totalQuantity
.
intValue
());
}
List
<
Integer
>
companyIds
=
vehicleFeign
.
findCompanyIdsByAreaId
(
null
);
List
stisticsActiveState
=
ordersMap
.
isEmpty
()
?
Collections
.
EMPTY_LIST
:
Lists
.
newArrayList
(
ordersMap
.
keySet
());
List
<
OrderRentVehicleReceivedStatistics
>
otherStatisticsStateGroupList
=
createOtherStatisticsStateGroupList
(
startDate
,
stisticsActiveState
,
companyIds
);
...
...
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