Commit c52e533d by 吕明尚

更改seisson

parent e4d49c52
...@@ -188,5 +188,4 @@ meituan: ...@@ -188,5 +188,4 @@ meituan:
dianping: dianping:
appKey: a59ea57cd1eb4737 appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706 appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: 5067d2db1311d32a0ff366c79a73df51
...@@ -178,3 +178,7 @@ xss: ...@@ -178,3 +178,7 @@ xss:
excludes: /system/notice excludes: /system/notice
# 匹配链接 # 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
...@@ -178,3 +178,6 @@ xss: ...@@ -178,3 +178,6 @@ xss:
excludes: /system/notice excludes: /system/notice
# 匹配链接 # 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
...@@ -190,5 +190,4 @@ meituan: ...@@ -190,5 +190,4 @@ meituan:
dianping: dianping:
appKey: a59ea57cd1eb4737 appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706 appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz authCode: 6be3e11e19d0b3595046cc2cefbf05da790be35d
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
...@@ -191,5 +191,3 @@ meituan: ...@@ -191,5 +191,3 @@ meituan:
dianping: dianping:
appKey: a59ea57cd1eb4737 appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706 appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
\ No newline at end of file
...@@ -191,5 +191,3 @@ meituan: ...@@ -191,5 +191,3 @@ meituan:
dianping: dianping:
appKey: a59ea57cd1eb4737 appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706 appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
\ No newline at end of file
...@@ -39,8 +39,6 @@ public class QPServiceImpl implements QPService { ...@@ -39,8 +39,6 @@ public class QPServiceImpl implements QPService {
private String APP_KEY; private String APP_KEY;
@Value("${dianping.appSecret}") @Value("${dianping.appSecret}")
private String APP_SECRET; private String APP_SECRET;
@Value("${dianping.openShoopUuid}")
private String OPEN_SHOP_UUID;
@Autowired @Autowired
...@@ -60,15 +58,16 @@ public class QPServiceImpl implements QPService { ...@@ -60,15 +58,16 @@ public class QPServiceImpl implements QPService {
if (sCoupon == null) { if (sCoupon == null) {
throw new RuntimeException("未找到对应的优惠券"); throw new RuntimeException("未找到对应的优惠券");
} }
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo(); TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo();
//查询领取记录表 //查询领取记录表
LambdaQueryWrapper<SConsumerCoupon> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SConsumerCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SConsumerCoupon::getDealId, prepare.getDeal_id()); queryWrapper.eq(SConsumerCoupon::getDealId, prepare.getDeal_id());
queryWrapper.eq(SConsumerCoupon::getConsumerId, user.getId());
SConsumerCoupon one = isConsumerCouponService.getOne(queryWrapper); SConsumerCoupon one = isConsumerCouponService.getOne(queryWrapper);
if (ObjectUtils.isEmpty(one)) { if (ObjectUtils.isEmpty(one)) {
throw new RuntimeException("该券码已被使用"); throw new RuntimeException("该券码已被使用");
} }
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (ObjectUtils.isNotEmpty(sCoupon)) { if (ObjectUtils.isNotEmpty(sCoupon)) {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon(); SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setDealId(prepare.getDeal_id()); sConsumerCoupon.setDealId(prepare.getDeal_id());
...@@ -153,7 +152,7 @@ public class QPServiceImpl implements QPService { ...@@ -153,7 +152,7 @@ public class QPServiceImpl implements QPService {
*/ */
@Override @Override
public TuangouReceiptPrepareResponseEntity prepare(String code, String openShopUuid) { public TuangouReceiptPrepareResponseEntity prepare(String code, String openShopUuid) {
TuangouReceiptPrepareRequest request = new TuangouReceiptPrepareRequest(APP_KEY, APP_SECRET, "04bdcb2ccac3075eac0f60680587be2138c6c362", code, "", openShopUuid); TuangouReceiptPrepareRequest request = new TuangouReceiptPrepareRequest(APP_KEY, APP_SECRET, "5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc", code, "", openShopUuid);
TuangouReceiptPrepare tuangouReceiptPrepare = new TuangouReceiptPrepare(request); TuangouReceiptPrepare tuangouReceiptPrepare = new TuangouReceiptPrepare(request);
DefaultOpenAPIClient client = new DefaultOpenAPIClient(); DefaultOpenAPIClient client = new DefaultOpenAPIClient();
TuangouReceiptPrepareResponse invoke = client.invoke(tuangouReceiptPrepare); TuangouReceiptPrepareResponse invoke = client.invoke(tuangouReceiptPrepare);
...@@ -171,7 +170,7 @@ public class QPServiceImpl implements QPService { ...@@ -171,7 +170,7 @@ public class QPServiceImpl implements QPService {
public List<TuangouReceiptConsumeResponseEntity> consume(String code, int count, String openShopUuid) { public List<TuangouReceiptConsumeResponseEntity> consume(String code, int count, String openShopUuid) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
String requestid = UUID.randomUUID().toString(); String requestid = UUID.randomUUID().toString();
TuangouReceiptConsumeRequest request = new TuangouReceiptConsumeRequest(APP_KEY, APP_SECRET, "04bdcb2ccac3075eac0f60680587be2138c6c362", TuangouReceiptConsumeRequest request = new TuangouReceiptConsumeRequest(APP_KEY, APP_SECRET, "5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc",
requestid, code, count, openShopUuid, requestid, code, count, openShopUuid,
user.getAccount(), user.getNickName()); user.getAccount(), user.getNickName());
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient(); DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
...@@ -190,7 +189,7 @@ public class QPServiceImpl implements QPService { ...@@ -190,7 +189,7 @@ public class QPServiceImpl implements QPService {
@Override @Override
public List<TuangouReceiptReverseConsumeResponseEntity> reverseconsume(String code, Long appDealId, String openShopUuid) { public List<TuangouReceiptReverseConsumeResponseEntity> reverseconsume(String code, Long appDealId, String openShopUuid) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
TuangouReceiptReverseConsumeRequest tuangouReceiptReverseConsumeRequest = new TuangouReceiptReverseConsumeRequest(APP_KEY, APP_SECRET, "04bdcb2ccac3075eac0f60680587be2138c6c362", TuangouReceiptReverseConsumeRequest tuangouReceiptReverseConsumeRequest = new TuangouReceiptReverseConsumeRequest(APP_KEY, APP_SECRET, "5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc",
String.valueOf(appDealId), code, openShopUuid, String.valueOf(appDealId), code, openShopUuid,
user.getAccount(), user.getNickName()); user.getAccount(), user.getNickName());
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient(); DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
...@@ -210,7 +209,7 @@ public class QPServiceImpl implements QPService { ...@@ -210,7 +209,7 @@ public class QPServiceImpl implements QPService {
public TuangouReceiptGetConsumedReponseEntity getconsumed(String code, String openShopUuid) { public TuangouReceiptGetConsumedReponseEntity getconsumed(String code, String openShopUuid) {
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient(); DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
TuangouReceiptGetConsumedRequest request = new TuangouReceiptGetConsumedRequest(APP_KEY, APP_SECRET, TuangouReceiptGetConsumedRequest request = new TuangouReceiptGetConsumedRequest(APP_KEY, APP_SECRET,
"04bdcb2ccac3075eac0f60680587be2138c6c362", code, openShopUuid); "5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc", code, openShopUuid);
TuangouReceiptGetConsumed tuangouReceiptGetConsumed = new TuangouReceiptGetConsumed(request); TuangouReceiptGetConsumed tuangouReceiptGetConsumed = new TuangouReceiptGetConsumed(request);
TuangouReceiptGetConsumedReponse response = openAPIClient.invoke(tuangouReceiptGetConsumed); TuangouReceiptGetConsumedReponse response = openAPIClient.invoke(tuangouReceiptGetConsumed);
if (response.getCode() != 200) { if (response.getCode() != 200) {
...@@ -223,11 +222,11 @@ public class QPServiceImpl implements QPService { ...@@ -223,11 +222,11 @@ public class QPServiceImpl implements QPService {
public String oauthToken(String authCode) { public String oauthToken(String authCode) {
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient(); DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
DynamicTokenRequest request = new DynamicTokenRequest(APP_KEY, DynamicTokenRequest request = new DynamicTokenRequest(APP_KEY,
APP_SECRET, GrantType.AUTHORIZATION_CODE.getValue(), "6be3e11e19d0b3595046cc2cefbf05da790be35d"); APP_SECRET, GrantType.AUTHORIZATION_CODE.getValue(), authCode);
DynamicToken dynamicToken = new DynamicToken(request); DynamicToken dynamicToken = new DynamicToken(request);
DynamicTokenResponse response = openAPIClient.invoke(dynamicToken); DynamicTokenResponse response = openAPIClient.invoke(dynamicToken);
if (response.getRemain_refresh_count() == 0) { if (response.getRemain_refresh_count() == 0) {
return refreshToken(response.getRefresh_token()); return refreshToken(response.getAccess_token());
} }
return response.getAccess_token(); return response.getAccess_token();
} }
...@@ -241,7 +240,7 @@ public class QPServiceImpl implements QPService { ...@@ -241,7 +240,7 @@ public class QPServiceImpl implements QPService {
* @param app_shop_id * @param app_shop_id
*/ */
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient(); DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
TuangouDealQueryShopDealRequest request = new TuangouDealQueryShopDealRequest(APP_KEY, APP_SECRET, "04bdcb2ccac3075eac0f60680587be2138c6c362", "", 1, 100, openShopUuid); TuangouDealQueryShopDealRequest request = new TuangouDealQueryShopDealRequest(APP_KEY, APP_SECRET, "5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc", "", 1, 100, openShopUuid);
TuangouDealQueryShopDeal tuangouDealQueryShopDeal = new TuangouDealQueryShopDeal(request); TuangouDealQueryShopDeal tuangouDealQueryShopDeal = new TuangouDealQueryShopDeal(request);
TuangouDealQueryShopDealResponse response = openAPIClient.invoke(tuangouDealQueryShopDeal); TuangouDealQueryShopDealResponse response = openAPIClient.invoke(tuangouDealQueryShopDeal);
if (response.getCode() != 200) { if (response.getCode() != 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment