diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index b99d2c17..b7e701c0 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -353,11 +353,12 @@ public class Ghrh_ResumeController : BaseController /// 简历Id /// 扩展栏位 + /// 扩展栏位 /// - [HttpPost, Route("SendOffer/{id}")] - public async Task SendOffer(long id, [FromBody] Dictionary extFields) + [HttpPost, Route("SendOffer/{id}/{templateId}")] + public async Task SendOffer(long id, long templateId, [FromBody] Dictionary extFields) { - return await _service.SendOffer(id, extFields); + return await _service.SendOffer(id, templateId, extFields); } #endregion diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs index 22aa0dbc..1692ee82 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_TemplateController.cs @@ -34,10 +34,13 @@ public class Ghrh_TemplateController : BaseController - /// Offer支持的字段 + /// 预览Offer /// + /// 简历Id + /// 模板ID + /// 扩展字段 /// - [HttpPost("Preview/{resumeId}")] - public async Task> Preview(long resumeId, Dictionary extFields) => await _service.Preview(resumeId, extFields); + [HttpPost("Preview/{resumeId}/{templateId}")] + public async Task> Preview(long resumeId, long templateId, Dictionary extFields) => await _service.Preview(resumeId, templateId, extFields); #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index a9b64c5c..d41d571f 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1498,12 +1498,13 @@ 简历Id,列表 - + 发offer 简历Id 扩展栏位 + 扩展栏位 @@ -1710,10 +1711,13 @@ - + - Offer支持的字段 + 预览Offer + 简历Id + 模板ID + 扩展字段 diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index 62957604..f4a60745 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -53,7 +53,7 @@ public interface IGhrh_ResumeServices : IBaseServices ModifyInterviewer(long id, List InterviewStaffs); Task SendOffer(List ids); - Task SendOffer(long id, Dictionary extFields); + Task SendOffer(long id, long templateId, Dictionary extFields); Task RemindHasOffer(List ids); diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs index 1390c2c3..3e5c0ee3 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs @@ -13,5 +13,5 @@ public interface IGhrh_TemplateServices : IBaseServices>> QueryOfferTags(); - Task> Preview(long resumeId, Dictionary extFields); + Task> Preview(long resumeId, long templateId, Dictionary extFields); } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 2382938f..2de8fe57 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -353,7 +353,7 @@ public class Ghrh_ResumeServices : BaseServices x.ResumeId == x.ResumeId)) + if (applyOrders.Any(o => o.ResumeId == x.ResumeId)) x.OfferApplyExist = true; } if (x.Status == DIC_INTERVIEW_ORDER_STATUS.HasSendOffer) @@ -2073,7 +2073,7 @@ END"; return ServiceResult.OprateSuccess(); } - public async Task SendOffer(long id, Dictionary extFields) + public async Task SendOffer(long id, long templateId, Dictionary extFields) { var entity = await base.QueryById(id); if (entity == null) @@ -2089,7 +2089,7 @@ END"; await LogRecord(order.Id, "变更状态为:已发offer!"); - var content = (await _ghrh_TemplateServices.Preview(id, extFields)).Data; + var content = (await _ghrh_TemplateServices.Preview(id, templateId, extFields)).Data; #region 发送邮件 var mailOutbox = new Ghrs_MailOutbox(); mailOutbox.TOMail = entity.Email; diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs index d2754430..76c1f4a2 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_TemplateServices.cs @@ -18,19 +18,15 @@ public class Ghrh_TemplateServices : BaseServices SwitchPublish(long id, int? isPublish) { - - if (isPublish == 0) - return ServiceResult.OprateFailed("当前已开启状态 不可以取消!"); - - await Db.Updateable() - .SetColumns(it => new Ghrh_Template() - { - IsPublish = 0, - UpdateBy = App.User.ID, - UpdateTime = DateTime.Now - }) - .Where(it => it.IsPublish == 1) - .ExecuteCommandAsync(); + //await Db.Updateable() + // .SetColumns(it => new Ghrh_Template() + // { + // IsPublish = 0, + // UpdateBy = App.User.ID, + // UpdateTime = DateTime.Now + // }) + // .Where(it => it.IsPublish == 1) + // .ExecuteCommandAsync(); await Db.Updateable() .SetColumns(it => new Ghrh_Template() { @@ -95,11 +91,11 @@ public class Ghrh_TemplateServices : BaseServices> Preview(long resumeId, Dictionary extFields) + public async Task> Preview(long resumeId, long templateId, Dictionary extFields) { var resume = await Db.Queryable().Where(x => x.Id == resumeId).SingleAsync(); var result = string.Empty; - var template = await base.QuerySingle(x => x.IsPublish == 1); + var template = await base.QuerySingle(x => x.Id == templateId); if (template != null) { result = template.TemplateContent; diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index a9b64c5c..d41d571f 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1498,12 +1498,13 @@ 简历Id,列表 - + 发offer 简历Id 扩展栏位 + 扩展栏位 @@ -1710,10 +1711,13 @@ - + - Offer支持的字段 + 预览Offer + 简历Id + 模板ID + 扩展字段