|
|
@@ -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());
|