From 99fa1d83a72d0236b37fd9158afeb06a8ef47c35 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 28 Jul 2023 15:27:38 +0500 Subject: [PATCH 1/4] UserSettingsController rename Delete method --- AsbCloudWebApi/Controllers/UserSettingsController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudWebApi/Controllers/UserSettingsController.cs b/AsbCloudWebApi/Controllers/UserSettingsController.cs index 9d0f5c99..e3e47327 100644 --- a/AsbCloudWebApi/Controllers/UserSettingsController.cs +++ b/AsbCloudWebApi/Controllers/UserSettingsController.cs @@ -94,7 +94,7 @@ namespace AsbCloudWebApi.Controllers /// [HttpDelete("/api/admin/user/{idUser}/settings")] [Permission] - public virtual async Task> DeleteAsync(int idUser, CancellationToken token) + public virtual async Task> DeleteAllAsync(int idUser, CancellationToken token) { var result = await service.DeleteAsync(idUser, token).ConfigureAwait(false); From f6ac5b5a98a763312146e34ebbcc602db857020d Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 28 Jul 2023 15:28:30 +0500 Subject: [PATCH 2/4] OperationsStatService.GetTvdAsync() Fin exception then empty operations. --- .../Services/WellOperationService/OperationsStatService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index ea74cd8b..2757dbfd 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -431,6 +431,9 @@ namespace AsbCloudInfrastructure.Services.WellOperationService var tzOffsetHours = wellService.GetTimezone(idWell).Hours; var merged = MergeArraysBySections(sectionsIds, wellOperationsPlan, wellOperationsFact).ToList(); + if (merged.Count ==0) + return Enumerable.Empty>(); + var tvd = new List>(merged.Count); var (Plan, Fact) = merged.FirstOrDefault(); var dateStart = Plan?.DateStart ?? Fact!.DateStart; From e0320e7c9944a432ee6019dbac017b7d9e3ffaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Wed, 2 Aug 2023 15:10:00 +0500 Subject: [PATCH 3/4] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=83=D0=B2?= =?UTF-8?q?=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Notifications/NotificationService.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/AsbCloudApp/Services/Notifications/NotificationService.cs b/AsbCloudApp/Services/Notifications/NotificationService.cs index 849a2833..270d90db 100644 --- a/AsbCloudApp/Services/Notifications/NotificationService.cs +++ b/AsbCloudApp/Services/Notifications/NotificationService.cs @@ -92,13 +92,10 @@ public class NotificationService cancellationToken) ?? throw new ArgumentInvalidException("Уведомление не найдено", nameof(idNotification)); - if (isRead) - { - if (notification.SentDate == null) - throw new ArgumentInvalidException("Уведомление не может быть прочитано", nameof(isRead)); - - notification.SentDate = DateTime.UtcNow; - } + if(isRead && !notification.SentDate.HasValue) + throw new ArgumentInvalidException("Уведомление не может быть прочитано", nameof(isRead)); + + notification.ReadDate = isRead ? DateTime.UtcNow : null; await notificationRepository.UpdateAsync(notification, cancellationToken); From 13603378f2ff7bc8b40e7430b41169b51035006a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Wed, 2 Aug 2023 15:41:12 +0500 Subject: [PATCH 4/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20Set=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BE=D1=81=D1=82=D0=BE?= =?UTF-8?q?=D1=8F=D0=BD=D0=B8=D1=8F=20=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/NotificationDto.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AsbCloudApp/Data/NotificationDto.cs b/AsbCloudApp/Data/NotificationDto.cs index 982262d2..d23497d3 100644 --- a/AsbCloudApp/Data/NotificationDto.cs +++ b/AsbCloudApp/Data/NotificationDto.cs @@ -41,7 +41,7 @@ public class NotificationDto : IId /// Дата прочтения уведомления /// public DateTime? ReadDate { get; set; } - + /// /// Состояние уведомления /// 0 - Зарегистрировано, @@ -60,6 +60,10 @@ public class NotificationDto : IId return 0; } + set + { + + } } ///