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
72c21db0
Commit
72c21db0
authored
Nov 02, 2020
by
huiyang.chen
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 新增加料信息
parent
ab85dd94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+22
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
72c21db0
...
@@ -171,7 +171,12 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -171,7 +171,12 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
//商品券已添加情况校验
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
);
List
<
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
productMaterialList
);
if
(
CollectionUtils
.
isNotEmpty
(
productMaterialList
)){
// 复制加料信息
addShoppingCartGoodsRequestVo
.
setProductMaterialList
(
adapterProductMateria
(
productMaterialList
));
}
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
setClassificationAndPrice
(
addCartGoods
,
productBeanListSpuClass
);
setClassificationAndPrice
(
addCartGoods
,
productBeanListSpuClass
);
if
(
StringUtils
.
isNotEmpty
(
addShoppingCartGoodsRequestVo
.
getGroupName
()))
{
if
(
StringUtils
.
isNotEmpty
(
addShoppingCartGoodsRequestVo
.
getGroupName
()))
{
...
@@ -200,6 +205,18 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -200,6 +205,18 @@ public class ShoppingCartMCoffeeServiceImpl {
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
private
List
<
MaterialRequestVo
>
adapterProductMateria
(
List
<
CartGoods
.
MaterialGoods
>
productMaterialList
){
List
<
MaterialRequestVo
>
materialRequestVos
=
new
ArrayList
<>();
for
(
CartGoods
.
MaterialGoods
materialGoods:
productMaterialList
)
{
MaterialRequestVo
vo
=
new
MaterialRequestVo
();
vo
.
setSpuId
(
materialGoods
.
getSpuId
());
vo
.
setCustomerCode
(
materialGoods
.
getCustomerCode
());
vo
.
setGroupId
(
materialGoods
.
getGroupId
());
}
return
materialRequestVos
;
}
private
MCoffeeProductIdsVo
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
,
String
menuType
)
{
private
MCoffeeProductIdsVo
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
,
String
menuType
)
{
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()),
menuType
);
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()),
menuType
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
...
@@ -217,7 +234,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -217,7 +234,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
private
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
checkGoodsCoupon
(
List
<
CartGoods
>
oldCartGoodsList
,
Integer
operationType
,
String
couponCode
,
String
goodsId
)
{
private
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
checkGoodsCoupon
(
List
<
CartGoods
>
oldCartGoodsList
,
Integer
operationType
,
String
couponCode
,
String
goodsId
,
List
<
CartGoods
.
MaterialGoods
>
productMaterialList
)
{
if
(
operationType
!=
null
&&
operationType
==
1
&&
StringUtils
.
isBlank
(
couponCode
))
{
if
(
operationType
!=
null
&&
operationType
==
1
&&
StringUtils
.
isBlank
(
couponCode
))
{
throw
new
ServiceException
(
ResponseResult
.
PARAMETER_MISSING
,
"商品券券号为空"
);
throw
new
ServiceException
(
ResponseResult
.
PARAMETER_MISSING
,
"商品券券号为空"
);
}
}
...
@@ -238,6 +255,9 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -238,6 +255,9 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods
.
setQty
(
0
);
cartGoods
.
setQty
(
0
);
}
}
if
(
StringUtils
.
isNotEmpty
(
goodsId
)
&&
StringUtils
.
isNotEmpty
(
couponCode
)
&&
goodsId
.
equals
(
cartGoods
.
getSkuId
())
&&
StringUtils
.
isBlank
(
cartGoods
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
goodsId
)
&&
StringUtils
.
isNotEmpty
(
couponCode
)
&&
goodsId
.
equals
(
cartGoods
.
getSkuId
())
&&
StringUtils
.
isBlank
(
cartGoods
.
getCouponCode
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
.
getProductMaterialList
()))
{
productMaterialList
.
addAll
(
cartGoods
.
getProductMaterialList
());
}
if
(
cartGoods
.
getQty
()
>
1
){
if
(
cartGoods
.
getQty
()
>
1
){
cartGoods
.
setQty
(
cartGoods
.
getQty
()
-
1
);
cartGoods
.
setQty
(
cartGoods
.
getQty
()
-
1
);
}
else
{
}
else
{
...
...
谌会阳
@huiyang.chen
mentioned in commit
a85de71a
Nov 04, 2020
mentioned in commit
a85de71a
mentioned in commit a85de71a2e692a8f6fa06a315a8834d66aebb972
Toggle commit list
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