diff --git a/.gitignore b/.gitignore index 674512f1..efeea142 100644 --- a/.gitignore +++ b/.gitignore @@ -362,3 +362,6 @@ MigrationBackup/ # # Fody - auto-generated XML schema # FodyWeavers.xsd .idea +/ServiceHost/appsettings.Development.json +/ServiceHost/appsettings.json +/ServiceHost/web.config diff --git a/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Projects/Commands/SetTimeProject/SetTimeProjectCommandHandler.cs b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Projects/Commands/SetTimeProject/SetTimeProjectCommandHandler.cs index 2ee2ea7d..fdbadc28 100644 --- a/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Projects/Commands/SetTimeProject/SetTimeProjectCommandHandler.cs +++ b/ProgramManager/src/Application/GozareshgirProgramManager.Application/Modules/Projects/Commands/SetTimeProject/SetTimeProjectCommandHandler.cs @@ -352,7 +352,8 @@ public class SetTimeProjectCommandHandler : IBaseCommandHandler x.Id, x => x.FullName, cancellationToken); - var result = data + var result = data .OrderByDescending(x => x.CurrentAssignedUserId == currentUserId) + .ThenBy(x => GetStatusOrder(x.Status)) .Select(x => { // محاسبه یکبار برای هر Activity و Cache کردن نتیجه @@ -95,9 +96,6 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler h.IsCurrentUser).ToList(); - return new ProjectBoardListResponse() { Id = x.Id, @@ -116,19 +114,21 @@ public class ProjectBoardListQueryHandler : IBaseQueryHandler - { - // اگر AssignedUser null نباشد، بررسی کن که برابر current user هست یا نه - if (r.AssignedUser != null) - { - return users.FirstOrDefault(u => u.Value == r.AssignedUser).Key == currentUserId; - } - // اگر AssignedUser null بود، از OriginalUser بررسی کن - return users.FirstOrDefault(u => u.Value == r.OriginalUser).Key == currentUserId; - }) - .ToList(); + }).ToList(); return OperationResult>.Success(result); } + + private static int GetStatusOrder(TaskSectionStatus status) + { + return status switch + { + TaskSectionStatus.InProgress => 0, + TaskSectionStatus.Incomplete => 1, + TaskSectionStatus.NotAssigned => 2, + TaskSectionStatus.ReadyToStart => 2, + TaskSectionStatus.PendingForCompletion => 3, + _ => 99 + }; + } } \ No newline at end of file diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index f5214c2b..29cf7c0a 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -19,7 +19,7 @@ "sqlDebugging": true, "dotnetRunMessages": "true", "nativeDebugging": true, - "applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5006", + "applicationUrl": "https://localhost:5004;http://localhost:5003;", "jsWebView2Debugging": false, "hotReloadEnabled": true }, diff --git a/ServiceHost/ServiceHost.csproj b/ServiceHost/ServiceHost.csproj index 8eb8a743..a6eb425b 100644 --- a/ServiceHost/ServiceHost.csproj +++ b/ServiceHost/ServiceHost.csproj @@ -10,6 +10,7 @@ true + a6049acf-0286-4947-983a-761d06d65f36 -