diff --git a/Hushian.Application/Services/ChatService.cs b/Hushian.Application/Services/ChatService.cs index 9ed187c..ca82f75 100644 --- a/Hushian.Application/Services/ChatService.cs +++ b/Hushian.Application/Services/ChatService.cs @@ -42,7 +42,7 @@ namespace Hushian.Application.Services => await _ConversationRepository.Get() .Include(inc => inc.Group) .Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper) - .Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == status) + .Where(w => w.ConversationResponses.OrderBy(o => o.ID).Last().ExperID == ExperID && w.Status == status) .Select(s => new ChatItemDto() { ID = s.ID, @@ -119,6 +119,7 @@ namespace Hushian.Application.Services .Include(inc => inc.Group) .Include(inc => inc.ConversationResponses).ThenInclude(tinc => tinc.Exper) .Where(w => w.Status == ConversationStatus.Recorded && w.CompanyID == CompanyID); + if (groupallow != null) request = request.Where(w => !w.GroupID.HasValue || groupallow.Contains(w.GroupID.Value)); return await request.Select(s => new ChatItemDto() { @@ -275,7 +276,7 @@ namespace Hushian.Application.Services }; Response.Success = statuschangedb.ID > 0; - if (convModel.Status == ConversationStatus.Recorded && Response.Success) + if (dto.Type != ConversationType.UE && convModel.Status == ConversationStatus.Recorded && Response.Success) { convModel.Status = ConversationStatus.InProgress; await _ConversationRepository.UPDATE(convModel); diff --git a/Hushian.Application/Services/ExperService.cs b/Hushian.Application/Services/ExperService.cs index ae26c1e..3898038 100644 --- a/Hushian.Application/Services/ExperService.cs +++ b/Hushian.Application/Services/ExperService.cs @@ -72,7 +72,7 @@ namespace Hushian.Application.Services { return await _ExperRepository.Get().Where(w => w.ID == ExperID).Select(s => new CurrentUserInfo { - CompanyID = CompanyID, + CompanyID = s.CompanyID, ExperID = ExperID, Username = s.UserName, Role = "Exper" diff --git a/Presentation/HushianWebApp/Pages/Chat.razor b/Presentation/HushianWebApp/Pages/Chat.razor index 5a80618..651945b 100644 --- a/Presentation/HushianWebApp/Pages/Chat.razor +++ b/Presentation/HushianWebApp/Pages/Chat.razor @@ -106,11 +106,23 @@ }
- @item.LastMsgdate - @item.LastMsgtime + @item.LastMsgdate @item.LastMsgtime + @* *@
-
@item.LastText
+ +
+ @if (item.LastMsgType == ConversationType.UE) + { + + } + else + { + + } + + @item.LastText +
@if (item.Responses.Count(c => !c.IsRead && c.Type == ConversationType.UE) > 0) { diff --git a/Presentation/HushianWebApp/Pages/FromUserSide/UserCP.razor b/Presentation/HushianWebApp/Pages/FromUserSide/UserCP.razor index 0916534..b6f6987 100644 --- a/Presentation/HushianWebApp/Pages/FromUserSide/UserCP.razor +++ b/Presentation/HushianWebApp/Pages/FromUserSide/UserCP.razor @@ -41,12 +41,7 @@
@if (LastOpenChat != null) { - @if (LastOpenChat.status == Common.Enums.ConversationStatus.InProgress) - { - - } + @@ -175,7 +170,7 @@ - +
} + + + @if (LastOpenChat!=null && LastOpenChat.status == Common.Enums.ConversationStatus.InProgress) + { + + } }