|
@ -501,13 +501,15 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
Integer authCount = customerMpDao.selectAuthCount(customerId); |
|
|
Integer authCount = customerMpDao.selectAuthCount(customerId); |
|
|
String openPlatformId = null; |
|
|
String openPlatformId = null; |
|
|
String authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType); |
|
|
String authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType); |
|
|
|
|
|
Map authRefresh = JSON.parseObject(authorizerRefreshToken, Map.class); |
|
|
|
|
|
AuthorizationInfoResultDTO authorizationInfo = this.mapToEntity(authRefresh, AuthorizationInfoResultDTO.class); |
|
|
if (authCount==NumConstant.ZERO){ |
|
|
if (authCount==NumConstant.ZERO){ |
|
|
log.info("未查询到该客户授权信息,先创建开放平台账号,再绑定"); |
|
|
log.info("未查询到该客户授权信息,先创建开放平台账号,再绑定"); |
|
|
//没有任何一个小程序/公众号授权,【先创建,再绑定】
|
|
|
//没有任何一个小程序/公众号授权,【先创建,再绑定】
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
jsonObject.put(ModuleConstant.APP_ID,authAppId); |
|
|
jsonObject.put(ModuleConstant.APP_ID,authAppId); |
|
|
// 此处的 access_token 为 【authorizer_access_token】
|
|
|
// 此处的 access_token 为 【authorizer_access_token】
|
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_CREATE_OPEN + authorizerRefreshToken, JSON.toJSONString(jsonObject)).getData(); |
|
|
String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_CREATE_OPEN + authorizationInfo.getAuthorizer_access_token(), JSON.toJSONString(jsonObject)).getData(); |
|
|
Map<String,String> map = JSON.parseObject(data, Map.class); |
|
|
Map<String,String> map = JSON.parseObject(data, Map.class); |
|
|
CreateOpenResultDTO createOpen = new CreateOpenResultDTO(); |
|
|
CreateOpenResultDTO createOpen = new CreateOpenResultDTO(); |
|
|
createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE))); |
|
|
createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE))); |
|
|