|
|
|
@ -18,19 +18,15 @@ public class Ghrh_TemplateServices : BaseServices<Ghrh_Template, Ghrh_TemplateDt |
|
|
|
|
#region 是否开启 |
|
|
|
|
public async Task<ServiceResult> SwitchPublish(long id, int? isPublish) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (isPublish == 0) |
|
|
|
|
return ServiceResult.OprateFailed("当前已开启状态 不可以取消!"); |
|
|
|
|
|
|
|
|
|
await Db.Updateable<Ghrh_Template>() |
|
|
|
|
.SetColumns(it => new Ghrh_Template() |
|
|
|
|
{ |
|
|
|
|
IsPublish = 0, |
|
|
|
|
UpdateBy = App.User.ID, |
|
|
|
|
UpdateTime = DateTime.Now |
|
|
|
|
}) |
|
|
|
|
.Where(it => it.IsPublish == 1) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
//await Db.Updateable<Ghrh_Template>() |
|
|
|
|
// .SetColumns(it => new Ghrh_Template() |
|
|
|
|
// { |
|
|
|
|
// IsPublish = 0, |
|
|
|
|
// UpdateBy = App.User.ID, |
|
|
|
|
// UpdateTime = DateTime.Now |
|
|
|
|
// }) |
|
|
|
|
// .Where(it => it.IsPublish == 1) |
|
|
|
|
// .ExecuteCommandAsync(); |
|
|
|
|
await Db.Updateable<Ghrh_Template>() |
|
|
|
|
.SetColumns(it => new Ghrh_Template() |
|
|
|
|
{ |
|
|
|
@ -95,11 +91,11 @@ public class Ghrh_TemplateServices : BaseServices<Ghrh_Template, Ghrh_TemplateDt |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 预览Offer简历 |
|
|
|
|
public async Task<ServiceResult<string>> Preview(long resumeId, Dictionary<string, string> extFields) |
|
|
|
|
public async Task<ServiceResult<string>> Preview(long resumeId, long templateId, Dictionary<string, string> extFields) |
|
|
|
|
{ |
|
|
|
|
var resume = await Db.Queryable<Ghrh_Resume>().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; |
|
|
|
|