เพิ่มลูกจ้าง api อัพเดทสถานะ mark ระบบเครื่องราช (issue ##1344)
Some checks failed
release-dev / release-dev (push) Failing after 11s
Some checks failed
release-dev / release-dev (push) Failing after 11s
This commit is contained in:
parent
a2efb8d9af
commit
c832465e71
3 changed files with 60 additions and 53 deletions
|
|
@ -8868,48 +8868,44 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task UpdateInsigniaRequestProfile(string[] items, string type, Guid? periodId)
|
||||
public async Task UpdateInsigniaRequestProfile(string[] items, string type)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (type.Trim().ToUpper() == "OFFICER")
|
||||
var allProfiles = await _userProfileRepository.GetInsigniaRequestsProfileAsync(items, type, AccessToken);
|
||||
|
||||
if (allProfiles != null && allProfiles.Count > 0)
|
||||
{
|
||||
var allProfiles = await _userProfileRepository.GetInsigniaRequestsProfileAsync(items, type, AccessToken);
|
||||
var insigniaRequestProfiles = await _dbContext.Set<InsigniaRequestProfile>()
|
||||
.Where(x => allProfiles.Select(x => x.Id).ToList().Contains(x.ProfileId))
|
||||
.ToListAsync();
|
||||
|
||||
if (allProfiles != null && allProfiles.Count > 0)
|
||||
foreach (var insigniaRequestProfile in insigniaRequestProfiles)
|
||||
{
|
||||
var insigniaRequestProfiles = await _dbContext.Set<InsigniaRequestProfile>()
|
||||
.Where(x => allProfiles.Select(x => x.Id).ToList().Contains(x.ProfileId))
|
||||
.ToListAsync();
|
||||
var profile = allProfiles.FirstOrDefault(p => p.Id == insigniaRequestProfile.ProfileId);
|
||||
|
||||
foreach (var insigniaRequestProfile in insigniaRequestProfiles)
|
||||
if (profile != null)
|
||||
{
|
||||
var profile = allProfiles.FirstOrDefault(p => p.Id == insigniaRequestProfile.ProfileId);
|
||||
|
||||
if (profile != null)
|
||||
{
|
||||
insigniaRequestProfile.MarkDiscipline = profile?.MarkDiscipline;
|
||||
insigniaRequestProfile.MarkLeave = profile?.MarkLeave;
|
||||
insigniaRequestProfile.MarkRate = profile?.MarkRate;
|
||||
insigniaRequestProfile.MarkInsignia = profile?.MarkInsignia;
|
||||
}
|
||||
insigniaRequestProfile.MarkDiscipline = profile?.MarkDiscipline;
|
||||
insigniaRequestProfile.MarkLeave = profile?.MarkLeave;
|
||||
insigniaRequestProfile.MarkRate = profile?.MarkRate;
|
||||
insigniaRequestProfile.MarkInsignia = profile?.MarkInsignia;
|
||||
insigniaRequestProfile.APR1 = profile?.APR1;
|
||||
insigniaRequestProfile.APR2 = profile?.APR2;
|
||||
insigniaRequestProfile.APR3 = profile?.APR3;
|
||||
insigniaRequestProfile.APR4 = profile?.APR4;
|
||||
insigniaRequestProfile.APR5 = profile?.APR5;
|
||||
insigniaRequestProfile.OCT1 = profile?.OCT1;
|
||||
insigniaRequestProfile.OCT2 = profile?.OCT2;
|
||||
insigniaRequestProfile.OCT3 = profile?.OCT3;
|
||||
insigniaRequestProfile.OCT4 = profile?.OCT4;
|
||||
insigniaRequestProfile.OCT5 = profile?.OCT5;
|
||||
insigniaRequestProfile.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
insigniaRequestProfile.LastUpdateUserId = UserId ?? "";
|
||||
insigniaRequestProfile.LastUpdatedAt = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
//else if (type.Trim().ToUpper() == "EMPLOYEE" && periodId != null)
|
||||
//{
|
||||
// var insigniaRequests = await _dbContext.Set<InsigniaRequest>()
|
||||
// .Where(x => x.Period.Id == periodId)
|
||||
// .ToListAsync();
|
||||
|
||||
// var allEmpProfileIds = new List<string>();
|
||||
// foreach (var insigniaRequest in insigniaRequests)
|
||||
// {
|
||||
// var orgRootId = insigniaRequest.Id.ToString();
|
||||
// var allEmpProfiles = await _userProfileRepository.GetInsigniaRequestsProfileEmpAsync(items, orgRootId, AccessToken);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue