新增安排面试接口

master
xiaochanghai 7 months ago
parent b38afc3dfc
commit cadc21659d
  1. 12
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs
  2. 8
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 1
      Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs
  4. 44
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs

@ -243,4 +243,16 @@ public class Ghrh_ResumeController : BaseController<IGhrh_ResumeServices, Ghrh_R
public async Task<ServiceResult> SubscribeInterview(long id, [FromBody] List<string> times) => await _service.SubscribeInterview(id, times); public async Task<ServiceResult> SubscribeInterview(long id, [FromBody] List<string> times) => await _service.SubscribeInterview(id, times);
#endregion #endregion
#region 安排面试
/// <summary>
/// 面试官约面
/// </summary>
/// <param name="id">简历Id</param>
/// <param name="time">时间段,2024/10/12 10:00~2024/10/12 11:00</param>
/// <returns></returns>
[HttpPost, Route("ScheduleInterview/{id}")]
public async Task<ServiceResult> ScheduleInterview(long id, [FromBody] string time) => await _service.ScheduleInterview(id, time);
#endregion
} }

@ -1372,6 +1372,14 @@
<param name="times">时间段列表,["2024/10/12 10:00~2024/10/12 11:00"],最多三个,超过三个取前三</param> <param name="times">时间段列表,["2024/10/12 10:00~2024/10/12 11:00"],最多三个,超过三个取前三</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.ScheduleInterview(System.Int64,System.String)">
<summary>
面试官约面
</summary>
<param name="id">简历Id</param>
<param name="time">时间段,2024/10/12 10:00~2024/10/12 11:00</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController"> <member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController">
<summary> <summary>
教育背景(Controller) 教育背景(Controller)

@ -38,4 +38,5 @@ public interface IGhrh_ResumeServices : IBaseServices<Ghrh_Resume, Ghrh_ResumeDt
Task<ServiceResult> RemindHasRecommend(long id); Task<ServiceResult> RemindHasRecommend(long id);
Task<ServiceResult> SubscribeInterview(long id, List<string> times); Task<ServiceResult> SubscribeInterview(long id, List<string> times);
Task<ServiceResult> ScheduleInterview(long id, string time);
} }

@ -1333,30 +1333,48 @@ END";
#endregion #endregion
#region 安排面试 #region 安排面试
public async Task<ServiceResult> ScheduleInterview(long id) public async Task<ServiceResult> ScheduleInterview(long id, string time)
{ {
var entity = await _ghrh_InterviewOrderServices.QueryById(id); var entity = await base.QueryById(id);
if (entity == null) if (entity == null)
return ServiceResult.OprateFailed("无效的简历工单ID!"); return ServiceResult.OprateFailed("无效的简历ID!");
if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended) if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.WaitAppointment)
return ServiceResult.OprateFailed("已推荐状态下简历才可安排面试!"); return ServiceResult.OprateFailed("待预约状态下才能安排面试!");
var order = await Db.Queryable<Ghrh_InterviewOrder>().FirstAsync(x => x.ResumeId == id); if (time.IndexOf("~") < 0)
throw new Exception($"传入时间【{time}】无效,请检查格式!");
var array = time.Split('~');
try
{
Convert.ToDateTime(array[0]);
Convert.ToDateTime(array[1]);
}
catch (Exception)
{
throw new Exception($"传入时间【{time}】无效,请检查格式!");
}
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id);
if (order != null) if (order != null)
{ {
var record = await _ghrh_InterviewRecordServices.QuerySingle(x => x.Round == order.Round && x.OrderId == order.Id); var record = await _ghrh_InterviewRecordServices.QuerySingle(x => x.Round == order.Round && x.OrderId == order.Id);
if (record.FirstViewTime.IsNotEmptyOrNull()) record.InterviewTime = time;
return ServiceResult.OprateFailed("面试官已查看简历,暂不可发送提醒!"); record.InterviewBeginTime = Convert.ToDateTime(array[0]);
record.InterviewEndTime = Convert.ToDateTime(array[1]);
if (record.ReceiverIds.IsNotEmptyOrNull()) record.Status = DIC_INTERVIEW_ORDER_STATUS.WaitInterview;
{
var staffs = JsonHelper.JsonToObj<List<ResumeRecommendFormStaff>>(record.ReceiverIds); await _ghrh_InterviewRecordServices.Update(record, ["InterviewTime", "InterviewBeginTime", "InterviewEndTime", "Status"]);
await SendMessage(staffs.Select(x => x.StaffId).ToList(), "简历提醒", "您有个简历推荐,请及时查看!");
}
var usser = await GetUser();
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
OrderId = order.Id,
RemarkSz = $"用户【{usser?.UserName ?? App.User.ID.ToString()}】安排面试,面试时间:{time}!"
});
entity.Status = DIC_INTERVIEW_ORDER_STATUS.WaitInterview;
await Update(entity, ["Status"]);
} }
return ServiceResult.OprateSuccess(); return ServiceResult.OprateSuccess();

Loading…
Cancel
Save