fix Put Note/{insigniaNoteId} API

This commit is contained in:
Suphonchai Phoonsawat 2024-07-02 02:54:38 +07:00
parent bc37746aa5
commit 0234925827

View file

@ -1738,29 +1738,49 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (req.DateReceive != null && req.Date != null)
{
profileInsignia.Status = "DONE";
await _context.ProfileInsignias.AddAsync(new ProfileInsignia
var profileInsigniaBody = new PostProfileInsigniaDto
{
Year = insigniaNote.Year,
No = req.No,
Issue = req.VolumeNo,
VolumeNo = req.VolumeNo,
//Volume = req.Volume,
Section = req.Section,
Page = req.Page,
DateAnnounce = req.Date,
ReceiveDate = req.DateReceive,
InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
Insignia = insignia,
// RefCommandNo = req.RefCommandNo,
// RefCommandDate = req.RefCommandDate,
ProfileId = profile.Id,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
});
profileId = profileInsignia.ProfileId.Value,
year = insigniaNote.Year,
no = profileInsignia.No,
volumeNo = profileInsignia.VolumeNo,
section = profileInsignia.Section,
page = profileInsignia.Page,
receiveDate = profileInsignia.DateReceive.Value,
dateAnnounce = profileInsignia.Date.Value,
insigniaId = profileInsignia.RequestInsignia.Id,
issue = "",
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
//await _context.ProfileInsignias.AddAsync(new ProfileInsignia
//{
// Year = insigniaNote.Year,
// No = req.No,
// Issue = req.VolumeNo,
// VolumeNo = req.VolumeNo,
// //Volume = req.Volume,
// Section = req.Section,
// Page = req.Page,
// DateAnnounce = req.Date,
// ReceiveDate = req.DateReceive,
// InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name,
// Insignia = insignia,
// // RefCommandNo = req.RefCommandNo,
// // RefCommandDate = req.RefCommandDate,
// ProfileId = profile.Id,
// CreatedFullName = FullName ?? "System Administrator",
// CreatedUserId = UserId ?? "",
// CreatedAt = DateTime.Now,
// LastUpdateFullName = FullName ?? "System Administrator",
// LastUpdateUserId = UserId ?? "",
// LastUpdatedAt = DateTime.Now,
//});
}
}
}