diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index a62a1e9f..6a790cb6 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -346,6 +346,20 @@ public class Ghrh_ResumeController : BaseController + /// 发offer + /// + /// 简历Id + /// Offer内容 + /// + [HttpPost, Route("SendOffer/{id}")] + public async Task SendOffer(long id, [FromBody] string content) + { + return await _service.SendOffer(id, content); + } + #endregion + #region 已发offer提醒 /// /// 已发offer提醒 diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs index 944cdf8d..80e8ce60 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs @@ -22,4 +22,22 @@ public class Ghrh_TemplateController : BaseController SwitchPublish(long id, int? isPublish) => await _service.SwitchPublish(id, isPublish); #endregion + + #region 查询Offer支持的字段 + /// + /// Offer支持的字段 + /// + /// + [HttpPost("QueryOfferTags")] + public async Task>> QueryOfferTags() => await _service.QueryOfferTags(); + #endregion + + #region 预览 + /// + /// Offer支持的字段 + /// + /// + [HttpPost("Preview/{resumeId}")] + public async Task> Preview(string resumeId) => await _service.Preview(resumeId); + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 599ac085..ea34056f 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -25760,6 +25760,51 @@ + + + 分组 + + + + + 字段 + + + + + 标签对应的描述 + + + + + 描述 + + + + + 字段 + + + + + 姓名 + + + + + 电话 + + + + + 邮箱 + + + + + 身份证号码 + + 修改信息 黄一名 于 2024-05-10 15:02 最后修改 diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 8483b36d..c72ef119 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1460,6 +1460,14 @@ 简历Id,列表 + + + 发offer + + 简历Id + Offer内容 + + 已发offer提醒 @@ -1650,6 +1658,26 @@ 招聘模板(Controller) + + + 是否开启 + + + + + + + + Offer支持的字段 + + + + + + Offer支持的字段 + + + 年度人力配置(Controller) diff --git a/Tiobon.Core.Common/Helper/StringHelper.cs b/Tiobon.Core.Common/Helper/StringHelper.cs index 1b73a8b8..4652985b 100644 --- a/Tiobon.Core.Common/Helper/StringHelper.cs +++ b/Tiobon.Core.Common/Helper/StringHelper.cs @@ -1,4 +1,6 @@ -using System.Text; +using System.ComponentModel; +using System.Reflection; +using System.Text; namespace Tiobon.Core.Common.Helper; @@ -232,4 +234,59 @@ public class StringHelper catch (Exception) { throw; } } #endregion + + #region 获取字段描述 + /// + /// 对象字段描述 + /// + private static Dictionary> m_FieldDesc = new Dictionary>(); + + /// + /// 获取字段的描述(描述 - 列名) + /// + /// + /// + public static Dictionary GetFieldDesc() + { + var type = typeof(T).ToString(); + lock (m_FieldDesc) + { + if (m_FieldDesc.ContainsKey(type)) + return m_FieldDesc[type]; + } + Dictionary dic = new Dictionary(); + try + { + PropertyInfo[] peroperties = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance); + if (peroperties != null) + { + foreach (PropertyInfo property in peroperties) + { + object[] objs = property.GetCustomAttributes(typeof(DescriptionAttribute), true); + if (objs.Length > 0) + { + var desc = ((DescriptionAttribute)objs[0]).Description.Trim(); + if (!dic.ContainsKey(desc)) + { + dic.Add(desc, property.Name); + } + else + { + dic[desc] = property.Name; + } + } + } + } + } + catch //(Exception ex) + { + } + lock (m_FieldDesc) + { + if (!m_FieldDesc.ContainsKey(type)) + m_FieldDesc.Add(type, dic); + } + return dic; + } + #endregion } diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index 5202a48e..b05450fe 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -53,6 +53,7 @@ public interface IGhrh_ResumeServices : IBaseServices ModifyInterviewer(long id, List InterviewStaffs); Task SendOffer(List ids); + Task SendOffer(long id, string content); Task RemindHasOffer(List ids); diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs index d1d7d8ab..685f81c0 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs @@ -10,4 +10,8 @@ namespace Tiobon.Core.IServices; public interface IGhrh_TemplateServices : IBaseServices { Task SwitchPublish(long id, int? isPublish); + + Task>> QueryOfferTags(); + + Task> Preview(string resumeId); } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Extend/CustomFieldView.cs b/Tiobon.Core.Model/ViewModels/Extend/CustomFieldView.cs new file mode 100644 index 00000000..b739583c --- /dev/null +++ b/Tiobon.Core.Model/ViewModels/Extend/CustomFieldView.cs @@ -0,0 +1,57 @@ +namespace Tiobon.Core.Model; + + +public class CustomFieldView +{ + /// + /// 分组 + /// + public string GroupName { get; set; } + /// + /// 字段 + /// + public List Fields { get; set; } +} + +/// +/// 标签对应的描述 +/// +public class ModelTagView2Item +{ + /// + /// 描述 + /// + public string Name { get; set; } + /// + /// 字段 + /// + public string Code { set; get; } +} + +public class OfferTemplate +{ + /// + /// 姓名 + /// + [Description("姓名")] + public string StaffName { get; set; } + + /// + /// 电话 + /// + [Description("电话")] + public string Mobile { get; set; } + + /// + /// 邮箱 + /// + [Description("邮箱")] + public string Email { get; set; } + + /// + /// 身份证号码 + /// + [Description("身份证号码")] + public string IdCardNo { get; set; } + +} \ No newline at end of file diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 93abe668..098cce08 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1729,6 +1729,8 @@ public partial class CommonServices : BaseServices>, ICommon if (toolbar != null) toolbar.fnKey = "TBD2YN"; toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD3YN"; + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault(); + if (toolbar != null) toolbar.fnKey = "TBD4YN"; break; } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 7e6666ac..067a87d2 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -1885,6 +1885,21 @@ END"; } return ServiceResult.OprateSuccess(); } + + public async Task SendOffer(long id, string content) + { + var entity = await base.QueryById(id); + if (entity == null) + return ServiceResult.OprateFailed("无效的简历ID!"); + + await UpdateResumeStatus(entity, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer); + var order = await _ghrh_InterviewOrderServices.QuerySingle(x => x.ResumeId == id); + await UpdateInterviewOrderStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer); + await UpdateInterviewRecordStatus(order, DIC_INTERVIEW_ORDER_STATUS.HasSendOffer); + + await LogRecord(order.Id, "变更状态为:已发offer!"); + return ServiceResult.OprateSuccess(); + } #endregion #region 已发offer提醒 diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs index 8796e418..ced70a8e 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs @@ -41,4 +41,29 @@ public class Ghrh_TemplateServices : BaseServices>> QueryOfferTags() + { + var list = new List() + { + new CustomFieldView { GroupName = "中文", Fields = StringHelper.GetFieldDesc().Select(o => new ModelTagView2Item { Name=o.Key,Code=o.Key}).ToList() }, + new CustomFieldView { GroupName = "英文", Fields = StringHelper.GetFieldDesc().Select(o => new ModelTagView2Item { Name=o.Value+"_EN",Code=o.Value+"_EN"}).ToList() }, + }; + return await Task.FromResult(ServiceResult>.OprateSuccess("查询成功!", list)); + } + #endregion + + #region 预览Offer简历 + public async Task> Preview(string resumeId) + { + var result = string.Empty; + var template = await base.QuerySingle(x => x.IsPublish == 1); + if (template != null) + { + result = template.TemplateContent; + } + return await Task.FromResult(ServiceResult.OprateSuccess("查询成功!", result)); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 599ac085..ea34056f 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -25760,6 +25760,51 @@ + + + 分组 + + + + + 字段 + + + + + 标签对应的描述 + + + + + 描述 + + + + + 字段 + + + + + 姓名 + + + + + 电话 + + + + + 邮箱 + + + + + 身份证号码 + + 修改信息 黄一名 于 2024-05-10 15:02 最后修改 diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 8483b36d..c72ef119 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1460,6 +1460,14 @@ 简历Id,列表 + + + 发offer + + 简历Id + Offer内容 + + 已发offer提醒 @@ -1650,6 +1658,26 @@ 招聘模板(Controller) + + + 是否开启 + + + + + + + + Offer支持的字段 + + + + + + Offer支持的字段 + + + 年度人力配置(Controller)