fix issue : #1067
This commit is contained in:
parent
b6aa239b57
commit
f6c6fe069d
1 changed files with 59 additions and 1 deletions
|
|
@ -388,6 +388,16 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpGet("cal-test/{period:guid}/{oc:guid}")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetTestInsigniaRequest(Guid period, Guid oc)
|
||||||
|
{
|
||||||
|
var candidate = await _repository.GetInsigniaCandidateBKK(period, oc);
|
||||||
|
await _repository.InsertCandidate(period, oc, "สำนักงานเขตพระนคร", candidate);
|
||||||
|
|
||||||
|
return Success(candidate);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// คำนวณราชชื่อผู้ได้รับเครื่องราช
|
/// คำนวณราชชื่อผู้ได้รับเครื่องราช
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1062,6 +1072,50 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
if (profileOld.ProfileId == null)
|
if (profileOld.ProfileId == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
var pf = _userProfileRepository.GetOfficerProfileById(profileOld.ProfileId, AccessToken);
|
||||||
|
if (pf == null)
|
||||||
|
pf = _userProfileRepository.GetEmployeeProfileById(profileOld.ProfileId, AccessToken);
|
||||||
|
|
||||||
|
var orgSend = "";
|
||||||
|
var orgRecv = "";
|
||||||
|
|
||||||
|
if (profileOld.Child4 != null || profileOld.Child4 != "")
|
||||||
|
orgSend += $"{profileOld.Child4}";
|
||||||
|
if (profileOld.Child3 != null || profileOld.Child3 != "")
|
||||||
|
orgSend += $" {profileOld.Child3}";
|
||||||
|
if (profileOld.Child2 != null || profileOld.Child2 != "")
|
||||||
|
orgSend += $" {profileOld.Child2}";
|
||||||
|
if (profileOld.Child1 != null || profileOld.Child1 != "")
|
||||||
|
orgSend += $" {profileOld.Child1}";
|
||||||
|
if (profileOld.Root != null || profileOld.Root != "")
|
||||||
|
orgSend += $" {profileOld.Root}";
|
||||||
|
|
||||||
|
orgSend = orgSend.Trim();
|
||||||
|
|
||||||
|
if (pf != null)
|
||||||
|
{
|
||||||
|
var kk = pf.Keycloak == null ? Guid.Empty : pf.Keycloak.Value;
|
||||||
|
var pfData = await _userProfileRepository.GetProfileByKeycloakIdAsync(kk, AccessToken);
|
||||||
|
if (pfData != null)
|
||||||
|
{
|
||||||
|
if (pfData.Child4 != null || pfData.Child4 != "")
|
||||||
|
orgRecv += $"{pfData.Child4}";
|
||||||
|
if (pfData.Child3 != null || pfData.Child3 != "")
|
||||||
|
orgRecv += $" {pfData.Child3}";
|
||||||
|
if (pfData.Child2 != null || pfData.Child2 != "")
|
||||||
|
orgRecv += $" {pfData.Child2}";
|
||||||
|
if (pfData.Child1 != null || pfData.Child1 != "")
|
||||||
|
orgRecv += $" {pfData.Child1}";
|
||||||
|
if (pfData.Root != null || pfData.Root != "")
|
||||||
|
orgRecv += $" {pfData.Root}";
|
||||||
|
|
||||||
|
|
||||||
|
orgRecv = orgRecv.Trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await _context.InsigniaNoteProfiles.AddAsync(new InsigniaNoteProfile
|
await _context.InsigniaNoteProfiles.AddAsync(new InsigniaNoteProfile
|
||||||
{
|
{
|
||||||
RequestDate = profileOld.RequestDate,
|
RequestDate = profileOld.RequestDate,
|
||||||
|
|
@ -1070,7 +1124,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
Status = "PENDING",
|
Status = "PENDING",
|
||||||
ProfileId = profileOld.ProfileId,
|
ProfileId = profileOld.ProfileId,
|
||||||
RequestInsignia = profileOld.RequestInsignia,
|
RequestInsignia = profileOld.RequestInsignia,
|
||||||
OrganizationOrganizationSend = null,
|
|
||||||
|
|
||||||
|
OrganizationOrganizationSend = orgSend,
|
||||||
|
OrganizationOrganizationReceive = orgRecv,
|
||||||
|
|
||||||
InsigniaNote = insigniaNote,
|
InsigniaNote = insigniaNote,
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue