From e989d6c58456e609bb897d046c3c4b8313f125a9 Mon Sep 17 00:00:00 2001 From: kittapath Date: Fri, 18 Oct 2024 16:11:47 +0700 Subject: [PATCH] no message --- .../MessageQueue/NotificationRepository.cs | 63 +++++++- .../Reports/InsigniaReportRepository.cs | 6 +- .../Reports/ProbationReportRepository.cs | 3 +- .../Messages/NotificationResponse.cs | 2 +- .../DisciplineComplaintController.cs | 9 +- .../DisciplineComplaint_AppealController.cs | 9 +- .../Controllers/InsigniaRequestController.cs | 55 ++++--- .../Controllers/NotifyController.cs | 14 +- .../Controllers/PlacementController.cs | 1 + .../Requests/NotisRequest.cs | 4 +- .../Requests/ReportExecuteRequest.cs | 1 + .../RetirementDeceasedController.cs | 2 + .../Controllers/RetirementResignController.cs | 144 ++++++++++-------- 13 files changed, 201 insertions(+), 112 deletions(-) diff --git a/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs b/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs index 633dcf2e..dfd0baf0 100644 --- a/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs +++ b/BMA.EHR.Application/Repositories/MessageQueue/NotificationRepository.cs @@ -93,7 +93,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue Type = x.Type, ReceiveDate = x.ReceiveDate, OpenDate = x.OpenDate, - Payload = x.Payload == "" ? null : JsonConvert.DeserializeObject(Regex.Unescape(x.Payload)) + Payload = x.Payload }).ToList(); var data_opens = await _dbContext.Set() @@ -185,7 +185,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue } } - public async Task PushNotificationAsync(Guid ReceiverUserId, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false) + public async Task PushNotificationAsync(Guid ReceiverUserId, string Subject, string Body, string Payload = "", string NotiLink = "", bool IsSendInbox = false, bool IsSendMail = false) { try { @@ -197,7 +197,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue Body = Body, ReceiverUserId = ReceiverUserId, Type = "", - Payload = Payload, + Payload = NotiLink, CreatedFullName = FullName ?? "System Administrator", CreatedUserId = UserId ?? "", CreatedAt = DateTime.Now, @@ -234,7 +234,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue } } - public async Task PushNotificationsAsync(Guid[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false) + public async Task PushNotificationsAsync(Guid[] ReceiverUserIds, string Subject, string Body, string Payload = "", string NotiLink = "", bool IsSendInbox = false, bool IsSendMail = false) { try { @@ -245,7 +245,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue Body = Body, ReceiverUserId = ReceiverUserId, Type = "", - Payload = Payload, + Payload = NotiLink, CreatedFullName = FullName ?? "System Administrator", CreatedUserId = UserId ?? "", CreatedAt = DateTime.Now, @@ -281,6 +281,59 @@ namespace BMA.EHR.Application.Repositories.MessageQueue throw; } } + + public class NotisLinkRequest + { + public Guid ReceiverUserId { get; set; } + public string NotiLink { get; set; } + } + public async Task PushNotificationsLinkAsync(NotisLinkRequest[] ReceiverUserIds, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false) + { + try + { + foreach (var ReceiverUserId in ReceiverUserIds) + { + _dbContext.Set().Add(new Notification + { + Body = Body, + ReceiverUserId = ReceiverUserId.ReceiverUserId, + Type = "", + Payload = ReceiverUserId.NotiLink, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + if (IsSendInbox == true) + { + _dbContext.Set().Add(new Inbox + { + Subject = Subject, + Body = Body, + ReceiverUserId = ReceiverUserId.ReceiverUserId, + Payload = Payload, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, + }); + } + if (IsSendMail == true) + { + _emailSenderService.SendMail(Subject, Body, "kittapath@frappet.com"); + } + } + await _dbContext.SaveChangesAsync(); + } + catch + { + throw; + } + } public async Task PushNotificationAsyncV2(string? ReceiverUserId, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false) { try diff --git a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs index 1d783717..e44448f9 100644 --- a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs @@ -973,15 +973,17 @@ namespace BMA.EHR.Application.Repositories.Reports $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", "", + "", true - ); + ); await _repositoryNoti.PushNotificationAsync( Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", "", + "", true - ); + ); } } } diff --git a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs index 5553201d..4871892a 100644 --- a/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/ProbationReportRepository.cs @@ -990,9 +990,10 @@ namespace BMA.EHR.Application.Repositories.Reports cronjobNoti.Subject, cronjobNoti.Body, cronjobNoti.Payload, + "", cronjobNoti.IsSendInbox, cronjobNoti.IsSendMail - ); + ); cronjobNoti.IsSendNoti = true; } } diff --git a/BMA.EHR.Application/Responses/Messages/NotificationResponse.cs b/BMA.EHR.Application/Responses/Messages/NotificationResponse.cs index a6e8a3e4..77912c96 100644 --- a/BMA.EHR.Application/Responses/Messages/NotificationResponse.cs +++ b/BMA.EHR.Application/Responses/Messages/NotificationResponse.cs @@ -11,7 +11,7 @@ public string Type { get; set; } = "TEXT"; - public CommandPayload Payload { get; set; } = new(); + public string Payload { get; set; } = string.Empty; public bool IsOpen { get; set; } = false; diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs index 97f01299..eb7accea 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaintController.cs @@ -361,10 +361,11 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), $"มีคำขอร้องเรียนเรื่อง {req.title}", $"มีคำขอร้องเรียนเรื่อง {req.title}", - "", - true, - true - ); + "", + "", + true, + true + ); await _context.DisciplineComplaints.AddAsync(disciplineComplaint); await _context.SaveChangesAsync(); return Success(disciplineComplaint.Id); diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs index d5dc5e01..c3a9bb7d 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineComplaint_AppealController.cs @@ -391,10 +391,11 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), $"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}", $"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}", - "", - true, - true - ); + "", + "", + true, + true + ); await _context.SaveChangesAsync(); return Success(disciplineComplaint_Appeal.Id); } diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index 078e4429..255fbbd4 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -697,11 +697,12 @@ namespace BMA.EHR.Insignia.Service.Controllers requestNew.RequestNote = ""; await _repositoryNoti.PushNotificationAsync( Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"), - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - "", - true - ); + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + "", + "", + true + ); _context.SaveChanges(); return Success(); } @@ -760,18 +761,20 @@ namespace BMA.EHR.Insignia.Service.Controllers requestNew.RequestNote = ""; await _repositoryNoti.PushNotificationAsync( Guid.Parse("08dbc953-64d9-497a-87a3-0244eade622c"), - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - "", - true - ); + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + "", + "", + true + ); await _repositoryNoti.PushNotificationAsync( Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - "", - true - ); + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + "", + "", + true + ); _context.SaveChanges(); return Success(); } @@ -804,11 +807,12 @@ namespace BMA.EHR.Insignia.Service.Controllers requestNew.RequestNote = req.Reason; await _repositoryNoti.PushNotificationAsync( Guid.Parse("08dbc953-61ac-47eb-82d7-0e72df7669b5"), - $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - "", - true - ); + $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + "", + "", + true + ); _context.SaveChanges(); return Success(); } @@ -838,11 +842,12 @@ namespace BMA.EHR.Insignia.Service.Controllers requestNew.RequestStatus = "st5"; requestNew.RequestNote = req.Reason; await _repositoryNoti.PushNotificationAsync( - Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"), - $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", - "", - true + Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"), + $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", + "", + "", + true ); _context.SaveChanges(); return Success(); diff --git a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs index 2fdd8609..6e6797a7 100644 --- a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs +++ b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs @@ -63,13 +63,14 @@ namespace BMA.EHR.Placement.Service.Controllers public async Task> UpdatePropertyByUser([FromBody] NotiRequest req) { await _repositoryNoti.PushNotificationAsync( - Guid.Parse(req.ReceiverUserId), + Guid.Parse(req.ReceiverUserId), req.Subject, req.Body, req.Payload, + "", req.IsSendInbox, req.IsSendMail - ); + ); return Success(); } @@ -93,6 +94,7 @@ namespace BMA.EHR.Placement.Service.Controllers req.Subject, req.Body, req.Payload, + "", req.IsSendInbox, req.IsSendMail ); @@ -111,6 +113,7 @@ namespace BMA.EHR.Placement.Service.Controllers req.Subject, req.Body, req.Payload, + "", req.IsSendInbox, req.IsSendMail ); @@ -121,8 +124,8 @@ namespace BMA.EHR.Placement.Service.Controllers [HttpPost("profiles")] public async Task> UpdatePropertyByUserProfiles([FromBody] NotisRequest req) { - await _repositoryNoti.PushNotificationsAsync( - req.ReceiverUserIds.Select(x => Guid.Parse(x)).ToArray(), + await _repositoryNoti.PushNotificationsLinkAsync( + req.ReceiverUserIds, req.Subject, req.Body, req.Payload, @@ -157,9 +160,10 @@ namespace BMA.EHR.Placement.Service.Controllers req.Subject, req.Body, req.Payload, + "", req.IsSendInbox, req.IsSendMail - ); + ); } return Success(); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index e1227d44..ba0006d6 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1674,6 +1674,7 @@ namespace BMA.EHR.Placement.Service.Controllers { profileId = string.Empty, date = r.commandAffectDate, + commandId = r.commandId, amount = r.amount, positionSalaryAmount = r.positionSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount, diff --git a/BMA.EHR.Placement.Service/Requests/NotisRequest.cs b/BMA.EHR.Placement.Service/Requests/NotisRequest.cs index 201bde0a..5e263e10 100644 --- a/BMA.EHR.Placement.Service/Requests/NotisRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/NotisRequest.cs @@ -1,5 +1,6 @@ using BMA.EHR.Domain.Models.MetaData; using Microsoft.EntityFrameworkCore; +using static BMA.EHR.Application.Repositories.MessageQueue.NotificationRepository; namespace BMA.EHR.Placement.Service.Requests { @@ -8,7 +9,8 @@ namespace BMA.EHR.Placement.Service.Requests public string Subject { get; set; } public string Body { get; set; } public string Payload { get; set; } - public string[] ReceiverUserIds { get; set; } + // public string NotiLink { get; set; } + public NotisLinkRequest[] ReceiverUserIds { get; set; } public bool IsSendMail { get; set; } public bool IsSendInbox { get; set; } public bool IsSendNotification { get; set; } diff --git a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs index 7718c354..2bf63096 100644 --- a/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/ReportExecuteRequest.cs @@ -12,6 +12,7 @@ namespace BMA.EHR.Placement.Service.Requests public string? refId { get; set; } public DateTime commandAffectDate { get; set; } public string? commandNo { get; set; } + public string? commandId { get; set; } public int commandYear { get; set; } public string? templateDoc { get; set; } public double? amount { get; set; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs index 3d365f7c..849082d3 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs @@ -710,6 +710,7 @@ namespace BMA.EHR.Retirement.Service.Controllers $"หนังสือเวียนถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", $"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", payload_str, + "", profile.IsSendInbox, profile.IsSendMail ); @@ -727,6 +728,7 @@ namespace BMA.EHR.Retirement.Service.Controllers $"หนังสือเวียนถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", $"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", payload_str, + "", item.IsSendInbox, item.IsSendMail ); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 15dc99a3..e513cfc5 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -504,9 +504,10 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก", $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก", - "", - true - ); + "", + "", + true + ); await _context.SaveChangesAsync(); using (var client = new HttpClient()) { @@ -667,9 +668,10 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", - "", - true - ); + "", + "", + true + ); } if (updated.CommanderReject != null) { @@ -677,10 +679,10 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", - "", - true - ); - + "", + "", + true + ); } if (updated.OligarchReject != null) { @@ -688,9 +690,10 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", - "", - true - ); + "", + "", + true + ); } updated.CancelReason = req.Reason; updated.LastUpdateFullName = FullName ?? "System Administrator"; @@ -805,18 +808,20 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( Guid.Parse(updated.profileId), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", - "", - true - ); + "", + "", + true + ); } await _context.SaveChangesAsync(); @@ -852,17 +857,19 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( Guid.Parse(updated.profileId), - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", - "", - true + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", + "", + "", + true ); } await _context.SaveChangesAsync(); @@ -897,18 +904,20 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( - Guid.Parse(updated.profileId), - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", + Guid.Parse(updated.profileId), + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", + "", "", true - ); + ); } await _context.SaveChangesAsync(); @@ -944,18 +953,20 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( - Guid.Parse(updated.profileId), - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", - "", - true - ); + Guid.Parse(updated.profileId), + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", + "", + "", + true + ); } await _context.SaveChangesAsync(); @@ -988,18 +999,20 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( - Guid.Parse(updated.profileId), - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", - $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", - "", - true - ); + Guid.Parse(updated.profileId), + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", + "", + "", + true + ); } await _context.SaveChangesAsync(); @@ -1035,18 +1048,20 @@ namespace BMA.EHR.Retirement.Service.Controllers Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", - "", - true - ); + "", + "", + true + ); if (updated.profileId != null) { await _repositoryNoti.PushNotificationAsync( - Guid.Parse(updated.profileId), -$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", -$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", - "", - true -); + Guid.Parse(updated.profileId), + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", + $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", + "", + "", + true + ); } await _context.SaveChangesAsync(); @@ -1451,10 +1466,11 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda { await _repositoryNoti.PushNotificationAsync( Guid.Parse(uppdated.RetirementResign.profileId), - $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", - $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", - "", - true + $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", + $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", + "", + "", + true ); } await _context.SaveChangesAsync();