เพิ่มลูกจ้างลงทะเบียนเครื่องราช
This commit is contained in:
parent
c832465e71
commit
b1380d4a2f
3 changed files with 104 additions and 35 deletions
|
|
@ -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)
|
public async Task<GetIsOfficerDto> GetIsOfficerRootAsync(string? accessToken, string sys)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
{
|
{
|
||||||
public class PostProfileInsigniaDto
|
public class PostProfileInsigniaDto
|
||||||
{
|
{
|
||||||
public Guid profileId { get; set; }
|
public Guid? profileId { get; set; }
|
||||||
|
public Guid? profileEmployeeId { get; set; }
|
||||||
|
|
||||||
public int year { get; set; } = 0;
|
public int year { get; set; } = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1798,25 +1798,50 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
{
|
{
|
||||||
insigniaNoteProfile.Status = "DONE";
|
insigniaNoteProfile.Status = "DONE";
|
||||||
|
|
||||||
var profileInsigniaBody = new PostProfileInsigniaDto
|
if (profile.ProfileType == "OFFICER")
|
||||||
{
|
{
|
||||||
profileId = profile.Id,
|
var profileInsigniaBody = new PostProfileInsigniaDto
|
||||||
year = insigniaNote.Year,
|
{
|
||||||
no = req.No,
|
profileId = profile.Id,
|
||||||
volumeNo = req.VolumeNo,
|
year = insigniaNote.Year,
|
||||||
section = req.Section,
|
no = req.No,
|
||||||
page = req.Page,
|
volumeNo = req.VolumeNo,
|
||||||
receiveDate = req.DateReceive.Value,
|
section = req.Section,
|
||||||
dateAnnounce = req.Date.Value,
|
page = req.Page,
|
||||||
insigniaId = insignia.Id,
|
receiveDate = req.DateReceive.Value,
|
||||||
issue = req.Issue,
|
dateAnnounce = req.Date.Value,
|
||||||
note = "",
|
insigniaId = insignia.Id,
|
||||||
refCommandDate = null,
|
issue = req.Issue,
|
||||||
refCommandNo = "",
|
note = "",
|
||||||
volume = "",
|
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
|
else
|
||||||
|
|
@ -1841,24 +1866,48 @@ 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";
|
||||||
var profileInsigniaBody = new PostProfileInsigniaDto
|
if (profile.ProfileType == "OFFICER")
|
||||||
{
|
{
|
||||||
profileId = profileInsignia.ProfileId.Value,
|
var profileInsigniaBody = new PostProfileInsigniaDto
|
||||||
year = insigniaNote.Year,
|
{
|
||||||
no = profileInsignia.No,
|
profileId = profileInsignia.ProfileId.Value,
|
||||||
volumeNo = profileInsignia.VolumeNo,
|
year = insigniaNote.Year,
|
||||||
section = profileInsignia.Section,
|
no = profileInsignia.No,
|
||||||
page = profileInsignia.Page,
|
volumeNo = profileInsignia.VolumeNo,
|
||||||
receiveDate = profileInsignia.DateReceive.Value,
|
section = profileInsignia.Section,
|
||||||
dateAnnounce = profileInsignia.Date.Value,
|
page = profileInsignia.Page,
|
||||||
insigniaId = profileInsignia.RequestInsignia.Id,
|
receiveDate = profileInsignia.DateReceive.Value,
|
||||||
issue = profileInsignia.Issue,
|
dateAnnounce = profileInsignia.Date.Value,
|
||||||
note = "",
|
insigniaId = profileInsignia.RequestInsignia.Id,
|
||||||
refCommandDate = null,
|
issue = profileInsignia.Issue,
|
||||||
refCommandNo = "",
|
note = "",
|
||||||
volume = "",
|
refCommandDate = null,
|
||||||
};
|
refCommandNo = "",
|
||||||
await _userProfileRepository.PostProfileInsigniaAsync(profileInsigniaBody, AccessToken);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue