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
4d7f91ac
Commit
4d7f91ac
authored
Nov 02, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询券校验门店是否可用
parent
7dc97176
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
12 deletions
+31
-12
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetCouponDetailResponseDto.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/GetMemberCouponRequestVo.java
+3
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+25
-12
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetCouponDetailResponseDto.java
View file @
4d7f91ac
...
...
@@ -35,6 +35,7 @@ public class GetCouponDetailResponseDto {
private
Integer
storeChannelLimit
;
private
Active
active
;
private
List
<
ActiveProduct
>
activeProduct
;
//活动门店限制(非发券指定门店活动使用)
private
List
<
ActiveRestrictionVOS
>
activeRestrictionVOS
;
/**
* 可核销周,时间段设置
...
...
@@ -66,6 +67,8 @@ public class GetCouponDetailResponseDto {
private
List
<
ActiveChannel
>
activeChannels
;
// private List<ActiveRedeemTimeIntervalVO> activeRedeemTimeIntervalList;
private
Integer
storeLimitLevel
;
//为0可用
private
Integer
storelimit
;
private
String
limitStoreId
;
// private Integer today_available_times;
private
Integer
total_available_times
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/GetMemberCouponRequestVo.java
View file @
4d7f91ac
...
...
@@ -18,4 +18,7 @@ public class GetMemberCouponRequestVo {
private
String
couponCode
;
// 门店ID
private
String
storeId
;
//是否 校验券门店是否可用
private
Boolean
checkStoreId
=
false
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
4d7f91ac
...
...
@@ -39,6 +39,7 @@ import com.freemud.application.sdk.api.productcenter.constant.ResponseConstant;
import
com.freemud.application.sdk.api.util.SignUtil
;
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.util.ShoppingSdkLogUtil
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.ObjectUtils
;
...
...
@@ -144,6 +145,10 @@ public class CouponServiceImpl implements CouponService {
// 券码接口新增参数:组织机构(多个用英文逗号分离)
String
channelIds
=
commonService
.
getOrgIdsAsString
(
requestVo
.
getPartnerId
(),
requestVo
.
getStoreId
());
map
.
put
(
Finals
.
CHANNEL_ID_LIST
,
channelIds
);
if
(
requestVo
.
getCheckStoreId
()){
map
.
put
(
Finals
.
STOREID
,
requestVo
.
getStoreId
());
map
.
put
(
Finals
.
STORECHECK
,
"0"
);
}
String
appSecret
=
getAppSecret
(
requestVo
.
getPartnerId
());
String
sign
=
SignUtil
.
createMD5Sign
(
map
,
appSecret
);
map
.
put
(
Finals
.
SIGN
,
sign
);
...
...
@@ -540,6 +545,7 @@ public class CouponServiceImpl implements CouponService {
* 老版本券校验
*/
public
CheckSpqInfoResponseDto
checkSpqInfo
(
CheckSpqInfoRequestDto
requestDto
)
{
ShoppingSdkLogUtil
.
infoLog
(
"OldCheckSpqInfo"
,
"requestDto"
);
String
partnerId
=
requestDto
.
getPartnerId
();
String
couponCode
=
requestDto
.
getCouponCode
();
String
storeId
=
requestDto
.
getStoreId
();
...
...
@@ -548,6 +554,7 @@ public class CouponServiceImpl implements CouponService {
requestVo
.
setPartnerId
(
partnerId
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
requestVo
.
setCheckStoreId
(
true
);
GetCouponDetailResponseDto
couponDetailResponseDto
=
this
.
getMemberCoupon
(
requestVo
);
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
...
...
@@ -557,16 +564,20 @@ public class CouponServiceImpl implements CouponService {
&&
!
Objects
.
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getStatus
(),
CouponStatus
.
STATUS_2
.
getCode
()))
{
return
null
;
}
List
<
String
>
couPonstoreIds
=
Lists
.
newArrayList
();
//
List<String> couPonstoreIds = Lists.newArrayList();
//TODO 判断该券是否在这个门店下(一个券可以在多个门店下使用)
if
(
CollectionUtils
.
isNotEmpty
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveRestrictionVOS
()))
{
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveRestrictionVOS
().
forEach
(
activeRestrictionVOS
->
{
couPonstoreIds
.
add
(
activeRestrictionVOS
.
getStoreIdPartner
());
});
}
if
(
CollectionUtils
.
isNotEmpty
(
couPonstoreIds
)
&&
!
couPonstoreIds
.
contains
(
storeId
)
)
{
//
couponDetailResponseDto.getDetails().get(0).getActiveRestrictionVOS().forEach(activeRestrictionVOS -> {
//
couPonstoreIds.add(activeRestrictionVOS.getStoreIdPartner());
//
});
GetCouponDetailResponseDto
.
Details
detail
=
couponDetailResponseDto
.
getDetails
().
get
(
0
);
if
(
detail
.
getStorelimit
()
!=
0
||
detail
.
getStoreChannelLimit
()
!=
0
)
{
return
null
;
}
}
// if (CollectionUtils.isNotEmpty(couPonstoreIds) && !couPonstoreIds.contains(storeId)) {
// return null;
// }
//券返回的商品id
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
String
skuId
=
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveProduct
().
get
(
0
).
getProductIdPartner
();
...
...
@@ -731,6 +742,7 @@ public class CouponServiceImpl implements CouponService {
requestVo
.
setPartnerId
(
partnerId
);
requestVo
.
setCouponCode
(
couponCode
);
requestVo
.
setStoreId
(
requestDto
.
getStoreId
());
requestVo
.
setCheckStoreId
(
true
);
GetCouponDetailResponseDto
couponDetailResponseDto
=
this
.
getMemberCoupon
(
requestVo
);
if
(
couponDetailResponseDto
==
null
||
!
couponDetailResponseDto
.
getResult
().
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_1
)
||
CollectionUtils
.
isEmpty
(
couponDetailResponseDto
.
getDetails
()))
{
return
null
;
...
...
@@ -765,16 +777,17 @@ public class CouponServiceImpl implements CouponService {
return
null
;
}
//判断该券是否在这个门店下(一个券可以在多个门店下使用)
List
<
String
>
couponStoreIds
=
Lists
.
newArrayList
();
//
List<String> couponStoreIds = Lists.newArrayList();
for
(
GetCouponDetailResponseDto
.
Details
detail
:
couponDetailResponseDto
.
getDetails
())
{
if
(!
CouponStatus
.
STATUS_0
.
getCode
().
equals
(
detail
.
getStatus
())
&&
!
CouponStatus
.
STATUS_2
.
getCode
().
equals
(
detail
.
getStatus
()))
continue
;
for
(
GetCouponDetailResponseDto
.
ActiveRestrictionVOS
activeRestrictionVO
:
detail
.
getActiveRestrictionVOS
())
{
couponStoreIds
.
add
(
activeRestrictionVO
.
getStoreIdPartner
());
}
}
if
(
CollectionUtils
.
isNotEmpty
(
couponStoreIds
)
&&
!
couponStoreIds
.
contains
(
storeId
))
{
// for (GetCouponDetailResponseDto.ActiveRestrictionVOS activeRestrictionVO : detail.getActiveRestrictionVOS()) {
// couponStoreIds.add(activeRestrictionVO.getStoreIdPartner());
// }
if
(
detail
.
getStorelimit
()
!=
0
||
detail
.
getStoreChannelLimit
()
!=
0
)
{
return
null
;
}
}
//券返回的商品id
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
String
skuId
=
goodsId
;
...
...
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