|
|
@ -119,7 +119,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
log.info(String.format(ThirdRunTimeInfoConstant.MSG,msg)); |
|
|
|
// 将xml转为map
|
|
|
|
Map<String, String> result = WXXmlToMapUtil.xmlToMap(msg); |
|
|
|
String infotype = result.get(ModuleConstant.INFO_TYPE); //获取infotype,注:微信开放平台文档中标明固定为:"component_verify_ticket",但参考其他代码,还包含authorized???
|
|
|
|
String infotype = result.get(ModuleConstant.INFO_TYPE); |
|
|
|
log.info(infotype); |
|
|
|
switch (infotype){ |
|
|
|
case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】
|
|
|
@ -131,7 +131,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
ticketFormDTO.setComponentAppId(componentAppId); |
|
|
|
ticketFormDTO.setComponentVerifyTicket(ComponentVerifyTicket); |
|
|
|
//先逻辑删
|
|
|
|
ticketDao.updateOldComponentVerifyTicket(); |
|
|
|
ticketDao.deleteOldComponentVerifyTicket(); |
|
|
|
ticketDao.insertComponentVerifyTicket(ticketFormDTO); |
|
|
|
log.info(ModuleConstant.TICKET_UNDERLINE_KEY+":"+ComponentVerifyTicket); |
|
|
|
break; |
|
|
@ -509,14 +509,20 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
} |
|
|
|
|
|
|
|
public void createAndBindOpenAccount(String customerId,String authAppId,String clientType){ |
|
|
|
Map<String, Object> authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType); |
|
|
|
String authorizerAccessToken = authorizerRefreshToken.get("authorizerAccessToken").toString(); |
|
|
|
JSONObject bindInfoForm = new JSONObject(); |
|
|
|
bindInfoForm.put(ModuleConstant.LOW_APP_ID,authAppId); |
|
|
|
String bindResult = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_OPEN_GET + authorizerAccessToken, JSON.toJSONString(bindInfoForm)).getData(); |
|
|
|
Map<String,Object> bindInfo = JSON.parseObject(bindResult, Map.class); |
|
|
|
boolean bindStatus = bindInfo.containsKey(ModuleConstant.OPEN_APP_ID); |
|
|
|
if (bindStatus != true) { |
|
|
|
log.info("开始创建开放平台账号并绑定"); |
|
|
|
List<String> authCount = customerMpDao.selectAuthCount(customerId); |
|
|
|
String openPlatformId = null; |
|
|
|
if (authCount.size() > 0) { |
|
|
|
openPlatformId = openPlatformAccountDao.selectOpenAppIdByCustomerId(customerId); |
|
|
|
} |
|
|
|
Map<String, Object> authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType); |
|
|
|
String authorizerAccessToken = authorizerRefreshToken.get("authorizerAccessToken").toString(); |
|
|
|
if (authCount.size() == NumConstant.ZERO) { |
|
|
|
log.info("未查询到该客户授权信息,先创建开放平台账号,再绑定"); |
|
|
|
//没有任何一个小程序/公众号授权,【先创建,再绑定】
|
|
|
@ -537,6 +543,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
coForm.setOpenid(map.get(ModuleConstant.OPEN_APP_ID).toString()); |
|
|
|
coForm.setCustomerId(customerId); |
|
|
|
//插入 open_platform_account 表
|
|
|
|
openPlatformAccountDao.deleteOldOpenPlatFprmAccount(customerId); |
|
|
|
openPlatformAccountDao.insertOpenPlatFormAccount(coForm); |
|
|
|
break; |
|
|
|
case NumConstant.ONE_NEG: |
|
|
@ -583,6 +590,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
bindingAccountDao.insertBindingAccount(bindingAccount); |
|
|
|
log.info("创建绑定账号结束"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description map 转 Entity |
|
|
|