diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java index 80132c3..1c4d3a4 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxAuthorizerInfoMapper.java @@ -9,9 +9,9 @@ public interface WxAuthorizerInfoMapper extends CommonMapper findList(WxAuthorizerInfo wxAuthorizerInfo); - List findWeappList(); + List findWeappList(); - List findWxMpList(); + List findWxMpList(); List findVoList(WxWeappInfo wxWeappInfo); diff --git a/mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml index ed9ce1e..9c45d6d 100644 --- a/mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAuthorizerInfoMapper.xml @@ -119,16 +119,6 @@ - - - - update wx_authorizer_info set `current_version` = #{currentVersion}, `current_desc` = #{currentDesc}, `release_time` = #{releaseTime}, `update_time` = #{updateTime} @@ -170,6 +160,7 @@ + @@ -183,7 +174,7 @@ ai.`template_status`,ai.`template_time`, ai.`current_version`,ai.`current_desc`,ai.`release_time`, ai.`open_appid`,ai.`bind_open_time`, - a.`type`,a.`name` + a.`tenant_id`,a.`type`,a.`name` @@ -251,10 +242,20 @@ left join wx_appinfo a on ai.`authorizer_appid` = a.app_id - - - - + + + + diff --git a/mlWechatOpen/src/main/java/com/iformall/schedule/AppAccessTokenSchedule.java b/mlWechatOpen/src/main/java/com/iformall/schedule/AppAccessTokenSchedule.java index aa564f7..377ea7b 100644 --- a/mlWechatOpen/src/main/java/com/iformall/schedule/AppAccessTokenSchedule.java +++ b/mlWechatOpen/src/main/java/com/iformall/schedule/AppAccessTokenSchedule.java @@ -1,6 +1,6 @@ package com.iformall.schedule; -import com.iformall.domain.po.WxAuthorizerInfo; +import com.iformall.domain.vo.WxWeappInfo; import com.iformall.mapper.WxAuthorizerInfoMapper; import com.iformall.service.wechat.WxOpenService; import me.chanjar.weixin.common.error.WxErrorException; @@ -22,15 +22,15 @@ public class AppAccessTokenSchedule { @Autowired private WxOpenService openService; - @Scheduled(cron = "0 0 */1 * * *?") // 每小时更新一次 + @Scheduled(cron = "0 10 * * * *?") // 每小时更新一次 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 public void updateAppAccessToken() { // 微信小程序 /* - List weappList = authorizerInfoMapper.findWeappList(); - weappList.stream().forEach(wxAuthorizerInfo -> { + List weappList = authorizerInfoMapper.findWeappList(); + weappList.stream().forEach(weappInfo -> { try { - openService.getWxOpenComponentService().getAuthorizerAccessToken(wxAuthorizerInfo.getAuthorizerAppid(), true); + openService.getWxOpenComponentService().getAuthorizerAccessToken(weappInfo.getAuthorizerAppid(), true); } catch (WxErrorException e) { logger.error(e.getMessage()); } @@ -38,10 +38,10 @@ public class AppAccessTokenSchedule { */ // 微信公众号 - List wxmpList = authorizerInfoMapper.findWxMpList(); - wxmpList.stream().forEach(wxAuthorizerInfo -> { + List wxmpList = authorizerInfoMapper.findWxMpList(); + wxmpList.stream().forEach(weappInfo -> { try { - openService.getWxOpenComponentService().getAuthorizerAccessToken(wxAuthorizerInfo.getAuthorizerAppid(), true); + openService.getWxOpenComponentService().getAuthorizerAccessToken(weappInfo.getAuthorizerAppid(), true); } catch (WxErrorException e) { logger.error(e.getMessage()); }