Merge branch 'develop' into working
Some checks failed
release-dev / release-dev (push) Failing after 13s

This commit is contained in:
Suphonchai Phoonsawat 2025-01-27 11:07:16 +07:00
commit b2141b0be7
21 changed files with 58373 additions and 56 deletions

View file

@ -243,6 +243,7 @@ namespace BMA.EHR.Application.Repositories
{
try
{
Console.WriteLine(ocId);
var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId);
if (period == null)
@ -293,7 +294,6 @@ namespace BMA.EHR.Application.Repositories
Root = p.Root,
});
// check วันที่บรรจะต้องน้อยกว่า 29/5/ปี-8 ขอ บม.
var s1 = ((from p in inst_profile
where p.ProfileDateAppoint <= new DateTime(period.Year - 8, 5, 29)
@ -340,7 +340,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
}
})).ToList();
@ -445,7 +445,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
new MatchingCondition
{
@ -548,7 +548,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
new MatchingCondition
{
@ -734,7 +734,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
}
})).ToList();
@ -841,7 +841,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
new MatchingCondition
{
@ -945,7 +945,7 @@ namespace BMA.EHR.Application.Repositories
{
Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}"
Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
},
new MatchingCondition
{
@ -6530,30 +6530,35 @@ namespace BMA.EHR.Application.Repositories
var allOfficerProfilesByRoot =
(await _userProfileRepository.GetOfficerProfileByRootIdAsync(ocId, AccessToken));
var allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByRootIdAsync(ocId, AccessToken));
var period = await _dbContext.Set<InsigniaPeriod>().Include(x => x.InsigniaEmployees).FirstOrDefaultAsync(p => p.Id == periodId);
var allEmployeeProfileByRoot = new List<GetProfileByRootIdDto>();
if (period != null && period.InsigniaEmployees != null)
{
allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByPositionAsync(ocId, period.InsigniaEmployees.Select(x => x.RefId), AccessToken));
}
var type_coin = await GetCoinCandidate(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_level3 = await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot);
var type1_level4 = await GetInsigniaCandidate_Type1_Level4(periodId, ocId, allOfficerProfilesByRoot);
var type2_level5 = await GetInsigniaCandidate_Type2_Level5(periodId, ocId, allOfficerProfilesByRoot);
var type2_level6 = await GetInsigniaCandidate_Type2_Level6(periodId, ocId, allOfficerProfilesByRoot);
var type2_level7 = await GetInsigniaCandidate_Type2_Level7(periodId, ocId, allOfficerProfilesByRoot);
var type2_level8 = await GetInsigniaCandidate_Type2_Level8(periodId, ocId, allOfficerProfilesByRoot);
var type_coin = allOfficerProfilesByRoot.Count() > 0 ? await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level1 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level2 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level2(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level3 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level4 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level4(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level5 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level5(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level6 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level6(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level7 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level7(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level8 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level8(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level9_1 =
await GetInsigniaCandidate_Type2_Level9_1(periodId, ocId, allOfficerProfilesByRoot);
allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level9_1(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level9_2 =
await GetInsigniaCandidate_Type2_Level9_2(periodId, ocId, allOfficerProfilesByRoot);
var type3_level10 = await GetInsigniaCandidate_Type3_Level10(periodId, ocId, allOfficerProfilesByRoot);
var type3_level11 = await GetInsigniaCandidate_Type3_Level11(periodId, ocId, allOfficerProfilesByRoot);
var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot);
var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot);
allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level9_2(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type3_level10 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type3_Level10(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type3_level11 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type3_Level11(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type4_level10 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type4_level11 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot);
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot);
var employee_type1 = allEmployeeProfileByRoot.Count() > 0 ? await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot) : new List<InsigniaResultSet>();
var employee_type2 = allEmployeeProfileByRoot.Count() > 0 ? await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot) : new List<InsigniaResultSet>();
// union result
foreach (var r in type_coin)

View file

@ -910,17 +910,17 @@ namespace BMA.EHR.Application.Repositories.Reports
? "🗹"
: "☐";
var passResult1 = evaluate_assign.result.evaluate.pass_result == 1
? "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็น ควรให้รับราชการต่อไป"
: "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็น ควรให้รับราชการต่อไป";
? no == 1 ? "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป"
: no == 1 ? "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป";
var passResult2 = evaluate_assign.result.evaluate.pass_result == 2
? "🗹 ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกราชการต่อไป"
: "☐ ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกราชการต่อไป";
? no == 1 ? "🗹 ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "🗹 ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ"
: no == 1 ? "☐ ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "☐ ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ";
var passResult3 = evaluate_assign.result.evaluate.pass_result == 3
? $"🗹 เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน"
: "☐ เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก.....เดือน";
var passResult = evaluate_assign.result.evaluate.pass_result == 1
? "เห็นควรให้รับราชการต่อไป"
? no == 1 ? "เห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "เห็นควรให้รับราชการต่อไป"
: evaluate_assign.result.evaluate.pass_result == 2
? "เห็นควรให้ออกจากราชการ"
: $"เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน";
@ -947,10 +947,10 @@ namespace BMA.EHR.Application.Repositories.Reports
ExpandMonth = expandMonth,
ChairmanName = string.IsNullOrEmpty(evaluate_assign.result.chairman.name) ? string.Empty : evaluate_assign.result.chairman.name,
ChairmanPosition = string.IsNullOrEmpty(evaluate_assign.result.chairman.Position) ? string.Empty : evaluate_assign.result.chairman.Position,
ChairmanDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.chairman_dated.ToThaiFullDate().ToString().ToThaiNumber(),
ChairmanDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate?.chairman_dated?.ToThaiFullDate().ToString().ToThaiNumber(),
CommanderName = string.IsNullOrEmpty(evaluate_assign.result.commander.name) ? string.Empty : evaluate_assign.result.commander.name,
CommanderPosition = string.IsNullOrEmpty(evaluate_assign.result.commander.Position) ? string.Empty : evaluate_assign.result.commander.Position,
CommanderDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director1_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.director1_dated.ToThaiFullDate().ToString().ToThaiNumber(),
CommanderDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director1_dated.ToString()) ? "-" : evaluate_assign.result.evaluate?.director1_dated?.ToThaiFullDate().ToString().ToThaiNumber(),
Name = evaluate_assign.result.experimentee.name,
RoundNo = no.ToString().ToThaiNumber(),
DateStart = evaluate_assign.result.assign.date_start != string.Empty ? dateStart_ : "-",

View file

@ -129,6 +129,36 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task<List<GetProfileByRootIdDto>> GetEmployeeProfileByPositionAsync(Guid rootId, dynamic empPosId, string? accessToken)
{
try
{
var apiPath = $"{_configuration["API"]}/org/dotnet/find/employee/position";
var apiKey = _configuration["API_KEY"];
var body = new
{
rootId,
empPosId
};
var apiResult = await PostExternalAPIAsync(apiPath, accessToken, body, apiKey);
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetProfileByRootIdResultDto>(apiResult);
if (raw != null)
return raw.Result;
}
return null;
}
catch
{
throw;
}
}
public async Task<GetProfileByKeycloakIdDto?> GetProfileByKeycloakIdAsync(Guid keycloakId, string? accessToken)
{
try