แก้บัคแสดงข้อมูลการศึกษา

This commit is contained in:
Kittapath 2023-04-20 11:20:04 +07:00
parent eb567349b4
commit 56bc4e512f
4 changed files with 273 additions and 281 deletions

View file

@ -1435,6 +1435,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
throw new Exception(GlobalMessages.ExamNotFound);
var candidate = await _context.Candidates.AsQueryable()
.Include(x => x.ProfileImg)
.Where(x => x.PeriodExam == exam && x.UserId == UserId)
.FirstOrDefaultAsync();
@ -1456,6 +1457,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
return new RequestCardCandidate
{
Avatar = candidate.ProfileImg == null ? "" : _minioService.ImagesPath(candidate.ProfileImg.Id).Result,
FirstName = candidate.FirstName,
LastName = candidate.LastName,
Prefix = candidate.PrefixName,

View file

@ -928,6 +928,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{
var periodExam = await _context.PeriodExams.AsQueryable()
.Include(x => x.Candidate)
.ThenInclude(x => x.PaymentImg)
.Where(x => x.Id == Guid.Parse(examId))
.FirstOrDefaultAsync();
@ -939,63 +940,51 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
new DashboardResponseItem
{
Id = 1,
Name = "ผู้สมัครสอบ",
Name = "จำนวนผู้สมัครคัดเลือกทั้งหมด",
Count = periodExam.Candidate.Count()
},
new DashboardResponseItem
{
Id = 2,
Name = "จำนวนผู้มีสิทธิ์เข้ารับคัดเลือกทั้งหมด",
Count = periodExam.Candidate.Where(x=>x.ExamIdenNumber != null).Count()
},
new DashboardResponseItem
{
Id = 3,
Name = "จำนวนผู้เข้ารับการคัดเลือกทั้งหมด",
Count = periodExam.Candidate.Where(x=>x.PaymentImg!=null).Count()
},
new DashboardResponseItem
{
Id = 4,
Name = "ผ่านการสอบ",
Count = periodExam.Candidate.Where(x=>x.Pass == true).Count()
},
new DashboardResponseItem
{
Id = 3,
Id = 5,
Name = "ไม่ผ่านการสอบ",
Count = periodExam.Candidate.Where(x=>x.Pass == false).Count()
},
new DashboardResponseItem
{
Id = 4,
Id = 6,
Name = "เพศชาย",
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("ชาย")).Count()
},
new DashboardResponseItem
{
Id = 5,
Id = 7,
Name = "เพศหญิง",
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("หญิง")).Count()
},
new DashboardResponseItem
{
Id = 6,
Id = 8,
Name = "เพศอื่นๆ",
Count = periodExam.Candidate.Count() -periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("ชาย")).Count()-periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("หญิง")).Count()
},
// new DashboardResponseItem
// {
// Id = 7,
// Name = "จังหวัด",
// Count = provinceItem.ProvinceCount
// },
// new DashboardResponseItem
// {
// Id = 8,
// Name = "เขต/อำเภอ",
// Count = provinceItem.DistrictCount
// },
// new DashboardResponseItem
// {
// Id = 9,
// Name = "แขวง/ตำบล",
// Count = provinceItem.SubDistrictCount
// },
// new DashboardResponseItem
// {
// Id = 10,
// Name = "รหัสไปรษณีย์",
// Count = provinceItem.ZipCodeCount
// },
};
return dashboard;