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
jenkins
order-group
Commits
9fb9285d
Commit
9fb9285d
authored
Jan 08, 2020
by
haibo.jiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/1.9.9-购物车接口增加渠道-海波'
parents
2e7b1ae7
6067bcb5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
100 additions
and
13 deletions
+100
-13
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/request/GetProductInfoRequest.java
+2
-0
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddGoodsByWeixinCardRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddShoppingCartGoodsRequestVo.java
+7
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/UpdateShoppingCartGoodsQtyRequestVo.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/enums/BusinessTypeEnum.java
+51
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AdditionalPromotionService.java
+2
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
+3
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuyAndGiftsPromotionService.java
+9
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+7
-5
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/request/GetProductInfoRequest.java
View file @
9fb9285d
...
@@ -27,4 +27,6 @@ public class GetProductInfoRequest {
...
@@ -27,4 +27,6 @@ public class GetProductInfoRequest {
String
trackingNo
;
String
trackingNo
;
String
businessType
;
}
}
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/ShoppingCartBaseService.java
View file @
9fb9285d
...
@@ -106,7 +106,7 @@ public interface ShoppingCartBaseService {
...
@@ -106,7 +106,7 @@ public interface ShoppingCartBaseService {
getProductInfoDto
.
setShopId
(
getProductInfoRequest
.
getStoreId
());
getProductInfoDto
.
setShopId
(
getProductInfoRequest
.
getStoreId
());
getProductInfoDto
.
setProductInfoType
(
2
);
getProductInfoDto
.
setProductInfoType
(
2
);
getProductInfoDto
.
setProductIds
(
goodsIds
);
getProductInfoDto
.
setProductIds
(
goodsIds
);
getProductInfoDto
.
setChannel
(
OrderChannelType
.
SAAS
.
getCod
e
());
getProductInfoDto
.
setChannel
(
getProductInfoRequest
.
getBusinessTyp
e
());
ProductService
productService
=
SDKCommonBaseContextWare
.
getBean
(
ProductService
.
class
);
ProductService
productService
=
SDKCommonBaseContextWare
.
getBean
(
ProductService
.
class
);
com
.
freemud
.
application
.
sdk
.
api
.
base
.
BaseResponse
<
ProductInfosDTO
>
productInfosDTOBaseResponse
=
productService
.
listProductInfoByIdList
(
getProductInfoDto
,
LogThreadLocal
.
getTrackingNo
());
com
.
freemud
.
application
.
sdk
.
api
.
base
.
BaseResponse
<
ProductInfosDTO
>
productInfosDTOBaseResponse
=
productService
.
listProductInfoByIdList
(
getProductInfoDto
,
LogThreadLocal
.
getTrackingNo
());
if
(!
Objects
.
equals
(
ResponseResultEnum
.
SUCCESS
.
getCode
(),
productInfosDTOBaseResponse
.
getCode
())
||
productInfosDTOBaseResponse
.
getData
()
==
null
)
{
if
(!
Objects
.
equals
(
ResponseResultEnum
.
SUCCESS
.
getCode
(),
productInfosDTOBaseResponse
.
getCode
())
||
productInfosDTOBaseResponse
.
getData
()
==
null
)
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddGoodsByWeixinCardRequestVo.java
View file @
9fb9285d
...
@@ -48,5 +48,12 @@ public class AddGoodsByWeixinCardRequestVo {
...
@@ -48,5 +48,12 @@ public class AddGoodsByWeixinCardRequestVo {
@NotNull
(
message
=
"couponType不能为空"
)
@NotNull
(
message
=
"couponType不能为空"
)
private
Integer
couponType
;
private
Integer
couponType
;
private
String
skuId
;
private
String
skuId
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
Integer
businessType
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddShoppingCartGoodsRequestVo.java
View file @
9fb9285d
...
@@ -75,7 +75,14 @@ public class AddShoppingCartGoodsRequestVo {
...
@@ -75,7 +75,14 @@ public class AddShoppingCartGoodsRequestVo {
private
String
appType
;
private
String
appType
;
private
String
tableNumber
;
private
String
tableNumber
;
private
Integer
qty
;
private
Integer
qty
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
Integer
businessType
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
9fb9285d
...
@@ -90,6 +90,11 @@ public class ShoppingCartInfoRequestVo {
...
@@ -90,6 +90,11 @@ public class ShoppingCartInfoRequestVo {
*/
*/
private
BuyMemberCard
buyMemberCard
;
private
BuyMemberCard
buyMemberCard
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
Integer
businessType
;
@Data
@Data
public
final
static
class
SendGoods
{
public
final
static
class
SendGoods
{
/**
/**
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/UpdateShoppingCartGoodsQtyRequestVo.java
View file @
9fb9285d
...
@@ -58,4 +58,9 @@ public class UpdateShoppingCartGoodsQtyRequestVo {
...
@@ -58,4 +58,9 @@ public class UpdateShoppingCartGoodsQtyRequestVo {
*/
*/
private
Integer
carVer
;
private
Integer
carVer
;
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
private
Integer
businessType
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/enums/BusinessTypeEnum.java
0 → 100644
View file @
9fb9285d
package
cn
.
freemud
.
enums
;
import
java.util.Arrays
;
public
enum
BusinessTypeEnum
{
SAAS_PICKUP
(
0
,
"自提"
,
"saas"
),
SAAS_DELIVERY
(
1
,
"外卖"
,
"saas_delivery"
),
SAAS_MALL
(
2
,
"商城"
,
"saas_mall"
),
SAAS_WC
(
3
,
"围餐"
,
"wc"
);
private
Integer
type
;
private
String
name
;
private
String
code
;
BusinessTypeEnum
(
Integer
type
,
String
name
,
String
code
)
{
this
.
type
=
type
;
this
.
name
=
name
;
this
.
code
=
code
;
}
public
static
BusinessTypeEnum
getByType
(
Integer
type
)
{
return
Arrays
.
stream
(
BusinessTypeEnum
.
values
())
.
filter
(
e
->
e
.
type
.
equals
(
type
))
.
findFirst
().
get
();
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AdditionalPromotionService.java
View file @
9fb9285d
...
@@ -97,7 +97,8 @@ public class AdditionalPromotionService implements IPromotionService {
...
@@ -97,7 +97,8 @@ public class AdditionalPromotionService implements IPromotionService {
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoods
=
shoppingCartInfoRequestVo
.
getSendGoods
();
List
<
String
>
goodsIds
=
sendGoods
.
stream
().
map
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
List
<
String
>
goodsIds
=
sendGoods
.
stream
().
map
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
Map
<
String
,
ShoppingCartInfoRequestVo
.
SendGoods
>
goodQtyMap
=
sendGoods
.
stream
().
collect
(
Collectors
.
toMap
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
Map
<
String
,
ShoppingCartInfoRequestVo
.
SendGoods
>
goodQtyMap
=
sendGoods
.
stream
().
collect
(
Collectors
.
toMap
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
(),
goodsIds
,
shoppingCartBaseService
);
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
shoppingCartInfoRequestVo
.
getPartnerId
()
,
shoppingCartInfoRequestVo
.
getShopId
(),
goodsIds
,
shoppingCartInfoRequestVo
.
getBusinessType
(),
shoppingCartBaseService
);
if
(
CollectionUtils
.
isEmpty
(
productBeanList
))
{
if
(
CollectionUtils
.
isEmpty
(
productBeanList
))
{
throw
new
ServiceException
(
ResponseResult
.
PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST
);
throw
new
ServiceException
(
ResponseResult
.
PREMIUM_EXCHANGE_ACTIVITY_NOT_EXIST
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
View file @
9fb9285d
...
@@ -4,6 +4,7 @@ import ch.qos.logback.classic.Level;
...
@@ -4,6 +4,7 @@ import ch.qos.logback.classic.Level;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.CartGoods
;
import
cn.freemud.entities.vo.ShoppingCartGoodsBaseResponseVo
;
import
cn.freemud.entities.vo.ShoppingCartGoodsBaseResponseVo
;
import
cn.freemud.enums.BusinessTypeEnum
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
...
@@ -162,12 +163,13 @@ public class AssortmentSdkService {
...
@@ -162,12 +163,13 @@ public class AssortmentSdkService {
* @param goodsIds
* @param goodsIds
* @return
* @return
*/
*/
public
List
<
ProductBeanDTO
>
getProductsInfoSdk
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
ShoppingCartBaseService
shoppingCartService
)
{
public
List
<
ProductBeanDTO
>
getProductsInfoSdk
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
Integer
businessType
,
ShoppingCartBaseService
shoppingCartService
)
{
GetProductInfoRequest
request
=
new
GetProductInfoRequest
();
GetProductInfoRequest
request
=
new
GetProductInfoRequest
();
request
.
setGoodsIds
(
goodsIds
);
request
.
setGoodsIds
(
goodsIds
);
request
.
setPartnerId
(
partnerId
);
request
.
setPartnerId
(
partnerId
);
request
.
setStoreId
(
storeId
);
request
.
setStoreId
(
storeId
);
request
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
request
.
setTrackingNo
(
LogThreadLocal
.
getTrackingNo
());
request
.
setBusinessType
(
BusinessTypeEnum
.
getByType
(
businessType
).
getCode
());
BaseResponse
<
List
<
ProductBeanDTO
>>
baseResponse
=
BaseResponse
<
List
<
ProductBeanDTO
>>
baseResponse
=
shoppingCartService
.
getProductsInfo
(
request
);
shoppingCartService
.
getProductsInfo
(
request
);
if
(
baseResponse
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
baseResponse
.
getCode
())
||
CollectionUtils
.
isEmpty
(
baseResponse
.
getResult
()))
{
if
(
baseResponse
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
baseResponse
.
getCode
())
||
CollectionUtils
.
isEmpty
(
baseResponse
.
getResult
()))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuyAndGiftsPromotionService.java
View file @
9fb9285d
...
@@ -42,7 +42,10 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
...
@@ -42,7 +42,10 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
private
ShoppingCartBaseServiceImpl
shoppingCartBaseService
;
private
ShoppingCartBaseServiceImpl
shoppingCartBaseService
;
@Override
@Override
public
void
updateShoppingCartGoodsDiscount
(
CouponPromotionVO
couponPromotionVO
,
ActivityQueryDto
activityQueryDto
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
List
<
CartGoods
>
cartGoodsList
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
UserLoginInfoDto
userLoginInfoDto
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
)
{
public
void
updateShoppingCartGoodsDiscount
(
CouponPromotionVO
couponPromotionVO
,
ActivityQueryDto
activityQueryDto
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
List
<
CartGoods
>
cartGoodsList
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
UserLoginInfoDto
userLoginInfoDto
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
)
{
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getSendGoods
()))
{
if
(
calculationDiscountResult
==
null
||
CollectionUtils
.
isEmpty
(
calculationDiscountResult
.
getSendGoods
()))
{
return
;
return
;
}
}
...
@@ -52,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
...
@@ -52,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
}
}
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
=
new
ArrayList
<>();
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
=
new
ArrayList
<>();
sendActivities
.
forEach
(
sendActivity
->
sendGoodsList
.
addAll
(
sendActivity
.
getSendGoods
()));
sendActivities
.
forEach
(
sendActivity
->
sendGoodsList
.
addAll
(
sendActivity
.
getSendGoods
()));
List
<
ProductBeanDTO
>
productBeanDTOS
=
buildActivityProduct
(
activityQueryDto
,
sendGoodsList
);
List
<
ProductBeanDTO
>
productBeanDTOS
=
buildActivityProduct
(
activityQueryDto
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
getBusinessType
()
);
if
(
CollectionUtils
.
isEmpty
(
productBeanDTOS
))
{
if
(
CollectionUtils
.
isEmpty
(
productBeanDTOS
))
{
return
;
return
;
}
}
...
@@ -145,10 +148,12 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
...
@@ -145,10 +148,12 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
* @param sendGoodsList
* @param sendGoodsList
* @return
* @return
*/
*/
private
List
<
ProductBeanDTO
>
buildActivityProduct
(
ActivityQueryDto
activityQueryDto
,
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
)
{
private
List
<
ProductBeanDTO
>
buildActivityProduct
(
ActivityQueryDto
activityQueryDto
,
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
,
Integer
businessType
)
{
//获取
//获取
List
<
String
>
goodsIds
=
sendGoodsList
.
stream
().
map
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
List
<
String
>
goodsIds
=
sendGoodsList
.
stream
().
map
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
activityQueryDto
.
getPartnerId
(),
activityQueryDto
.
getStoreId
(),
goodsIds
,
shoppingCartBaseService
);
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
activityQueryDto
.
getPartnerId
()
,
activityQueryDto
.
getStoreId
(),
goodsIds
,
businessType
,
shoppingCartBaseService
);
if
(
CollectionUtils
.
isEmpty
(
productBeanList
))
{
if
(
CollectionUtils
.
isEmpty
(
productBeanList
))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
View file @
9fb9285d
...
@@ -102,7 +102,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
...
@@ -102,7 +102,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
}
}
// 获取商品信息
// 获取商品信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
mealCartBaseService
);
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
requestVo
.
getBusinessType
(),
mealCartBaseService
);
if
(
productBeanListSpuClass
==
null
)
{
if
(
productBeanListSpuClass
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_ADD_ERROR
);
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_ADD_ERROR
);
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
9fb9285d
...
@@ -174,7 +174,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -174,7 +174,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
// 判断商品状态是否可以加入购物车
// 判断商品状态是否可以加入购物车
List
<
ProductBeanDTO
>
productInfos
=
assortmentSdkService
.
getProductsInfoSdk
(
request
.
getPartnerId
(),
request
.
getShopId
(),
Arrays
.
asList
(
getProductsVo
.
getSpuId
()),
this
.
shoppingCartBaseService
);
List
<
ProductBeanDTO
>
productInfos
=
assortmentSdkService
.
getProductsInfoSdk
(
request
.
getPartnerId
(),
request
.
getShopId
(),
Arrays
.
asList
(
getProductsVo
.
getSpuId
()),
request
.
getBusinessType
(),
this
.
shoppingCartBaseService
);
if
(
CollectionUtils
.
isNotEmpty
(
productInfos
))
{
if
(
CollectionUtils
.
isNotEmpty
(
productInfos
))
{
ProductBeanDTO
productBean
=
productInfos
.
get
(
0
);
ProductBeanDTO
productBean
=
productInfos
.
get
(
0
);
Integer
status
=
productBean
.
getStatus
();
Integer
status
=
productBean
.
getStatus
();
...
@@ -224,7 +224,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -224,7 +224,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
);
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
);
}
}
// 获取商品详细信息
// 获取商品详细信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
this
.
shoppingCartBaseService
);
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
getBusinessType
(),
this
.
shoppingCartBaseService
);
//缓存中获取购物车商品信息
//缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样
// 注意,围餐和点餐redis数据结构不一样
...
@@ -585,7 +586,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -585,7 +586,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
coupons
.
add
(
coupon
);
coupons
.
add
(
coupon
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
sendGoodsList
))
{
processSendGoods
(
sendGoodsList
,
partnerId
,
storeId
,
shoppingCartBaseService
);
processSendGoods
(
sendGoodsList
,
partnerId
,
storeId
,
shoppingCartInfoRequestVo
.
getBusinessType
()
,
shoppingCartBaseService
);
}
else
{
}
else
{
//组装加价购商品
//组装加价购商品
if
(
null
!=
premiumExchangeActivity
&&
CollectionUtils
.
isNotEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
if
(
null
!=
premiumExchangeActivity
&&
CollectionUtils
.
isNotEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
...
@@ -838,10 +839,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -838,10 +839,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* @param partnerId
* @param partnerId
* @param storeId
* @param storeId
*/
*/
private
void
processSendGoods
(
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
partnerId
,
String
storeId
,
ShoppingCartBaseService
shoppingCartService
)
{
private
void
processSendGoods
(
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
partnerId
,
String
storeId
,
Integer
businessType
,
ShoppingCartBaseService
shoppingCartService
)
{
List
<
String
>
goodsIds
=
sendGoodsList
.
parallelStream
().
map
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
List
<
String
>
goodsIds
=
sendGoodsList
.
parallelStream
().
map
(
ShoppingCartInfoRequestVo
.
SendGoods
::
getGoodsId
).
collect
(
Collectors
.
toList
());
List
<
ProductBeanDTO
>
productBeanList
=
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
goodsIds
,
shoppingCartService
);
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
goodsIds
,
businessType
,
shoppingCartService
);
// 将productBeanList转换为Map,key为pid,即goodsId
// 将productBeanList转换为Map,key为pid,即goodsId
Map
<
String
,
ProductBeanDTO
>
productBeanMap
=
productBeanList
.
parallelStream
()
Map
<
String
,
ProductBeanDTO
>
productBeanMap
=
productBeanList
.
parallelStream
()
.
collect
(
Collectors
.
toMap
(
ProductBeanDTO:
:
getPid
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
.
collect
(
Collectors
.
toMap
(
ProductBeanDTO:
:
getPid
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
...
...
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