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
Expand all
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
This diff is collapsed.
Click to expand it.
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