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
8b40cf68
Commit
8b40cf68
authored
Dec 27, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
0c06e9e7
aa438504
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
9 deletions
+40
-9
LargeScreenDisplayConstantDataBo.java
...c/platform/order/bo/LargeScreenDisplayConstantDataBo.java
+8
-0
OrderProfileDisplayBiz.java
...a/com/xxfc/platform/order/biz/OrderProfileDisplayBiz.java
+32
-9
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/bo/LargeScreenDisplayConstantDataBo.java
View file @
8b40cf68
...
@@ -26,6 +26,14 @@ public class LargeScreenDisplayConstantDataBo implements Serializable {
...
@@ -26,6 +26,14 @@ public class LargeScreenDisplayConstantDataBo implements Serializable {
* 订单基础单量
* 订单基础单量
*/
*/
private
int
baseOrderNum
;
private
int
baseOrderNum
;
/**
* 当日基础订单量
*/
private
long
baseTodayOrderNum
;
/**
* 当日基础金额
*/
private
BigDecimal
baseTodayOrderAmount
=
BigDecimal
.
ZERO
;
/**
/**
* 微信支付占比率
* 微信支付占比率
*/
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderProfileDisplayBiz.java
View file @
8b40cf68
...
@@ -80,6 +80,10 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -80,6 +80,10 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
Dictionary
largeScreenConstantDictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
largeScreenType
,
largeScreenCode
);
Dictionary
largeScreenConstantDictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
largeScreenType
,
largeScreenCode
);
if
(
Objects
.
nonNull
(
largeScreenConstantDictionary
)
&&
StringUtils
.
hasText
(
largeScreenConstantDictionary
.
getDetail
()))
{
if
(
Objects
.
nonNull
(
largeScreenConstantDictionary
)
&&
StringUtils
.
hasText
(
largeScreenConstantDictionary
.
getDetail
()))
{
largeScreenDisplayConstantDataBo
=
JSON
.
parseObject
(
largeScreenConstantDictionary
.
getDetail
(),
LargeScreenDisplayConstantDataBo
.
class
);
largeScreenDisplayConstantDataBo
=
JSON
.
parseObject
(
largeScreenConstantDictionary
.
getDetail
(),
LargeScreenDisplayConstantDataBo
.
class
);
orderProfileDispayVo
.
setTodayOrderNum
(
largeScreenDisplayConstantDataBo
.
getBaseTodayOrderNum
());
orderProfileDispayVo
.
setTodayOrderAmount
(
largeScreenDisplayConstantDataBo
.
getBaseTodayOrderAmount
());
orderProfileDispayVo
.
setOrderAmount
(
largeScreenDisplayConstantDataBo
.
getBaseOrderAmount
());
orderProfileDispayVo
.
setOrderNum
(
largeScreenDisplayConstantDataBo
.
getBaseOrderNum
());
}
}
//2.1查询订单数据
//2.1查询订单数据
...
@@ -125,12 +129,6 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -125,12 +129,6 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
log
.
error
(
"统计出错:【{}】"
,
e
);
log
.
error
(
"统计出错:【{}】"
,
e
);
}
}
//1.基础金额 + 真实金额 基础订单量+真实订单量
long
totalOrderNum
=
orderProfileDispayVo
.
getOrderNum
()
+
largeScreenDisplayConstantDataBo
.
getBaseOrderNum
();
BigDecimal
totalOrderAmount
=
orderProfileDispayVo
.
getOrderAmount
().
add
(
largeScreenDisplayConstantDataBo
.
getBaseOrderAmount
());
orderProfileDispayVo
.
setOrderAmount
(
totalOrderAmount
);
orderProfileDispayVo
.
setOrderNum
(
totalOrderNum
);
largeScreenDisplayDataVo
.
setOrderProfileDispayData
(
orderProfileDispayVo
);
largeScreenDisplayDataVo
.
setOrderProfileDispayData
(
orderProfileDispayVo
);
return
largeScreenDisplayDataVo
;
return
largeScreenDisplayDataVo
;
}
}
...
@@ -150,11 +148,15 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -150,11 +148,15 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
OrderPayProfileDispalyVo
orderPayProfileDispalyVo
=
new
OrderPayProfileDispalyVo
();
OrderPayProfileDispalyVo
orderPayProfileDispalyVo
=
new
OrderPayProfileDispalyVo
();
BigDecimal
orderAmountConstant
=
CollectionUtils
.
isEmpty
(
orderProfileDisplays
)
?
BigDecimal
.
ZERO
:
BigDecimal
orderAmountConstant
=
CollectionUtils
.
isEmpty
(
orderProfileDisplays
)
?
BigDecimal
.
ZERO
:
orderProfileDisplays
.
stream
().
map
(
OrderProfileDisplay:
:
getOrderAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
orderProfileDisplays
.
stream
().
map
(
OrderProfileDisplay:
:
getOrderAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
//订单总金额
orderAmountConstant
=
orderAmountConstant
.
add
(
largeScreenDisplayConstantDataBo
.
getBaseTodayOrderAmount
()).
add
(
largeScreenDisplayConstantDataBo
.
getBaseOrderAmount
());
//1.支付方式统计
//1.支付方式统计
wrapToPayProfileWithPayWay
(
baseOrders
,
orderAmountConstant
,
largeScreenDisplayConstantDataBo
,
orderPayProfileDispalyVo
);
wrapToPayProfileWithPayWay
(
baseOrders
,
orderAmountConstant
,
largeScreenDisplayConstantDataBo
,
orderPayProfileDispalyVo
);
//2.支付终端统计
//2.支付终端统计
wrapToPayProfileWithPayTerminal
(
baseOrders
,
orderAmountConstant
,
largeScreenDisplayConstantDataBo
,
orderPayProfileDispalyVo
);
wrapToPayProfileWithPayTerminal
(
baseOrders
,
orderAmountConstant
,
largeScreenDisplayConstantDataBo
,
orderPayProfileDispalyVo
);
//累计订单金额
orderProfileDispayVo
.
setOrderAmount
(
orderAmountConstant
);
orderProfileDispayVo
.
setOrderPayProfileDisplay
(
orderPayProfileDispalyVo
);
orderProfileDispayVo
.
setOrderPayProfileDisplay
(
orderPayProfileDispalyVo
);
return
orderProfileDispayVo
;
return
orderProfileDispayVo
;
}
}
...
@@ -245,12 +247,15 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -245,12 +247,15 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
Map
<
Date
,
BigDecimal
>
orderAmountMap
=
baseOrderDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
BaseOrderDTO:
:
getPayDate
,
CollectorsUtil
.
summingBigDecimal
(
BaseOrderDTO:
:
getRealAmount
)));
Map
<
Date
,
BigDecimal
>
orderAmountMap
=
baseOrderDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
BaseOrderDTO:
:
getPayDate
,
CollectorsUtil
.
summingBigDecimal
(
BaseOrderDTO:
:
getRealAmount
)));
//2.某个时间段的订单统计
//2.某个时间段的订单统计
//2.1 订单金额
//2.1 订单金额
List
<
OrderProfileVo
>
orderProfileVos
=
createOrderProfiles
(
orderAmountMap
);
List
<
OrderProfileVo
>
orderProfileVos
=
createOrderProfiles
(
orderAmountMap
,
orderProfileDispayVo
.
getTodayOrderAmount
()
);
//2.2 订单量
//2.2 订单量
wrapBaseDateToOrderProfileDispay
(
baseOrders
,
orderProfileDispayVo
);
wrapBaseDateToOrderProfileDispay
(
baseOrders
,
orderProfileDispayVo
);
//3.今日金额
//3.今日金额
Date
date
=
DateUtil
.
beginOfDay
(
new
Date
()).
toJdkDate
();
Date
date
=
DateUtil
.
beginOfDay
(
new
Date
()).
toJdkDate
();
BigDecimal
todayOrderAmount
=
orderAmountMap
==
null
?
BigDecimal
.
ZERO
:
orderAmountMap
.
get
(
date
)
==
null
?
BigDecimal
.
ZERO
:
orderAmountMap
.
get
(
date
);
BigDecimal
todayOrderAmount
=
orderAmountMap
==
null
?
BigDecimal
.
ZERO
:
orderAmountMap
.
get
(
date
)
==
null
?
BigDecimal
.
ZERO
:
orderAmountMap
.
get
(
date
);
//3.1真实金额+基础金额
todayOrderAmount
=
todayOrderAmount
.
add
(
orderProfileDispayVo
.
getTodayOrderAmount
());
orderProfileDispayVo
.
setTodayOrderAmount
(
todayOrderAmount
);
orderProfileDispayVo
.
setTodayOrderAmount
(
todayOrderAmount
);
orderProfileDispayVo
.
setOrderProfiles
(
orderProfileVos
);
orderProfileDispayVo
.
setOrderProfiles
(
orderProfileVos
);
return
orderProfileDispayVo
;
return
orderProfileDispayVo
;
...
@@ -271,7 +276,12 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -271,7 +276,12 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
Date
date
=
DateUtil
.
beginOfDay
(
new
Date
()).
toJdkDate
();
Date
date
=
DateUtil
.
beginOfDay
(
new
Date
()).
toJdkDate
();
//今日订单量
//今日订单量
long
todayOrderNum
=
orderNumMap
.
get
(
date
)
==
null
?
0
:
orderNumMap
.
get
(
date
);
long
todayOrderNum
=
orderNumMap
.
get
(
date
)
==
null
?
0
:
orderNumMap
.
get
(
date
);
//真实订单量 + 基础订单量
todayOrderNum
=
todayOrderNum
+
orderProfileDispayVo
.
getTodayOrderNum
();
//总订单量
long
totalOrderNum
=
orderProfileDispayVo
.
getOrderNum
()+
baseOrderDTOS
.
size
()+
orderProfileDispayVo
.
getTodayOrderNum
();
orderProfileDispayVo
.
setTodayOrderNum
(
todayOrderNum
);
orderProfileDispayVo
.
setTodayOrderNum
(
todayOrderNum
);
orderProfileDispayVo
.
setOrderNum
(
totalOrderNum
);
return
orderProfileDispayVo
;
return
orderProfileDispayVo
;
}
}
...
@@ -281,7 +291,7 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -281,7 +291,7 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
* @param orderAmountMap
* @param orderAmountMap
* @return
* @return
*/
*/
private
List
<
OrderProfileVo
>
createOrderProfiles
(
Map
<
Date
,
BigDecimal
>
orderAmountMap
)
{
private
List
<
OrderProfileVo
>
createOrderProfiles
(
Map
<
Date
,
BigDecimal
>
orderAmountMap
,
BigDecimal
baseTodayOrderAmount
)
{
List
<
OrderProfileVo
>
orderProfileVos
=
new
ArrayList
<>();
List
<
OrderProfileVo
>
orderProfileVos
=
new
ArrayList
<>();
if
(
orderAmountMap
==
null
||
orderAmountMap
.
isEmpty
())
{
if
(
orderAmountMap
==
null
||
orderAmountMap
.
isEmpty
())
{
return
orderProfileVos
;
return
orderProfileVos
;
...
@@ -289,14 +299,27 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
...
@@ -289,14 +299,27 @@ public class OrderProfileDisplayBiz extends BaseBiz<OrderProfileDisplayMapper, O
Set
<
Map
.
Entry
<
Date
,
BigDecimal
>>
orderAmountEntrySet
=
orderAmountMap
.
entrySet
();
Set
<
Map
.
Entry
<
Date
,
BigDecimal
>>
orderAmountEntrySet
=
orderAmountMap
.
entrySet
();
Iterator
<
Map
.
Entry
<
Date
,
BigDecimal
>>
orderAmountIterator
=
orderAmountEntrySet
.
iterator
();
Iterator
<
Map
.
Entry
<
Date
,
BigDecimal
>>
orderAmountIterator
=
orderAmountEntrySet
.
iterator
();
OrderProfileVo
orderProfileVo
;
OrderProfileVo
orderProfileVo
;
Date
date
=
DateUtil
.
beginOfDay
(
new
Date
()).
toJdkDate
();
boolean
isToday
=
(
orderAmountMap
==
null
||
orderAmountMap
.
isEmpty
())?
false
:
Objects
.
nonNull
(
orderAmountMap
.
get
(
date
));
while
(
orderAmountIterator
.
hasNext
())
{
while
(
orderAmountIterator
.
hasNext
())
{
Map
.
Entry
<
Date
,
BigDecimal
>
orderAmountMapEntry
=
orderAmountIterator
.
next
();
Map
.
Entry
<
Date
,
BigDecimal
>
orderAmountMapEntry
=
orderAmountIterator
.
next
();
orderProfileVo
=
new
OrderProfileVo
();
orderProfileVo
=
new
OrderProfileVo
();
orderProfileVo
.
setOrderDate
(
orderAmountMapEntry
.
getKey
());
orderProfileVo
.
setOrderDate
(
orderAmountMapEntry
.
getKey
());
orderProfileVo
.
setOrderAmount
(
orderAmountMapEntry
.
getValue
());
BigDecimal
orderAmount
=
orderAmountMapEntry
.
getValue
();
if
(
isToday
){
orderAmount
=
orderAmount
.
add
(
baseTodayOrderAmount
);
}
orderProfileVo
.
setOrderAmount
(
orderAmount
);
orderProfileVo
.
setDate
(
DateUtil
.
format
(
orderProfileVo
.
getOrderDate
(),
"MM.dd"
));
orderProfileVo
.
setDate
(
DateUtil
.
format
(
orderProfileVo
.
getOrderDate
(),
"MM.dd"
));
orderProfileVos
.
add
(
orderProfileVo
);
orderProfileVos
.
add
(
orderProfileVo
);
}
}
if
(!
isToday
){
OrderProfileVo
todayOrderProfileVo
=
new
OrderProfileVo
();
todayOrderProfileVo
.
setOrderDate
(
date
);
todayOrderProfileVo
.
setOrderAmount
(
baseTodayOrderAmount
);
orderProfileVos
.
add
(
todayOrderProfileVo
);
}
orderProfileVos
.
sort
(
Comparator
.
comparing
(
OrderProfileVo:
:
getOrderDate
));
orderProfileVos
.
sort
(
Comparator
.
comparing
(
OrderProfileVo:
:
getOrderDate
));
return
orderProfileVos
;
return
orderProfileVos
;
}
}
...
...
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