GetExpersCompany

GetGroupsCompany
This commit is contained in:
mmrbnjd
2025-07-25 21:29:57 +03:30
parent d4c4bb2ffd
commit 29107ce9c6
10 changed files with 88 additions and 42 deletions

View File

@@ -67,6 +67,7 @@ namespace Hushian.Application.Services
Role="Company",
img=Company.logo,
MobileOrUserName = Company.Mobile,
CompanyId= Company.ID,
Token = new JwtSecurityTokenHandler().WriteToken(_jwtSettings.GenerateToken(Company.Mobile, Company.ID, "Company"))
};
}

View File

@@ -128,14 +128,14 @@ namespace Hushian.Application.Services
.Where(w => w.UserID == UserID && w.CompanyID==CompanyID)
.Select(s => new Read_ConversationDto()
{
ExperID = s.ConversationResponses.Last().ExperID,
ExperFullName = s.ConversationResponses.Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.Last().Text,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
LastMsgdate = s.Cdatetime.GetDatePersian(),
LastMsgtime = s.Cdatetime.GetTime(),
LastMsgType = s.ConversationResponses.Last().Type,
LastMsgType = s.ConversationResponses.OrderBy(o => o.ID).Last().Type,
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
status = s.Status,
UserID = s.UserID,
@@ -170,14 +170,14 @@ namespace Hushian.Application.Services
.Where(w => w.ConversationResponses.Any(a => a.ExperID == ExperID) && w.Status == status)
.Select(s => new Read_ConversationDto()
{
ExperID = s.ConversationResponses.Last().ExperID,
ExperFullName = s.ConversationResponses.Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.Last().Text,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
LastMsgdate = s.Cdatetime.GetDatePersian(),
LastMsgtime = s.Cdatetime.GetTime(),
LastMsgType = s.ConversationResponses.Last().Type,
LastMsgType = s.ConversationResponses.OrderBy(o => o.ID).Last().Type,
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
status = s.Status,
UserID = s.UserID,
@@ -191,14 +191,14 @@ namespace Hushian.Application.Services
.Where(w => w.CompanyID==CompanyID && w.Status ==status)
.Select(s => new Read_ConversationDto()
{
ExperID = s.ConversationResponses.Last().ExperID,
ExperFullName = s.ConversationResponses.Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o => o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.Last().Text,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
LastMsgdate = s.Cdatetime.GetDatePersian(),
LastMsgtime = s.Cdatetime.GetTime(),
LastMsgType = s.ConversationResponses.Last().Type,
LastMsgType = s.ConversationResponses.OrderBy(o => o.ID).Last().Type,
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
status = s.Status,
UserID = s.UserID,
@@ -212,14 +212,14 @@ namespace Hushian.Application.Services
.Where(w => w.Status== ConversationStatus.Recorded && w.CompanyID == CompanyID)
.Select(s => new Read_ConversationDto()
{
ExperID = s.ConversationResponses.Last().ExperID,
ExperFullName = s.ConversationResponses.Last().Exper.FullName,
ExperID = s.ConversationResponses.OrderBy(o=>o.ID).Last().ExperID,
ExperFullName = s.ConversationResponses.OrderBy(o => o.ID).Last().Exper.FullName,
GroupID = s.GroupID,
GroupName = s.Group.Name,
LastText = s.ConversationResponses.Last().Text,
LastText = s.ConversationResponses.OrderBy(o => o.ID).Last().Text,
LastMsgdate = s.Cdatetime.GetDatePersian(),
LastMsgtime = s.Cdatetime.GetTime(),
LastMsgType = s.ConversationResponses.Last().Type,
LastMsgType = s.ConversationResponses.OrderBy(o => o.ID).Last().Type,
NoReadCount = s.ConversationResponses.Count(c => !c.IsRead),
status = s.Status,
UserID = s.UserID,