api review
This commit is contained in:
parent
9d61daf66c
commit
34806a0bc2
10 changed files with 3098 additions and 213 deletions
|
|
@ -1914,6 +1914,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
ResultC = candidate.ResultC,
|
||||
Pass = candidate.Pass,
|
||||
Number = candidate.Number,
|
||||
ReviewPoint = candidate.ReviewPoint,
|
||||
Review = candidate.Review,
|
||||
AnnouncementDate = exam.AnnouncementDate.AddYears(2),
|
||||
Id = candidate.Id,
|
||||
};
|
||||
|
|
@ -1946,6 +1948,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
ResultC = candidate.ResultC,
|
||||
Pass = candidate.Pass,
|
||||
Number = candidate.Number,
|
||||
ReviewPoint = candidate.ReviewPoint,
|
||||
Review = candidate.Review,
|
||||
AnnouncementDate = candidate.PeriodExam?.AnnouncementDate.AddYears(2),
|
||||
Id = candidate.Id,
|
||||
};
|
||||
|
|
@ -1993,6 +1997,41 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
return _minioService.ImagesPath(Guid.Parse("08db463c-9bf7-494f-8b35-e9b777256dae")).Result;
|
||||
}
|
||||
|
||||
public async Task UpdateReviewAsyncCandidate(string examId, string positionId, RequestReview item)
|
||||
{
|
||||
var exam = await _context.PeriodExams.AsQueryable()
|
||||
.Where(p => p.CheckDisability == false)
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
||||
|
||||
if (exam == null)
|
||||
throw new Exception(GlobalMessages.ExamNotFound);
|
||||
|
||||
var candidate = await _context.Candidates.AsQueryable()
|
||||
.Include(x => x.ProfileImg)
|
||||
.Where(x => x.PeriodExam == exam && x.UserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
if (positionId != "00000000-0000-0000-0000-000000000000")
|
||||
{
|
||||
var position = await _context.PositionExams.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam);
|
||||
|
||||
if (position == null)
|
||||
throw new Exception(GlobalMessages.PositionExamNotFound);
|
||||
|
||||
candidate = await _context.Candidates.AsQueryable()
|
||||
.Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
if (candidate == null)
|
||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||
|
||||
candidate.ReviewPoint = item.ReviewPoint;
|
||||
candidate.Review = item.Review;
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue