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
jenkins
order-group
Commits
1ba8a361
Commit
1ba8a361
authored
Mar 23, 2020
by
姜海波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整配送费显示
parent
50dc0f01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
shopping-cart-application-service/src/main/java/cn/freemud/constant/ApplicationConstant.java
+3
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+14
-6
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/constant/ApplicationConstant.java
View file @
1ba8a361
...
@@ -18,5 +18,7 @@ public class ApplicationConstant {
...
@@ -18,5 +18,7 @@ public class ApplicationConstant {
public
final
static
String
BURYINGPOINT
=
"POINT"
;
public
final
static
String
BURYINGPOINT
=
"POINT"
;
public
final
static
String
DELIVERY_DISCOUNT_DESC
=
"订单满%d元 【减%d配送费】 & 【免配送费】"
;
public
final
static
String
DELIVERY_DISCOUNT_DESC1
=
"订单满%d元 减%d配送费"
;
public
final
static
String
DELIVERY_DISCOUNT_DESC2
=
"订单满%d元 免配送费"
;
public
final
static
String
DELIVERY_DISCOUNT_DESC3
=
"另需配送费%d元"
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
1ba8a361
...
@@ -72,7 +72,7 @@ import java.util.*;
...
@@ -72,7 +72,7 @@ import java.util.*;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
cn
.
freemud
.
constant
.
ApplicationConstant
.
DELIVERY_DISCOUNT_DESC
;
import
static
cn
.
freemud
.
constant
.
ApplicationConstant
.
*
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_INVALIAD_GOODS
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_INVALIAD_GOODS
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
...
@@ -1001,23 +1001,31 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1001,23 +1001,31 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
.
findFirst
();
.
findFirst
();
if
(
discount
.
isPresent
())
{
if
(
discount
.
isPresent
())
{
String
desc
=
DELIVERY_DISCOUNT_DESC
;
if
(
calculationDiscountResult
.
getDistributionFee
()>
0
){
String
desc
=
DELIVERY_DISCOUNT_DESC1
;
shoppingCartGoodsResponseVo
.
setDeliveryDiscountDesc
(
String
.
format
(
desc
,
discount
.
get
().
getThresholdAmount
()
/
100
,
(
calculationDiscountResult
.
getDeliveryAmount
()
-
calculationDiscountResult
.
getDistributionFee
())
/
100
));
}
else
{
String
desc
=
DELIVERY_DISCOUNT_DESC2
;
shoppingCartGoodsResponseVo
.
setDeliveryDiscountDesc
(
String
.
format
(
desc
,
discount
.
get
().
getThresholdAmount
()
/
100
));
}
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDistributionFee
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDistributionFee
());
shoppingCartGoodsResponseVo
.
setThresholdAmount
(
discount
.
get
().
getThresholdAmount
());
shoppingCartGoodsResponseVo
.
setThresholdAmount
(
discount
.
get
().
getThresholdAmount
());
shoppingCartGoodsResponseVo
.
setDeliveryDiscountDesc
(
String
.
format
(
desc
,
discount
.
get
().
getThresholdAmount
()
/
100
,
(
calculationDiscountResult
.
getDeliveryAmount
()
-
calculationDiscountResult
.
getDistributionFee
())
/
100
));
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
true
);
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
true
);
}
else
{
}
else
{
String
desc
=
DELIVERY_DISCOUNT_DESC3
;
shoppingCartGoodsResponseVo
.
setDeliveryDiscountDesc
(
String
.
format
(
desc
,
calculationDiscountResult
.
getDeliveryAmount
()
/
100
));
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
// shoppingCartGoodsResponseVo.setThresholdAmount(discount.get().getThresholdAmount());
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
false
);
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
false
);
}
}
}
else
{
}
else
{
String
desc
=
DELIVERY_DISCOUNT_DESC3
;
shoppingCartGoodsResponseVo
.
setDeliveryDiscountDesc
(
String
.
format
(
desc
,
calculationDiscountResult
.
getDeliveryAmount
()
/
100
));
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
shoppingCartGoodsResponseVo
.
setDiscountDeliveryAmount
(
calculationDiscountResult
.
getDeliveryAmount
());
// shoppingCartGoodsResponseVo.setThresholdAmount(discount.get().getThresholdAmount());
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
false
);
shoppingCartGoodsResponseVo
.
setIsDiscountDelivery
(
false
);
}
}
}
}
...
...
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