lock insignia
Some checks failed
release-dev / release-dev (push) Failing after 12s

This commit is contained in:
kittapath 2025-08-01 17:08:11 +07:00
parent f6594f9773
commit 0c9ec3dd43
5 changed files with 99 additions and 70 deletions

View file

@ -336,14 +336,8 @@ namespace BMA.EHR.Insignia.Service.Controllers
//}
if (role.Trim().ToLower() == "officer")
{
/* resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type))
.Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList();*/
var items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type);
resend.Items = (items ?? new List<InsigniaRequestItem>())
.Where(x => x != null && !string.IsNullOrEmpty(x.ProfileType) && x.ProfileType.ToLower() == type.ToLower())
.ToList();
resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type))
.Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList();
return Success(resend);
}
else
@ -1318,9 +1312,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (profileOld.ProfileId == null)
continue;
var pf = _userProfileRepository.GetOfficerProfileById(profileOld.ProfileId, AccessToken);
if (pf == null)
pf = _userProfileRepository.GetEmployeeProfileById(profileOld.ProfileId, AccessToken);
var pf = _userProfileRepository.GetOrgProfileByProfileId(profileOld.ProfileId, AccessToken);
var orgSend = "";
var orgRecv = "";
@ -1340,27 +1332,19 @@ namespace BMA.EHR.Insignia.Service.Controllers
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();
}
if (pf.Child4 != null || pf.Child4 != "")
orgRecv += $"{pf.Child4}";
if (pf.Child3 != null || pf.Child3 != "")
orgRecv += $" {pf.Child3}";
if (pf.Child2 != null || pf.Child2 != "")
orgRecv += $" {pf.Child2}";
if (pf.Child1 != null || pf.Child1 != "")
orgRecv += $" {pf.Child1}";
if (pf.Root != null || pf.Root != "")
orgRecv += $" {pf.Root}";
orgRecv = orgRecv.Trim();
}
await _context.InsigniaNoteProfiles.AddAsync(new InsigniaNoteProfile
{
RequestDate = profileOld.RequestDate,
@ -2484,11 +2468,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
receiveDate = profile.DateReceive!.Value,
dateAnnounce = profile.Date!.Value,
insigniaId = profile.RequestInsignia!.Id,
issue = profile!.Issue ?? "",
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = profile!.VolumeNo ?? "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
@ -2506,11 +2490,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
receiveDate = profile.DateReceive!.Value,
dateAnnounce = profile.Date!.Value,
insigniaId = profile.RequestInsignia!.Id,
issue = profile!.Issue ?? "",
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = profile!.VolumeNo ?? "",
volume = "",
};
await _userProfileRepository.PostProfileEmpInsigniaAsync(profileInsigniaBody, AccessToken);