Commit c52e533d by 吕明尚

更改seisson

parent e4d49c52
......@@ -188,5 +188,4 @@ meituan:
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: 5067d2db1311d32a0ff366c79a73df51
......@@ -178,3 +178,7 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
......@@ -178,3 +178,6 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
......@@ -190,5 +190,4 @@ meituan:
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
authCode: 6be3e11e19d0b3595046cc2cefbf05da790be35d
......@@ -190,6 +190,4 @@ meituan:
appAuthToken: abcdefghijklmnopqrstuvwxyz
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
\ No newline at end of file
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
\ No newline at end of file
......@@ -190,6 +190,4 @@ meituan:
appAuthToken: abcdefghijklmnopqrstuvwxyz
dianping:
appKey: a59ea57cd1eb4737
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
authCode: abcdefghijklmnopqrstuvwxyz
openShoopUuid: cf0eb0891f9e366bcda10cb7f6f23b25
\ No newline at end of file
appSecret: 0caaabb7fda1c1be46636171548dcf510d1fb706
\ No newline at end of file
......@@ -39,8 +39,6 @@ public class QPServiceImpl implements QPService {
private String APP_KEY;
@Value("${dianping.appSecret}")
private String APP_SECRET;
@Value("${dianping.openShoopUuid}")
private String OPEN_SHOP_UUID;
@Autowired
......@@ -60,15 +58,16 @@ public class QPServiceImpl implements QPService {
if (sCoupon == null) {
throw new RuntimeException("未找到对应的优惠券");
}
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
TuangouReceiptPrepareResponseEntityVo response = new TuangouReceiptPrepareResponseEntityVo();
//查询领取记录表
LambdaQueryWrapper<SConsumerCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SConsumerCoupon::getDealId, prepare.getDeal_id());
queryWrapper.eq(SConsumerCoupon::getConsumerId, user.getId());
SConsumerCoupon one = isConsumerCouponService.getOne(queryWrapper);
if (ObjectUtils.isEmpty(one)) {
throw new RuntimeException("该券码已被使用");
}
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (ObjectUtils.isNotEmpty(sCoupon)) {
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setDealId(prepare.getDeal_id());
......@@ -153,7 +152,7 @@ public class QPServiceImpl implements QPService {
*/
@Override
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);
DefaultOpenAPIClient client = new DefaultOpenAPIClient();
TuangouReceiptPrepareResponse invoke = client.invoke(tuangouReceiptPrepare);
......@@ -171,7 +170,7 @@ public class QPServiceImpl implements QPService {
public List<TuangouReceiptConsumeResponseEntity> consume(String code, int count, String openShopUuid) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
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,
user.getAccount(), user.getNickName());
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
......@@ -190,7 +189,7 @@ public class QPServiceImpl implements QPService {
@Override
public List<TuangouReceiptReverseConsumeResponseEntity> reverseconsume(String code, Long appDealId, String openShopUuid) {
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,
user.getAccount(), user.getNickName());
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
......@@ -210,7 +209,7 @@ public class QPServiceImpl implements QPService {
public TuangouReceiptGetConsumedReponseEntity getconsumed(String code, String openShopUuid) {
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
TuangouReceiptGetConsumedRequest request = new TuangouReceiptGetConsumedRequest(APP_KEY, APP_SECRET,
"04bdcb2ccac3075eac0f60680587be2138c6c362", code, openShopUuid);
"5bf98bb4c6c0d8ecef94f0882b40e00c5a248abc", code, openShopUuid);
TuangouReceiptGetConsumed tuangouReceiptGetConsumed = new TuangouReceiptGetConsumed(request);
TuangouReceiptGetConsumedReponse response = openAPIClient.invoke(tuangouReceiptGetConsumed);
if (response.getCode() != 200) {
......@@ -223,11 +222,11 @@ public class QPServiceImpl implements QPService {
public String oauthToken(String authCode) {
DefaultOpenAPIClient openAPIClient = new DefaultOpenAPIClient();
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);
DynamicTokenResponse response = openAPIClient.invoke(dynamicToken);
if (response.getRemain_refresh_count() == 0) {
return refreshToken(response.getRefresh_token());
return refreshToken(response.getAccess_token());
}
return response.getAccess_token();
}
......@@ -241,7 +240,7 @@ public class QPServiceImpl implements QPService {
* @param app_shop_id
*/
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);
TuangouDealQueryShopDealResponse response = openAPIClient.invoke(tuangouDealQueryShopDeal);
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