uncomment code

This commit is contained in:
Suphonchai Phoonsawat 2024-12-26 15:04:10 +07:00
parent eef2e809dc
commit e18c9dbfa2

View file

@ -287,8 +287,8 @@ namespace BMA.EHR.Application.Repositories
.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)) .Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29))
.OrderByDescending(x => x.Order).FirstOrDefault().Amount : .OrderByDescending(x => x.Order).FirstOrDefault().Amount :
p.Amount, p.Amount,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
}); });
@ -322,8 +322,8 @@ namespace BMA.EHR.Application.Repositories
LastInsignia = p.LastInsignia, LastInsignia = p.LastInsignia,
LastInsigniaId = p.LastInsigniaId, LastInsigniaId = p.LastInsigniaId,
Salary = p.Salary, Salary = p.Salary,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
RequestInsignia = GetInsigniaByName("เบญจมาภรณ์มงกุฎไทย"), RequestInsignia = GetInsigniaByName("เบญจมาภรณ์มงกุฎไทย"),
@ -380,8 +380,8 @@ namespace BMA.EHR.Application.Repositories
PositionTypeId = p.PosTypeId, PositionTypeId = p.PosTypeId,
PositionTypeName = p.PosType, PositionTypeName = p.PosType,
Gender = p.Gender ?? "", Gender = p.Gender ?? "",
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
LastInsignia = p.ProfileInsignia == null || p.ProfileInsignia.Count == 0 LastInsignia = p.ProfileInsignia == null || p.ProfileInsignia.Count == 0
@ -511,8 +511,8 @@ namespace BMA.EHR.Application.Repositories
.FirstOrDefault() == null ? 0 : .FirstOrDefault() == null ? 0 :
p.ProfileInsignia.Where(x => x.InsigniaId.Value == bcmRoyal.Id).OrderBy(x => x.Year) p.ProfileInsignia.Where(x => x.InsigniaId.Value == bcmRoyal.Id).OrderBy(x => x.Year)
.FirstOrDefault().Year, .FirstOrDefault().Year,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
}) })
@ -684,8 +684,8 @@ namespace BMA.EHR.Application.Repositories
.Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29)) .Where(x => x.Date.Value <= new DateTime(period.Year, 4, 29))
.OrderByDescending(x => x.Order).FirstOrDefault().Amount : .OrderByDescending(x => x.Order).FirstOrDefault().Amount :
p.Amount, p.Amount,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
}); });
@ -800,8 +800,8 @@ namespace BMA.EHR.Application.Repositories
.FirstOrDefault() == null ? 0 : .FirstOrDefault() == null ? 0 :
p.ProfileInsignia.Where(x => x.InsigniaId.Value == bcpRoyal.Id).OrderBy(x => x.Year) p.ProfileInsignia.Where(x => x.InsigniaId.Value == bcpRoyal.Id).OrderBy(x => x.Year)
.FirstOrDefault().Year, .FirstOrDefault().Year,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
}) })
@ -831,8 +831,8 @@ namespace BMA.EHR.Application.Repositories
RequestInsignia = GetInsigniaByName("จัตุรถาภรณ์มงกุฎไทย"), RequestInsignia = GetInsigniaByName("จัตุรถาภรณ์มงกุฎไทย"),
Seq = 2, Seq = 2,
Gender = p.Gender, Gender = p.Gender,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
MatchingConditions = new List<MatchingCondition> MatchingConditions = new List<MatchingCondition>
@ -935,8 +935,8 @@ namespace BMA.EHR.Application.Repositories
RequestInsignia = GetInsigniaByName("จัตุรถาภรณ์ช้างเผือก"), RequestInsignia = GetInsigniaByName("จัตุรถาภรณ์ช้างเผือก"),
Seq = 2, Seq = 2,
Gender = p.Gender, Gender = p.Gender,
PositionSalaryAmount = p.PositionSalaryAmount, PositionSalaryAmount = p.PositionSalaryAmount ?? 0,
Amount = p.Amount, Amount = p.Amount ?? 0,
RootId = p.RootId, RootId = p.RootId,
Root = p.Root, Root = p.Root,
MatchingConditions = new List<MatchingCondition> MatchingConditions = new List<MatchingCondition>
@ -6529,8 +6529,9 @@ namespace BMA.EHR.Application.Repositories
var result_candidate = new List<InsigniaResultSet>(); var result_candidate = new List<InsigniaResultSet>();
var allOfficerProfilesByRoot = var allOfficerProfilesByRoot =
(await _userProfileRepository.GetOfficerProfileByRootIdAsync(ocId, AccessToken)); (await _userProfileRepository.GetOfficerProfileByRootIdAsync(ocId, AccessToken));
//var allEmployeeProfileByRoot =
// (await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken)); var allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken));
var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot); var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot);
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot); var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot);
@ -6550,6 +6551,10 @@ namespace BMA.EHR.Application.Repositories
var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot); var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot);
var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot); var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot);
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot);
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot);
// union result // union result
foreach (var r in type_coin) foreach (var r in type_coin)
{ {
@ -6656,20 +6661,19 @@ namespace BMA.EHR.Application.Repositories
result_candidate.Add(r); result_candidate.Add(r);
} }
// TODO : Remove for Test Error foreach (var r in employee_type2)
//foreach (var r in employee_type2) {
//{ var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId); if (old == null)
// if (old == null) result_candidate.Add(r);
// result_candidate.Add(r); }
//}
//foreach (var r in employee_type1) foreach (var r in employee_type1)
//{ {
// var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId); var old = result_candidate.FirstOrDefault(x => x.ProfileId == r.ProfileId);
// if (old == null) if (old == null)
// result_candidate.Add(r); result_candidate.Add(r);
//} }
//foreach (var r in type) //foreach (var r in type)