เพิ่มลูกจ้างลงทะเบียนเครื่องราช

This commit is contained in:
moss 2025-05-27 10:46:44 +07:00
parent c832465e71
commit b1380d4a2f
3 changed files with 104 additions and 35 deletions

View file

@ -1051,6 +1051,25 @@ namespace BMA.EHR.Application.Repositories
}
public async Task PostProfileEmpInsigniaAsync(PostProfileInsigniaDto body, string? accessToken)
{
try
{
var apiPath = $"{_configuration["API"]}/org/profile-employee/insignia";
var apiKey = _configuration["API_KEY"];
var profiles = new List<SearchProfileDto>();
var apiResult = await PostExternalAPIBooleanAsync(apiPath, accessToken ?? "", body, apiKey);
}
catch
{
throw;
}
}
public async Task<GetIsOfficerDto> GetIsOfficerRootAsync(string? accessToken, string sys)
{
try

View file

@ -2,7 +2,8 @@
{
public class PostProfileInsigniaDto
{
public Guid profileId { get; set; }
public Guid? profileId { get; set; }
public Guid? profileEmployeeId { get; set; }
public int year { get; set; } = 0;

View file

@ -1798,25 +1798,50 @@ namespace BMA.EHR.Insignia.Service.Controllers
{
insigniaNoteProfile.Status = "DONE";
var profileInsigniaBody = new PostProfileInsigniaDto
if (profile.ProfileType == "OFFICER")
{
profileId = profile.Id,
year = insigniaNote.Year,
no = req.No,
volumeNo = req.VolumeNo,
section = req.Section,
page = req.Page,
receiveDate = req.DateReceive.Value,
dateAnnounce = req.Date.Value,
insigniaId = insignia.Id,
issue = req.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
var profileInsigniaBody = new PostProfileInsigniaDto
{
profileId = profile.Id,
year = insigniaNote.Year,
no = req.No,
volumeNo = req.VolumeNo,
section = req.Section,
page = req.Page,
receiveDate = req.DateReceive.Value,
dateAnnounce = req.Date.Value,
insigniaId = insignia.Id,
issue = req.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
}
else
{
var profileInsigniaBody = new PostProfileInsigniaDto
{
profileEmployeeId = profile.Id,
year = insigniaNote.Year,
no = req.No,
volumeNo = req.VolumeNo,
section = req.Section,
page = req.Page,
receiveDate = req.DateReceive.Value,
dateAnnounce = req.Date.Value,
insigniaId = insignia.Id,
issue = req.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileEmpInsigniaAsync(profileInsigniaBody, AccessToken);
}
}
}
else
@ -1841,24 +1866,48 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (req.DateReceive != null && req.Date != null)
{
profileInsignia.Status = "DONE";
var profileInsigniaBody = new PostProfileInsigniaDto
if (profile.ProfileType == "OFFICER")
{
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 = profileInsignia.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
var profileInsigniaBody = new PostProfileInsigniaDto
{
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 = profileInsignia.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
}
else
{
var profileInsigniaBody = new PostProfileInsigniaDto
{
profileEmployeeId = 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 = profileInsignia.Issue,
note = "",
refCommandDate = null,
refCommandNo = "",
volume = "",
};
await _userProfileRepository.PostProfileEmpInsigniaAsync(profileInsigniaBody, AccessToken);
}
}
}
}