|
|
@@ -245,6 +245,14 @@ public class IpadSendUtils {
|
|
|
* @return 返回的userid
|
|
|
*/
|
|
|
private Long chatIds(BaseVo vo){
|
|
|
+ try {
|
|
|
+ String idStr = redisCache.getCacheObject(USER_KEY + vo.getExId());
|
|
|
+ if(StringUtils.isNotEmpty(idStr)){
|
|
|
+ return Long.parseLong(idStr);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("获取群ID失败", e);
|
|
|
+ }
|
|
|
// 实时查询群聊信息
|
|
|
QwGroupChat qwGroupChat = qwGroupChatMapper.selectQwGroupChatByChatId(vo.getExId());
|
|
|
if(qwGroupChat == null){
|
|
|
@@ -254,7 +262,10 @@ public class IpadSendUtils {
|
|
|
return qwGroupChat.getRoomid();
|
|
|
}
|
|
|
// 找到对应的企业微信
|
|
|
- QwUser qwUser = qwUserMapper.selectOne(new QueryWrapper<QwUser>().eq("corp_id", qwGroupChat.getCorpId()).eq("ipad_status", 1).last(" limit 1"));
|
|
|
+ QwUser qwUser = qwUserMapper.selectQwUserAppKeyAndIdByCorpIdAndUserIdAndIpad(qwGroupChat.getCorpId(), qwGroupChat.getOwner());
|
|
|
+ if(qwUser == null){
|
|
|
+ throw new BaseException("群主离线无法转换");
|
|
|
+ }
|
|
|
WxWorkChatIdToRoomIdDTO tdo = new WxWorkChatIdToRoomIdDTO();
|
|
|
// 重新组装数据
|
|
|
tdo.setChatid(qwGroupChat.getChatId());
|
|
|
@@ -562,7 +573,7 @@ public class IpadSendUtils {
|
|
|
}
|
|
|
return data.stream().map(WxWorkVid2UserIdRespDTO::getUser_id).collect(Collectors.toList());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void sendTxtAtMsgVo(WxSendTextAtMsgTwoDTO dto, Long serverId){
|
|
|
WxWorkResponseDTO<WxSendTextAtMsgVo> result = wxWorkService.sendTextAtMsgTwo(dto, serverId);
|
|
|
log.info("发送@所有人返回数据:{}", result);
|