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
80a616c1
Commit
80a616c1
authored
Jul 27, 2020
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
麦咖啡p1v2
parent
f06c8499
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
1 deletions
+67
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/CouponService.java
+23
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+18
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineMCDClient.java
+25
-0
shopping-cart-application-service/src/test/java/cn.freemud/service/CouponServiceTest.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/CouponService.java
View file @
80a616c1
...
...
@@ -59,6 +59,24 @@ public interface CouponService {
List
<
GetCouponDetailResponseDto
.
Details
>
getMemberCoupons
(
String
partnerId
,
String
storeId
,
List
<
String
>
codes
);
/**
* 获取麦咖啡卡券详情
*
* @param requestVo
* @return
*/
GetCouponDetailResponseDto
getMCDMemberCoupon
(
GetMemberCouponRequestVo
requestVo
);
/**
* 批次查询麦咖啡券详情
*
* @param partnerId
* @param storeId
* @param codes
* @return
*/
List
<
GetCouponDetailResponseDto
.
Details
>
getMCDMemberCoupons
(
String
partnerId
,
String
storeId
,
List
<
String
>
codes
);
/**
* 同步券到会员卡包(投放会员卡包)
*
* @param requestVo
...
...
@@ -80,6 +98,11 @@ public interface CouponService {
String
getAppSecret
(
String
partnerId
);
/**
* 获取卡券服务麦咖啡商户密钥
*/
String
getAppSecretMCD
(
String
partnerId
);
/**
* 通过code校验券是否存在,返回商品券信息pid、price、code
*
* @param requestDto
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
80a616c1
...
...
@@ -94,6 +94,8 @@ public class CouponServiceImpl implements CouponService {
@Autowired
private
CardBinClient
cardBinClient
;
@Autowired
private
CardBinMCDClient
cardBinMCDClient
;
@Autowired
private
StoreItemClient
storeItemClient
;
@Autowired
private
StoreItemAdapter
storeItemAdapter
;
...
...
@@ -304,6 +306,22 @@ public class CouponServiceImpl implements CouponService {
return
appSecret
;
}
@Override
public
String
getAppSecretMCD
(
String
partnerId
)
{
// 获取券服务的密钥
String
couponAppSecret
=
RedisUtil
.
getCouponAppSecret
(
partnerId
);
String
appSecret
=
redisCache
.
getValue
(
couponAppSecret
);
if
(
StringUtils
.
isBlank
(
appSecret
))
{
GetAppKeyResponseDto
getAppKeyResponseDto
=
cardBinMCDClient
.
getAppKey
(
GetAppKeyRequestDto
.
builder
().
partnerId
(
partnerId
).
appId
(
appid
).
build
());
if
(
Objects
.
equals
(
String
.
valueOf
(
getAppKeyResponseDto
.
getStatusCode
()),
ResponseResult
.
SUCCESS
.
getCode
())
&&
getAppKeyResponseDto
.
getData
()
!=
null
)
{
redisCache
.
save
(
couponAppSecret
,
getAppKeyResponseDto
.
getData
().
getAppKey
());
appSecret
=
getAppKeyResponseDto
.
getData
().
getAppKey
();
}
}
return
appSecret
;
}
/**
* key = 活动code , value = 返回是否匹配点餐方式
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineMCDClient.java
0 → 100644
View file @
80a616c1
package
cn
.
freemud
.
service
.
thirdparty
;
//import cn.freemud.constant.IgnoreFeignLogAnnotation;
import
cn.freemud.entities.dto.GetCouponDetailResponseDto
;
import
cn.freemud.interceptor.FormSupportConfig
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.Map
;
//@IgnoreFeignLogAnnotation
@FeignClient
(
name
=
"COUPONOLINE"
,
url
=
"${saas.coupononlineclient.feign.url}"
,
configuration
=
FormSupportConfig
.
class
)
public
interface
CouponOnlineMCDClient
{
/**
* 查询券详情
*/
@PostMapping
(
value
=
"/code_v4"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
,
consumes
=
{
MediaType
.
APPLICATION_FORM_URLENCODED_VALUE
}
)
GetCouponDetailResponseDto
getCouponDetails
(
@RequestBody
Map
<
String
,
?>
map
);
}
shopping-cart-application-service/src/test/java/cn.freemud/service/CouponServiceTest.java
View file @
80a616c1
...
...
@@ -192,7 +192,7 @@ public class CouponServiceTest {
@Test
public
String
getAppSecret
(
String
partner
)
{
String
appSecret
=
couponService
.
getAppSecret
(
partner
);
String
appSecret
=
couponService
.
getAppSecret
MCD
(
partner
);
System
.
out
.
println
(
appSecret
);
return
appSecret
;
}
...
...
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