|
|
|
@ -1,8 +1,9 @@ |
|
|
|
|
using DinkToPdf; |
|
|
|
|
using Amazon.Auth.AccessControlPolicy; |
|
|
|
|
using DinkToPdf; |
|
|
|
|
using DinkToPdf.Contracts; |
|
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
|
using MySqlX.XDevAPI.Common; |
|
|
|
|
using NPOI.HSSF.Record; |
|
|
|
|
using System.IO.Compression; |
|
|
|
|
using static Tiobon.Core.Model.Consts; |
|
|
|
|
|
|
|
|
@ -13,6 +14,8 @@ namespace Tiobon.Core.Services; |
|
|
|
|
/// </summary> |
|
|
|
|
public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, InsertGhrh_ResumeInput, EditGhrh_ResumeInput>, IGhrh_ResumeServices |
|
|
|
|
{ |
|
|
|
|
#region 变量定义 |
|
|
|
|
|
|
|
|
|
private readonly IBaseRepository<Ghrh_Resume> _dal; |
|
|
|
|
private readonly IGhrh_ResumeEduBGServices _ghrh_ResumeEduBGServices; |
|
|
|
|
private readonly IGhrh_ResumeWorkExpServices _ghrh_ResumeWorkExpServices; |
|
|
|
@ -92,7 +95,9 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins |
|
|
|
|
_converter = converter; |
|
|
|
|
_hostingEnvironment = hostingEnvironment; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 字典映射、全称、单位转换等 |
|
|
|
|
/// <summary> |
|
|
|
|
/// 字典映射、全称、单位转换等 |
|
|
|
|
/// </summary> |
|
|
|
@ -134,6 +139,9 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins |
|
|
|
|
x.IsPassLabel = x.IsPass == true ? "通过" : "不通过"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 查询 |
|
|
|
|
public override async Task<ServicePageResult<Ghrh_ResumeDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) |
|
|
|
|
{ |
|
|
|
|
var query = Db.Queryable<Ghrh_Resume>(); |
|
|
|
@ -424,6 +432,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins |
|
|
|
|
|
|
|
|
|
return list[0]; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 获取简历Tabs接口 |
|
|
|
|
public ServiceResult<List<ResumeViewTab>> QueryViewTab() |
|
|
|
@ -2153,9 +2162,11 @@ END"; |
|
|
|
|
await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer); |
|
|
|
|
await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer); |
|
|
|
|
|
|
|
|
|
await LogRecord(order.Id, "变更状态为:已发offer!"); |
|
|
|
|
//await LogRecord(order.Id, $"给【{entity.StaffName}】发送Offer!", id, null, "SendOffer"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var content = (await _ghrh_TemplateServices.Preview(id, templateId, extFields)).Data; |
|
|
|
|
|
|
|
|
|
#region 发送邮件 |
|
|
|
|
var mailOutbox = new Ghrs_MailOutbox(); |
|
|
|
|
mailOutbox.TOMail = entity.Email; |
|
|
|
@ -2208,6 +2219,18 @@ END"; |
|
|
|
|
} |
|
|
|
|
entity.OfferFileUrl = "/Advanced/files/pdf_files/" + fileName; |
|
|
|
|
await Update(entity, ["OfferFileUrl"]); |
|
|
|
|
|
|
|
|
|
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput() |
|
|
|
|
{ |
|
|
|
|
InterviewOrderId = order.Id, |
|
|
|
|
ResumeId = id, |
|
|
|
|
Source = "SendOffer", |
|
|
|
|
Reverse1 = entity.OfferFileUrl, |
|
|
|
|
UserId = App.User.ID, |
|
|
|
|
UserName = App.User.Name, |
|
|
|
|
RemarkSz = $"给【{entity.StaffName}】发送Offer!", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
|
@ -2363,7 +2386,7 @@ END"; |
|
|
|
|
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, "发起录用审批!"); |
|
|
|
|
await LogRecord(order.Id, "发起录用审批!", id, null, "ApplyOffer"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
|
@ -2891,7 +2914,6 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
path = "/Advanced" + path; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ServiceResult<string>.OprateSuccess(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2919,21 +2941,27 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 获取评估单表单信息 |
|
|
|
|
public async Task<ServiceResult<dynamic>> QueryAssessForm(long id) |
|
|
|
|
public async Task<ServiceResult<dynamic>> QueryAssessForm(long id, long? orderId = null) |
|
|
|
|
{ |
|
|
|
|
dynamic result = new ExpandoObject(); |
|
|
|
|
|
|
|
|
|
var entity = await base.QueryById(id); |
|
|
|
|
if (entity == null) |
|
|
|
|
return ServiceResult<dynamic>.OprateFailed("无效的简历ID!"); |
|
|
|
|
var order = new Ghrh_InterviewOrder(); |
|
|
|
|
if (orderId is null) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
|
order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); |
|
|
|
|
if (order == null) |
|
|
|
|
return ServiceResult<dynamic>.OprateFailed("无效的简历ID!"); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
order = await Db.Ado.SqlQuerySingleAsync<Ghrh_InterviewOrder>($"SELECT * from Ghrh_InterviewOrder where Id={orderId} "); |
|
|
|
|
|
|
|
|
|
var assessConfigs = new List<Ghrh_AssessConfigDto>(); |
|
|
|
|
|
|
|
|
|
var assess = await _ghrh_InterviewAssessServices.QuerySingle(x => x.OrderId == order.Id); |
|
|
|
|
var assess = await _ghrh_InterviewAssessServices.QuerySingle(x => x.OrderId == orderId); |
|
|
|
|
if (assess != null) |
|
|
|
|
assessConfigs = JsonHelper.JsonToObj<List<Ghrh_AssessConfigDto>>(assess.AssessFormContent); |
|
|
|
|
else |
|
|
|
@ -3510,6 +3538,58 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 AND C.Status = A.Status"; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 面试日志 |
|
|
|
|
public async Task<ServiceResult<List<ResumeLog>>> Log(long id) |
|
|
|
|
{ |
|
|
|
|
var logs = new List<ResumeLog>(); |
|
|
|
|
var sql = $"Select * from Ghrh_InterviewOrder where ResumeId='{id}' Order by CreateTime desc "; |
|
|
|
|
var orders = await Db.Ado.SqlQueryAsync<Ghrh_InterviewOrder>(sql); |
|
|
|
|
for (int i = 0; i < orders.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var items = new List<ResumeLogItem>(); |
|
|
|
|
var interviewLogs = await _ghrh_InterviewLogServices.Query(x => x.InterviewOrderId == orders[i].Id, "CreateTime asc"); |
|
|
|
|
for (int j = 0; j < interviewLogs.Count; j++) |
|
|
|
|
{ |
|
|
|
|
var interviewLog = interviewLogs[j]; |
|
|
|
|
var attachments = new List<Ghrs_Attachment>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (interviewLog.Source) |
|
|
|
|
{ |
|
|
|
|
case "Recommended": |
|
|
|
|
attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == interviewLog.InterviewOrderId.ObjToString()).ToListAsync(); |
|
|
|
|
break; |
|
|
|
|
case "ScheduleInterview": |
|
|
|
|
attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == interviewLog.InterviewRecordId.ObjToString()).ToListAsync(); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
items.Add(new ResumeLogItem() |
|
|
|
|
{ |
|
|
|
|
Time = interviewLog.CreateTime, |
|
|
|
|
Operator = interviewLog.UserName, |
|
|
|
|
Content = interviewLog.RemarkSz, |
|
|
|
|
Source = interviewLog.Source, |
|
|
|
|
Attachments = attachments, |
|
|
|
|
RequestId = interviewLog.Source == "Recommended" ? orders[i].RequestId : null |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
logs.Add(new ResumeLog() |
|
|
|
|
{ |
|
|
|
|
OrderId = orders[i].Id, |
|
|
|
|
FirstRecommendTime = orders[i].RecommendTime, |
|
|
|
|
Items = items |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ServiceResult<List<ResumeLog>>.OprateSuccess("查询成功!", logs); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 通用方法 |
|
|
|
|
/// <summary> |
|
|
|
|
/// 记录日志 |
|
|
|
|