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
3cc464e7
Commit
3cc464e7
authored
Mar 05, 2021
by
chongfu.liang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品券
parent
07c79717
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractUpdateGoodsQtyService.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
+17
-7
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractAddGoodsService.java
View file @
3cc464e7
...
@@ -379,6 +379,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -379,6 +379,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
calCostBO
.
setChanged
(
addGoodsToShoppingCartBO
.
getChanged
());
calCostBO
.
setChanged
(
addGoodsToShoppingCartBO
.
getChanged
());
calCostBO
.
setShoppingCartContext
(
addGoodsToShoppingCartBO
.
getShoppingCartContext
());
calCostBO
.
setShoppingCartContext
(
addGoodsToShoppingCartBO
.
getShoppingCartContext
());
calCostBO
.
setToastMsg
(
addGoodsToShoppingCartBO
.
getToastMsg
());
calCostBO
.
setToastMsg
(
addGoodsToShoppingCartBO
.
getToastMsg
());
calCostBO
.
setValidCouponMap
(
addGoodsToShoppingCartBO
.
getValidCouponMap
());
calCostBO
.
setIsMember
(
addGoodsToShoppingCartBO
.
getIsMember
());
calCostBO
.
setIsMember
(
addGoodsToShoppingCartBO
.
getIsMember
());
return
calCostBO
;
return
calCostBO
;
...
@@ -438,6 +439,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
...
@@ -438,6 +439,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
return
before
;
return
before
;
}
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
calculationDiscountBO
.
getResult
().
setValidCouponMap
(
before
.
getValidCouponMap
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
return
before
;
return
before
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractApportionService.java
View file @
3cc464e7
...
@@ -380,6 +380,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
...
@@ -380,6 +380,7 @@ public class AbstractApportionService implements GetShoppingCartGoodsApportionSe
return
before
;
return
before
;
}
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
calculationDiscountBO
.
getResult
().
setValidCouponMap
(
before
.
getValidCouponMap
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
return
before
;
return
before
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/AbstractUpdateGoodsQtyService.java
View file @
3cc464e7
...
@@ -308,6 +308,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
...
@@ -308,6 +308,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
calCostBO
.
setCartGoods
(
addGoodsToShoppingCartBO
.
getCartGoods
());
calCostBO
.
setCartGoods
(
addGoodsToShoppingCartBO
.
getCartGoods
());
calCostBO
.
setChanged
(
addGoodsToShoppingCartBO
.
getChanged
());
calCostBO
.
setChanged
(
addGoodsToShoppingCartBO
.
getChanged
());
calCostBO
.
setShoppingCartContext
(
addGoodsToShoppingCartBO
.
getShoppingCartContext
());
calCostBO
.
setShoppingCartContext
(
addGoodsToShoppingCartBO
.
getShoppingCartContext
());
calCostBO
.
setValidCouponMap
(
addGoodsToShoppingCartBO
.
getValidCouponMap
());
calCostBO
.
setToastMsg
(
addGoodsToShoppingCartBO
.
getToastMsg
());
calCostBO
.
setToastMsg
(
addGoodsToShoppingCartBO
.
getToastMsg
());
calCostBO
.
setIsMember
(
addGoodsToShoppingCartBO
.
getIsMember
());
calCostBO
.
setIsMember
(
addGoodsToShoppingCartBO
.
getIsMember
());
return
calCostBO
;
return
calCostBO
;
...
@@ -363,6 +364,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
...
@@ -363,6 +364,7 @@ public abstract class AbstractUpdateGoodsQtyService implements UpdateGoodsQtySer
return
before
;
return
before
;
}
}
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
CalculationDiscountBO
calculationDiscountBO
=
promotionManager
.
calculationDiscount
(
before
.
getGetCalculationDiscountBO
(),
baseRequestDTO
.
getManagerService
().
getPromotionService
());
calculationDiscountBO
.
getResult
().
setValidCouponMap
(
before
.
getValidCouponMap
());
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
before
.
setCalculationDiscountBO
(
calculationDiscountBO
);
return
before
;
return
before
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformAddGoodsService.java
View file @
3cc464e7
...
@@ -101,6 +101,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
...
@@ -101,6 +101,7 @@ public class PlatformAddGoodsService extends AbstractAddGoodsService {
}
else
{
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
}
calCostBO
.
setValidCouponMap
(
discountResultBO
.
getValidCouponMap
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
return
calCostBO
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/demo/service/impl/PlatformUpdateGoodsQtyService.java
View file @
3cc464e7
...
@@ -10,16 +10,17 @@ import cn.freemud.demo.entities.bo.promotion.GetCalculationDiscountBO;
...
@@ -10,16 +10,17 @@ import cn.freemud.demo.entities.bo.promotion.GetCalculationDiscountBO;
import
cn.freemud.demo.entities.bo.store.GetStoreBO
;
import
cn.freemud.demo.entities.bo.store.GetStoreBO
;
import
cn.freemud.demo.entities.bo.store.GetStoreInfoBO
;
import
cn.freemud.demo.entities.bo.store.GetStoreInfoBO
;
import
cn.freemud.demo.entities.bo.store.StoreInfoBO
;
import
cn.freemud.demo.entities.bo.store.StoreInfoBO
;
import
cn.freemud.demo.manager.coupon.CouponService
;
import
cn.freemud.demo.manager.customer.CustomerManager
;
import
cn.freemud.demo.manager.customer.CustomerManager
;
import
cn.freemud.demo.manager.product.ProductManager
;
import
cn.freemud.demo.manager.product.ProductManager
;
import
cn.freemud.demo.manager.store.StoreManager
;
import
cn.freemud.demo.manager.store.StoreManager
;
import
cn.freemud.demo.service.impl.AbstractUpdateGoodsQtyService
;
import
cn.freemud.demo.service.impl.AbstractUpdateGoodsQtyService
;
import
cn.freemud.entities.dto.CheckSpqInfoRequestDto
;
import
cn.freemud.entities.dto.CheckSpqInfoResponseDto
;
import
cn.freemud.entities.dto.CheckSpqInfoResponseDto
;
import
cn.freemud.entities.dto.StoreDeliveryInfoDto
;
import
cn.freemud.entities.dto.StoreDeliveryInfoDto
;
import
cn.freemud.entities.vo.ActivityClassifyCouponBean
;
import
cn.freemud.entities.vo.ActivityClassifyCouponBean
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.enums.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.service.CouponService
;
import
cn.freemud.utils.PropertyConvertUtil
;
import
cn.freemud.utils.PropertyConvertUtil
;
import
cn.freemud.utils.WebUtil
;
import
cn.freemud.utils.WebUtil
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
import
com.freemud.application.sdk.api.log.LogThreadLocal
;
...
@@ -107,6 +108,7 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
...
@@ -107,6 +108,7 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
}
else
{
}
else
{
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
calCostBO
.
setGetCalculationDiscountBO
(
calculationSharingDiscountRequestDto
);
}
}
calCostBO
.
setValidCouponMap
(
discountResultBO
.
getValidCouponMap
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
calCostBO
.
setCartGoods
(
discountResultBO
.
getCartGoods
());
return
calCostBO
;
return
calCostBO
;
}
}
...
@@ -169,17 +171,25 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
...
@@ -169,17 +171,25 @@ public class PlatformUpdateGoodsQtyService extends AbstractUpdateGoodsQtyService
List
<
CartGoods
>
cartGoodsList
=
addGoodsToShoppingCartBO
.
getCartGoods
();
List
<
CartGoods
>
cartGoodsList
=
addGoodsToShoppingCartBO
.
getCartGoods
();
int
cartSize
=
cartGoodsList
.
size
()
-
1
;
int
cartSize
=
cartGoodsList
.
size
()
-
1
;
// 校验商品券
// 校验商品券
HashMap
<
String
,
CheckSpqInfoResponseDto
>
validCouponMap
=
new
HashMap
<>(
16
);
for
(
int
i
=
cartSize
;
i
>=
0
;
i
--){
for
(
int
i
=
cartSize
;
i
>=
0
;
i
--){
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
if
(
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
)){
if
(
cartGoods
.
getCartGoodsUid
().
startsWith
(
CommonsConstant
.
COUPON_PREFIX
)){
GetCheckSpqBo
getCheckSpqBo
=
new
GetCheckSpqBo
(
baseRequestDTO
.
getPartnerId
(),
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()),
String
spqId
=
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
baseRequestDTO
.
getShopId
(),
baseRequestDTO
.
getMenuType
(),
cartGoods
.
getSpuId
(),
cartGoods
.
getSkuId
(),
baseRequestDTO
.
getManagerService
().
getProductService
());
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
baseRequestDTO
.
getPartnerId
(),
baseRequestDTO
.
getShopId
(),
spqId
,
baseRequestDTO
.
getMenuType
());
CheckSpqBO
checkSpqBO
=
couponService
.
checkSpq
(
getCheckSpqBo
);
CheckSpqInfoResponseDto
checkSpqInfo
=
null
;
if
(
checkSpqBO
==
null
){
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
checkSpqInfo
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
,
cartGoods
.
getSkuId
());
}
else
{
checkSpqInfo
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
);
}
if
(
checkSpqInfo
==
null
){
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
remove
(
i
);
}
else
{
}
else
{
cartGoods
.
setCouponProductPrice
(
checkSpqBO
.
getProductPrice
());
cartGoods
.
setCouponProductPrice
(
checkSpqInfo
.
getPrice
());
cartGoods
.
setActivityCode
(
checkSpqBO
.
getDetails
().
getActiveCode
());
cartGoods
.
setActivityCode
(
checkSpqInfo
.
getActiveCode
());
validCouponMap
.
put
(
spqId
,
checkSpqInfo
);
addGoodsToShoppingCartBO
.
setValidCouponMap
(
validCouponMap
);
}
}
}
}
}
}
...
...
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