...
This commit is contained in:
@@ -44,8 +44,8 @@ namespace Hushian.Application.Services
|
|||||||
.Select(s => new ChatItemDto()
|
.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
@@ -77,9 +77,9 @@ namespace Hushian.Application.Services
|
|||||||
.Where(w => w.CompanyID == CompanyID && w.Status == status)
|
.Where(w => w.CompanyID == CompanyID && w.Status == status)
|
||||||
.Select(s => new ChatItemDto()
|
.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
@@ -121,8 +121,8 @@ namespace Hushian.Application.Services
|
|||||||
return await request.Select(s => new ChatItemDto()
|
return await request.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
@@ -184,8 +184,8 @@ namespace Hushian.Application.Services
|
|||||||
.Select(s => new ChatItemDto()
|
.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
@@ -340,7 +340,7 @@ namespace Hushian.Application.Services
|
|||||||
public async Task<bool> MarkAsReadChatItem(int ID, ConversationType Type, int? ExperID)
|
public async Task<bool> MarkAsReadChatItem(int ID, ConversationType Type, int? ExperID)
|
||||||
{
|
{
|
||||||
var item = await _ConversationResponseRepository.Get()
|
var item = await _ConversationResponseRepository.Get()
|
||||||
.Include(inc => inc.conversation).FirstOrDefaultAsync(w => w.ID == ID && !w.ExperID.HasValue
|
.Include(inc => inc.conversation).FirstOrDefaultAsync(w => w.ID == ID /*&& !w.ExperID.HasValue*/
|
||||||
&& w.conversation.Status != ConversationStatus.Finished);
|
&& w.conversation.Status != ConversationStatus.Finished);
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
@@ -377,8 +377,8 @@ namespace Hushian.Application.Services
|
|||||||
.Select(s => new ChatItemDto()
|
.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l=>l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
@@ -418,8 +418,8 @@ namespace Hushian.Application.Services
|
|||||||
.Select(s => new ChatItemDto()
|
.Select(s => new ChatItemDto()
|
||||||
{
|
{
|
||||||
ID = s.ID,
|
ID = s.ID,
|
||||||
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
|
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).ExperID,
|
||||||
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
|
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last(l => l.ExperID.HasValue).Exper.FullName,
|
||||||
GroupID = s.GroupID,
|
GroupID = s.GroupID,
|
||||||
GroupName = s.Group.Name,
|
GroupName = s.Group.Name,
|
||||||
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
|
||||||
|
@@ -195,9 +195,17 @@
|
|||||||
value += "/" + CompanyGroups.FirstOrDefault(f => f.ID == GroupID.GetValueOrDefault()).Name;
|
value += "/" + CompanyGroups.FirstOrDefault(f => f.ID == GroupID.GetValueOrDefault()).Name;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (LastOpenChat != null && !string.IsNullOrEmpty(LastOpenChat.ExperFullName))
|
if (LastOpenChat != null)
|
||||||
{
|
{
|
||||||
value += "/" + LastOpenChat.ExperFullName;
|
var model = LastOpenChat.Responses.OrderBy(o => o.ID).LastOrDefault(l => l.Type != Common.Enums.ConversationType.UE);
|
||||||
|
|
||||||
|
if (model!=null && model.Type==Common.Enums.ConversationType.CU && !string.IsNullOrEmpty(CompanyInfo.FullNameManager))
|
||||||
|
{
|
||||||
|
value += "/" + CompanyInfo.FullNameManager;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (!string.IsNullOrEmpty(LastOpenChat.ExperFullName))
|
||||||
|
value += "/" + LastOpenChat.ExperFullName;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -303,7 +311,7 @@
|
|||||||
|
|
||||||
if (LastOpenChat != null)
|
if (LastOpenChat != null)
|
||||||
{
|
{
|
||||||
|
GroupID = LastOpenChat.GroupID;
|
||||||
// Always set up visibility observation for chat bubbles
|
// Always set up visibility observation for chat bubbles
|
||||||
_shouldObserveVisibility = true;
|
_shouldObserveVisibility = true;
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
Reference in New Issue
Block a user