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
e8d46e16
Commit
e8d46e16
authored
Oct 05, 2020
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
再来一单校验修改
parent
3cea7744
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
54 deletions
+32
-54
shopping-cart-application-service/src/main/java/cn/freemud/enums/ShoppingCartOperationType.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+24
-52
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CopyShoppingCartRequestVo.java
+6
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/enums/ShoppingCartOperationType.java
View file @
e8d46e16
...
@@ -17,8 +17,8 @@ public enum ShoppingCartOperationType {
...
@@ -17,8 +17,8 @@ public enum ShoppingCartOperationType {
ADD_PRODUCT_COUPON
(
1
,
"增加商品券"
),
ADD_PRODUCT_COUPON
(
1
,
"增加商品券"
),
ADD_SUPER_PRICE_GOODS
(
2
,
"增加超值加购商品"
),
ADD_SUPER_PRICE_GOODS
(
2
,
"增加超值加购商品"
),
UPDATE3
(
3
,
"切换门店校验"
),
CHECK
(
3
,
"切换门店校验"
),
UPDATE4
(
4
,
"确认切换门店"
)
CONFIRM
(
4
,
"确认切换门店"
)
;
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
e8d46e16
...
@@ -533,7 +533,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -533,7 +533,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
List
<
CartGoods
>
onlyCheckGoodsList
=
new
ArrayList
<>();
List
<
CartGoods
>
onlyCheckGoodsList
=
new
ArrayList
<>();
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
UPDATE3
.
getCode
()){
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
CHECK
.
getCode
()){
onlyCheckGoodsList
.
addAll
(
cartGoodsList
);
onlyCheckGoodsList
.
addAll
(
cartGoodsList
);
// 新门店check购物车中所有商品
// 新门店check购物车中所有商品
onlyCheckGoodsList
=
checkCartGoods
(
partnerId
,
toStoreId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
onlyCheckGoodsList
);
onlyCheckGoodsList
=
checkCartGoods
(
partnerId
,
toStoreId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
onlyCheckGoodsList
);
...
@@ -542,7 +542,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -542,7 +542,7 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoodsList
=
checkCartGoods
(
partnerId
,
toStoreId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
cartGoodsList
);
cartGoodsList
=
checkCartGoods
(
partnerId
,
toStoreId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
cartGoodsList
);
}
}
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
UPDATE3
.
getCode
())
{
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
CHECK
.
getCode
())
{
if
(
StringUtils
.
isNotEmpty
(
shoppingCartGoodsResponseVo
.
getToastMsg
())){
if
(
StringUtils
.
isNotEmpty
(
shoppingCartGoodsResponseVo
.
getToastMsg
())){
//设置更新响应信息,校验失败只弹框提示消息,不切换门店,故将门店id重置为原来门店
//设置更新响应信息,校验失败只弹框提示消息,不切换门店,故将门店id重置为原来门店
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
...
@@ -568,7 +568,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -568,7 +568,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
}
}
}
// 新门店check购物车中所有商品
// 新门店check购物车中所有商品
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
UPDATE4
.
getCode
())
{
if
(
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
CONFIRM
.
getCode
())
{
// 重新存储新门店购物车
// 重新存储新门店购物车
assortmentSdkService
.
setShoppingCart
(
partnerId
,
toStoreId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
toStoreId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
//清空商品券商品
//清空商品券商品
...
@@ -619,28 +619,31 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -619,28 +619,31 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
orderInfo
==
null
||
orderInfo
.
getResult
()
==
null
)
{
if
(
orderInfo
==
null
||
orderInfo
.
getResult
()
==
null
)
{
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_QUERYORDER_ERROR
);
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_QUERYORDER_ERROR
);
}
}
if
(
orderInfo
.
getResult
().
getOrderType
()
==
3
||
orderInfo
.
getResult
().
getOrderType
()
==
4
)
{
BaseResponse
storeCheckResponse
=
checkOrderByStore
(
orderInfo
.
getResult
().
getPartnerId
(),
orderInfo
.
getResult
().
getStoreId
(),
LogThreadLocal
.
getTrackingNo
());
menuType
=
"saasdelivery"
;
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
storeCheckResponse
.
getCode
()))
{
orderType
=
2
;
return
storeCheckResponse
;
}
}
List
<
CartGoods
>
cartGoodsList
=
getOrderGoods
(
orderInfo
.
getResult
());
String
storeId
=
orderInfo
.
getResult
().
getStoreId
();
String
storeId
=
orderInfo
.
getResult
().
getStoreId
();
if
(
StringUtils
.
isNotEmpty
(
requestVo
.
getShopId
())){
if
(
StringUtils
.
isNotEmpty
(
requestVo
.
getShopId
())){
storeId
=
requestVo
.
getShopId
();
storeId
=
requestVo
.
getShopId
();
}
}
if
(
orderInfo
.
getResult
().
getOrderType
()
==
3
||
orderInfo
.
getResult
().
getOrderType
()
==
4
)
{
BaseResponse
storeCheckResponse
=
checkOrderByStore
(
orderInfo
.
getResult
().
getPartnerId
(),
storeId
,
LogThreadLocal
.
getTrackingNo
());
menuType
=
"saasdelivery"
;
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
storeCheckResponse
.
getCode
()))
{
orderType
=
2
;
return
storeCheckResponse
;
}
List
<
CartGoods
>
cartGoodsList
=
getOrderGoods
(
orderInfo
.
getResult
());
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_GETINFO_INVAILD
);
}
}
// check购物车中所有商品
cartGoodsList
=
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
cartGoodsList
);
// 如果购物车商品不为空, 则check购物车中所有商品
// 如果购物车商品不为空, 则check购物车中所有商品
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
))
{
if
(
shoppingCartGoodsResponseVo
.
getChanged
()
&&
requestVo
.
getOperationType
()
==
ShoppingCartOperationType
.
CHECK
.
getCode
())
{
// check购物车中所有商品
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
cartGoodsList
=
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
cartGoodsList
);
// 重新存储最新购物车
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
}
}
// 重新存储最新购物车
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
// 促销活动的优惠金额计算
// 促销活动的优惠金额计算
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
null
,
null
,
calculationService
.
updateShoppingCartGoodsDiscount
(
partnerId
,
storeId
,
userId
,
appId
,
orderType
,
assortmentCustomerInfoVo
.
isMemberPaid
(),
menuType
,
null
,
null
,
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
);
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>(),
shoppingCartGoodsResponseVo
);
...
@@ -692,7 +695,9 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -692,7 +695,9 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
());
}
else
if
(
10
==
orderItem
.
getProductType
())
{
}
else
if
(
10
==
orderItem
.
getProductType
())
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
());
}
else
{
}
else
if
(!
orderItem
.
getProductId
().
equals
(
orderItem
.
getProductSpec
()))
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
());
}
else
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
COMMON_GOODS
.
getGoodsType
());
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
COMMON_GOODS
.
getGoodsType
());
}
}
if
((
"早餐啡常搭"
.
equals
(
orderItem
.
getProductName
())
&&
"早餐啡常搭"
.
equals
(
orderItem
.
getProductSpecName
()))
if
((
"早餐啡常搭"
.
equals
(
orderItem
.
getProductName
())
&&
"早餐啡常搭"
.
equals
(
orderItem
.
getProductSpecName
()))
...
@@ -722,7 +727,7 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -722,7 +727,7 @@ public class ShoppingCartMCoffeeServiceImpl {
private
CartGoods
.
ComboxGoods
getComboxGoods
(
CartGoods
cartGoods
,
OrderItemResp
orderItemResp
)
{
private
CartGoods
.
ComboxGoods
getComboxGoods
(
CartGoods
cartGoods
,
OrderItemResp
orderItemResp
)
{
CartGoods
.
ComboxGoods
comboxGoods
=
new
CartGoods
.
ComboxGoods
();
CartGoods
.
ComboxGoods
comboxGoods
=
new
CartGoods
.
ComboxGoods
();
comboxGoods
.
setSkuId
(
orderItemResp
.
getProduct
Id
());
comboxGoods
.
setSkuId
(
orderItemResp
.
getProduct
Spec
());
comboxGoods
.
setGoodsId
(
orderItemResp
.
getProductId
());
comboxGoods
.
setGoodsId
(
orderItemResp
.
getProductId
());
comboxGoods
.
setQty
(
orderItemResp
.
getProductQuantity
());
comboxGoods
.
setQty
(
orderItemResp
.
getProductQuantity
());
comboxGoods
.
setOriginalPrice
(
orderItemResp
.
getProductPrice
().
longValue
());
comboxGoods
.
setOriginalPrice
(
orderItemResp
.
getProductPrice
().
longValue
());
...
@@ -744,39 +749,6 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -744,39 +749,6 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
map
.
containsKey
(
"isFixedProduct"
)
&&
!(
boolean
)
map
.
get
(
"isFixedProduct"
))
{
if
(
map
.
containsKey
(
"isFixedProduct"
)
&&
!(
boolean
)
map
.
get
(
"isFixedProduct"
))
{
cartGoods
.
getProductGroupList
().
add
(
comboxGoods
);
cartGoods
.
getProductGroupList
().
add
(
comboxGoods
);
}
}
if
(
6
==
orderItemResp
.
getProductType
())
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
());
}
else
if
(
10
==
orderItemResp
.
getProductType
())
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
SKU_GOODS
.
getGoodsType
());
}
else
{
cartGoods
.
setGoodsType
(
com
.
freemud
.
sdk
.
api
.
assortment
.
shoppingcart
.
constant
.
GoodsTypeEnum
.
COMMON_GOODS
.
getGoodsType
());
}
// comboxGoods.setWeight(orderItemResp.getWeight());
// productBean.setCustomerCode(orderItemResp.getThirdProductId());
// productBean.setProductCode(orderItemResp.getProductCode());
// productBean.setNumber(orderItemResp.getProductQuantity());
// productBean.setOpid(orderItemResp.getProductSeq() == null ? null : orderItemResp.getProductSeq().toString());
// productBean.setSequence(orderItemResp.getProductSeq() == null ? 0 : orderItemResp.getProductSeq());
// productBean.setOrderId(orderItemResp.getOrderCode());
// comboxGoods.setProductId(orderItemResp.getProductId());
// productBean.setParentProductId("");
// productBean.setPicture(orderItemResp.getProductPicUrl());
// productBean.setPrice(orderItemResp.getProductPrice().longValue());
// productBean.setSalePrice(orderItemResp.getSalePrice().longValue());
// productBean.setProductName(orderItemResp.getProductName());
// productBean.setSpecification(orderItemResp.getProductSpec());
// productBean.setSpecificationName(orderItemResp.getProductSpecName());
// productBean.setProductSharePrice(orderItemResp.getProductSharePrice());
// productBean.setSettlementPrice(orderItemResp.getSettlementPrice().longValue());
// productBean.setUnit(orderItemResp.getProductUnit());
//
// // 套餐
// productBean.setParentProductId(orderItemResp.getParentProductId());
// productBean.setProductType(orderItemResp.getProductType());
// productBean.setId(orderItemResp.getId());
return
comboxGoods
;
return
comboxGoods
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/entity/CopyShoppingCartRequestVo.java
View file @
e8d46e16
...
@@ -44,4 +44,10 @@ public class CopyShoppingCartRequestVo {
...
@@ -44,4 +44,10 @@ public class CopyShoppingCartRequestVo {
@NotEmpty
(
message
=
"orderId不能为空"
)
@NotEmpty
(
message
=
"orderId不能为空"
)
private
String
orderId
;
private
String
orderId
;
/**
* 操作类型 ShoppingCartOperationType 枚举
* 校验通过直接返回购物车商品数据
*/
private
Integer
operationType
;
}
}
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