解决消息订阅提醒bug

This commit is contained in:
aikai 2024-12-05 17:39:59 +08:00
parent f8a0845c6e
commit 3ceabc2e7c
2 changed files with 13 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.template.vo.MsgData;
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
@ -33,20 +32,26 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi {
@Resource
private SocialClientService socialClientService;
@SneakyThrows
@Override
public CommonResult<Long> sendMaMsg(SubscribeMessageReqDTO reqDTO) {
try {
//发送审批结果通知
socialClientService.getWxMaService(reqDTO.getSocialType()).getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
} catch (Exception e) {
log.error("发送小程序订阅消息失败:{}", e.getMessage());
}
return success(1L);
}
@Override
@SneakyThrows
public CommonResult<Long> sendMpMsg(SubscribeMessageReqDTO reqDTO) {
// -- 公众号 点击 跳转 小程序 - 需要获取到小程序appId
// 判断是否需要跳转小程序 - 通过
try {
socialClientService.getWxMpService().getTemplateMsgService().sendTemplateMsg(initWxMpSubscribeMessage(reqDTO));
} catch (Exception e) {
log.error("发送公众号消息失败:{}", e.getMessage());
}
return success(1L);
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.service.auth;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.module.system.dal.dataobject.auth.AdminOauthUserOtherInfoDO;
import cn.iocoder.yudao.module.system.dal.mysql.auth.AdminOauthUserOtherInfoMapper;
import cn.iocoder.yudao.module.system.service.auth.dto.AdminOauthUserOtherInfoDTO;
@ -8,6 +9,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**