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
908a1316
Commit
908a1316
authored
Dec 22, 2020
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
8e7787d2
a08694cc
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
121 additions
and
10 deletions
+121
-10
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+16
-8
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+4
-0
order-application-service/src/main/java/cn/freemud/entities/vo/ProductVo.java
+5
-0
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
+4
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
+78
-0
shopping-cart-application-service/src/main/resources/application.properties
+0
-2
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
908a1316
...
@@ -2098,15 +2098,16 @@ public class OrderAdapter {
...
@@ -2098,15 +2098,16 @@ public class OrderAdapter {
discountTotalAmount
=
discountTotalAmount
+
productDiscount
.
getDiscountAmount
()*
productDiscount
.
getDiscountQty
();
discountTotalAmount
=
discountTotalAmount
+
productDiscount
.
getDiscountAmount
()*
productDiscount
.
getDiscountQty
();
if
(
OrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
productDiscount
.
getDiscountType
()))
{
if
(
OrderAccountType
.
PRODUCT_COUPON
.
getCode
().
equals
(
productDiscount
.
getDiscountType
()))
{
hasProductCoupon
=
true
;
hasProductCoupon
=
true
;
Integer
extendType
=
StringUtils
.
isBlank
(
productDiscount
.
getAddInfo
())?
null
:
JSON
.
parseObject
(
productDiscount
.
getAddInfo
()).
getInteger
(
"extendType"
);
if
(
null
!=
extendType
&&
(
3
==
extendType
||
4
==
extendType
||
5
==
extendType
))
{
productVo
.
setCouponName
(
productDiscount
.
getDiscountDesc
());
productVo
.
setCouponName
(
productDiscount
.
getDiscountDesc
());
}
else
{
// Integer extendType = StringUtils.isBlank(productDiscount.getAddInfo())?null:JSON.parseObject(productDiscount.getAddInfo()).getInteger("extendType");
productVo
.
setName
(
productDiscount
.
getDiscountDesc
());
// if(null != extendType && (3 == extendType || 4 == extendType || 5 == extendType)) {
productVo
.
setSpuName
(
productDiscount
.
getDiscountDesc
());
// productVo.setCouponName(productDiscount.getDiscountDesc());
productVo
.
setExtras
(
""
);
// } else {
productVo
.
setSpecification
(
""
);
// productVo.setName(productDiscount.getDiscountDesc());
}
// productVo.setSpuName(productDiscount.getDiscountDesc());
// productVo.setExtras("");
// productVo.setSpecification("");
// }
}
}
if
(
OrderAccountType
.
BUYM_SENDN
.
getCode
().
equals
(
productDiscount
.
getDiscountType
()))
{
if
(
OrderAccountType
.
BUYM_SENDN
.
getCode
().
equals
(
productDiscount
.
getDiscountType
()))
{
activityType
=
ActivityTypeEnum
.
TYPE_61
.
getCode
();
activityType
=
ActivityTypeEnum
.
TYPE_61
.
getCode
();
...
@@ -2136,6 +2137,9 @@ public class OrderAdapter {
...
@@ -2136,6 +2137,9 @@ public class OrderAdapter {
//套餐
//套餐
productVo
.
setParentProductId
(
productBean
.
getParentProductId
());
productVo
.
setParentProductId
(
productBean
.
getParentProductId
());
productVo
.
setProductType
(
productBean
.
getProductType
());
productVo
.
setProductType
(
productBean
.
getProductType
());
if
(
ProductTypeEnum
.
TABLEWARE_PRODUCT
.
getCode
().
equals
(
productBean
.
getProductType
()))
{
productVo
.
setIsTableware
(
true
);
}
productVo
.
setUnit
(
productBean
.
getUnit
());
productVo
.
setUnit
(
productBean
.
getUnit
());
productVo
.
setWeight
(
productBean
.
getWeight
()
!=
null
?
productBean
.
getWeight
().
doubleValue
()
:
0
);
productVo
.
setWeight
(
productBean
.
getWeight
()
!=
null
?
productBean
.
getWeight
().
doubleValue
()
:
0
);
return
productVo
;
return
productVo
;
...
@@ -2455,7 +2459,11 @@ public class OrderAdapter {
...
@@ -2455,7 +2459,11 @@ public class OrderAdapter {
createOrderProductDemoDto
.
setPicture
(
cartGoodsDetailDto
.
getPicture
());
createOrderProductDemoDto
.
setPicture
(
cartGoodsDetailDto
.
getPicture
());
createOrderProductDemoDto
.
setAddInfo
(
cartGoodsDetailDto
.
getAttributeNames
());
createOrderProductDemoDto
.
setAddInfo
(
cartGoodsDetailDto
.
getAttributeNames
());
createOrderProductDemoDto
.
setDiscountId
(
cartGoodsDetailDto
.
getCouponCode
());
createOrderProductDemoDto
.
setDiscountId
(
cartGoodsDetailDto
.
getCouponCode
());
if
(
cartGoodsDetailDto
.
getIsTableware
()
==
0
)
{
createOrderProductDemoDto
.
setProductType
(
productType
);
createOrderProductDemoDto
.
setProductType
(
productType
);
}
else
{
createOrderProductDemoDto
.
setProductType
(
ProductTypeEnum
.
TABLEWARE_PRODUCT
.
getCode
());
}
createOrderProductDemoDto
.
setParentProductId
(
cartGoodsDetailDto
.
getParentProductId
());
createOrderProductDemoDto
.
setParentProductId
(
cartGoodsDetailDto
.
getParentProductId
());
createOrderProductDemoDto
.
setIsFixedProduct
(
cartGoodsDetailDto
.
getIsFixedProduct
());
createOrderProductDemoDto
.
setIsFixedProduct
(
cartGoodsDetailDto
.
getIsFixedProduct
());
createOrderProductDemoDto
.
setCustomerCode
(
cartGoodsDetailDto
.
getCustomerCode
());
createOrderProductDemoDto
.
setCustomerCode
(
cartGoodsDetailDto
.
getCustomerCode
());
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
908a1316
...
@@ -203,6 +203,10 @@ public class ShoppingCartGoodsDto {
...
@@ -203,6 +203,10 @@ public class ShoppingCartGoodsDto {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Integer
isTableware
=
0
;
/**
* 商品重量
* 商品重量
*/
*/
private
Double
weight
;
private
Double
weight
;
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/ProductVo.java
View file @
908a1316
...
@@ -154,6 +154,11 @@ public class ProductVo {
...
@@ -154,6 +154,11 @@ public class ProductVo {
private
Integer
productType
;
private
Integer
productType
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableware
=
false
;
/**
* 商品单位
* 商品单位
*/
*/
private
String
unit
;
private
String
unit
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
View file @
908a1316
...
@@ -708,6 +708,9 @@ public class CheckMCCafeOrder {
...
@@ -708,6 +708,9 @@ public class CheckMCCafeOrder {
//校验收货地址是否可配送
//校验收货地址是否可配送
String
receiveId
=
createOrderVo
.
getReceiveId
();
String
receiveId
=
createOrderVo
.
getReceiveId
();
String
trackingNo
=
LogThreadLocal
.
getTrackingNo
();
String
trackingNo
=
LogThreadLocal
.
getTrackingNo
();
if
(
StringUtils
.
isBlank
(
receiveId
))
{
throw
new
ServiceException
(
ResponseResult
.
ORDER_TAKE_OUT_ADDRESS_INVAILD
,
"收货地址不能为空"
);
}
QueryReceiveAddressRequest
request
=
new
QueryReceiveAddressRequest
(
receiveId
,
storeDeliveryInfoDto
.
getPartnerId
());
QueryReceiveAddressRequest
request
=
new
QueryReceiveAddressRequest
(
receiveId
,
storeDeliveryInfoDto
.
getPartnerId
());
BaseResponse
<
QueryReceiveAddressResponse
>
queryReceiveAddressResponse
=
memberCenterService
.
queryReceiveAddressById
(
request
,
trackingNo
);
BaseResponse
<
QueryReceiveAddressResponse
>
queryReceiveAddressResponse
=
memberCenterService
.
queryReceiveAddressById
(
request
,
trackingNo
);
if
(!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
queryReceiveAddressResponse
.
getCode
())
||
queryReceiveAddressResponse
.
getData
()
==
null
)
{
if
(!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
queryReceiveAddressResponse
.
getCode
())
||
queryReceiveAddressResponse
.
getData
()
==
null
)
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
908a1316
...
@@ -30,6 +30,7 @@ import com.google.common.collect.Lists;
...
@@ -30,6 +30,7 @@ import com.google.common.collect.Lists;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.*
;
...
@@ -42,6 +43,9 @@ public class ShoppingCartConvertAdapter {
...
@@ -42,6 +43,9 @@ public class ShoppingCartConvertAdapter {
private
static
final
String
ATTRIBUTEID
=
"attributeId"
;
private
static
final
String
ATTRIBUTEID
=
"attributeId"
;
private
static
final
String
ATTRIBUTENAME
=
"attributeName"
;
private
static
final
String
ATTRIBUTENAME
=
"attributeName"
;
@Value
(
"${mccafe.tableware.skuId}"
)
private
String
mcCafeTablewareSkuId
;
public
ShoppingCartGoodsDto
.
CartGoodsDetailDto
getCartGoodsDetailDto
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
,
GetProductsVo
getProductsVo
,
String
goodsId
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
sendGoods
)
{
public
ShoppingCartGoodsDto
.
CartGoodsDetailDto
getCartGoodsDetailDto
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
,
GetProductsVo
getProductsVo
,
String
goodsId
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
sendGoods
)
{
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
cartGoodsDetailDto
.
setOriginalPrice
(
getProductsVo
.
getFinalPrice
());
cartGoodsDetailDto
.
setOriginalPrice
(
getProductsVo
.
getFinalPrice
());
...
@@ -121,6 +125,9 @@ public class ShoppingCartConvertAdapter {
...
@@ -121,6 +125,9 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto
.
setSpecialExtra
(
cartGoods
.
getSpecialExtra
());
cartGoodsDetailDto
.
setSpecialExtra
(
cartGoods
.
getSpecialExtra
());
cartGoodsDetailDto
.
setClassificationId
(
cartGoods
.
getClassificationId
());
cartGoodsDetailDto
.
setClassificationId
(
cartGoods
.
getClassificationId
());
cartGoodsDetailDto
.
setClassificationName
(
cartGoods
.
getClassificationName
());
cartGoodsDetailDto
.
setClassificationName
(
cartGoods
.
getClassificationName
());
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoods
.
getSkuId
()))
{
cartGoodsDetailDto
.
setIsTableware
(
1
);
}
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
SET_MEAL_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
cartGoodsDetailDto
.
setProductType
(
ProductType
.
SETMEAL
.
getCode
());
cartGoodsDetailDto
.
setProductType
(
ProductType
.
SETMEAL
.
getCode
());
}
else
if
(
cartGoods
.
isWeightType
())
{
}
else
if
(
cartGoods
.
isWeightType
())
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/shoppingCart/ShoppingCartGoodsDto.java
View file @
908a1316
...
@@ -255,6 +255,10 @@ public class ShoppingCartGoodsDto {
...
@@ -255,6 +255,10 @@ public class ShoppingCartGoodsDto {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Integer
isTableware
=
0
;
/**
* 商品货号
* 商品货号
*/
*/
private
String
productCode
;
private
String
productCode
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
View file @
908a1316
...
@@ -196,6 +196,10 @@ public class CartGoods {
...
@@ -196,6 +196,10 @@ public class CartGoods {
*/
*/
private
boolean
isStockLimit
;
private
boolean
isStockLimit
;
/**
/**
* 是否餐具商品
*/
private
Boolean
isTableware
=
false
;
/**
* 第三方商品编码
* 第三方商品编码
*/
*/
private
String
customerCode
;
private
String
customerCode
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
View file @
908a1316
...
@@ -123,6 +123,8 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -123,6 +123,8 @@ public class ShoppingCartMCoffeeServiceImpl {
private
String
mcCafeUniversalCouponCode
;
private
String
mcCafeUniversalCouponCode
;
@Value
(
"${mccafe.pay.card.fee}"
)
@Value
(
"${mccafe.pay.card.fee}"
)
private
String
payCardFee
;
private
String
payCardFee
;
@Value
(
"${mccafe.tableware.skuId}"
)
private
String
mcCafeTablewareSkuId
;
/**
/**
* 添加商品、超值加购、商品券
* 添加商品、超值加购、商品券
...
@@ -175,6 +177,14 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -175,6 +177,14 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
oldCartGoodsList
))
{
oldCartGoodsList
=
new
ArrayList
<>();
oldCartGoodsList
=
new
ArrayList
<>();
}
}
if
(
mcCafeTablewareSkuId
.
equals
(
skuId
))
{
for
(
CartGoods
cartGoods
:
oldCartGoodsList
)
{
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoods
.
getSkuId
()))
{
return
ResponseUtil
.
error
(
ResponseResult
.
SHOPPING_CART_ADD_ERROR
.
getCode
(),
"不能重复添加餐具商品"
);
}
}
}
//商品券已添加情况校验
//商品券已添加情况校验
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
=
checkGoodsCoupon
(
oldCartGoodsList
,
operationType
,
couponCode
,
goodsId
,
addShoppingCartGoodsRequestVo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
CartGoods
addCartGoods
=
convent2CartGoods
(
addShoppingCartGoodsRequestVo
,
goodsId
,
vo
);
...
@@ -331,6 +341,8 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -331,6 +341,8 @@ public class ShoppingCartMCoffeeServiceImpl {
// 先验证商品是否存在
// 先验证商品是否存在
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
List
<
CartGoods
>
cartGoodsList
=
assortmentSdkService
.
getShoppingCart
(
partnerId
,
storeId
,
userId
,
null
,
null
,
shoppingCartBaseService
);
CartGoods
cartGoods
=
null
;
CartGoods
cartGoods
=
null
;
String
skuId
=
""
;
Integer
finalQty
=
qty
;
for
(
CartGoods
cartGoods_
:
cartGoodsList
)
{
for
(
CartGoods
cartGoods_
:
cartGoodsList
)
{
if
(
cartGoodsUid
.
equals
(
cartGoods_
.
getCartGoodsUid
()))
{
if
(
cartGoodsUid
.
equals
(
cartGoods_
.
getCartGoodsUid
()))
{
cartGoods
=
cartGoods_
;
cartGoods
=
cartGoods_
;
...
@@ -339,10 +351,20 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -339,10 +351,20 @@ public class ShoppingCartMCoffeeServiceImpl {
}
else
{
}
else
{
cartGoods_
.
setQty
(
cartGoods_
.
getQty
()
-
(
oldQty
-
qty
));
cartGoods_
.
setQty
(
cartGoods_
.
getQty
()
-
(
oldQty
-
qty
));
}
}
skuId
=
cartGoods_
.
getSkuId
();
finalQty
=
cartGoods_
.
getQty
();
break
;
break
;
}
}
}
}
if
(!
mcCafeTablewareSkuId
.
equals
(
skuId
)
&&
finalQty
==
0
&&
CollectionUtils
.
isNotEmpty
(
cartGoodsList
)
&&
cartGoodsList
.
size
()
==
2
)
{
for
(
CartGoods
cartGoods_
:
cartGoodsList
)
{
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoods_
.
getSkuId
()))
{
cartGoods_
.
setQty
(
0
);
}
}
}
if
(
cartGoods
==
null
)
{
if
(
cartGoods
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_UPDATE_ERROR
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_UPDATE_ERROR
);
}
}
...
@@ -426,6 +448,21 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -426,6 +448,21 @@ public class ShoppingCartMCoffeeServiceImpl {
temList
.
addAll
(
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
Arrays
.
asList
(
goods
)));
temList
.
addAll
(
checkCartGoods
(
partnerId
,
storeId
,
orderType
,
menuType
,
shoppingCartGoodsResponseVo
,
Arrays
.
asList
(
goods
)));
}
}
cartGoodsList
=
temList
;
cartGoodsList
=
temList
;
//如果是餐具商品,则放到最后
if
(
CollectionUtils
.
isNotEmpty
(
cartGoodsList
))
{
int
size
=
cartGoodsList
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
if
(
cartGoodsList
.
get
(
i
).
getSkuId
().
equals
(
mcCafeTablewareSkuId
))
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
cartGoods
.
setIsTableware
(
true
);
if
(
i
!=
size
-
1
)
{
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
add
(
cartGoods
);
break
;
}
}
}
}
// 重新存储最新购物车
// 重新存储最新购物车
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
sessionId
,
""
,
shoppingCartBaseService
);
}
}
...
@@ -806,6 +843,22 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -806,6 +843,22 @@ public class ShoppingCartMCoffeeServiceImpl {
//设置均摊信息
//设置均摊信息
calculationService
.
updateShoppingCartGoodsApportion
(
shoppingCartGoodsResponseVo
,
calculationDiscount
,
shoppingCartGoodsDto
,
premiumExchangeActivity
,
shoppingCartInfoRequestVo
);
calculationService
.
updateShoppingCartGoodsApportion
(
shoppingCartGoodsResponseVo
,
calculationDiscount
,
shoppingCartGoodsDto
,
premiumExchangeActivity
,
shoppingCartInfoRequestVo
);
//如果是餐具商品,则放到最后
if
(
CollectionUtils
.
isNotEmpty
(
shoppingCartGoodsDto
.
getProducts
()))
{
int
size
=
shoppingCartGoodsDto
.
getProducts
().
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
if
(
shoppingCartGoodsDto
.
getProducts
().
get
(
i
).
getSkuId
().
equals
(
mcCafeTablewareSkuId
))
{
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
shoppingCartGoodsDto
.
getProducts
().
get
(
i
);
cartGoodsDetailDto
.
setIsTableware
(
1
);
if
(
i
!=
size
-
1
)
{
shoppingCartGoodsDto
.
getProducts
().
remove
(
i
);
shoppingCartGoodsDto
.
getProducts
().
add
(
cartGoodsDetailDto
);
break
;
}
}
}
}
return
ResponseUtil
.
success
(
shoppingCartGoodsDto
);
return
ResponseUtil
.
success
(
shoppingCartGoodsDto
);
}
}
...
@@ -834,6 +887,14 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -834,6 +887,14 @@ public class ShoppingCartMCoffeeServiceImpl {
// 如果购物车商品不为空, 则check购物车中所有商品
// 如果购物车商品不为空, 则check购物车中所有商品
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
if
(
CollectionUtils
.
isEmpty
(
cartGoodsList
))
{
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
else
{
//移除餐具商品
for
(
int
i
=
0
;
i
<
cartGoodsList
.
size
();
i
++)
{
if
(
mcCafeTablewareSkuId
.
equals
(
cartGoodsList
.
get
(
i
).
getSkuId
()))
{
cartGoodsList
.
remove
(
i
);
break
;
}
}
}
}
List
<
CartGoods
>
onlyCheckGoodsList
=
new
ArrayList
<>();
List
<
CartGoods
>
onlyCheckGoodsList
=
new
ArrayList
<>();
...
@@ -1595,6 +1656,23 @@ public class ShoppingCartMCoffeeServiceImpl {
...
@@ -1595,6 +1656,23 @@ public class ShoppingCartMCoffeeServiceImpl {
if
(
CollectionUtils
.
isNotEmpty
(
reduceGoods
))
{
if
(
CollectionUtils
.
isNotEmpty
(
reduceGoods
))
{
allCartGoodsList
.
addAll
(
reduceGoods
);
allCartGoodsList
.
addAll
(
reduceGoods
);
}
}
//如果是餐具商品,则放到最后
if
(
CollectionUtils
.
isNotEmpty
(
allCartGoodsList
))
{
int
size
=
allCartGoodsList
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
if
(
allCartGoodsList
.
get
(
i
).
getSkuId
().
equals
(
mcCafeTablewareSkuId
))
{
CartGoods
cartGoods
=
allCartGoodsList
.
get
(
i
);
cartGoods
.
setIsTableware
(
true
);
if
(
i
!=
size
-
1
)
{
allCartGoodsList
.
remove
(
i
);
allCartGoodsList
.
add
(
cartGoods
);
break
;
}
}
}
}
return
allCartGoodsList
;
return
allCartGoodsList
;
}
}
...
...
shopping-cart-application-service/src/main/resources/application.properties
View file @
908a1316
...
@@ -22,5 +22,3 @@ management.metrics.tags.application=${spring.application.name}
...
@@ -22,5 +22,3 @@ management.metrics.tags.application=${spring.application.name}
management.endpoint.shutdown.enabled
=
true
management.endpoint.shutdown.enabled
=
true
management.security.enabled
=
false
management.security.enabled
=
false
management.health.rabbit.enabled
=
false
management.health.rabbit.enabled
=
false
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