소스 검색

fix
研究队列推送

lifang 1 개월 전
부모
커밋
2400233b0c
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      tr-modules/tr-module-mobile/src/main/java/cn/tr/module/mobile/service/impl/ImMsgReceivedServiceImpl.java

+ 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);
             }
         };