Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop

This commit is contained in:
Kittapath 2024-07-02 10:19:07 +07:00
commit 8b80d44b8e

View file

@ -1687,31 +1687,53 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (req.DateReceive != null && req.Date != null) if (req.DateReceive != null && req.Date != null)
{ {
insigniaNoteProfile.Status = "DONE"; insigniaNoteProfile.Status = "DONE";
await _context.ProfileInsignias.AddAsync(new ProfileInsignia
var profileInsigniaBody = new PostProfileInsigniaDto
{ {
Year = insigniaNote.Year, profileId = insigniaNoteProfile.ProfileId.Value,
No = req.No, year = insigniaNote.Year,
Issue = req.VolumeNo, no = insigniaNoteProfile.No,
VolumeNo = req.VolumeNo, volumeNo = insigniaNoteProfile.VolumeNo,
// Volume = req.Volume, section = insigniaNoteProfile.Section,
Section = req.Section, page = insigniaNoteProfile.Page,
Page = req.Page, receiveDate = insigniaNoteProfile.DateReceive.Value,
DateAnnounce = req.Date, dateAnnounce = insigniaNoteProfile.Date.Value,
ReceiveDate = req.DateReceive, insigniaId = insigniaNoteProfile.RequestInsignia.Id,
InsigniaType = insignia.InsigniaType == null ? null : insignia.InsigniaType.Name, issue = insigniaNoteProfile.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",
LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
});
} }
await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile);
// 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,
// });
//}
//await _context.InsigniaNoteProfiles.AddAsync(insigniaNoteProfile);
} }
else else
{ {
@ -1750,7 +1772,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
receiveDate = profileInsignia.DateReceive.Value, receiveDate = profileInsignia.DateReceive.Value,
dateAnnounce = profileInsignia.Date.Value, dateAnnounce = profileInsignia.Date.Value,
insigniaId = profileInsignia.RequestInsignia.Id, insigniaId = profileInsignia.RequestInsignia.Id,
issue = "", issue = profileInsignia.Issue,
note = "", note = "",
refCommandDate = null, refCommandDate = null,
refCommandNo = "", refCommandNo = "",