|
|
@@ -2,6 +2,7 @@ package com.nb.im.controller;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
@@ -85,16 +86,17 @@ public class ImRoomController implements BaseSaveController<ImRoomEntity,String>
|
|
|
if(Boolean.TRUE.equals(source.isAutoCreate())&&StrUtil.isEmpty(source.getDoctorNickname())){
|
|
|
throw new CustomException("医生昵称不可为空");
|
|
|
}
|
|
|
+ Date dateTime= DateUtil.offsetDay(new Date(),-30);
|
|
|
ImRoomEntity chatRoom = imRoomService.getOne(new QueryWrapper<ImRoomEntity>()
|
|
|
.lambda()
|
|
|
.eq(ImRoomEntity::getAssistId, source.getAssistId())
|
|
|
.eq(ImRoomEntity::getDoctorId, source.getDoctorId())
|
|
|
.eq(ImRoomEntity::getPatientId, source.getPatientId())
|
|
|
- .in(ImRoomEntity::getStatus,ImStatusEnum.WAITING,ImStatusEnum.SUCCESS)
|
|
|
+// .in(ImRoomEntity::getStatus,ImStatusEnum.WAITING,ImStatusEnum.SUCCESS)
|
|
|
.nested(r->
|
|
|
- r .gt(ImRoomEntity::getCreateTime,System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30))
|
|
|
+ r .gt(ImRoomEntity::getCreateTime,dateTime)
|
|
|
.or()
|
|
|
- .gt(ImRoomEntity::getSuccessTime,System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30))
|
|
|
+ .gt(ImRoomEntity::getSuccessTime,dateTime)
|
|
|
)
|
|
|
.orderByDesc(ImRoomEntity::getCreateTime)
|
|
|
.last("limit 1"));
|