Merge branch 'develop' into develop-Bright

This commit is contained in:
Bright 2024-10-18 17:41:45 +07:00
commit cf56ef9297
13 changed files with 201 additions and 112 deletions

View file

@ -93,7 +93,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
Type = x.Type, Type = x.Type,
ReceiveDate = x.ReceiveDate, ReceiveDate = x.ReceiveDate,
OpenDate = x.OpenDate, OpenDate = x.OpenDate,
Payload = x.Payload == "" ? null : JsonConvert.DeserializeObject<CommandPayload>(Regex.Unescape(x.Payload)) Payload = x.Payload
}).ToList(); }).ToList();
var data_opens = await _dbContext.Set<Notification>() var data_opens = await _dbContext.Set<Notification>()
@ -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 try
{ {
@ -197,7 +197,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
Body = Body, Body = Body,
ReceiverUserId = ReceiverUserId, ReceiverUserId = ReceiverUserId,
Type = "", Type = "",
Payload = Payload, Payload = NotiLink,
CreatedFullName = FullName ?? "System Administrator", CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "", CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now, 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 try
{ {
@ -245,7 +245,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
Body = Body, Body = Body,
ReceiverUserId = ReceiverUserId, ReceiverUserId = ReceiverUserId,
Type = "", Type = "",
Payload = Payload, Payload = NotiLink,
CreatedFullName = FullName ?? "System Administrator", CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "", CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now, CreatedAt = DateTime.Now,
@ -281,6 +281,59 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
throw; 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<Notification>().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<Inbox>().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) public async Task PushNotificationAsyncV2(string? ReceiverUserId, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false)
{ {
try try

View file

@ -973,15 +973,17 @@ namespace BMA.EHR.Application.Repositories.Reports
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
"", "",
"",
true true
); );
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
$"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}", $"แจ้งเตือนรอบการเสนอขอ {insigniaPeriod.Name} รอบที่{insigniaPeriod.Round}",
"", "",
"",
true true
); );
} }
} }
} }

View file

@ -990,9 +990,10 @@ namespace BMA.EHR.Application.Repositories.Reports
cronjobNoti.Subject, cronjobNoti.Subject,
cronjobNoti.Body, cronjobNoti.Body,
cronjobNoti.Payload, cronjobNoti.Payload,
"",
cronjobNoti.IsSendInbox, cronjobNoti.IsSendInbox,
cronjobNoti.IsSendMail cronjobNoti.IsSendMail
); );
cronjobNoti.IsSendNoti = true; cronjobNoti.IsSendNoti = true;
} }
} }

View file

@ -11,7 +11,7 @@
public string Type { get; set; } = "TEXT"; 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; public bool IsOpen { get; set; } = false;

View file

@ -361,10 +361,11 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"มีคำขอร้องเรียนเรื่อง {req.title}", $"มีคำขอร้องเรียนเรื่อง {req.title}",
$"มีคำขอร้องเรียนเรื่อง {req.title}", $"มีคำขอร้องเรียนเรื่อง {req.title}",
"", "",
true, "",
true true,
); true
);
await _context.DisciplineComplaints.AddAsync(disciplineComplaint); await _context.DisciplineComplaints.AddAsync(disciplineComplaint);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return Success(disciplineComplaint.Id); return Success(disciplineComplaint.Id);

View file

@ -391,10 +391,11 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}", $"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
$"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}", $"มีคำขอยื่นอุทธรณ์/ร้องทุกข์จาก {req.Fullname}",
"", "",
true, "",
true true,
); true
);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return Success(disciplineComplaint_Appeal.Id); return Success(disciplineComplaint_Appeal.Id);
} }

View file

