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 {