fix Put Note/{insigniaNoteId} API

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

View file

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