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
979ea83c
Commit
979ea83c
authored
Sep 25, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Plain Diff
sunyu::fix conflicts
parents
4c361c14
ce485fa1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
19 deletions
+54
-19
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartParamDto.java
+2
-2
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/controller/MCoffeeShoppingCartController.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
+30
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+6
-9
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+11
-5
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/domain/CartParamDto.java
View file @
979ea83c
...
@@ -24,6 +24,8 @@ public class CartParamDto {
...
@@ -24,6 +24,8 @@ public class CartParamDto {
private
String
sessionId
;
private
String
sessionId
;
private
String
couponCode
;
private
String
userId
;
private
String
userId
;
private
String
storeId
;
private
String
storeId
;
...
@@ -34,8 +36,6 @@ public class CartParamDto {
...
@@ -34,8 +36,6 @@ public class CartParamDto {
private
String
cartGoodsUid
;
private
String
cartGoodsUid
;
private
String
couponCode
;
private
Integer
qty
;
private
Integer
qty
;
private
MealClearOperationEnum
operationType
;
private
MealClearOperationEnum
operationType
;
...
...
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
View file @
979ea83c
...
@@ -1027,4 +1027,8 @@ public interface ShoppingCartBaseService {
...
@@ -1027,4 +1027,8 @@ public interface ShoppingCartBaseService {
}
}
return
null
;
return
null
;
}
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/controller/MCoffeeShoppingCartController.java
View file @
979ea83c
...
@@ -57,6 +57,7 @@ public class MCoffeeShoppingCartController {
...
@@ -57,6 +57,7 @@ public class MCoffeeShoppingCartController {
return
shoppingCartMCoffeeService
.
updateGoodsQty
(
request
);
return
shoppingCartMCoffeeService
.
updateGoodsQty
(
request
);
}
}
/**
/**
* 查询购物车信息
* 查询购物车信息
*/
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
View file @
979ea83c
...
@@ -187,8 +187,6 @@ public class AssortmentSdkService {
...
@@ -187,8 +187,6 @@ public class AssortmentSdkService {
return
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
baseResponse
.
getResult
()),
CartGoods
.
class
);
return
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
baseResponse
.
getResult
()),
CartGoods
.
class
);
}
}
/**
/**
* 调用SDK校验购物车
* 调用SDK校验购物车
*
*
...
@@ -210,6 +208,34 @@ public class AssortmentSdkService {
...
@@ -210,6 +208,34 @@ public class AssortmentSdkService {
checkCartRequest
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
checkCartRequest
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
checkCartRequest
.
setMenuType
(
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
());
checkCartRequest
.
setMenuType
(
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
());
BaseResponse
<
CheckCartRequest
>
baseResponse
;
BaseResponse
<
CheckCartRequest
>
baseResponse
;
baseResponse
=
shoppingCartService
.
checkAllCartGoodsNew
(
checkCartRequest
);
if
(
baseResponse
==
null
)
{
return
null
;
}
return
baseResponse
.
getResult
();
}
/**
* 调用SDK校验购物车
*
* @param oldAllCartGoodsList
* @param partnerId
* @param storeId
* @param shoppingCartGoodsResponseVo
* @param orderType
*/
public
CheckCartRequest
checkShoppingCartSdkForMCoffee
(
List
<
CartGoods
>
oldAllCartGoodsList
,
String
partnerId
,
String
storeId
,
ShoppingCartGoodsBaseResponseVo
shoppingCartGoodsResponseVo
,
Integer
orderType
,
String
tableNumber
,
String
menuType
,
ShoppingCartBaseService
shoppingCartService
)
{
CheckCartRequest
checkCartRequest
=
new
CheckCartRequest
();
checkCartRequest
.
setCartGoodsList
(
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
oldAllCartGoodsList
),
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
CartGoods
.
class
));
checkCartRequest
.
setOrderWay
(
orderType
);
checkCartRequest
.
setPartnerId
(
partnerId
);
checkCartRequest
.
setShoppingCartGoodsResponseVo
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
shoppingCartGoodsResponseVo
),
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
domain
.
ShoppingCartGoodsResponseVo
.
class
));
checkCartRequest
.
setStoreId
(
storeId
);
checkCartRequest
.
setTableNumber
(
tableNumber
);
checkCartRequest
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
checkCartRequest
.
setMenuType
(
BusinessTypeEnum
.
getByType
(
menuType
).
getCode
());
BaseResponse
<
CheckCartRequest
>
baseResponse
;
baseResponse
=
shoppingCartService
.
checkAllCartGoodsForMCoffee
(
checkCartRequest
);
baseResponse
=
shoppingCartService
.
checkAllCartGoodsForMCoffee
(
checkCartRequest
);
if
(
baseResponse
==
null
)
{
if
(
baseResponse
==
null
)
{
return
null
;
return
null
;
...
@@ -255,4 +281,4 @@ public class AssortmentSdkService {
...
@@ -255,4 +281,4 @@ public class AssortmentSdkService {
cartParamDto
.
setStoreId
(
storeId
);
cartParamDto
.
setStoreId
(
storeId
);
return
cartParamDto
;
return
cartParamDto
;
}
}
}
}
\ No newline at end of file
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
979ea83c
package
cn
.
freemud
.
service
.
impl
.
mcoffee
;
package
cn
.
freemud
.
service
.
impl
.
mcoffee
;
import
cn.freemud.adapter.ActivityAdapter
;
import
cn.freemud.adapter.ActivityAdapter
;
import
cn.freemud.adapter.ShoppingCartConvertAdapter
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.constant.ShoppingCartConstant
;
import
cn.freemud.entities.dto.*
;
import
cn.freemud.entities.dto.*
;
...
@@ -20,7 +19,6 @@ import cn.freemud.service.impl.mcoffee.calculation.CalculationServiceImpl;
...
@@ -20,7 +19,6 @@ import cn.freemud.service.impl.mcoffee.calculation.CalculationServiceImpl;
import
cn.freemud.service.impl.mcoffee.calculation.CouponDiscountCalculation
;
import
cn.freemud.service.impl.mcoffee.calculation.CouponDiscountCalculation
;
import
cn.freemud.service.impl.mcoffee.entity.CopyShoppingCartRequestVo
;
import
cn.freemud.service.impl.mcoffee.entity.CopyShoppingCartRequestVo
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq
;
import
cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq
;
import
cn.freemud.service.impl.mcoffee.entity.CouponState
;
import
cn.freemud.service.impl.mcoffee.entity.MCoffeeAddGoodsRequestVo
;
import
cn.freemud.service.impl.mcoffee.entity.MCoffeeAddGoodsRequestVo
;
import
cn.freemud.service.impl.mcoffee.entity.SwitchShoppingCartRequestVo
;
import
cn.freemud.service.impl.mcoffee.entity.SwitchShoppingCartRequestVo
;
import
cn.freemud.service.thirdparty.CustomerApplicationClient
;
import
cn.freemud.service.thirdparty.CustomerApplicationClient
;
...
@@ -354,8 +352,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -354,8 +352,6 @@ public class ShoppingCartMCoffeeServiceImpl {
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
/**
/**
* 券码用-查询购物车最新信息,计算优惠
* 券码用-查询购物车最新信息,计算优惠
* @param requestVo
* @param requestVo
...
@@ -371,9 +367,10 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -371,9 +367,10 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
getCoupon
(
null
,
null
,
cartGoodsList
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
getCoupon
(
null
,
null
,
cartGoodsList
);
// 促销活动的优惠金额计算
// 促销活动的优惠金额计算
calculationService
.
updateShoppingCartGoodsDiscount
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
(),
requestVo
.
getUserId
(),
requestVo
.
getAppId
(),
requestVo
.
getOrderType
(),
assortmentCustomerInfoVo
.
isMemberPaid
(),
requestVo
.
getMenuType
(),
requestVo
.
getReceiveId
(),
null
,
calculationService
.
updateShoppingCartGoodsDiscount
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
(),
requestVo
.
getUserId
(),
requestVo
.
getAppId
(),
requestVo
.
getOrderType
(),
assortmentCustomerInfoVo
.
isMemberPaid
(),
requestVo
.
getMenuType
(),
requestVo
.
getReceiveId
(),
null
,
cartGoodsList
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
);
cartGoodsList
,
coupons
,
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
);
List
<
CouponAvailableReq
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
);
String
moneyCoupon
=
assortmentSdkService
.
getShoppingCartCoupon
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
(),
requestVo
.
getUserId
(),
shoppingCartBaseService
);
return
ResponseUtil
.
success
(
resList
);
List
<
CouponAvailableReq
>
resList
=
couponDiscountCalculation
.
buildAvailableCoupons
(
requestVo
,
cartGoodsList
,
moneyCoupon
);
return
ResponseUtil
.
success
(
resList
);
}
}
...
@@ -1072,7 +1069,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1072,7 +1069,7 @@ public class ShoppingCartMCoffeeServiceImpl {
List
<
CartGoods
>
allCartGoodsList
=
new
ArrayList
<>();
List
<
CartGoods
>
allCartGoodsList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
checkGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
checkGoods
))
{
//当商品全部添加完毕,校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
//当商品全部添加完毕,校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
CheckCartRequest
checkCartRequest
=
assortmentSdkService
.
checkShoppingCartSdk
(
checkGoods
,
partnerId
,
CheckCartRequest
checkCartRequest
=
assortmentSdkService
.
checkShoppingCartSdk
ForMCoffee
(
checkGoods
,
partnerId
,
storeId
,
shoppingCartGoodsResponseVo
,
orderType
,
""
,
menuType
,
shoppingCartBaseService
);
storeId
,
shoppingCartGoodsResponseVo
,
orderType
,
""
,
menuType
,
shoppingCartBaseService
);
if
(
checkCartRequest
.
getShoppingCartGoodsResponseVo
()
!=
null
)
{
if
(
checkCartRequest
.
getShoppingCartGoodsResponseVo
()
!=
null
)
{
shoppingCartGoodsResponseVo
.
setToastMsg
(
checkCartRequest
.
getShoppingCartGoodsResponseVo
().
getToastMsg
());
shoppingCartGoodsResponseVo
.
setToastMsg
(
checkCartRequest
.
getShoppingCartGoodsResponseVo
().
getToastMsg
());
...
@@ -1108,7 +1105,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1108,7 +1105,7 @@ public class ShoppingCartMCoffeeServiceImpl {
CheckCartRequest
checkCartRequest
=
null
;
CheckCartRequest
checkCartRequest
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
checkGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
checkGoods
))
{
//当商品全部添加完毕,校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
//当商品全部添加完毕,校验购物车商品(是否合法,上下架,点餐方式,是否在当前菜单中...),并移除非法商品
checkCartRequest
=
assortmentSdkService
.
checkShoppingCartSdk
(
checkGoods
,
partnerId
,
checkCartRequest
=
assortmentSdkService
.
checkShoppingCartSdk
ForMCoffee
(
checkGoods
,
partnerId
,
storeId
,
shoppingCartGoodsResponseVo
,
orderType
,
""
,
menuType
,
shoppingCartBaseService
);
storeId
,
shoppingCartGoodsResponseVo
,
orderType
,
""
,
menuType
,
shoppingCartBaseService
);
}
}
return
checkCartRequest
;
return
checkCartRequest
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
979ea83c
...
@@ -321,7 +321,7 @@ public class CouponDiscountCalculation {
...
@@ -321,7 +321,7 @@ public class CouponDiscountCalculation {
}
}
public
List
<
CouponAvailableReq
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
){
public
List
<
CouponAvailableReq
>
buildAvailableCoupons
(
QueryCartInfoRequestVo
requestVo
,
List
<
CartGoods
>
cartGoods
,
String
moneyCoupon
){
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
List
<
CouponAvailableReq
>
resList
=
new
ArrayList
<>();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
CouponAvailableReq
res
=
new
CouponAvailableReq
();
res
.
setProviderId
(
requestVo
.
getPartnerId
());
res
.
setProviderId
(
requestVo
.
getPartnerId
());
...
@@ -330,12 +330,20 @@ public class CouponDiscountCalculation {
...
@@ -330,12 +330,20 @@ public class CouponDiscountCalculation {
List
<
String
>
couponList
=
new
ArrayList
<>();
List
<
String
>
couponList
=
new
ArrayList
<>();
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
res
.
setChannelIdList
(
commonService
.
getOrgCodes
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
()));
List
<
CouponProductVo
>
productList
=
new
ArrayList
<>();
List
<
CouponProductVo
>
productList
=
new
ArrayList
<>();
res
.
setCouponCodes
(
StringUtils
.
isNotEmpty
(
moneyCoupon
)
?
Arrays
.
asList
(
moneyCoupon
)
:
null
);
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGoods
))
{
cartGoods
.
forEach
(
cartGood
->
{
cartGoods
.
forEach
(
cartGood
->
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
cartGood
.
getCouponCode
()))
{
couponList
.
add
(
cartGood
.
getCouponCode
());
CouponProductVo
couponProductVo
=
new
CouponProductVo
();
res
.
setCouponCodes
(
couponList
);
couponProductVo
.
setAmount
(
cartGood
.
getAmount
().
intValue
());
couponProductVo
.
setKeyProductCode
(
cartGood
.
getCustomerCode
());
couponProductVo
.
setQuantity
(
cartGood
.
getQty
());
couponProductVo
.
setProductId
(
cartGood
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
productList
.
add
(
couponProductVo
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
cartGood
.
getProductComboList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
cartGood
.
getProductComboList
()))
{
cartGood
.
getProductComboList
().
forEach
(
comboxGoods
->
{
cartGood
.
getProductComboList
().
forEach
(
comboxGoods
->
{
CouponProductVo
couponProductVo
=
new
CouponProductVo
();
CouponProductVo
couponProductVo
=
new
CouponProductVo
();
...
@@ -343,7 +351,6 @@ public class CouponDiscountCalculation {
...
@@ -343,7 +351,6 @@ public class CouponDiscountCalculation {
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
couponProductVo
.
setCategoryCode
(
null
);
productList
.
add
(
couponProductVo
);
productList
.
add
(
couponProductVo
);
});
});
...
@@ -355,7 +362,6 @@ public class CouponDiscountCalculation {
...
@@ -355,7 +362,6 @@ public class CouponDiscountCalculation {
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setKeyProductCode
(
comboxGoods
.
getCustomerCode
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setQuantity
(
comboxGoods
.
getQty
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setProductId
(
comboxGoods
.
getGoodsId
());
couponProductVo
.
setCouponCode
(
cartGood
.
getCouponCode
());
couponProductVo
.
setCategoryCode
(
null
);
couponProductVo
.
setCategoryCode
(
null
);
productList
.
add
(
couponProductVo
);
productList
.
add
(
couponProductVo
);
});
});
...
...
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