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
a88e8cd6
Commit
a88e8cd6
authored
Jan 10, 2020
by
姜海波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
businessType =》 menuType
parent
c31005a7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
16 deletions
+16
-16
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddGoodsByWeixinCardRequestVo.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddShoppingCartGoodsRequestVo.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/UpdateShoppingCartGoodsQtyRequestVo.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AdditionalPromotionService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/BuyAndGiftsPromotionService.java
+3
-3
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
+5
-5
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddGoodsByWeixinCardRequestVo.java
View file @
a88e8cd6
...
@@ -55,5 +55,5 @@ public class AddGoodsByWeixinCardRequestVo {
...
@@ -55,5 +55,5 @@ public class AddGoodsByWeixinCardRequestVo {
/**
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
*/
private
Integer
business
Type
;
private
Integer
menu
Type
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/AddShoppingCartGoodsRequestVo.java
View file @
a88e8cd6
...
@@ -83,6 +83,6 @@ public class AddShoppingCartGoodsRequestVo {
...
@@ -83,6 +83,6 @@ public class AddShoppingCartGoodsRequestVo {
/**
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
*/
private
Integer
business
Type
;
private
Integer
menu
Type
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartInfoRequestVo.java
View file @
a88e8cd6
...
@@ -93,7 +93,7 @@ public class ShoppingCartInfoRequestVo {
...
@@ -93,7 +93,7 @@ public class ShoppingCartInfoRequestVo {
/**
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
*/
private
Integer
business
Type
;
private
Integer
menu
Type
;
@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 @
a88e8cd6
...
@@ -61,6 +61,6 @@ public class UpdateShoppingCartGoodsQtyRequestVo {
...
@@ -61,6 +61,6 @@ public class UpdateShoppingCartGoodsQtyRequestVo {
/**
/**
* 业务类型: 0 : 自提 1:外卖 2:微商城
* 业务类型: 0 : 自提 1:外卖 2:微商城
*/
*/
private
Integer
business
Type
;
private
Integer
menu
Type
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AdditionalPromotionService.java
View file @
a88e8cd6
...
@@ -98,7 +98,7 @@ public class AdditionalPromotionService implements IPromotionService {
...
@@ -98,7 +98,7 @@ public class AdditionalPromotionService implements IPromotionService {
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
()
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
shoppingCartInfoRequestVo
.
getPartnerId
()
,
shoppingCartInfoRequestVo
.
getShopId
(),
goodsIds
,
shoppingCartInfoRequestVo
.
get
Business
Type
(),
shoppingCartBaseService
);
,
shoppingCartInfoRequestVo
.
getShopId
(),
goodsIds
,
shoppingCartInfoRequestVo
.
get
Menu
Type
(),
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 @
a88e8cd6
...
@@ -163,13 +163,13 @@ public class AssortmentSdkService {
...
@@ -163,13 +163,13 @@ public class AssortmentSdkService {
* @param goodsIds
* @param goodsIds
* @return
* @return
*/
*/
public
List
<
ProductBeanDTO
>
getProductsInfoSdk
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
Integer
business
Type
,
ShoppingCartBaseService
shoppingCartService
)
{
public
List
<
ProductBeanDTO
>
getProductsInfoSdk
(
String
partnerId
,
String
storeId
,
List
<
String
>
goodsIds
,
Integer
menu
Type
,
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
(
business
Type
).
getCode
());
request
.
setBusinessType
(
BusinessTypeEnum
.
getByType
(
menu
Type
).
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 @
a88e8cd6
...
@@ -55,7 +55,7 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
...
@@ -55,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
,
shoppingCartInfoRequestVo
.
get
Business
Type
());
List
<
ProductBeanDTO
>
productBeanDTOS
=
buildActivityProduct
(
activityQueryDto
,
sendGoodsList
,
shoppingCartInfoRequestVo
.
get
Menu
Type
());
if
(
CollectionUtils
.
isEmpty
(
productBeanDTOS
))
{
if
(
CollectionUtils
.
isEmpty
(
productBeanDTOS
))
{
return
;
return
;
}
}
...
@@ -149,11 +149,11 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
...
@@ -149,11 +149,11 @@ public class BuyAndGiftsPromotionService implements IPromotionService {
* @return
* @return
*/
*/
private
List
<
ProductBeanDTO
>
buildActivityProduct
(
ActivityQueryDto
activityQueryDto
,
List
<
ActivityCalculationDiscountResponseDto
private
List
<
ProductBeanDTO
>
buildActivityProduct
(
ActivityQueryDto
activityQueryDto
,
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
,
Integer
business
Type
)
{
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsList
,
Integer
menu
Type
)
{
//获取
//获取
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
()
List
<
ProductBeanDTO
>
productBeanList
=
assortmentSdkService
.
getProductsInfoSdk
(
activityQueryDto
.
getPartnerId
()
,
activityQueryDto
.
getStoreId
(),
goodsIds
,
business
Type
,
shoppingCartBaseService
);
,
activityQueryDto
.
getStoreId
(),
goodsIds
,
menu
Type
,
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 @
a88e8cd6
...
@@ -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
),
requestVo
.
get
Business
Type
(),
mealCartBaseService
);
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
requestVo
.
get
Menu
Type
(),
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 @
a88e8cd6
...
@@ -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
()),
request
.
get
Business
Type
(),
this
.
shoppingCartBaseService
);
List
<
ProductBeanDTO
>
productInfos
=
assortmentSdkService
.
getProductsInfoSdk
(
request
.
getPartnerId
(),
request
.
getShopId
(),
Arrays
.
asList
(
getProductsVo
.
getSpuId
()),
request
.
get
Menu
Type
(),
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
();
...
@@ -225,7 +225,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -225,7 +225,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
// 获取商品详细信息
// 获取商品详细信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
get
Business
Type
(),
this
.
shoppingCartBaseService
);
,
Collections
.
singletonList
(
spuId2
),
addShoppingCartGoodsRequestVo
.
get
Menu
Type
(),
this
.
shoppingCartBaseService
);
//缓存中获取购物车商品信息
//缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样
// 注意,围餐和点餐redis数据结构不一样
...
@@ -586,7 +586,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -586,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
,
shoppingCartInfoRequestVo
.
get
Business
Type
()
,
shoppingCartBaseService
);
processSendGoods
(
sendGoodsList
,
partnerId
,
storeId
,
shoppingCartInfoRequestVo
.
get
Menu
Type
()
,
shoppingCartBaseService
);
}
else
{
}
else
{
//组装加价购商品
//组装加价购商品
if
(
null
!=
premiumExchangeActivity
&&
CollectionUtils
.
isNotEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
if
(
null
!=
premiumExchangeActivity
&&
CollectionUtils
.
isNotEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
...
@@ -840,10 +840,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -840,10 +840,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* @param storeId
* @param storeId
*/
*/
private
void
processSendGoods
(
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
private
void
processSendGoods
(
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
partnerId
,
String
storeId
,
Integer
business
Type
,
ShoppingCartBaseService
shoppingCartService
)
{
,
String
partnerId
,
String
storeId
,
Integer
menu
Type
,
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
,
business
Type
,
shoppingCartService
);
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
,
goodsIds
,
menu
Type
,
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