insignia note

This commit is contained in:
Suphonchai Phoonsawat 2024-10-16 10:47:06 +07:00
parent 15cb83db64
commit 6b680cb9dd

View file

@ -8,6 +8,7 @@ using BMA.EHR.Domain.Models.Insignias;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Domain.Shared;
using BMA.EHR.Infrastructure.MessageQueue;
using BMA.EHR.Infrastructure.Migrations.LeaveDb;
using BMA.EHR.Infrastructure.Persistence;
using BMA.EHR.Insignia.Service.Requests;
using Microsoft.AspNetCore.Authorization;
@ -755,7 +756,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
var org = _userProfileRepository.GetOc(ocId, 0, AccessToken);
requestNew.RequestStatus = "st6";
requestNew.RequestNote = "";
await _repositoryNoti.PushNotificationAsync(
Guid.Parse("08dbc953-64d9-497a-87a3-0244eade622c"),
@ -1164,7 +1165,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call
ProfileType = "officer",
ProfileType = profile.ProfileType ?? "officer",
Prefix = profile.Prefix,
FirstName = profile.FirstName,
LastName = profile.LastName,
@ -1316,6 +1317,24 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call
ProfileType = profileOld.ProfileType ?? "officer",
Prefix = profileOld.Prefix,
FirstName = profileOld.FirstName,
LastName = profileOld.LastName,
CitizenId = profileOld.CitizenId,
BirthDate = profileOld.BirthDate,
DateAppoint = profileOld.DateAppoint,
Position = profileOld.Position,
Gender = profileOld.Gender,
PosTypeName = profileOld.PosTypeName,
PosLevelName = profileOld.PosLevelName,
PosNo = profileOld.PosNo,
Amount = profileOld.Amount,
PositionSalaryAmount = profileOld.PositionSalaryAmount,
});
}
}
@ -1603,7 +1622,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
return Success(_insigniaNoteProfiles);
}
/// <summary>
/// list รายชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยสภรณ์/การจ่ายใบกำกับ ไม่ validate สิทธิ์
/// </summary>
@ -1769,12 +1788,20 @@ namespace BMA.EHR.Insignia.Service.Controllers
.Select(x => new
{
Id = x.Id,
Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
Prefix = x.Prefix,
FirstName = x.FirstName,
LastName = x.LastName,
CitizenId = x.CitizenId,
Positon = x.Position ?? "",
ProfileType = x.ProfileType,
//Profile = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken),
//Prefix = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Prefix,
//Position = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Position,
//ProfileType = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).ProfileType,
OcId = Guid.Empty,
CitizenId = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).CitizenId,
//CitizenId = _userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).CitizenId,
//FullName = $"{_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).Prefix}{_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).FirstName} {_userProfileRepository.GetOfficerProfileById(x.ProfileId.Value, AccessToken).LastName}",
RequestInsignia = x.RequestInsignia.Name,
RequestInsigniaId = x.RequestInsignia.Id,
@ -1798,11 +1825,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
var _insigniaNoteProfile = new
{
insigniaNoteProfile.Id,
Prefix = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.Prefix : "",
Position = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.Position : "",
Prefix = insigniaNoteProfile.Prefix ?? "",
Position = insigniaNoteProfile.Positon,
insigniaNoteProfile.CitizenId,
ProfileType = insigniaNoteProfile.Profile is not null ? insigniaNoteProfile.Profile.ProfileType : "",
FullName = insigniaNoteProfile.Profile is not null ? $"{insigniaNoteProfile.Profile.Prefix}{insigniaNoteProfile.Profile.FirstName} {insigniaNoteProfile.Profile.LastName}" : "",
ProfileType = insigniaNoteProfile.ProfileType ?? "",
FullName = $"{insigniaNoteProfile.Prefix ?? ""}{insigniaNoteProfile.FirstName ?? ""} {insigniaNoteProfile.LastName ?? ""}",
insigniaNoteProfile.RequestInsignia,
insigniaNoteProfile.RequestInsigniaId,
insigniaNoteProfile.RequestInsigniaShortName,