From 56e4a63432b466302f3224d5b439b84c249612cd Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 21 Sep 2023 10:39:24 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=84=E0=B8=B4?= =?UTF-8?q?=E0=B8=A7=E0=B8=A3=E0=B8=B5=E0=B9=88=20=E0=B9=80=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B2?= =?UTF-8?q?=E0=B8=8A=20=E0=B8=82=E0=B8=A3=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reports/InsigniaReportRepository.cs | 42 +++++++++---------- .../Controllers/RetirementController.cs | 6 +-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs index f9558467..c93ac4f9 100644 --- a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs @@ -642,15 +642,15 @@ namespace BMA.EHR.Application.Repositories.Reports InsigniaInitial = r.RequestInsignia.ShortName, InsigniaName = r.RequestInsignia.Name, ProfileId = r.Profile.Id, - CitizenId = r.Profile.CitizenId, + CitizenId = r.Profile.CitizenId == null ? null : r.Profile.CitizenId.ToThaiNumber(), FullName = $"{r.Profile.Prefix?.Name}{r.Profile.FirstName} {r.Profile.LastName}", ShowProfileId = r.Profile.Id, Type = r.Profile.PositionType == null ? "-" : r.Profile.PositionType.Name, AcademicStanding = "", Level = r.Profile.PositionLevel == null ? "-" : r.Profile.PositionLevel.Name, - DateStart = r.Profile.DateStart == null ? null : r.Profile.DateStart.Value.ToThaiShortDate(), - SalaryAmount = r.Profile.Salaries.Count() == 0 ? 0 : - r.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount, + DateStart = r.Profile.DateStart == null ? null : r.Profile.DateStart.Value.ToThaiShortDate().ToThaiNumber(), + SalaryAmount = r.Profile.Salaries.Count() == 0 ? "-" : + Convert.ToInt32(r.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount).ToNumericText().ToThaiNumber(), InsigniaRecv = "", InsigniaRecvDate = "", InsigniaRequest = r.RequestInsignia.ShortName, @@ -911,23 +911,23 @@ namespace BMA.EHR.Application.Repositories.Reports .ToListAsync(); foreach (var insigniaPeriod in insigniaPeriods) { - if (insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date == DateTime.Now.Date) - { - await _repositoryNoti.PushNotificationAsync( - Guid.Parse("08db721d-ade4-480e-8d84-0853946a0ea5"), - $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", - $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", - "", - true - ); - await _repositoryNoti.PushNotificationAsync( - Guid.Parse("08db721d-adff-47b0-8762-41cd5c991001"), - $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", - $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", - "", - true - ); - } + // if (insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date == DateTime.Now.Date) + // { + await _repositoryNoti.PushNotificationAsync( + Guid.Parse("08db721d-ade4-480e-8d84-0853946a0ea5"), + $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round} {insigniaPeriod.EndDate.AddDays(-insigniaPeriod.Amount).Date}", + $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round} {DateTime.Now.Date}", + "", + true + ); + await _repositoryNoti.PushNotificationAsync( + Guid.Parse("08db721d-adff-47b0-8762-41cd5c991001"), + $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", + $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", + "", + true + ); + // } } } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs index f8ff68d2..d9dfd9d9 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementController.cs @@ -640,9 +640,9 @@ namespace BMA.EHR.Retirement.Service.Controllers } var num = 1; - var old_retire = retire.RetirementProfiles.OrderByDescending(x => x.Order).FirstOrDefault(); - if (old_retire != null) - num = old_retire.Order + 1; + // var old_retire = retire.RetirementProfiles.OrderByDescending(x => x.Order).FirstOrDefault(); + // if (old_retire != null) + // num = old_retire.Order + 1; var data = new RetirementProfile {