From c57cd97d0e455a2898919bf340aebd37e202f7f4 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 6 Dec 2024 16:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrh/Ghrh_OfferApplyOrderServices.cs | 6 ++ .../Ghrh/Ghrh_ResumeServices.cs | 80 +++++++++++++++++-- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs index 1862afc4..eafc45c5 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs @@ -235,6 +235,12 @@ public class Ghrh_OfferApplyOrderServices : BaseServices x.ResumeId == resumeId); + if (applyOrder != null) + { + obj.Items = await Db.Queryable().Where(x => x.OrderId == applyOrder.Id).ToListAsync(); + } + return ServiceResult.OprateSuccess("查询成功", obj); } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 03959ea5..8e15a98a 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -295,7 +295,7 @@ public class Ghrh_ResumeServices : BaseServices().Where(x => x.ConfigCode == "ESS_Recruit_Custom_Transfer_Staff").FirstAsync(); - var applyOrders = await Db.Queryable().Where(x => x.ResumeId != null && ids.Contains(x.ResumeId.Value)).ToListAsync(); + var applyOrders = await Db.Queryable().Where(x => x.ResumeId != null && ids.Contains(x.ResumeId.Value) && x.WorkState == 0).ToListAsync(); #endregion list.ForEach(async x => @@ -1613,8 +1613,8 @@ END"; if (entity == null) return ServiceResult.OprateFailed("无效的简历ID!"); - if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended) - return ServiceResult.OprateFailed("【已推荐】状态下才能约面!"); + //if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended) + // return ServiceResult.OprateFailed("【已推荐】状态下才能约面!"); form.Times.ForEach(x => { @@ -1635,9 +1635,6 @@ END"; var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); if (order != null) { - - - bool isChangeInterviewTime = false; var records = await _ghrh_InterviewRecordServices.Query(x => x.Round == order.Round && x.OrderId == order.Id); @@ -1731,6 +1728,77 @@ END"; } #endregion + #region 改期 + public async Task ChangeSubscribeInterview(long id, ResumeSubscribeInterviewForm form) + { + var entity = await base.QueryById(id); + if (entity == null) + return ServiceResult.OprateFailed("无效的简历ID!"); + + if (entity.Status != DIC_INTERVIEW_ORDER_STATUS.HasRecommended) + return ServiceResult.OprateFailed("【已推荐】状态下才能约面!"); + + form.Times.ForEach(x => + { + if (x.IndexOf("~") < 0) + throw new Exception($"传入时间【{x}】无效,请检查格式!"); + var array = x.Split('~'); + try + { + Convert.ToDateTime(array[0]); + Convert.ToDateTime(array[1]); + } + catch (Exception) + { + throw new Exception($"传入时间【{x}】无效,请检查格式!"); + } + }); + + var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); + if (order != null) + { + + bool isChangeInterviewTime = false; + + var records = await _ghrh_InterviewRecordServices.Query(x => x.Round == order.Round && x.OrderId == order.Id); + records.ForEach(record => + { + record.Status = DIC_INTERVIEW_ORDER_STATUS.WaitAppointment; + record.RemarkSz = form.Remark; + if (record.PlanInterviewTime1.IsNotEmptyOrNull() || record.PlanInterviewTime2.IsNotEmptyOrNull() || record.PlanInterviewTime3.IsNotEmptyOrNull()) + isChangeInterviewTime = true; + if (isChangeInterviewTime) + record.WaitInterviewStatus = "HasChangeInterviewTime"; + + }); + + for (int i = 0; i < form.Times.Count; i++) + { + if (i == 0) + records.ForEach(record => record.PlanInterviewTime1 = form.Times[i]); + else if (i == 1) + records.ForEach(record => record.PlanInterviewTime2 = form.Times[i]); + else if (i == 2) + records.ForEach(record => record.PlanInterviewTime3 = form.Times[i]); + } + if (isChangeInterviewTime) + order.WaitInterviewStatus = "HasChangeInterviewTime"; + + order.Status = DIC_INTERVIEW_ORDER_STATUS.WaitAppointment; + order.AppointmentFeedback = form.Remark; + await _ghrh_InterviewOrderServices.Update(order, ["Status", "AppointmentFeedback"]); + + await _ghrh_InterviewRecordServices.Update(records[0], ["PlanInterviewTime1", "PlanInterviewTime2", "PlanInterviewTime3", "Status"]); + + await LogRecord(order.Id, $"预约面试,面试时间:{string.Join("、", form.Times)}"); + + await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.WaitAppointment); + } + + return ServiceResult.OprateSuccess(); + } + #endregion + #region 变更面试时间 public async Task ModifyInterviewTime(long id, string time) {