diff --git a/Controllers/RecruitController.cs b/Controllers/RecruitController.cs index 1b315ee..a081207 100644 --- a/Controllers/RecruitController.cs +++ b/Controllers/RecruitController.cs @@ -1506,12 +1506,12 @@ namespace BMA.EHR.Recruit.Service.Controllers .Include(x => x.RecruitImport) .Include(x => x.Documents) .ThenInclude(x => x.DocumentFile) - .Where(x => x.RecruitImport.Id == id) + .Where(x => x.RecruitImport!.Id == id) .Where(x => x.ExamId == examId) .Join(_context.RecruitScores.AsQueryable() .Include(x => x.ScoreImport), - rc => new { rc.RecruitImport.Year, rc.ExamId }, - sc => new { sc.ScoreImport.Year, sc.ExamId }, + rc => new { rc.RecruitImport!.Id, rc.ExamId }, + sc => new { Id = sc.ScoreImport!.RecruitImportId, sc.ExamId }, (p, sr) => new { ExamID = p.ExamId, @@ -1530,7 +1530,7 @@ namespace BMA.EHR.Recruit.Service.Controllers Remark = p.Remark, University = p.Educations.First().University, PositionName = p.PositionName, - ExamName = p.RecruitImport.Name, + ExamName = p.RecruitImport!.Name, ExamOrder = p.RecruitImport.Order, ExamYear = p.RecruitImport.Year.ToThaiYear(), Score = sr == null ? 0 : sr.SumA + sr.SumB + sr.SumC, @@ -1846,10 +1846,13 @@ namespace BMA.EHR.Recruit.Service.Controllers .FirstOrDefaultAsync(x => x.Id == id); if (data == null) - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + return Error(GlobalMessages.DataNotFound, StatusCodes.Status500InternalServerError); if (data_pass == null) - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + return Error(GlobalMessages.DataNotFound, StatusCodes.Status500InternalServerError); + + if (data_pass!.ScoreImport == null) + return Error(GlobalMessages.InvalidExamScore, StatusCodes.Status500InternalServerError); var header = $"{data.Name} ครั้งที่ {data.Order}/{data.Year.ToThaiYear()}"; @@ -1950,10 +1953,13 @@ namespace BMA.EHR.Recruit.Service.Controllers .FirstOrDefaultAsync(x => x.Id == id); if (data == null) - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + return Error(GlobalMessages.DataNotFound, StatusCodes.Status500InternalServerError); if (data_pass == null) - return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + return Error(GlobalMessages.DataNotFound, StatusCodes.Status500InternalServerError); + + if (data_pass!.ScoreImport == null) + return Error(GlobalMessages.InvalidExamScore, StatusCodes.Status500InternalServerError); var header = $"{data.Name} ครั้งที่ {data.Order}/{data.Year.ToThaiYear()}"; diff --git a/Core/GlobalMessages.cs b/Core/GlobalMessages.cs index 30057cf..b37b5e8 100644 --- a/Core/GlobalMessages.cs +++ b/Core/GlobalMessages.cs @@ -7,5 +7,7 @@ public const string InvalidRequestParam = "Request parameter ไม่ถูกต้อง!!"; public const string NoFileToUpload = "ไม่พบไฟล์เพื่อทำการอัพโหลด"; public const string DataNotFound = "ไม่พบข้อมูลในระบบ"; + + public const string InvalidExamScore = "ไม่พบข้อมูลผลการสอบ กรุณาตรวจสอบความถูกต้องอีกครั้ง!"; } } diff --git a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfo.cs b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfo.cs index d67cf4a..66382c6 100644 --- a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfo.cs +++ b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfo.cs @@ -15,7 +15,11 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("BMA.EHR.Recruit.Service")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +<<<<<<< HEAD [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d7bfacb34ef93e51cfa16ab565056a2fc541c6e2")] +======= +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+54661ffbcbab112899e31b0397a986a02a1a7b98")] +>>>>>>> working [assembly: System.Reflection.AssemblyProductAttribute("BMA.EHR.Recruit.Service")] [assembly: System.Reflection.AssemblyTitleAttribute("BMA.EHR.Recruit.Service")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfoInputs.cache b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfoInputs.cache index b6a466f..2ecfb58 100644 --- a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfoInputs.cache +++ b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.AssemblyInfoInputs.cache @@ -1 +1,5 @@ +<<<<<<< HEAD a61618443a29215c1780096c70a4c1cfa90e1df3e1f003527b38ce0ccd7b73fc +======= +d0b8ae708cff3fbb17ec6ef788cd76ed1d601b65c1136482d745d4fd3aa82acc +>>>>>>> working diff --git a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.AssemblyReference.cache b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.AssemblyReference.cache new file mode 100644 index 0000000..6fb4818 Binary files /dev/null and b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.FileListAbsolute.txt b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.FileListAbsolute.txt index 15f357b..1455b8c 100644 --- a/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.FileListAbsolute.txt +++ b/obj/Debug/net7.0/BMA.EHR.Recruit.Service.csproj.FileListAbsolute.txt @@ -1077,6 +1077,7 @@ D:\BMA-EHR-RECRUIT-SERVICE\obj\Debug\net7.0\scopedcss\bundle\BMA.EHR.Recruit.Ser D:\BMA-EHR-RECRUIT-SERVICE\obj\Debug\net7.0\BMA.EHR.Recruit.Service.csproj.CopyComplete D:\BMA-EHR-RECRUIT-SERVICE\obj\Debug\net7.0\BMA.EHR.Recruit.Service.genruntimeconfig.cache D:\BMA-EHR-RECRUIT-SERVICE\obj\Debug\net7.0\ref\BMA.EHR.Recruit.Service.dll +<<<<<<< HEAD D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\nuget.config D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\appsettings.Development.json D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\appsettings.json @@ -1084,6 +1085,15 @@ D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\ExamList.xl D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\PassAExamList.xlsx D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\PassExamList.xlsx D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\BMA.EHR.Recruit.Service.staticwebassets.runtime.json +======= +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\appsettings.Development.json +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\appsettings.json +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\nuget.config +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\BMA.EHR.Recruit.Service.staticwebassets.runtime.json +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\ExamList.xlsx +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\PassAExamList.xlsx +D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\Templates\PassExamList.xlsx +>>>>>>> working D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\BMA.EHR.Recruit.Service.exe D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\BMA.EHR.Recruit.Service.deps.json D:\Develop\Source\BMA-EHR-RECRUIT-SERVICE\bin\Debug\net7.0\BMA.EHR.Recruit.Service.runtimeconfig.json