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
8380af56
Commit
8380af56
authored
Nov 10, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品券白名单
parent
a1a190f3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetCouponDetailResponseDto.java
+2
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+17
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CardBinClient.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponAdapterClient.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/GetCouponDetailResponseDto.java
View file @
8380af56
...
@@ -26,6 +26,8 @@ public class GetCouponDetailResponseDto {
...
@@ -26,6 +26,8 @@ public class GetCouponDetailResponseDto {
private
String
activeCode
;
private
String
activeCode
;
private
String
title
;
private
String
title
;
private
Integer
type
;
private
Integer
type
;
//type=0时,subType=1为黑名单,否则为白名单
private
Integer
subType
;
private
Integer
status
;
private
Integer
status
;
private
String
create_time
;
private
String
create_time
;
private
String
redeem_time
;
private
String
redeem_time
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
8380af56
...
@@ -26,6 +26,7 @@ import cn.freemud.entities.vo.coupon.CouponAvailableReqVo;
...
@@ -26,6 +26,7 @@ import cn.freemud.entities.vo.coupon.CouponAvailableReqVo;
import
cn.freemud.entities.vo.coupon.CouponStateVo
;
import
cn.freemud.entities.vo.coupon.CouponStateVo
;
import
cn.freemud.entities.vo.coupon.Product
;
import
cn.freemud.entities.vo.coupon.Product
;
import
cn.freemud.enums.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.redis.RedisCache
;
import
cn.freemud.redis.RedisCache
;
import
cn.freemud.service.CommonService
;
import
cn.freemud.service.CommonService
;
import
cn.freemud.service.CouponService
;
import
cn.freemud.service.CouponService
;
...
@@ -564,6 +565,12 @@ public class CouponServiceImpl implements CouponService {
...
@@ -564,6 +565,12 @@ public class CouponServiceImpl implements CouponService {
&&
!
Objects
.
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getStatus
(),
CouponStatus
.
STATUS_2
.
getCode
()))
{
&&
!
Objects
.
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getStatus
(),
CouponStatus
.
STATUS_2
.
getCode
()))
{
return
null
;
return
null
;
}
}
if
(
CouponTypeEnum
.
TYPE_0
.
getCode
().
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getType
())
&&
Integer
.
valueOf
(
1
).
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getSubType
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_PRODUCT_CAN_NOT_USE
,
"老版本不支持商品券黑名单商品,请升级小程序。"
);
}
// List<String> couPonstoreIds = Lists.newArrayList();
// List<String> couPonstoreIds = Lists.newArrayList();
//TODO 判断该券是否在这个门店下(一个券可以在多个门店下使用)
//TODO 判断该券是否在这个门店下(一个券可以在多个门店下使用)
if
(
CollectionUtils
.
isNotEmpty
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveRestrictionVOS
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveRestrictionVOS
()))
{
...
@@ -755,9 +762,14 @@ public class CouponServiceImpl implements CouponService {
...
@@ -755,9 +762,14 @@ public class CouponServiceImpl implements CouponService {
if
(!
CouponStatus
.
STATUS_0
.
getCode
().
equals
(
detail
.
getStatus
())
&&
!
CouponStatus
.
STATUS_2
.
getCode
().
equals
(
detail
.
getStatus
()))
continue
;
if
(!
CouponStatus
.
STATUS_0
.
getCode
().
equals
(
detail
.
getStatus
())
&&
!
CouponStatus
.
STATUS_2
.
getCode
().
equals
(
detail
.
getStatus
()))
continue
;
for
(
GetCouponDetailResponseDto
.
ActiveProduct
activeProduct
:
detail
.
getActiveProduct
())
{
for
(
GetCouponDetailResponseDto
.
ActiveProduct
activeProduct
:
detail
.
getActiveProduct
())
{
if
(
goodsId
.
equals
(
activeProduct
.
getProductIdPartner
()))
{
if
(
goodsId
.
equals
(
activeProduct
.
getProductIdPartner
()))
{
if
(
CouponTypeEnum
.
TYPE_0
.
getCode
().
equals
(
detail
.
getType
())
&&
Integer
.
valueOf
(
1
).
equals
(
detail
.
getSubType
()))
{
//券码传过来的是黑名单
return
null
;
}
else
{
productValid
=
true
;
productValid
=
true
;
couponActivityDetail
=
detail
;
couponActivityDetail
=
detail
;
couponType
=
CouponTypeEnum
.
TYPE_4
.
getCode
();
couponType
=
CouponTypeEnum
.
TYPE_4
.
getCode
();
}
break
;
break
;
}
}
}
}
...
@@ -861,6 +873,11 @@ public class CouponServiceImpl implements CouponService {
...
@@ -861,6 +873,11 @@ public class CouponServiceImpl implements CouponService {
return
null
;
return
null
;
}
}
if
(
CouponTypeEnum
.
TYPE_0
.
getCode
().
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getType
())
&&
Integer
.
valueOf
(
1
).
equals
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getSubType
()))
{
throw
new
ServiceException
(
ResponseResult
.
SHOPPING_CART_PRODUCT_CAN_NOT_USE
,
"老版本不支持商品券黑名单商品,请升级小程序。"
);
}
//券返回的商品id
//券返回的商品id
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
List
<
String
>
skuIds
=
Lists
.
newArrayList
();
String
skuId
=
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveProduct
().
get
(
0
).
getProductIdPartner
();
String
skuId
=
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActiveProduct
().
get
(
0
).
getProductIdPartner
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CardBinClient.java
View file @
8380af56
...
@@ -25,7 +25,7 @@ public interface CardBinClient {
...
@@ -25,7 +25,7 @@ public interface CardBinClient {
GetAppKeyResponseDto
getAppKey
(
GetAppKeyRequestDto
requestDto
);
GetAppKeyResponseDto
getAppKey
(
GetAppKeyRequestDto
requestDto
);
/**
/**
* 活动信息批量查询
* 活动信息批量查询
疑似黑白名单接口但是出参没有商品信息
* @param requestDto
* @param requestDto
* @return
* @return
*/
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponAdapterClient.java
View file @
8380af56
...
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
public
interface
CouponAdapterClient
{
public
interface
CouponAdapterClient
{
/**
/**
* 获取可用券信息
* 获取可用券信息
需要券码改造为黑白名单接口,出参中的商品信息没有使用
*
*
* @param couponAvailableReqVo
* @param couponAvailableReqVo
* @return
* @return
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
View file @
8380af56
...
@@ -16,7 +16,7 @@ import java.util.Map;
...
@@ -16,7 +16,7 @@ import java.util.Map;
@FeignClient
(
name
=
"OPEN-STORE-ONLINE-COUPON-SERVICE"
,
url
=
"${saas.coupononlineclient.feign.url}"
,
configuration
=
FormSupportConfig
.
class
)
@FeignClient
(
name
=
"OPEN-STORE-ONLINE-COUPON-SERVICE"
,
url
=
"${saas.coupononlineclient.feign.url}"
,
configuration
=
FormSupportConfig
.
class
)
public
interface
CouponOnlineClient
{
public
interface
CouponOnlineClient
{
/**
/**
* 查询券详情
* 查询券详情
黑白名单接口
*/
*/
@IgnoreFeignLogAnnotation
(
logMessage
=
"getCouponDetails"
,
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
@IgnoreFeignLogAnnotation
(
logMessage
=
"getCouponDetails"
,
excludeStatusCodes
=
{
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
},
statusCodeFieldName
=
ResponseCodeKeyConstant
.
STATUS_CODE
)
@PostMapping
(
value
=
"/code_v4"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
@PostMapping
(
value
=
"/code_v4"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
...
...
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