Merge commit '08c7a11ec0' into develop

# Conflicts:
#	Migrations/ApplicationDbContextModelSnapshot.cs
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.deps.json
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.dll
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.exe
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.pdb
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.runtimeconfig.json
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.staticwebassets.runtime.json
#	bin/Debug/net7.0/BMA.EHR.Recruit.Service.xml
#	obj/BMA.EHR.Recruit.Service.csproj.nuget.dgspec.json
#	obj/BMA.EHR.Recruit.Service.csproj.nuget.g.props
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfo.cs
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfoInputs.cache
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.GeneratedMSBuildEditorConfig.editorconfig
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.GlobalUsings.g.cs
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.MvcApplicationPartsAssemblyInfo.cs
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.assets.cache
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.CoreCompileInputs.cache
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.FileListAbsolute.txt
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.dll
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.genruntimeconfig.cache
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.pdb
#	obj/Debug/net7.0/BMA.EHR.Recruit.Service.xml
#	obj/Debug/net7.0/Sentry.Attributes.cs
#	obj/Debug/net7.0/ref/BMA.EHR.Recruit.Service.dll
#	obj/Debug/net7.0/refint/BMA.EHR.Recruit.Service.dll
#	obj/Debug/net7.0/staticwebassets.build.json
#	obj/Debug/net7.0/staticwebassets.development.json
#	obj/Debug/net7.0/staticwebassets/msbuild.build.BMA.EHR.Recruit.Service.props
#	obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.BMA.EHR.Recruit.Service.props
#	obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.BMA.EHR.Recruit.Service.props
#	obj/project.assets.json
#	obj/project.nuget.cache
This commit is contained in:
kittapath 2025-02-18 13:40:36 +07:00
commit 045d407938
42 changed files with 25814 additions and 49 deletions

View file

@ -1,9 +1,6 @@
using Amazon.S3.Model;
using BMA.EHR.MetaData.Service.Models;
using BMA.EHR.Profile.Service.Models.HR;
//using BMA.EHR.Extensions;
using BMA.EHR.Recruit.Service.Core;
using BMA.EHR.Recruit.Service.Data;
using BMA.EHR.Recruit.Service.Extensions;
@ -1247,6 +1244,9 @@ namespace BMA.EHR.Recruit.Service.Controllers
var file = Request.Form.Files[0];
var doc = await _minioService.UploadFileAsync(file);
import_doc_id = doc.Id.ToString("D");
Console.WriteLine($"file id = {import_doc_id}");
var fileContent = (await _minioService.DownloadFileAsync(doc.Id)).FileContent;
// create import history
@ -1289,20 +1289,20 @@ namespace BMA.EHR.Recruit.Service.Controllers
r.ExamId = workSheet?.Cells[row, 2]?.GetValue<string>();
r.FullA = (int)workSheet?.Cells[7, 7]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
r.SumA = workSheet?.Cells[row, 7]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 7]?.GetValue<string>().Replace(".00", "").ToInteger();
r.SumA = workSheet?.Cells[row, 7]?.GetValue<string>() == "ขส." ? 0.00 : (double)workSheet?.Cells[row, 7]?.GetValue<double>();
r.PercentageA = workSheet?.Cells[row, 8]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 8]?.GetValue<double>();
r.AStatus = workSheet?.Cells[row, 9]?.GetValue<string>();
r.FullB = (int)workSheet?.Cells[7, 12]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
r.SumB = workSheet?.Cells[row, 12]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 12]?.GetValue<string>().Replace(".00", "").ToInteger();
r.SumB = workSheet?.Cells[row, 12]?.GetValue<string>() == "ขส." ? 0.00 : (double)workSheet?.Cells[row, 12]?.GetValue<double>();
r.PercentageB = workSheet?.Cells[row, 13]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 13]?.GetValue<double>();
r.BStatus = workSheet?.Cells[row, 14]?.GetValue<string>();
r.SumAB = workSheet?.Cells[row, 15]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 15]?.GetValue<string>().Replace(".00", "").ToInteger();
r.SumAB = workSheet?.Cells[row, 15]?.GetValue<string>() == "ขส." ? 0.00 : (double)workSheet?.Cells[row, 15]?.GetValue<double>();
r.ABStatus = workSheet?.Cells[row, 17]?.GetValue<string>();
r.FullC = (int)workSheet?.Cells[7, 20]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
r.SumC = workSheet?.Cells[row, 20]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 20]?.GetValue<string>().Replace(".00", "").ToInteger();
r.SumC = workSheet?.Cells[row, 20]?.GetValue<string>() == "ขส." ? 0.00 : (double)workSheet?.Cells[row, 20]?.GetValue<double>();
r.PercentageC = workSheet?.Cells[row, 21]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 21]?.GetValue<double>();
r.CStatus = workSheet?.Cells[row, 22]?.GetValue<string>();
@ -1346,7 +1346,7 @@ namespace BMA.EHR.Recruit.Service.Controllers
}
catch (Exception ex)
{
await _minioService.DeleteFileAsync(Guid.Parse(import_doc_id));
//await _minioService.DeleteFileAsync(Guid.Parse(import_doc_id));
return Error(ex);
}
finally
@ -1572,7 +1572,7 @@ namespace BMA.EHR.Recruit.Service.Controllers
ExamName = p.RecruitImport!.Name,
ExamOrder = p.RecruitImport.Order,
ExamYear = p.RecruitImport.Year.ToThaiYear(),
Score = sr == null ? 0 : sr.SumA + sr.SumB + sr.SumC,
Score = sr == null ? 0.0 : sr.SumA + sr.SumB + sr.SumC,
Number = sr == null ? "" : sr.Number,
ExamCount = _recruitService.GetExamCount(p.CitizenId),
ScoreExpire = p.RecruitImport.AnnouncementDate == null ? "" : p.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate(),