@ -697,11 +697,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
requestNew.RequestNote = ""; requestNew.RequestNote = "";
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"), Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"),
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
"", "",
true "",
); true
);
_context.SaveChanges(); _context.SaveChanges();
return Success(); return Success();
} }
@ -760,18 +761,20 @@ namespace BMA.EHR.Insignia.Service.Controllers
requestNew.RequestNote = ""; requestNew.RequestNote = "";
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-64d9-497a-87a3-0244eade622c"), Guid.Parse("08dbc953-64d9-497a-87a3-0244eade622c"),
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
"", "",
true "",
); true
);
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"), Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6"),
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
$"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ยื่นขอมูลข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
"", "",
true "",
); true
);
_context.SaveChanges(); _context.SaveChanges();
return Success(); return Success();
} }
@ -804,11 +807,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
requestNew.RequestNote = req.Reason; requestNew.RequestNote = req.Reason;
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-61ac-47eb-82d7-0e72df7669b5"), Guid.Parse("08dbc953-61ac-47eb-82d7-0e72df7669b5"),
$"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
$"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"{(org == null ? null : org.Root)} ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
"", "",
true "",
); true
);
_context.SaveChanges(); _context.SaveChanges();
return Success(); return Success();
} }
@ -838,11 +842,12 @@ namespace BMA.EHR.Insignia.Service.Controllers
requestNew.RequestStatus = "st5"; requestNew.RequestStatus = "st5";
requestNew.RequestNote = req.Reason; requestNew.RequestNote = req.Reason;
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"), Guid.Parse("08dbc953-630a-4e72-88a7-c68dbb1ba856"),
$"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
$"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}", $"สกจ. ตีกลับข้อมูลผู้มีสิทธิ์ได้รับเครื่องราชฯ {requestNew.Period.Name}",
"", "",
true "",
true
); );
_context.SaveChanges(); _context.SaveChanges();
return Success(); return Success();

View file

@ -63,13 +63,14 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUser([FromBody] NotiRequest req) public async Task<ActionResult<ResponseObject>> UpdatePropertyByUser([FromBody] NotiRequest req)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(req.ReceiverUserId), Guid.Parse(req.ReceiverUserId),
req.Subject, req.Subject,
req.Body, req.Body,
req.Payload, req.Payload,
"",
req.IsSendInbox, req.IsSendInbox,
req.IsSendMail req.IsSendMail
); );
return Success(); return Success();
} }
@ -93,6 +94,7 @@ namespace BMA.EHR.Placement.Service.Controllers
req.Subject, req.Subject,
req.Body, req.Body,
req.Payload, req.Payload,
"",
req.IsSendInbox, req.IsSendInbox,
req.IsSendMail req.IsSendMail
); );
@ -111,6 +113,7 @@ namespace BMA.EHR.Placement.Service.Controllers
req.Subject, req.Subject,
req.Body, req.Body,
req.Payload, req.Payload,
"",
req.IsSendInbox, req.IsSendInbox,
req.IsSendMail req.IsSendMail
); );
@ -121,8 +124,8 @@ namespace BMA.EHR.Placement.Service.Controllers
[HttpPost("profiles")] [HttpPost("profiles")]
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserProfiles([FromBody] NotisRequest req) public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserProfiles([FromBody] NotisRequest req)
{ {
await _repositoryNoti.PushNotificationsAsync( await _repositoryNoti.PushNotificationsLinkAsync(
req.ReceiverUserIds.Select(x => Guid.Parse(x)).ToArray(), req.ReceiverUserIds,
req.Subject, req.Subject,
req.Body, req.Body,
req.Payload, req.Payload,
@ -157,9 +160,10 @@ namespace BMA.EHR.Placement.Service.Controllers
req.Subject, req.Subject,
req.Body, req.Body,
req.Payload, req.Payload,
"",
req.IsSendInbox, req.IsSendInbox,
req.IsSendMail req.IsSendMail
); );
} }
return Success(); return Success();
} }

View file

