fix
This commit is contained in:
parent
142f87ce57
commit
f58ba90f62
3 changed files with 23 additions and 16 deletions
|
|
@ -7039,8 +7039,8 @@ namespace BMA.EHR.Application.Repositories
|
||||||
(await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken));
|
(await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken));
|
||||||
|
|
||||||
var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot);
|
var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot);
|
||||||
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot);
|
//var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot);
|
||||||
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot);
|
//var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot);
|
||||||
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot);
|
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot);
|
||||||
var type1_level2 = await GetInsigniaCandidate_Type1_Level2(periodId, ocId, allOfficerProfilesByRoot);
|
var type1_level2 = await GetInsigniaCandidate_Type1_Level2(periodId, ocId, allOfficerProfilesByRoot);
|
||||||
var type1_level3 = await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot);
|
var type1_level3 = await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot);
|
||||||
|
|
@ -7165,19 +7165,22 @@ namespace BMA.EHR.Application.Repositories
|
||||||
result_candidate.Add(r);
|
result_candidate.Add(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var r in employee_type2)
|
// TODO : Remove for Test Error
|
||||||
{
|
//foreach (var r in employee_type2)
|
||||||
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
//{
|
||||||
if (old == null)
|
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
result_candidate.Add(r);
|
// if (old == null)
|
||||||
}
|
// result_candidate.Add(r);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//foreach (var r in employee_type1)
|
||||||
|
//{
|
||||||
|
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
|
// if (old == null)
|
||||||
|
// result_candidate.Add(r);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
foreach (var r in employee_type1)
|
|
||||||
{
|
|
||||||
var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
|
||||||
if (old == null)
|
|
||||||
result_candidate.Add(r);
|
|
||||||
}
|
|
||||||
//foreach (var r in type)
|
//foreach (var r in type)
|
||||||
//{
|
//{
|
||||||
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
|
||||||
|
|
|
||||||
|
|
@ -502,11 +502,15 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
if (insigniaNoteProfile.Status != "DONE")
|
if (insigniaNoteProfile.Status != "DONE")
|
||||||
return Error(GlobalMessages.InsigniaNoBorrow);
|
return Error(GlobalMessages.InsigniaNoBorrow);
|
||||||
|
|
||||||
|
var userProfile = _userProfileRepository.GetOfficerProfileById(insigniaNoteProfile.ProfileId.Value, AccessToken);
|
||||||
|
|
||||||
//var _organization = await _context.Organizations.AsQueryable()
|
//var _organization = await _context.Organizations.AsQueryable()
|
||||||
// .FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
|
// .FirstOrDefaultAsync(x => x.Id == insigniaNoteProfile.Profile.OcId);
|
||||||
|
|
||||||
//TODO : Hardcode OCId ต้องแก้ให้ดึงมาจากคน Login
|
//TODO : Hardcode OCId ต้องแก้ให้ดึงมาจากคน Login
|
||||||
if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
|
var user_oc = _userProfileRepository.GetUserOCId(userProfile.Keycloak.Value, AccessToken);
|
||||||
|
if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = user_oc;
|
||||||
|
//if (req.BorrowOrganizationId == null) req.BorrowOrganizationId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
|
||||||
|
|
||||||
var organization = _userProfileRepository.GetOc(req.BorrowOrganizationId.Value, 0, AccessToken);
|
var organization = _userProfileRepository.GetOc(req.BorrowOrganizationId.Value, 0, AccessToken);
|
||||||
//if (organization == null)
|
//if (organization == null)
|
||||||
|
|
|
||||||
|
|
@ -2812,7 +2812,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
[HttpPut("upload/{requestId:length(36)}"), DisableRequestSizeLimit]
|
[HttpPut("upload/{requestId:length(36)}"), DisableRequestSizeLimit]
|
||||||
public async Task<ActionResult<ResponseObject>> UpdatePersonDeferment([FromForm] ImportFileRequest req, Guid requestId)
|
public async Task<ActionResult<ResponseObject>> UpdatePersonDeferment([FromForm] ImportFileRequest req, Guid requestId)
|
||||||
{
|
{
|
||||||
var insigniaRequest = await _context.InsigniaRequests.Include(x => x.Document).Where(x => x.Id == requestId).FirstOrDefaultAsync();
|
var insigniaRequest = await _context.InsigniaRequests.AsNoTracking().Include(x => x.Document).Where(x => x.Id == requestId).FirstOrDefaultAsync();
|
||||||
if (insigniaRequest == null)
|
if (insigniaRequest == null)
|
||||||
return Error(GlobalMessages.InsigniaRequestNotFound, 404);
|
return Error(GlobalMessages.InsigniaRequestNotFound, 404);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue