เพิ่มการบันทึกไปทะเบียนประวัติ ตามประเภท officer หรือ employee โดยไปเรียก api ของระบบโครงสร้าง
Some checks failed
release-dev / release-dev (push) Failing after 12s

This commit is contained in:
Suphonchai Phoonsawat 2025-05-28 11:28:14 +07:00
parent d9be2426c4
commit fd25873348

View file

@ -2293,24 +2293,71 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (profile.Status != "DONE")
{
profile.Status = "DONE";
var profileInsignia = new PostProfileInsigniaDto
// check profile.ProfileType ก่อนส่งไประบบทะเบียนประวัติ
if (profile.ProfileType == "OFFICER")
{
profileId = profile.ProfileId.Value,
year = insigniaNote.Year,
no = profile.No,
volumeNo = profile.VolumeNo,
section = profile.Section,
page = profile.Page,
receiveDate = profile.DateReceive.Value,
dateAnnounce = profile.Date.Value,
insigniaId = profile.RequestInsignia.Id,
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsignia, AccessToken);
var profileInsigniaBody = new PostProfileInsigniaDto
{
profileId = profile!.ProfileId!.Value,
year = insigniaNote.Year,
no = profile!.No ?? "",
volumeNo = profile!.VolumeNo ?? "",
section = profile!.Section ?? "",
page = profile!.Page ?? "",
receiveDate = profile.DateReceive!.Value,
dateAnnounce = profile.Date!.Value,
insigniaId = profile.RequestInsignia!.Id,
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
}
else
{
var profileInsigniaBody = new PostProfileEmpInsigniaDto
{
profileEmployeeId = profile!.ProfileId!.Value,
year = insigniaNote.Year,
no = profile!.No ?? "",
volumeNo = profile!.VolumeNo ?? "",
section = profile!.Section ?? "",
page = profile!.Page ?? "",
receiveDate = profile.DateReceive!.Value,
dateAnnounce = profile.Date!.Value,
insigniaId = profile.RequestInsignia!.Id,
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileEmpInsigniaAsync(profileInsigniaBody, AccessToken);
}
//var profileInsignia = new PostProfileInsigniaDto
//{
// profileId = profile.ProfileId.Value,
// year = insigniaNote.Year,
// no = profile.No,
// volumeNo = profile.VolumeNo,
// section = profile.Section,
// page = profile.Page,
// receiveDate = profile.DateReceive.Value,
// dateAnnounce = profile.Date.Value,
// insigniaId = profile.RequestInsignia.Id,
// issue = "",
// note = "",
// refCommandDate = null,
// refCommandNo = "",
// volume = "",
//};
//await _userProfileRepository.PostProfileInsigniaAsync(profileInsignia, AccessToken);
}
}
await _context.SaveChangesAsync();