lifang 3 月之前
父節點
當前提交
0ac862cf8c

+ 1 - 4
tr-modules/tr-module-mobile/src/main/java/cn/tr/module/mobile/dto/ImMsgUnreadTotalCountQueryDTO.java

@@ -4,13 +4,10 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
-import java.util.*;
+
 @Data
 public class ImMsgUnreadTotalCountQueryDTO {
     @ApiModelProperty(value = "用户id",required = true)
     @NotBlank(message = "用户id不能为空")
     private String userId;
-
-    @ApiModelProperty(value = "显示哪些消息类型")
-    private List<String> msgType;
 }

+ 16 - 12
tr-modules/tr-module-mobile/src/main/java/cn/tr/module/mobile/service/impl/ImMsgReceivedServiceImpl.java

@@ -7,6 +7,7 @@ import cn.tr.module.mobile.config.ServerEventCallbackHandler;
 import cn.tr.module.mobile.controller.vo.ImMsgReceivedVO;
 import cn.tr.module.mobile.dto.ImMsgUnreadTotalCountQueryDTO;
 import cn.tr.module.mobile.dto.MsgDTO;
+import cn.tr.module.mobile.enums.MsgContentType;
 import cn.tr.module.mobile.po.ImGroupUserPO;
 import cn.tr.module.mobile.repository.ImGroupUserRepository;
 import cn.tr.module.mobile.utils.UserUtils;
@@ -24,7 +25,6 @@ import cn.tr.module.mobile.po.ImMsgReceivedPO;
 import cn.tr.module.mobile.dto.ImMsgReceivedQueryDTO;
 import java.util.*;
 import cn.tr.module.mobile.service.IImMsgReceivedService;
-import cn.tr.module.mobile.mapper.ImMsgReceivedMapper;
 import javax.annotation.PostConstruct;
 
 /**
@@ -48,17 +48,21 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
             if(p!=null){
                 return;
             }
-            ImMsgReceivedPO receivedPO = new ImMsgReceivedPO();
-            receivedPO.setMsgId(msgDTO.getMsgId());
-            receivedPO.setMsgFrom(msgDTO.getFromUserId());
-            receivedPO.setMsgTo(msgDTO.getToUserId());
-            receivedPO.setGroupId(msgDTO.getClinicId());
-            receivedPO.setMsgContent(msgDTO.getContent());
-            receivedPO.setSendTime(new Date());
-            receivedPO.setMsgType(msgDTO.getType());
-            receivedPO.setMsgFromRole(msgDTO.getRole());
-            receivedPO.setDuration(msgDTO.getDuration());
-            baseRepository.insert(receivedPO);
+            if(MsgContentType.DOCTOR_IN.equals(msgDTO.getType())||MsgContentType.DOCTOR_OUT.equals(msgDTO.getType())){
+
+            }else {
+                ImMsgReceivedPO receivedPO = new ImMsgReceivedPO();
+                receivedPO.setMsgId(msgDTO.getMsgId());
+                receivedPO.setMsgFrom(msgDTO.getFromUserId());
+                receivedPO.setMsgTo(msgDTO.getToUserId());
+                receivedPO.setGroupId(msgDTO.getClinicId());
+                receivedPO.setMsgContent(msgDTO.getContent());
+                receivedPO.setSendTime(new Date());
+                receivedPO.setMsgType(msgDTO.getType());
+                receivedPO.setMsgFromRole(msgDTO.getRole());
+                receivedPO.setDuration(msgDTO.getDuration());
+                baseRepository.insert(receivedPO);
+            }
             //发送群组消息
             List<String> userIds = ServerEventCallbackHandler.onGetGroupUserIds.apply(msgDTO.getClinicId());
             CollectionUtil.removeAny(userIds,msgDTO.getFromUserId());

+ 1 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/wx/config/WxAppletOauth2UserOperator.java

@@ -177,6 +177,7 @@ public class WxAppletOauth2UserOperator extends AbstractOAuth2PswUserOperator {
     @Override
     @TenantIgnore
     public OAuth2PswLoginInfoDTO getUserLoginInfo() {
+        SaTokenUtils.getStpUtil().checkLogin();
         String loginId = String.valueOf(SaTokenUtils.getStpUtil().getLoginId());
         BizWxUserDTO user = wxUserService.selectBizWxUserById(loginId);
         BizWxUserMpCarePO bizWxUserMpCarePO =null;

+ 1 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/oauth2/psw/operator/LoginOAuth2PswUserOperator.java

@@ -179,6 +179,7 @@ public class LoginOAuth2PswUserOperator extends AbstractOAuth2PswUserOperator{
 
     @Override
     public OAuth2PswLoginInfoDTO getUserLoginInfo() {
+        SaTokenUtils.getStpUtil().checkLogin();
         String currentUserId = LoginUserStrategy.tr.getCurrentUserId();
         SysUserPO sysUser = sysUserRepository.selectById(currentUserId);
         OAuth2PswLoginInfoDTO pswLoginInfo = OAuth2Mapper.INSTANCE.toPswLoginInfo(sysUser);

+ 1 - 1
tr-test/src/main/java/cn/tr/test/WebApplication.java

@@ -22,4 +22,4 @@ public class WebApplication {
         SaStrategy.me.checkElementAnnotation= t->{};
         SpringApplication.run(WebApplication.class);
     }
-}
+}