Browse Source

Merge remote-tracking branch 'origin/dev_thirdplatform' into dev

dev_shibei_match
zxc 5 years ago
parent
commit
5f5af59a4c
  1. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java
  2. 33
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  3. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java
  4. 2
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -65,7 +65,7 @@ public interface ModuleConstant {
String COMPONENT_APP_ID = "component_appid";
String AUTHORIZER_APP_ID = "authorizer_appid";
String AUTHORIZER_INFO = "authorizer_info";
String MINI_PROGRAM_INFO = "miniprograminfo";
String MINI_PROGRAM_INFO = "MiniProgramInfo";
String BUSINESS_INFO = "business_info";
String CATEGORIES = "categories";
String NETWORK = "network";

33
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -378,7 +378,6 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
String client = authCodeAndTime.getClientType();
String expiresIn = authCodeAndTime.getExpiresIn();
String customerId = tokenDto.getCustomerId();
customerId = "f530774b31e0609a3c7f0f83794cda0c";
Date expiresInTime = this.countExpirationTime(expiresIn);
if (StringUtils.isBlank(customerId)||StringUtils.isBlank(client)||StringUtils.isBlank(authCode)||StringUtils.isBlank(expiresIn)){
log.info("客户ID = "+customerId+", 客户端类型为 = "+client+", 授权码为 = "+authCode+", 有效期 = "+expiresIn);
@ -456,18 +455,20 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
//todo 小程序配置的类目信息插入
List<MiniCategoryInfoFormDTO> categoryInfoList = new ArrayList<>();
List<Map> categories = (List<Map>) miniProgramInfo.get(ModuleConstant.CATEGORIES);
categories.forEach(category -> {
category.forEach((key,value) -> {
MiniCategoryInfoFormDTO categoryInfo = new MiniCategoryInfoFormDTO();
categoryInfo.setCustomerId(customerId);
categoryInfo.setClientType(clientType);
categoryInfo.setCategorySort(key.toString());
categoryInfo.setCategoryName(value.toString());
categoryInfo.setPrimaryId(primaryId);
categoryInfoList.add(categoryInfo);
if (categories.size() != NumConstant.ZERO) {
categories.forEach(category -> {
category.forEach((key, value) -> {
MiniCategoryInfoFormDTO categoryInfo = new MiniCategoryInfoFormDTO();
categoryInfo.setCustomerId(customerId);
categoryInfo.setClientType(clientType);
categoryInfo.setCategorySort(key.toString());
categoryInfo.setCategoryName(value.toString());
categoryInfo.setPrimaryId(primaryId);
categoryInfoList.add(categoryInfo);
});
});
});
miniCategoryInfoDao.insertCategoryInfo(categoryInfoList);
miniCategoryInfoDao.insertCategoryInfo(categoryInfoList);
}
}else {
log.info("授权方为公众号 并 开始插入信息");
PaInfoFormDTO paInfoFormDTO = this.mapToEntity(authorizerInfo, PaInfoFormDTO.class);
@ -499,7 +500,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
*/
@Transactional(rollbackFor = Exception.class)
public void updateCustomerMpAppIdAndCreateOpenPlatform(String customerId,String authAppId,String clientType){
log.info("开始创建开放平台账号并绑定");
/*log.info("开始创建开放平台账号并绑定");
Integer authCount = customerMpDao.selectAuthCount(customerId);
String openPlatformId = null;
Map<String, Object> authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType);
@ -561,7 +562,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_FOUR:
throw new RenException(TO_LIMIT);
}
}
}*/
AuthCodeFormDTO formDTO = new AuthCodeFormDTO();
formDTO.setClientType(clientType);
formDTO.setAuthAppId(authAppId);
@ -569,12 +570,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
//回填customer_mp的appId 只需以上三个字段
customerMpDao.updateAppIDByCustomerIdAndClient(formDTO);
//插入 binding_account
BindingAccountFormDTO bindingAccount = new BindingAccountFormDTO();
/*BindingAccountFormDTO bindingAccount = new BindingAccountFormDTO();
bindingAccount.setOpenPlatformAccountId(openPlatformId);
bindingAccount.setAuthAppId(authAppId);
bindingAccount.setClientType(clientType);
bindingAccount.setCustomerId(customerId);
bindingAccountDao.insertBindingAccount(bindingAccount);
bindingAccountDao.insertBindingAccount(bindingAccount);*/
log.info("创建绑定账号结束");
}

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java

@ -41,8 +41,8 @@ public interface WxMaCodeConstant {
* pre_auth_code预授权码
* redirect_uri回调url获取授权码
*/
// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s";
String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect";
String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s";
// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect";
/**
* 创建开放平台帐号并绑定公众号/小程序

2
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml

@ -37,7 +37,7 @@
WHERE
customer_id = #{customerId}
AND del_flag = '0'
AND client = #{client}
AND client = #{clientType}
</update>
<!-- 修改小程序授权的状态 -->

Loading…
Cancel
Save