diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index 07b0e8e5..a38bca7d 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -424,4 +424,17 @@ public class Ghrh_ResumeController : BaseController + /// 发起录用审批 + /// + /// 简历ID + /// + [HttpPost, Route("ApplyOfferApproval")] + public async Task ApplyOfferApproval([FromBody] List ids) + { + return await _service.ApplyOfferApproval(ids); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 45842676..330b51c3 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1472,6 +1472,13 @@ body + + + 发起录用审批 + + 简历ID + + 教育背景(Controller) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index a8f81c8f..02b9e292 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -63,4 +63,6 @@ public interface IGhrh_ResumeServices : IBaseServices> QueryScheduleInterviewForm(long id); Task CancelInterview(long id, ResumeCancelInterviewForm input); + + Task ApplyOfferApproval(List ids); } \ No newline at end of file diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs index ef6d2d60..a38c730f 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs @@ -32,6 +32,8 @@ public class Ghrh_ResumeDto : Ghrh_Resume /// public string UpdateDataInfo { get; set; } public string TitleName { get; set; } + public string TitleLabel { get; set; } + public string GenderLabel { get; set; } public string EducationLabel { get; set; } public string NationLabel { get; set; } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 77c03b6a..a4c393ed 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -1,4 +1,5 @@ -using Tiobon.Core.Model.Models; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Tiobon.Core.Model.Models; using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; @@ -195,6 +196,7 @@ public class Ghrh_ResumeServices : BaseServices total = 0; + whereExpression.And(x => x.ApplicationStatus == "Submit"); var entitys = await query .WhereIF(condition.IsNotEmptyOrNull(), condition) .Where(whereExpression.ToExpression()) @@ -232,6 +234,7 @@ public class Ghrh_ResumeServices : BaseServices o.TitleID == x.TitleId).FirstOrDefault()?.TitleName; + x.TitleLabel = x.TitleName; x.GenderLabel = await GetParaLabel("Gender", x.Gender); x.EducationLabel = await GetParaLabel("EducationalBGLevel", x.Education); x.NationLabel = await GetParaLabel("A02", x.Nation); @@ -248,6 +251,18 @@ public class Ghrh_ResumeServices : BaseServices>(x.Tags); x.TagList = tags.Where(o => tagIds1.Contains(o.Id)).Select(o => o.TagName).ToList(); } + + #region 计算年龄 + if (x.Birthday != null && x.Birthday > DateTime.MinValue) + { + DateTime birthdate = (DateTime)x.Birthday; + DateTime now = DateTime.Now; + int age = now.Year - birthdate.Year; + if (now.Month < birthdate.Month || (now.Month == birthdate.Month && now.Day < birthdate.Day)) + age--; + x.Age = age; + } + #endregion }); return result; @@ -934,11 +949,16 @@ END"; #region 简历提交接口 public async Task Submit(long id, string status, ResumeFormColumnSubmit resume) { + resume.Base.ApplicationStatus = status; resume.Base.ApplicationTime = DateTime.Now; if (status == "Submit") resume.Base.Status = DIC_INTERVIEW_ORDER_STATUS.WaitRecommended; + var entity = await base.QueryById(id); + if (entity != null && entity.Status != DIC_INTERVIEW_ORDER_STATUS.WaitRecommended) + resume.Base.Status = entity.Status; + if (resume.Base.PhotoUrls != null && resume.Base.PhotoUrls.Any()) resume.Base.PhotoUrl = resume.Base.PhotoUrls[0].RelativePath; await base.Update(id, resume.Base); @@ -1247,9 +1267,17 @@ END"; x.Status == DIC_INTERVIEW_ORDER_STATUS.HasRecommended || x.Status == DIC_INTERVIEW_ORDER_STATUS.WaitAppointment || x.Status == DIC_INTERVIEW_ORDER_STATUS.WaitInterview || + x.Status == DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer || + x.Status == DIC_INTERVIEW_ORDER_STATUS.HasSendOffer || + x.Status == DIC_INTERVIEW_ORDER_STATUS.HasOffer || x.Status == DIC_INTERVIEW_ORDER_STATUS.HasInterview))) continue; + //await Db.Updateable() + // .SetColumns(it => it.IsEnable == 0) + // .Where(it => it.ResumeId == id) + // .ExecuteCommandAsync(); + var orderId = await _ghrh_InterviewOrderServices.Add(new InsertGhrh_InterviewOrderInput() { ResumeId = id, @@ -1610,8 +1638,9 @@ END"; record.Status = DIC_INTERVIEW_ORDER_STATUS.HasInterview; await _ghrh_InterviewRecordServices.Update(record, ["AssessTime", "Status", "IsPass", "InterviewResult"]); + await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.HasInterview); - await LogRecord(order.Id, "填写了面试评估,轮数:{order.Round},是否通过:{(input.IsPass == true ? \"通过\" : \"不通过\")},内容:{input.Content}!"); + await LogRecord(order.Id, $"填写了面试评估,轮数:{order.Round},是否通过:{(input.IsPass == true ? "通过" : "不通过")},内容:{input.Content}!"); return ServiceResult.OprateSuccess(); } @@ -1772,6 +1801,28 @@ END"; } #endregion + #region 发起录用审批 + public async Task ApplyOfferApproval(List ids) + { + for (int i = 0; i < ids.Count; i++) + { + var id = ids[i]; + var entity = await base.QueryById(id); + if (entity == null) + return ServiceResult.OprateFailed("无效的简历ID!"); + + await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); + + var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); + await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); + await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer); + await LogRecord(order.Id, "发起录用审批!"); + } + + return ServiceResult.OprateSuccess(); + } + #endregion + #region ESS端查询简历记录 public async Task> QueryESS(QueryBody filter, string condition) { @@ -1870,7 +1921,9 @@ END"; C.Status OrderStatus, C.StaffId, C.CancelReason, - C.IsCancel + C.IsCancel, + CONVERT + (BIT, CASE B.[Round] WHEN C.[Round] THEN 'true' ELSE 'false' END) AS IsAllowAssess FROM Ghrh_Resume A JOIN Ghrh_InterviewOrder B ON A.ID = B.ResumeId JOIN Ghrh_InterviewRecord C @@ -2013,7 +2066,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1"; var data = await Db.SqlQueryable(sql) .OrderBy(filter.orderBy) .ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); - + return new ServicePageResult(filter.pageNum, totalCount, filter.pageSize, data); } diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 45842676..330b51c3 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1472,6 +1472,13 @@ body + + + 发起录用审批 + + 简历ID + + 教育背景(Controller)