diff --git a/AsbCloudApp/Data/NotificationDto.cs b/AsbCloudApp/Data/NotificationDto.cs index 2f4b09dd..d067a633 100644 --- a/AsbCloudApp/Data/NotificationDto.cs +++ b/AsbCloudApp/Data/NotificationDto.cs @@ -46,7 +46,7 @@ public class NotificationDto : IId /// Дата прочтения уведомления /// public DateTime? ReadDate { get; set; } - + /// /// Состояние уведомления /// 0 - Зарегистрировано, @@ -65,6 +65,10 @@ public class NotificationDto : IId return 0; } + set + { + + } } /// diff --git a/AsbCloudApp/Services/Notifications/NotificationService.cs b/AsbCloudApp/Services/Notifications/NotificationService.cs index 6d6fc6d7..33ff10db 100644 --- a/AsbCloudApp/Services/Notifications/NotificationService.cs +++ b/AsbCloudApp/Services/Notifications/NotificationService.cs @@ -23,7 +23,6 @@ public class NotificationService /// Сервис для работы с уведомлениями /// /// - /// /// /// public NotificationService(ICrudRepository notificationCategoryRepository, @@ -80,13 +79,10 @@ public class NotificationService cancellationToken) ?? throw new ArgumentInvalidException("Уведомление не найдено", nameof(idNotification)); - if (isRead) - { - if (notification.SentDate == null) - throw new ArgumentInvalidException("Уведомление не может быть прочитано", nameof(isRead)); - - notification.ReadDate = DateTime.UtcNow; - } + if(isRead && !notification.SentDate.HasValue) + throw new ArgumentInvalidException("Уведомление не может быть прочитано", nameof(isRead)); + + notification.ReadDate = isRead ? DateTime.UtcNow : null; await notificationRepository.UpdateAsync(notification, cancellationToken); 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; 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);