浏览代码

fix
研究队列推送

lifang 1 月之前
父节点
当前提交
2400233b0c

+ 3 - 2
tr-modules/tr-module-mobile/src/main/java/cn/tr/module/mobile/service/impl/ImMsgReceivedServiceImpl.java

@@ -93,6 +93,7 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
             log.info("用户登录成功:{}", JSONUtil.toJsonStr(loginInfo));
             TenantContextHolder.setIgnore(Boolean.TRUE);
             groupUserRepository.readAllMsg(loginInfo.getClinicId(), loginInfo.getUserId());
+            TenantContextHolder.setIgnore(Boolean.FALSE);
             if(StrUtil.equals(MsgRoleType.DOCTOR,loginInfo.getRole())){
                 self.doctorOnLine(loginInfo.getClinicId());
             }
@@ -104,7 +105,9 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
                     sendMsg(MsgDTO.noneMsg(loginInfo.getClinicId(),loginInfo.getUserId(),loginInfo.getUserId(),loginInfo.getTenantId()),Boolean.FALSE);
                 }else if(StrUtil.equals(MsgRoleType.DOCTOR,loginInfo.getRole())){
                     //医生上线
+                    TenantContextHolder.setIgnore(Boolean.TRUE);
                     List<String> userIds = ServerEventCallbackHandler.onGetGroupUserIds.apply(loginInfo.getClinicId());
+                    TenantContextHolder.setIgnore(Boolean.FALSE);
                     log.info("群组用户:{}", JSONUtil.toJsonStr(userIds));
                     CollectionUtil.removeAny(userIds,loginInfo.getUserId());
                     for (String userId : userIds) {
@@ -118,8 +121,6 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
                         loginInfo.getRole(),
                         Optional.ofNullable(e.getMessage()).orElse("未知错误"),
                         e);
-            }finally {
-                TenantContextHolder.setIgnore(Boolean.FALSE);
             }
         };