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
8e2eda09
Commit
8e2eda09
authored
Feb 06, 2020
by
姜海波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menuType修改
parent
cd5b7f6a
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
33 deletions
+35
-33
shopping-cart-application-service/src/main/java/cn/freemud/adapter/StoreItemAdapter.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/CheckSpqInfoRequestDto.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/ItemService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/ProductService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
+3
-3
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/CouponServiceImpl.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
+4
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ProductServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
+2
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+14
-14
shopping-cart-application-service/src/test/java/cn.freemud/service/ItemServiceTest.java
+1
-1
shopping-cart-application-service/src/test/java/cn.freemud/service/StoreItemServiceTest.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/StoreItemAdapter.java
View file @
8e2eda09
...
...
@@ -50,14 +50,14 @@ public class StoreItemAdapter {
return
getProductDto
;
}
public
GetProductInfoDto
convert2ProductInfoDto
(
String
partnerId
,
String
shopId
,
Integer
productInfoType
,
List
<
String
>
productIds
)
{
public
GetProductInfoDto
convert2ProductInfoDto
(
String
partnerId
,
String
shopId
,
Integer
productInfoType
,
List
<
String
>
productIds
,
String
menuType
)
{
GetProductInfoDto
getProductInfoDto
=
new
GetProductInfoDto
();
getProductInfoDto
.
setPartnerId
(
partnerId
);
getProductInfoDto
.
setShopId
(
shopId
);
getProductInfoDto
.
setProductInfoType
(
productInfoType
);
getProductInfoDto
.
setProductIds
(
productIds
);
// 商品服务增加channel
getProductInfoDto
.
setChannel
(
OrderSourceType
.
SAAS
.
getCode
()
);
getProductInfoDto
.
setChannel
(
menuType
);
return
getProductInfoDto
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/CheckSpqInfoRequestDto.java
View file @
8e2eda09
...
...
@@ -14,4 +14,5 @@ public class CheckSpqInfoRequestDto {
* 券code
*/
private
String
couponCode
;
private
String
menuType
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/ItemService.java
View file @
8e2eda09
...
...
@@ -28,6 +28,6 @@ public interface ItemService {
* @param storeId
* @return key = skuid
*/
Map
<
String
,
GetProductsVo
>
getProducts
(
List
<
String
>
pids
,
String
partnerId
,
String
storeId
);
Map
<
String
,
GetProductsVo
>
getProducts
(
List
<
String
>
pids
,
String
partnerId
,
String
storeId
,
String
menuType
);
}
shopping-cart-application-service/src/main/java/cn/freemud/service/ProductService.java
View file @
8e2eda09
...
...
@@ -27,5 +27,5 @@ public interface ProductService {
* @param cartGoodsList
* @return
*/
boolean
hasRequiredProducts
(
String
partnerId
,
String
storeId
,
List
<
CartGoods
>
cartGoodsList
);
boolean
hasRequiredProducts
(
String
partnerId
,
String
storeId
,
List
<
CartGoods
>
cartGoodsList
,
String
menuType
);
}
shopping-cart-application-service/src/main/java/cn/freemud/service/ShoppingCartNewService.java
View file @
8e2eda09
...
...
@@ -95,7 +95,7 @@ public interface ShoppingCartNewService {
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
);
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
);
List
<
CartGoods
>
updateCartGoodsLegal
(
CartGoods
cartGoods
,
String
userId
,
ShoppingCartGoodsBaseResponseVo
shoppingCartGoodsResponseVo
,
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
List
<
CartGoods
>
oldAllCartGoodsList
);
...
...
@@ -109,9 +109,9 @@ public interface ShoppingCartNewService {
* @param productIds
* @return
*/
default
String
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
)
{
default
String
validCoupon
(
String
partnerId
,
String
storeId
,
String
spuId
,
List
<
Long
>
productIds
,
String
menuType
)
{
String
spuId2
;
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
()));
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spuId
.
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
())
,
menuType
);
CouponService
couponService
=
SDKCommonBaseContextWare
.
getBean
(
CouponService
.
class
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
);
if
(
checkSpqInfoResponseDto
==
null
)
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AdditionalPromotionService.java
View file @
8e2eda09
...
...
@@ -15,6 +15,7 @@ import cn.freemud.interceptor.ServiceException;
import
cn.freemud.service.IPromotionService
;
import
cn.freemud.service.ItemService
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
...
...
@@ -206,7 +207,7 @@ public class AdditionalPromotionService implements IPromotionService {
Map
<
String
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
>
sendGoodsMap
=
sendActivity1
.
getSendGoods
().
stream
().
collect
(
Collectors
.
toMap
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
SendActivity
.
SendGoods
::
getGoodsId
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
//添加商品行
List
<
String
>
productIds
=
premiumExchangeActivity
.
getProducts
().
parallelStream
().
map
(
p
->
StringUtils
.
isEmpty
(
p
.
getSkuId
())
?
p
.
getSpuId
()
:
p
.
getSkuId
()).
collect
(
Collectors
.
toList
());
Map
<
String
,
GetProductsVo
>
getProductsVoMap
=
itemService
.
getProducts
(
productIds
,
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
());
Map
<
String
,
GetProductsVo
>
getProductsVoMap
=
itemService
.
getProducts
(
productIds
,
shoppingCartInfoRequestVo
.
getPartnerId
(),
shoppingCartInfoRequestVo
.
getShopId
()
,
BusinessTypeEnum
.
getByType
(
shoppingCartInfoRequestVo
.
getMenuType
()).
getCode
()
);
// 获取计算返回的价格
Long
originalTotalAmount
=
shoppingCartGoodsResponseVo
.
getOriginalTotalAmount
();
Long
totalAmount
=
shoppingCartGoodsResponseVo
.
getTotalAmount
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
8e2eda09
...
...
@@ -588,7 +588,7 @@ public class CouponServiceImpl implements CouponService {
String
skuId
=
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveProduct
().
get
(
0
).
getProductIdPartner
();
skuIds
.
add
(
String
.
valueOf
(
skuId
));
//TODO 通过skuid查询spuid
Map
<
String
,
GetProductsVo
>
productsVoMap
=
itemService
.
getProducts
(
skuIds
,
partnerId
,
storeId
);
Map
<
String
,
GetProductsVo
>
productsVoMap
=
itemService
.
getProducts
(
skuIds
,
partnerId
,
storeId
,
requestDto
.
getMenuType
()
);
GetProductsVo
productsVo
=
productsVoMap
.
get
(
skuId
);
if
(
null
==
productsVo
||
!
Objects
.
equals
(
productsVo
.
getStatus
(),
StoreItemStatus
.
PUT_ON_SALE
.
getCode
()))
{
return
null
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
View file @
8e2eda09
...
...
@@ -63,7 +63,7 @@ public class ItemServiceImpl implements ItemService {
public
BaseResponse
<
Map
<
String
,
ProductBean
>>
getProducts
(
String
partnerId
,
String
shopId
,
List
<
String
>
productIds
,
boolean
reflash
)
{
public
BaseResponse
<
Map
<
String
,
ProductBean
>>
getProducts
(
String
partnerId
,
String
shopId
,
List
<
String
>
productIds
,
boolean
reflash
,
String
menuType
)
{
Map
<
String
,
ProductBean
>
newProductBeanMap
=
Maps
.
newTreeMap
();
if
(
CollectionUtils
.
isEmpty
(
productIds
))
{
return
ResponseUtil
.
success
(
newProductBeanMap
);
...
...
@@ -75,7 +75,7 @@ public class ItemServiceImpl implements ItemService {
return
ResponseUtil
.
success
(
productBeanMap
);
}
GetProductValidateDto
getProductValidateDto
=
storeItemAdapter
.
convert2ProductValidateDto
(
partnerId
,
shopId
,
productIds
);
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
shopId
,
ProductInfoType
.
ALL
.
getCode
(),
productIds
);
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
shopId
,
ProductInfoType
.
ALL
.
getCode
(),
productIds
,
menuType
);
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
if
(!
RESPONSE_SUCCESS_CODE
.
equals
(
productInfosDto
.
getErrcode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
log
.
error
(
"getShoppingCartInfo checkProductValidate is error , getProductValidateDto:{} , productCheckVaildDto:{}"
,
...
...
@@ -141,14 +141,14 @@ public class ItemServiceImpl implements ItemService {
}
@Override
public
Map
<
String
,
GetProductsVo
>
getProducts
(
List
<
String
>
pids
,
String
partnerId
,
String
storeId
)
{
public
Map
<
String
,
GetProductsVo
>
getProducts
(
List
<
String
>
pids
,
String
partnerId
,
String
storeId
,
String
menuType
)
{
Map
<
String
,
GetProductsVo
>
resultMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isEmpty
(
pids
))
{
return
resultMap
;
}
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
//查询商品详情
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
storeId
,
ProductInfoType
.
ALL
.
getCode
(),
pids
);
GetProductInfoDto
getProductInfoDto
=
storeItemAdapter
.
convert2ProductInfoDto
(
partnerId
,
storeId
,
ProductInfoType
.
ALL
.
getCode
(),
pids
,
menuType
);
ProductInfosDto
productInfosDto
=
storeItemClient
.
listProductInfos
(
getProductInfoDto
);
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
productInfosDto
.
getErrcode
())
&&
productInfosDto
.
getData
()
!=
null
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ProductServiceImpl.java
View file @
8e2eda09
...
...
@@ -33,8 +33,8 @@ public class ProductServiceImpl implements ProductService {
private
ProductClient
productClient
;
@Override
public
boolean
hasRequiredProducts
(
String
partnerId
,
String
storeId
,
List
<
CartGoods
>
cartGoodsList
)
{
RequiredProductRequest
request
=
RequiredProductRequest
.
builder
().
channel
(
"saas"
).
partnerId
(
partnerId
).
shopId
(
storeId
).
build
();
public
boolean
hasRequiredProducts
(
String
partnerId
,
String
storeId
,
List
<
CartGoods
>
cartGoodsList
,
String
menuType
)
{
RequiredProductRequest
request
=
RequiredProductRequest
.
builder
().
channel
(
menuType
).
partnerId
(
partnerId
).
shopId
(
storeId
).
build
();
ProductBaseResponse
<
List
<
String
>>
requiredProductList
=
productClient
.
getRequiredProductList
(
request
);
if
(
null
!=
requiredProductList
&&
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
requiredProductList
.
getErrcode
())
&&
!
CollectionUtils
.
isEmpty
(
requiredProductList
.
getData
()))
{
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartMealServiceImpl.java
View file @
8e2eda09
...
...
@@ -99,7 +99,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
productIds
.
add
(
Long
.
parseLong
(
goodsId
));
}
else
{
//校验券是否有效
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
);
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
,
BusinessTypeEnum
.
getByType
(
requestVo
.
getMenuType
()).
getCode
()
);
}
// 获取商品信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
...
...
@@ -491,7 +491,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
@Override
public
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
)
{
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
)
{
return
null
;
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
8e2eda09
...
...
@@ -149,7 +149,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
request
.
setEncryptCode
(
CommonsConstant
.
COUPON_PREFIX
+
result
.
getCode
());
// 根据skuId获取详情
Map
<
String
,
GetProductsVo
>
products
=
itemService
.
getProducts
(
Arrays
.
asList
(
request
.
getSkuId
()),
request
.
getPartnerId
(),
request
.
getShopId
());
Map
<
String
,
GetProductsVo
>
products
=
itemService
.
getProducts
(
Arrays
.
asList
(
request
.
getSkuId
()),
request
.
getPartnerId
(),
request
.
getShopId
()
,
BusinessTypeEnum
.
getByType
(
request
.
getMenuType
()).
getCode
()
);
if
(
products
==
null
||
products
.
size
()
==
0
)
{
return
ResponseUtil
.
error
(
ResponseResult
.
WEICHAT_PRODUCT_NOEXIST
);
}
...
...
@@ -222,7 +222,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
productIds
.
add
(
Long
.
parseLong
(
goodsId
));
}
else
{
//校验券是否有效
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
);
spuId2
=
validCoupon
(
partnerId
,
storeId
,
spuId
,
productIds
,
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
()
);
}
// 获取商品详细信息
List
<
ProductBeanDTO
>
productBeanListSpuClass
=
assortmentSdkService
.
getProductsInfoSdk
(
partnerId
,
storeId
...
...
@@ -255,7 +255,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
addShoppingCartGoodsRequestVo
.
getOrderType
(),
allCartGoodsList
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
addShoppingCartGoodsRequestVo
.
getOrderType
(),
allCartGoodsList
,
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
()
);
// 当商品数量被设为0时
if
(
Objects
.
equals
(
cartGoods
.
getQty
(),
0
))
{
assortmentSdkService
.
updateGoodsQtyBySdk
(
partnerId
,
userId
,
storeId
,
cartGoods
.
getCartGoodsUid
(),
0
,
""
,
shoppingCartBaseService
);
...
...
@@ -337,7 +337,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
assortmentSdkService
.
setShoppingCart
(
partnerId
,
storeId
,
userId
,
cartGoodsList
,
updateShoppingCartGoodsQtyRequestVo
.
getSessionId
(),
""
,
shoppingCartBaseService
);
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
updateShoppingCartGoodsQtyRequestVo
.
getOrderType
(),
cartGoodsList
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
updateShoppingCartGoodsQtyRequestVo
.
getOrderType
(),
cartGoodsList
,
BusinessTypeEnum
.
getByType
(
updateShoppingCartGoodsQtyRequestVo
.
getMenuType
()).
getCode
()
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
// return shoppingCartGoodsResponseVo;
...
...
@@ -371,7 +371,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//查询商品信息
List
<
String
>
pids
=
new
ArrayList
<>();
pids
.
add
(
cartGoods
.
getGoodsId
());
Map
<
String
,
GetProductsVo
>
products
=
itemService
.
getProducts
(
pids
,
partnerId
,
storeId
);
Map
<
String
,
GetProductsVo
>
products
=
itemService
.
getProducts
(
pids
,
partnerId
,
storeId
,
BusinessTypeEnum
.
getByType
(
updateShoppingCartGoodsQtyRequestVo
.
getMenuType
()).
getCode
()
);
GetProductsVo
getProductsVo
=
products
.
get
(
cartGoods
.
getGoodsId
());
// 商品没有库存限制
...
...
@@ -379,7 +379,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return
;
}
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
requestDto
.
setChannel
(
"saas"
);
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
updateShoppingCartGoodsQtyRequestVo
.
getMenuType
()).
getCode
()
);
requestDto
.
setPartnerId
(
partnerId
);
requestDto
.
setStoreId
(
storeId
);
requestDto
.
setProductIds
(
Collections
.
singletonList
(
Long
.
parseLong
(
cartGoods
.
getGoodsId
())));
...
...
@@ -443,7 +443,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
processSendGoods(sendGoodsList, partnerId, storeId);
}*/
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
(),
cartGoodsList
,
coupons
,
null
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
(),
cartGoodsList
,
coupons
,
null
,
BusinessTypeEnum
.
getByType
(
shoppingCartInfoRequestVo
.
getMenuType
()).
getCode
()
);
if
(
calculationDiscountResult
==
null
)
{
shoppingCartGoodsResponseVo
.
setProducts
(
cartGoodsList
);
// return shoppingCartGoodsResponseVo;
...
...
@@ -555,7 +555,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* 1. 调用商品服务拿到该门店是否有必选商品
* 2. 如果有,则和购物车的商品对比
*/
if
(
productService
.
hasRequiredProducts
(
partnerId
,
storeId
,
cartGoodsList
))
{
if
(
productService
.
hasRequiredProducts
(
partnerId
,
storeId
,
cartGoodsList
,
BusinessTypeEnum
.
getByType
(
shoppingCartInfoRequestVo
.
getMenuType
()).
getCode
()
))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_REQUIRED_PRODUCT_NOT_EXIST
);
}
...
...
@@ -603,7 +603,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
// 获取优惠信息
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
(),
cartGoodsList
,
coupons
,
sendGoodsList
);
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
=
this
.
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
(),
cartGoodsList
,
coupons
,
sendGoodsList
,
BusinessTypeEnum
.
getByType
(
shoppingCartInfoRequestVo
.
getMenuType
()).
getCode
()
);
ActivityQueryDto
activityQueryDto
=
activityAdapter
.
getActivityQueryDto
(
partnerId
,
storeId
,
userId
,
appId
,
shoppingCartInfoRequestVo
.
getOrderType
());
...
...
@@ -683,8 +683,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* @return
*/
public
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
wxAppid
,
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
)
{
return
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
wxAppid
,
orderType
,
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>());
String
partnerId
,
String
storeId
,
String
userId
,
String
wxAppid
,
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
,
String
menuType
)
{
return
getActivityCalculationDiscountResponse
(
partnerId
,
storeId
,
userId
,
wxAppid
,
orderType
,
cartGoodsList
,
new
ArrayList
<>(),
new
ArrayList
<>()
,
menuType
);
}
/**
...
...
@@ -699,7 +699,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
public
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
getActivityCalculationDiscountResponse
(
String
partnerId
,
String
storeId
,
String
userId
,
String
appId
,
Integer
orderType
,
List
<
CartGoods
>
cartGoodsList
,
List
<
ActivityCalculationDiscountRequestDto
.
CalculationDiscountCoupon
>
coupons
,
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
)
{
List
<
ShoppingCartInfoRequestVo
.
SendGoods
>
sendGoodsList
,
String
menuType
)
{
// 当购物车中只有商品券并且未使用折扣券时,不调用接口计算
// if (cartGoodsList.size() == 1
// && coupons.size() == 0) {
...
...
@@ -723,7 +723,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
else
{
// 商品券ID换取商品
String
spqId
=
cartGoods
.
getCartGoodsUid
().
substring
(
CommonsConstant
.
COUPON_PREFIX
.
length
());
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spqId
);
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
spqId
,
menuType
);
CheckSpqInfoResponseDto
checkSpqInfoResponseDto
=
couponService
.
checkSpqInfo
(
checkSpqInfoRequestDto
);
// 商品券不存在时,将商品券从购物车移除
if
(
checkSpqInfoResponseDto
==
null
)
{
...
...
@@ -1129,7 +1129,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private
void
queryManyGoodsStocks
(
AddShoppingCartGoodsRequestVo
addShoppingCartGoodsRequestVo
,
List
<
Long
>
productIds
,
List
<
ProductBeanDTO
>
productBeanListSpuClass
,
String
skuId
,
Integer
qty
)
{
GetProductStockRequestDto
requestDto
=
new
GetProductStockRequestDto
();
requestDto
.
setChannel
(
"saas"
);
requestDto
.
setChannel
(
BusinessTypeEnum
.
getByType
(
addShoppingCartGoodsRequestVo
.
getMenuType
()).
getCode
()
);
requestDto
.
setPartnerId
(
addShoppingCartGoodsRequestVo
.
getPartnerId
());
requestDto
.
setStoreId
(
addShoppingCartGoodsRequestVo
.
getShopId
());
requestDto
.
setProductIds
(
productIds
);
...
...
shopping-cart-application-service/src/test/java/cn.freemud/service/ItemServiceTest.java
View file @
8e2eda09
...
...
@@ -53,7 +53,7 @@ public class ItemServiceTest {
@Test
public
void
getProducts
()
{
Map
<
String
,
GetProductsVo
>
maps
=
itemService
.
getProducts
(
Arrays
.
asList
(
"1"
,
"2"
),
"1864"
,
"1011"
);
Map
<
String
,
GetProductsVo
>
maps
=
itemService
.
getProducts
(
Arrays
.
asList
(
"1"
,
"2"
),
"1864"
,
"1011"
,
"saas"
);
assertFalse
(
maps
==
null
||
maps
.
isEmpty
());
}
}
shopping-cart-application-service/src/test/java/cn.freemud/service/StoreItemServiceTest.java
View file @
8e2eda09
...
...
@@ -71,7 +71,7 @@ public class StoreItemServiceTest {
"125115354620910102"
,
"125117293812275722"
,
"125117293812275726"
,
"125117293812275730"
),
"1864"
,
"1001"
);
"125117293812275730"
),
"1864"
,
"1001"
,
"saas"
);
System
.
out
.
println
(
getProductsVoMap
);
}
...
...
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