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
0f68214a
Commit
0f68214a
authored
Nov 04, 2020
by
徐康
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/qa' into qa
parents
75fc8cae
a85de71a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
23 deletions
+2
-23
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+2
-23
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
0f68214a
...
@@ -172,12 +172,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -172,12 +172,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
//商品券已添加情况校验
//商品券已添加情况校验
List
<
CartGoods
.
MaterialGoods
>
productMaterialList
=
new
ArrayList
<>();
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
);
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
()))
{
...
@@ -206,19 +201,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -206,19 +201,6 @@ 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
());
materialRequestVos
.
add
(
vo
);
}
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
);
...
@@ -236,7 +218,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -236,7 +218,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
private
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
checkGoodsCoupon
(
List
<
CartGoods
>
oldCartGoodsList
,
Integer
operationType
,
String
couponCode
,
String
goodsId
,
List
<
CartGoods
.
MaterialGoods
>
productMaterialList
)
{
private
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
checkGoodsCoupon
(
List
<
CartGoods
>
oldCartGoodsList
,
Integer
operationType
,
String
couponCode
,
String
goodsId
)
{
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
,
"商品券券号为空"
);
}
}
...
@@ -257,9 +239,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -257,9 +239,6 @@ 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
{
...
...
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