diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java index 5e72094a57..c157efc7ce 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/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"; diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java index 30517d5cb7..ad4cd17964 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java +++ b/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 categoryInfoList = new ArrayList<>(); List categories = (List) 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 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("创建绑定账号结束"); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index e98f7a4701..4190008538 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/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"; /** * 创建开放平台帐号并绑定公众号/小程序 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml index 4612ca8c88..da99a3dd4f 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml +++ b/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}