|
|
@@ -91,7 +91,11 @@ public class ImRoomController implements BaseSaveController<ImRoomEntity,String>
|
|
|
.eq(ImRoomEntity::getDoctorId, source.getDoctorId())
|
|
|
.eq(ImRoomEntity::getPatientId, source.getPatientId())
|
|
|
.in(ImRoomEntity::getStatus,ImStatusEnum.WAITING,ImStatusEnum.SUCCESS)
|
|
|
- .gt(ImRoomEntity::getCreateTime,System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30))
|
|
|
+ .nested(r->
|
|
|
+ r .gt(ImRoomEntity::getCreateTime,System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30))
|
|
|
+ .or()
|
|
|
+ .gt(ImRoomEntity::getSuccessTime,System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30))
|
|
|
+ )
|
|
|
.orderByDesc(ImRoomEntity::getCreateTime)
|
|
|
.last("limit 1"));
|
|
|
if(chatRoom==null&&source.isAutoCreate()){
|
|
|
@@ -120,7 +124,7 @@ public class ImRoomController implements BaseSaveController<ImRoomEntity,String>
|
|
|
result.parallelStream().forEach(room->
|
|
|
room.setUnreadCount( roomOperatorManager.getRoomOperator(room)
|
|
|
.unReadCount(userId)
|
|
|
- ));
|
|
|
+ ));
|
|
|
return R.success(result);
|
|
|
}
|
|
|
|