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
6a22e638
Commit
6a22e638
authored
Feb 18, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠为空时
parent
fdba72eb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
34 deletions
+48
-34
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
+7
-7
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
+4
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
+4
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractUpdateGoodsQtyService.java
+7
-5
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
+7
-6
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
+6
-6
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformListCartGoodsService.java
+7
-1
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
+6
-7
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
View file @
6a22e638
...
...
@@ -391,11 +391,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
BenefitBeanBO
benefitBeanBO
=
benefitBeanBOList
.
get
(
0
);
//调用没有加入购物车的提示语的方法
activityList
=
setMessageNotInShoppingCart
(
messageBuilder
,
activityBO
,
benefitBeanBOList
,
benefitBeanBO
);
}
}
else
{
//促销返回满减提示语
List
<
CalculationDiscountBO
.
CalculationDiscountResult
.
ActivityPrompt
>
activityPrompts
=
discountResult
.
getActivityPrompts
();
//List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts();
...
...
@@ -408,7 +404,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
else
{
activityList
=
setMessageNoSatisfyCart
(
messageBuilder
,
discountResult
.
getDiscounts
());
}
}
/**
* 调用促销统一活动查询,过滤出参与的满减(目前只有每满减和阶梯满减)
*/
...
...
@@ -438,6 +434,10 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
private
CalCostBO
getComDiscountResult
(
BaseAddGoodsBO
baseRequestDTO
,
DiscountResultBO
discountResultBO
,
CalCostBO
before
)
{
if
(
before
.
getGetCalculationDiscountBO
()
==
null
){
before
.
setCalculationDiscountBO
(
new
CalculationDiscountBO
());
return
before
;
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
...
...
@@ -755,7 +755,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
ActivityBO
activityBO
=
promotionManager
.
queryActivityByType
(
getActivityBO
,
baseRequestDTO
.
getManagerService
().
getPromotionService
());
fullReduction
.
setActivityBO
(
activityBO
);
if
(
activityBO
==
null
){
if
(
discountResult
==
null
||
activityBO
==
null
){
return
fullReduction
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
View file @
6a22e638
...
...
@@ -371,7 +371,10 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
}
private
CalCostBO
getComDiscountResult
(
ShoppingCartGoodsApportionBO
baseRequestDTO
,
DiscountResultBO
discountResultBO
,
CalCostBO
before
)
{
if
(
before
.
getGetCalculationDiscountBO
()
==
null
){
before
.
setCalculationDiscountBO
(
new
CalculationDiscountBO
());
return
before
;
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractListCartGoodsService.java
View file @
6a22e638
...
...
@@ -428,7 +428,10 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
private
CalCostBO
getComDiscountResult
(
ListCartGoodsBO
baseRequestDTO
,
DiscountResultBO
discountResultBO
,
CalCostBO
before
)
{
if
(
before
.
getGetCalculationDiscountBO
()
==
null
){
before
.
setCalculationDiscountBO
(
new
CalculationDiscountBO
());
return
before
;
}
if
(
CollectionUtils
.
isNotEmpty
(
before
.
getGetCalculationDiscountBO
().
getGoods
())){
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
calculationDiscountBO
.
getResult
().
setValidCouponMap
(
before
.
getValidCouponMap
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractUpdateGoodsQtyService.java
View file @
6a22e638
...
...
@@ -357,9 +357,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
activityList
=
setMessageNotInShoppingCart
(
messageBuilder
,
activityBO
,
benefitBeanBOList
,
benefitBeanBO
);
}
}
else
{
//促销返回满减提示语
List
<
CalculationDiscountBO
.
CalculationDiscountResult
.
ActivityPrompt
>
activityPrompts
=
discountResult
.
getActivityPrompts
();
//List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts = discountResult.getDiscounts();
...
...
@@ -372,6 +370,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
else
{
activityList
=
setMessageNoSatisfyCart
(
messageBuilder
,
discountResult
.
getDiscounts
());
}
}
/**
* 调用促销统一活动查询,过滤出参与的满减(目前只有每满减和阶梯满减)
...
...
@@ -400,7 +399,10 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
}
private
CalCostBO
getComDiscountResult
(
UpdateAddGoodsBO
baseRequestDTO
,
DiscountResultBO
discountResultBO
,
CalCostBO
before
)
{
if
(
before
.
getGetCalculationDiscountBO
()
==
null
){
before
.
setCalculationDiscountBO
(
new
CalculationDiscountBO
());
return
before
;
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
...
...
@@ -719,7 +721,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
ActivityBO
activityBO
=
promotionManager
.
queryActivityByType
(
getActivityBO
,
baseRequestDTO
.
getManagerService
().
getPromotionService
());
fullReduction
.
setActivityBO
(
activityBO
);
if
(
activityBO
==
null
){
if
(
discountResult
==
null
||
activityBO
==
null
){
return
fullReduction
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
View file @
6a22e638
...
...
@@ -82,11 +82,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
}
}
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
return
null
;
}
//组装促销
calculationSharingDiscountRequestDto
.
setGoods
(
calculationDiscountGoodsList
);
...
...
@@ -94,8 +90,13 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
calculationSharingDiscountRequestDto
.
setOrgIds
(
baseRequestDTO
.
getManagerService
().
getStoreService
().
getOrgIds
(
new
GetStoreBO
(
baseRequestDTO
.
getPartnerId
(),
baseRequestDTO
.
getShopId
())));
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setIsMember
(
discountResultBO
.
getIsMember
());
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
calCostBO
.
setGetCalculationDiscountBO
(
null
);
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformApportionService.java
View file @
6a22e638
...
...
@@ -136,12 +136,6 @@ public class PlatformApportionService extends AbstractApportionService {
calculationSharingDiscountRequestDto
.
setSelectActivityList
(
selectActivityLists
);
}
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
return
null
;
}
//组装促销
calculationSharingDiscountRequestDto
.
setGoods
(
calculationDiscountGoodsList
);
calculationSharingDiscountRequestDto
.
setCoupons
(
coupons
);
...
...
@@ -149,7 +143,13 @@ public class PlatformApportionService extends AbstractApportionService {
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setIsMember
(
discountResultBO
.
getIsMember
());
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
calCostBO
.
setGetCalculationDiscountBO
(
null
);
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
calCostBO
.
setValidCouponMap
(
discountResultBO
.
getValidCouponMap
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformListCartGoodsService.java
View file @
6a22e638
...
...
@@ -147,14 +147,20 @@ public class PlatformListCartGoodsService extends AbstractListCartGoodsService {
calculationSharingDiscountRequestDto
.
setSelectActivityList
(
selectActivityLists
);
}
//组装促销
calculationSharingDiscountRequestDto
.
setGoods
(
calculationDiscountGoodsList
);
calculationSharingDiscountRequestDto
.
setCoupons
(
coupons
);
calculationSharingDiscountRequestDto
.
setOrgIds
(
baseRequestDTO
.
getManagerService
().
getStoreService
().
getOrgIds
(
new
GetStoreBO
(
baseRequestDTO
.
getPartnerId
(),
baseRequestDTO
.
getShopId
())));
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setIsMember
(
discountResultBO
.
getIsMember
());
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
calCostBO
.
setGetCalculationDiscountBO
(
null
);
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
calCostBO
.
setValidCouponMap
(
discountResultBO
.
getValidCouponMap
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
View file @
6a22e638
...
...
@@ -94,20 +94,19 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
}
}
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
return
null
;
}
//组装促销
calculationSharingDiscountRequestDto
.
setGoods
(
calculationDiscountGoodsList
);
calculationSharingDiscountRequestDto
.
setCoupons
(
coupons
);
calculationSharingDiscountRequestDto
.
setOrgIds
(
baseRequestDTO
.
getManagerService
().
getStoreService
().
getOrgIds
(
new
GetStoreBO
(
baseRequestDTO
.
getPartnerId
(),
baseRequestDTO
.
getShopId
())));
calculationSharingDiscountRequestDto
.
setDistributionFee
(
deliveryAmount
);
calculationSharingDiscountRequestDto
.
setIsMember
(
discountResultBO
.
getIsMember
());
//剔除商品数量为空的
calculationDiscountGoodsList
.
removeIf
(
v
->
v
.
getGoodsQuantity
().
equals
(
0
));
if
(
CollectionUtils
.
isEmpty
(
calculationDiscountGoodsList
))
{
calCostBO
.
setGetCalculationDiscountBO
(
null
);
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
}
...
...
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