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

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

@ -5,6 +5,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
{ {
public class RequestCardCandidate public class RequestCardCandidate
{ {
public string? Avatar { get; set; }
public string? FirstName { get; set; } public string? FirstName { get; set; }
public string? LastName { get; set; } public string? LastName { get; set; }
public string? Prefix { get; set; } public string? Prefix { get; set; }

View file

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

View file

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

File diff suppressed because it is too large Load diff