修改安排面试接口

master
xiaochanghai 7 months ago
parent f2e7ee3d37
commit 05fb27247f
  1. 4
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs
  2. 2
      Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs
  3. 20
      Tiobon.Core.Model/ViewModels/Extend/ResumeViewTab.cs
  4. 17
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs

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

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

@ -95,14 +95,26 @@ public class ResumeRecommendForm
public class ResumeScheduleInterviewForm
{
/// <summary>
/// 人力需求维护ID
/// 时间段,2024/10/12 10:00~2024/10/12 11:00
/// </summary>
public long RequestId { get; set; }
public string Time { get; set; }
/// <summary>
/// 面试官列表
/// 面试地点
/// </summary>
public List<ResumeRecommendFormStaff> InterviewStaffs { get; set; }
public string InterviewAddress { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 附件
/// </summary>
public List<ResumeAttachment> Attachments { get; set; }
}
public class ResumeRecommendFormStaff
{

@ -1,4 +1,5 @@
using MySqlX.XDevAPI.Common;
using NPOI.XWPF.UserModel;
using Tiobon.Core.Common.DB.Dapper.Extensions;
using static Tiobon.Core.Model.Consts;
@ -1375,7 +1376,7 @@ END";
#endregion
#region 安排面试
public async Task<ServiceResult> ScheduleInterview(long id, string time)
public async Task<ServiceResult> ScheduleInterview(long id, ResumeScheduleInterviewForm body)
{
var entity = await base.QueryById(id);
if (entity == null)
@ -1384,9 +1385,9 @@ END";
if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.WaitAppointment)
return ServiceResult.OprateFailed("【待预约】状态下才能安排面试!");
if (time.IndexOf("~") < 0)
throw new Exception($"传入时间【{time}】无效,请检查格式!");
var array = time.Split('~');
if (body.Time.IndexOf("~") < 0)
throw new Exception($"传入时间【{body.Time}】无效,请检查格式!");
var array = body.Time.Split('~');
try
{
Convert.ToDateTime(array[0]);
@ -1394,7 +1395,7 @@ END";
}
catch (Exception)
{
throw new Exception($"传入时间【{time}】无效,请检查格式!");
throw new Exception($"传入时间【{body.Time}】无效,请检查格式!");
}
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id);
if (order != null)
@ -1403,10 +1404,12 @@ END";
records.ForEach(record =>
{
record.InterviewTime = time;
record.InterviewTime = body.Time;
record.InterviewBeginTime = Convert.ToDateTime(array[0]);
record.InterviewEndTime = Convert.ToDateTime(array[1]);
record.Status = DIC_INTERVIEW_ORDER_STATUS.WaitInterview;
record.RemarkSz = body.Remark;
record.InterviewAddress = body.InterviewAddress;
});
await _ghrh_InterviewRecordServices.Update(records, ["InterviewTime", "InterviewBeginTime", "InterviewEndTime", "Status"]);
@ -1415,7 +1418,7 @@ END";
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
OrderId = order.Id,
RemarkSz = $"用户【{usser?.UserName ?? App.User.ID.ToString()}】安排面试,面试时间:{time}!"
RemarkSz = $"用户【{usser?.UserName ?? App.User.ID.ToString()}】安排面试,面试时间:{body.Time}!"
});
entity.Status = DIC_INTERVIEW_ORDER_STATUS.WaitInterview;

Loading…
Cancel
Save