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
dc0d8eb2
Commit
dc0d8eb2
authored
Nov 05, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并重复代码, 另外update数量接口加入全门槛数量计算
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
96d49c4c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
40 deletions
+12
-40
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+9
-37
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+3
-3
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
dc0d8eb2
...
@@ -38,7 +38,6 @@ import cn.freemud.utils.RedisUtil;
...
@@ -38,7 +38,6 @@ import cn.freemud.utils.RedisUtil;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
com.freemud.application.sdk.api.productcenter.constant.ResponseConstant
;
import
com.freemud.application.sdk.api.productcenter.constant.ResponseConstant
;
import
com.freemud.application.sdk.api.util.SignUtil
;
import
com.freemud.application.sdk.api.util.SignUtil
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CartResponseConstant
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
...
@@ -1002,39 +1001,7 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1002,39 +1001,7 @@ public class CouponServiceImpl implements CouponService {
@Override
@Override
public
GetProductsVo
getSpqProductInfo
(
CheckSpqInfoRequestDto
requestDto
)
{
public
GetProductsVo
getSpqProductInfo
(
CheckSpqInfoRequestDto
requestDto
)
{
String
partnerId
=
requestDto
.
getPartnerId
();
return
this
.
getSpqProductInfo
(
requestDto
,
null
);
String
couponCode
=
requestDto
.
getCouponCode
();
String
storeId
=
requestDto
.
getStoreId
();
//TODO 查询券详情券是否存在
GetMemberCouponRequestVo
requestVo
=
new
GetMemberCouponRequestVo
();
requestVo
.
setPartnerId
(
partnerId
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
GetCouponDetailResponseDto
couponDetailResponseDto
=
this
.
getMemberCoupon
(
requestVo
);
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
}
//券返回的商品id
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
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
,
requestDto
.
getMenuType
());
GetProductsVo
productsVo
=
productsVoMap
.
get
(
skuId
);
if
(
null
==
productsVo
||
!
Objects
.
equals
(
productsVo
.
getStatus
(),
StoreItemStatus
.
PUT_ON_SALE
.
getCode
()))
{
return
null
;
}
// 校验商品可用时间
ValidateShopProductRequest
request
=
getValidateShopProductRequest
(
productsVo
,
requestDto
);
ProductBaseResponse
<
ValiadShopProductResponse
>
valiadProductResponse
=
storeItemClient
.
validateShopProduct
(
request
);
if
(
null
==
valiadProductResponse
||
!
Objects
.
equals
(
ResponseConstant
.
SUCCESS_RESPONSE_CODE
,
valiadProductResponse
.
getErrcode
())
||
valiadProductResponse
.
getData
()
==
null
||
CollectionUtils
.
isEmpty
(
valiadProductResponse
.
getData
().
getSuccessList
()))
{
return
null
;
}
return
productsVo
;
}
}
...
@@ -1063,11 +1030,16 @@ public class CouponServiceImpl implements CouponService {
...
@@ -1063,11 +1030,16 @@ public class CouponServiceImpl implements CouponService {
if
(
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
if
(
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
return
null
;
}
}
Integer
couponType
=
0
;
//券返回的商品id
//券返回的商品id
String
skuId
;
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
String
skuId
=
goodsId
;
if
(
StringUtils
.
isEmpty
(
goodsId
))
{
//券返回的商品id
skuId
=
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveProduct
().
get
(
0
).
getProductIdPartner
();
skuIds
.
add
(
String
.
valueOf
(
skuId
));
}
else
{
skuId
=
goodsId
;
}
skuIds
.
add
(
skuId
);
skuIds
.
add
(
skuId
);
//TODO 通过skuid查询spuid
//TODO 通过skuid查询spuid
Map
<
String
,
GetProductsVo
>
productsVoMap
=
itemService
.
getProducts
(
skuIds
,
partnerId
,
storeId
,
requestDto
.
getMenuType
());
Map
<
String
,
GetProductsVo
>
productsVoMap
=
itemService
.
getProducts
(
skuIds
,
partnerId
,
storeId
,
requestDto
.
getMenuType
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
dc0d8eb2
...
@@ -565,7 +565,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -565,7 +565,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
calculationDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
partnerId
,
storeId
,
userId
,
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
setAddAndUpdateResponse
(
shoppingCartGoodsResponseVo
,
calculationDiscountResult
,
cartGoodsList
,
shoppingCartGoodsResponseVo
.
getToastMsg
(),
partnerId
,
storeId
,
userId
,
ShoppingCartConstant
.
ADD_AND_UPDATE
,
null
);
}
}
this
.
shoppingCartAddOrListCommonResponseHandle
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
return
ResponseUtil
.
success
(
shoppingCartGoodsResponseVo
);
}
}
...
@@ -697,8 +697,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -697,8 +697,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
for
(
int
i
=
cartGoodsList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
cartGoodsList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
if
(
GoodsTypeEnum
.
COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
())
||
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
())
||
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
unChooseCouponCode
.
equals
(
cartGoods
.
getSpuId
()
))
{
if
(
Objects
.
equals
(
cartGoods
.
getCouponCode
()
,
unChooseCouponCode
))
{
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
cartGoods
.
get
SpuId
(),
menuType
,
null
);
CheckSpqInfoRequestDto
checkSpqInfoRequestDto
=
new
CheckSpqInfoRequestDto
(
partnerId
,
storeId
,
cartGoods
.
get
CouponCode
(),
menuType
,
null
);
GetProductsVo
productInfo
=
null
;
GetProductsVo
productInfo
=
null
;
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
if
(
GoodsTypeEnum
.
HG_COUPON_GOODS
.
getGoodsType
().
equals
(
cartGoods
.
getGoodsType
()))
{
productInfo
=
couponService
.
getSpqProductInfo
(
checkSpqInfoRequestDto
,
cartGoods
.
getSkuId
());
productInfo
=
couponService
.
getSpqProductInfo
(
checkSpqInfoRequestDto
,
cartGoods
.
getSkuId
());
...
...
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