代码优化

master
xiaochanghai 7 months ago
parent 34337de25c
commit c5490f17fc
  1. 13
      Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs
  2. 7
      Tiobon.Core.Api/Tiobon.Core.xml
  3. 2
      Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs
  4. 2
      Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs
  5. 59
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs
  6. 7
      Tiobon.Core/Tiobon.Core.xml

@ -424,4 +424,17 @@ public class Ghrh_ResumeController : BaseController<IGhrh_ResumeServices, Ghrh_R
return await _service.CancelInterview(id, body);
}
#endregion
#region 发起录用审批
/// <summary>
/// 发起录用审批
/// </summary>
/// <param name="ids">简历ID</param>
/// <returns></returns>
[HttpPost, Route("ApplyOfferApproval")]
public async Task<ServiceResult> ApplyOfferApproval([FromBody] List<long> ids)
{
return await _service.ApplyOfferApproval(ids);
}
#endregion
}

@ -1472,6 +1472,13 @@
<param name="body">body</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.ApplyOfferApproval(System.Collections.Generic.List{System.Int64})">
<summary>
发起录用审批
</summary>
<param name="ids">简历ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController">
<summary>
教育背景(Controller)

@ -63,4 +63,6 @@ public interface IGhrh_ResumeServices : IBaseServices<Ghrh_Resume, Ghrh_ResumeDt
Task<ServiceResult<ResumeScheduleInterviewResult>> QueryScheduleInterviewForm(long id);
Task<ServiceResult> CancelInterview(long id, ResumeCancelInterviewForm input);
Task<ServiceResult> ApplyOfferApproval(List<long> ids);
}

@ -32,6 +32,8 @@ public class Ghrh_ResumeDto : Ghrh_Resume
/// </summary>
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; }

@ -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<Ghrh_Resume, Ghrh_ResumeDto, Ins
#endregion
RefAsync<int> 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<Ghrh_Resume, Ghrh_ResumeDto, Ins
{
//x.ResumeId = x.Id;
if (x.TitleId != null) x.TitleName = titles.Where(o => 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<Ghrh_Resume, Ghrh_ResumeDto, Ins
var tagIds1 = JsonHelper.JsonToObj<List<long>>(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<ServiceResult> 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<Ghrh_InterviewOrder>()
// .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<ServiceResult> ApplyOfferApproval(List<long> 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<ServicePageResult<object>> 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

@ -1472,6 +1472,13 @@
<param name="body">body</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghrh_ResumeController.ApplyOfferApproval(System.Collections.Generic.List{System.Int64})">
<summary>
发起录用审批
</summary>
<param name="ids">简历ID</param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghrh_ResumeEduBGController">
<summary>
教育背景(Controller)

Loading…
Cancel
Save