report ประวัติทำงาน
This commit is contained in:
parent
0043e86fa3
commit
4e90ffadb2
7 changed files with 46 additions and 34 deletions
|
|
@ -20,6 +20,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
#region " Fields "
|
||||
|
||||
private readonly IApplicationDBContext _dbContext;
|
||||
private readonly IApplicationDBExamContext _dbExamContext;
|
||||
private readonly IWebHostEnvironment _hostingEnvironment;
|
||||
private readonly MinIOService _documentService;
|
||||
private readonly OrganizationCommonRepository _organizationCommonRepository;
|
||||
|
|
@ -29,11 +30,13 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
#region " Constructor and Destructor "
|
||||
|
||||
public CandidateReportRepository(IApplicationDBContext dbContext,
|
||||
MinIOService documentService,
|
||||
OrganizationCommonRepository organizationCommonRepository,
|
||||
IWebHostEnvironment hostEnvironment)
|
||||
IApplicationDBExamContext dbExamContext,
|
||||
MinIOService documentService,
|
||||
OrganizationCommonRepository organizationCommonRepository,
|
||||
IWebHostEnvironment hostEnvironment)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_dbExamContext = dbExamContext;
|
||||
_hostingEnvironment = hostEnvironment;
|
||||
_organizationCommonRepository = organizationCommonRepository;
|
||||
_documentService = documentService;
|
||||
|
|
@ -46,11 +49,12 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
#region ใบสมัครสอบ
|
||||
public async Task<dynamic> GetExamCandidateAsync(Guid id)
|
||||
{
|
||||
var data = await _dbContext.Set<Candidate>().AsQueryable()
|
||||
var data = await _dbExamContext.Set<Candidate>().AsQueryable()
|
||||
.Where(x => x.Id == id)
|
||||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
AvatarId = p.ProfileImg == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.ProfileImg.Id,
|
||||
ExamIdenNumber = p.ExamIdenNumber,
|
||||
PositionName = p.PositionExam == null ? "" : p.PositionExam.PositionName,
|
||||
PeriodExamName = p.PeriodExam == null ? "" : p.PeriodExam.Name,
|
||||
|
|
@ -88,7 +92,7 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
DurationStart = y.DurationStart.ToThaiShortDate2(),
|
||||
DurationEnd = y.DurationEnd.ToThaiShortDate2(),
|
||||
RangeDate = y.RangeDate,
|
||||
}),
|
||||
}).ToList(),
|
||||
|
||||
RegistAddress = p.RegistAddress,
|
||||
RegistProvinceName = p.RegistProvinceName,
|
||||
|
|
@ -114,34 +118,23 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
if (data == null)
|
||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||
return data;
|
||||
}
|
||||
public async Task<dynamic> GetExamCareerCandidateAsync(Guid id)
|
||||
{
|
||||
var data = await _dbExamContext.Set<Career>().AsQueryable()
|
||||
.Where(x => x.Candidate != null)
|
||||
.Where(x => x.Candidate.Id == id)
|
||||
.Select(p => new
|
||||
{
|
||||
Position = p.Position,
|
||||
Type = p.Type,
|
||||
DurationStart = p.DurationStart.ToThaiShortDate2(),
|
||||
DurationEnd = p.DurationEnd.ToThaiShortDate2(),
|
||||
RangeDate = p.RangeDate,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
// string Prefix = string.IsNullOrEmpty(data.Prefix.ToString()) ? string.Empty : data.Prefix.ToString();
|
||||
// string FirstName = string.IsNullOrEmpty(data.FirstName.ToString()) ? string.Empty : data.FirstName.ToString();
|
||||
// string LastName = string.IsNullOrEmpty(data.LastName.ToString()) ? string.Empty : data.LastName.ToString();
|
||||
// string FullName = $"{Prefix} {FirstName} {LastName}";
|
||||
// string Date = string.IsNullOrEmpty(data.Date.ToString()) ? "วันที่ - เดือน - พ.ศ. -" : DateTime.Parse(data.Date.ToString()).ToThaiFullDate().ToString().ToThaiNumber();
|
||||
// string CurrentDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")).ToThaiFullDate().ToString().ToThaiNumber();
|
||||
// return new
|
||||
// {
|
||||
// FullName,
|
||||
// Date,
|
||||
// CurrentDate,
|
||||
// data.Position,
|
||||
// data.PositionExecutive,
|
||||
// data.PositionType,
|
||||
// data.PositionLine,
|
||||
// data.PositionLevel,
|
||||
// data.Organization,
|
||||
// data.PositionId,
|
||||
// data.PositionExecutiveId,
|
||||
// data.PositionTypeId,
|
||||
// data.PositionLineId,
|
||||
// data.PositionLevelId,
|
||||
// data.OrganizationId,
|
||||
// data.Number,
|
||||
// data.Location,
|
||||
// data.Reason,
|
||||
// };
|
||||
return data;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue