Update InsigniaRequestController to use GetOcByNodeId and include RootDnaId in insigniaNoteProfile #2390
All checks were successful
Build & Deploy Insignia Service / build (push) Successful in 2m3s

This commit is contained in:
Suphonchai Phoonsawat 2026-04-02 11:09:36 +07:00
parent 69b89dfc90
commit a4a5d13203

View file

@ -3146,7 +3146,10 @@ namespace BMA.EHR.Insignia.Service.Controllers
var doc = await _documentService.UploadFileAsync(file, file.FileName); var doc = await _documentService.UploadFileAsync(file, file.FileName);
insigniaNoteProfile.DocReceiveInsignia = doc; insigniaNoteProfile.DocReceiveInsignia = doc;
} }
var root = _userProfileRepository.GetOc(req.OrgId, 0, AccessToken)?.Root ?? null;
var orgData = _userProfileRepository.GetOcByNodeId(req.OrgId,0, AccessToken);
var root = orgData?.Root ?? null;
var rootDnaId = orgData?.RootDnaId ?? null;
if (req.OrgId != Guid.Parse("00000000-0000-0000-0000-000000000000")) if (req.OrgId != Guid.Parse("00000000-0000-0000-0000-000000000000"))
{ {
if (root == null) if (root == null)
@ -3157,6 +3160,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
root = "สำนักนายกรัฐมนตรี"; root = "สำนักนายกรัฐมนตรี";
} }
insigniaNoteProfile.OrgReceiveInsignia = root; insigniaNoteProfile.OrgReceiveInsignia = root;
insigniaNoteProfile.RootDnaId = rootDnaId;
insigniaNoteProfile.OrgReceiveInsigniaId = req.OrgId; insigniaNoteProfile.OrgReceiveInsigniaId = req.OrgId;
insigniaNoteProfile.DateReceiveInsignia = req.Date; insigniaNoteProfile.DateReceiveInsignia = req.Date;
insigniaNoteProfile.LastUpdateFullName = FullName ?? "System Administrator"; insigniaNoteProfile.LastUpdateFullName = FullName ?? "System Administrator";