@ -1683,6 +1683,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{ {
profileId = string.Empty, profileId = string.Empty,
date = r.commandAffectDate, date = r.commandAffectDate,
commandId = r.commandId,
amount = r.amount, amount = r.amount,
positionSalaryAmount = r.positionSalaryAmount, positionSalaryAmount = r.positionSalaryAmount,
mouthSalaryAmount = r.mouthSalaryAmount, mouthSalaryAmount = r.mouthSalaryAmount,

View file

@ -1,5 +1,6 @@
using BMA.EHR.Domain.Models.MetaData; using BMA.EHR.Domain.Models.MetaData;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using static BMA.EHR.Application.Repositories.MessageQueue.NotificationRepository;
namespace BMA.EHR.Placement.Service.Requests namespace BMA.EHR.Placement.Service.Requests
{ {
@ -8,7 +9,8 @@ namespace BMA.EHR.Placement.Service.Requests
public string Subject { get; set; } public string Subject { get; set; }
public string Body { get; set; } public string Body { get; set; }
public string Payload { 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 IsSendMail { get; set; }
public bool IsSendInbox { get; set; } public bool IsSendInbox { get; set; }
public bool IsSendNotification { get; set; } public bool IsSendNotification { get; set; }

View file

@ -12,6 +12,7 @@ namespace BMA.EHR.Placement.Service.Requests
public string? refId { get; set; } public string? refId { get; set; }
public DateTime commandAffectDate { get; set; } public DateTime commandAffectDate { get; set; }
public string? commandNo { get; set; } public string? commandNo { get; set; }
public string? commandId { get; set; }
public int commandYear { get; set; } public int commandYear { get; set; }
public string? templateDoc { get; set; } public string? templateDoc { get; set; }
public double? amount { get; set; } public double? amount { get; set; }

View file

@ -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}",
$"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", $"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}",
payload_str, payload_str,
"",
profile.IsSendInbox, profile.IsSendInbox,
profile.IsSendMail 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}",
$"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}", $"แจ้งข่าวการถึงแก่กรรมของ {item.RetirementDeceased.prefix}{item.RetirementDeceased.firstName} {item.RetirementDeceased.lastName}",
payload_str, payload_str,
"",
item.IsSendInbox, item.IsSendInbox,
item.IsSendMail item.IsSendMail
); );

View file

@ -504,9 +504,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
$"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก", $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
$"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก", $"{retirementResign.prefix}{retirementResign.firstName} {retirementResign.lastName} ได้ทำการยื่นขอลาออก",
"", "",
true "",
); true
);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
@ -667,9 +668,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
"", "",
true "",
); true
);
} }
if (updated.CommanderReject != null) if (updated.CommanderReject != null)
{ {
@ -677,10 +679,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
"", "",
true "",
); true
);
} }
if (updated.OligarchReject != null) if (updated.OligarchReject != null)
{ {
@ -688,9 +690,10 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้ทำการขอยกเลิก",
"", "",
true "",
); true
);
} }
updated.CancelReason = req.Reason; updated.CancelReason = req.Reason;
updated.LastUpdateFullName = FullName ?? "System Administrator"; updated.LastUpdateFullName = FullName ?? "System Administrator";
@ -805,18 +808,20 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากการเจ้าหน้าที่",
"", "",
true "",
); true
);
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -852,17 +857,19 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"), Guid.Parse("08dc432c-2bc5-4b81-8089-9c057c51192c"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากการเจ้าหน้าที่",
"", "",
true "",
true
); );
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -897,18 +904,20 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้บังคับบัญชา",
"",
"", "",
true true
); );
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -944,18 +953,20 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"), Guid.Parse("08dc4307-0adc-4bcd-8213-5479bb010236"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้บังคับบัญชา",
"", "",
true "",
); true
);
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -988,18 +999,20 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
"", "",
true "",
); true
);
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -1035,18 +1048,20 @@ namespace BMA.EHR.Retirement.Service.Controllers
Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"), Guid.Parse("08dc3db9-257d-470d-8256-3dc24f6fa332"),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ได้รับการอนุมัติจากผู้มีอำนาจ",
"", "",
true "",
); true
);
if (updated.profileId != null) if (updated.profileId != null)
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(updated.profileId), Guid.Parse(updated.profileId),
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ",
$"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ", $"คำขอลาออกของ {updated.prefix}{updated.firstName} {updated.lastName} ถูกยับยั้งจากผู้มีอำนาจ",
"", "",
true "",
); true
);
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -1451,10 +1466,11 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
{ {
await _repositoryNoti.PushNotificationAsync( await _repositoryNoti.PushNotificationAsync(
Guid.Parse(uppdated.RetirementResign.profileId), Guid.Parse(uppdated.RetirementResign.profileId),
$"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}",
$"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}", $"การนัดสัมภาษณ์เหตุผลการลาออก {req.AppointDate.ToThaiFullDate()}",
"", "",
true "",
true
); );
} }
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();