Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
0ad857fa
Commit
0ad857fa
authored
Oct 25, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询订单餐盒费配置增加外卖和打包带走判断
parent
509e0b82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
shopping-cart-application-service/src/main/java/cn/freemud/handle/CommonFunctionHandle.java
+23
-20
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/handle/CommonFunctionHandle.java
View file @
0ad857fa
...
@@ -38,26 +38,29 @@ public class CommonFunctionHandle {
...
@@ -38,26 +38,29 @@ public class CommonFunctionHandle {
* 查询配置,比较配送费
* 查询配置,比较配送费
*/
*/
public
Long
packAmountConfig
(
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
Long
newPackAmount
,
Long
totalAmount
)
{
public
Long
packAmountConfig
(
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
Long
newPackAmount
,
Long
totalAmount
)
{
if
(
newPackAmount
==
0
){
if
(
Objects
.
equals
(
shoppingCartInfoRequestVo
.
getOrderType
(),
CreateOrderType
.
TAKE_OUT
.
getCode
())
return
newPackAmount
;
||
Objects
.
equals
(
shoppingCartInfoRequestVo
.
getReachStoreType
(),
OrderType
.
COLLECT_GOODS
.
getCode
()))
{
}
if
(
newPackAmount
==
0
){
String
redisKey
=
RedisUtil
.
packAmountConfig
+
shoppingCartInfoRequestVo
.
getPartnerId
()
+
"_"
+
null
;
return
newPackAmount
;
String
value
=
redisCache
.
hashGet
(
redisKey
,
"packAmountType"
);
}
if
(
StringUtils
.
isEmpty
(
value
)){
String
redisKey
=
RedisUtil
.
packAmountConfig
+
shoppingCartInfoRequestVo
.
getPartnerId
()
+
"_"
+
null
;
return
newPackAmount
;
String
value
=
redisCache
.
hashGet
(
redisKey
,
"packAmountType"
);
}
if
(
StringUtils
.
isEmpty
(
value
)){
return
newPackAmount
;
PackAmountConfig
packAmountConfig
=
JSONObject
.
parseObject
(
value
,
PackAmountConfig
.
class
);
}
if
(
packAmountConfig
==
null
||
CollectionUtils
.
isEmpty
(
packAmountConfig
.
getCollectType
())){
ApiLog
.
printLog
(
"查询订单餐盒费配置"
,
String
.
valueOf
(
newPackAmount
),
String
.
valueOf
(
totalAmount
),
value
);
return
newPackAmount
;
PackAmountConfig
packAmountConfig
=
JSONObject
.
parseObject
(
value
,
PackAmountConfig
.
class
);
}
if
(
packAmountConfig
==
null
||
CollectionUtils
.
isEmpty
(
packAmountConfig
.
getCollectType
())){
List
<
PackAmountConfig
.
CollectType
>
collectTypes
=
packAmountConfig
.
getCollectType
();
return
newPackAmount
;
collectTypes
.
sort
((
p1
,
p2
)
->
p2
.
getOrderAmount
()
-
p1
.
getOrderAmount
());
}
newPackAmount
=
0L
;
List
<
PackAmountConfig
.
CollectType
>
collectTypes
=
packAmountConfig
.
getCollectType
();
for
(
PackAmountConfig
.
CollectType
collectType:
collectTypes
){
collectTypes
.
sort
((
p1
,
p2
)
->
p2
.
getOrderAmount
()
-
p1
.
getOrderAmount
());
if
(
totalAmount
>
collectType
.
getOrderAmount
()){
newPackAmount
=
0L
;
newPackAmount
=
collectType
.
getFee
().
longValue
();
for
(
PackAmountConfig
.
CollectType
collectType:
collectTypes
){
break
;
if
(
totalAmount
>
collectType
.
getOrderAmount
()){
newPackAmount
=
collectType
.
getFee
().
longValue
();
break
;
}
}
}
}
}
return
newPackAmount
;
return
newPackAmount
;
...
...
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