|
|
|
@ -1,6 +1,11 @@ |
|
|
|
|
|
|
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
|
using SqlSugar; |
|
|
|
|
using System.Linq.Expressions; |
|
|
|
|
using Tiobon.Core.Common; |
|
|
|
|
using Tiobon.Core.Common.Caches; |
|
|
|
|
using Tiobon.Core.Common.Extensions; |
|
|
|
|
using Tiobon.Core.Common.Helper; |
|
|
|
|
using Tiobon.Core.IRepository.Base; |
|
|
|
|
using Tiobon.Core.IServices; |
|
|
|
@ -34,7 +39,114 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins |
|
|
|
|
|
|
|
|
|
public override async Task<ServicePageResult<Ghrh_ResumeDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) |
|
|
|
|
{ |
|
|
|
|
var result = await base.QueryFilterPage(filter, condition, IsEnable); |
|
|
|
|
var query = Db.Queryable<Ghrh_Resume>(); |
|
|
|
|
|
|
|
|
|
#region 处理查询条件 |
|
|
|
|
//Expression<Func<Ghrh_Resume, bool>> whereExpression = new Expression<Func<Ghrh_Resume, bool>>(); |
|
|
|
|
var whereExpression = Expressionable.Create<Ghrh_Resume>(); |
|
|
|
|
foreach (JProperty jProperty in filter.jsonParam.Properties()) |
|
|
|
|
{ |
|
|
|
|
var name = jProperty.Name; |
|
|
|
|
var value = jProperty.Value.ToString(); |
|
|
|
|
if (name == "page" || name == "pageSize") |
|
|
|
|
continue; |
|
|
|
|
if (value.IsNotEmptyOrNull()) |
|
|
|
|
{ |
|
|
|
|
var jsonParam = JsonHelper.JsonToObj<JsonParam>(value); |
|
|
|
|
|
|
|
|
|
switch (name) |
|
|
|
|
{ |
|
|
|
|
case "WaitRecommend": |
|
|
|
|
if (jsonParam.columnValue.ObjToInt() == 1) |
|
|
|
|
whereExpression.And(x => x.IsRecommend != true); |
|
|
|
|
break; |
|
|
|
|
case "HasRecommend": |
|
|
|
|
if (jsonParam.columnValue.ObjToInt() == 1) |
|
|
|
|
whereExpression.And(x => x.IsRecommend == true); |
|
|
|
|
break; |
|
|
|
|
case "SalaryPeriod": |
|
|
|
|
case "Education": |
|
|
|
|
case "ApplyStatus": |
|
|
|
|
case "Gender": |
|
|
|
|
//if (jsonParam.columnValue.IsNotEmptyOrNull()) |
|
|
|
|
//{ |
|
|
|
|
// var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString()); |
|
|
|
|
// if (!ids1.Any(x => x == "NoFliter")) |
|
|
|
|
// whereExpression.And(x => ids1.Contains(x.Education)); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
if (jsonParam.columnValue != null) |
|
|
|
|
{ |
|
|
|
|
var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString()); |
|
|
|
|
if (!ids1.Any(x => x == "NoFliter")) |
|
|
|
|
condition += $" AND {name} IN ({string.Join(",", ids1.Select(id => "'" + id + "'"))})"; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case "WorkYears": |
|
|
|
|
case "Age": |
|
|
|
|
if (jsonParam.columnValue.IsNotEmptyOrNull()) |
|
|
|
|
{ |
|
|
|
|
var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString()); |
|
|
|
|
if (!ids1.Any(x => x == "NoFliter")) |
|
|
|
|
{ |
|
|
|
|
var i = 0; |
|
|
|
|
condition += " AND ("; |
|
|
|
|
ids1.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
var arr = x.Split(['-']); |
|
|
|
|
if (i == 0) |
|
|
|
|
condition += $"({name} >= {arr[0]} AND {name} <={arr[1]})"; |
|
|
|
|
else |
|
|
|
|
condition += $" OR ({name} >= {arr[0]} AND {name} <={arr[1]})"; |
|
|
|
|
i++; |
|
|
|
|
}); |
|
|
|
|
condition += ")"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "Tags": |
|
|
|
|
if (jsonParam.columnValue.IsNotEmptyOrNull()) |
|
|
|
|
{ |
|
|
|
|
var ids1 = JsonHelper.JsonToObj<List<string>>(jsonParam.columnValue.ToString()); |
|
|
|
|
if (!ids1.Any(x => x == "NoFliter")) |
|
|
|
|
{ |
|
|
|
|
var i = 0; |
|
|
|
|
condition += " AND ("; |
|
|
|
|
ids1.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
var arr = x.Split(['-']); |
|
|
|
|
if (i == 0) |
|
|
|
|
condition += $"({name} like '%{x}%')"; |
|
|
|
|
else |
|
|
|
|
condition += $" OR ({name} like '%{x}%')"; |
|
|
|
|
i++; |
|
|
|
|
}); |
|
|
|
|
condition += ")"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "Keywords": |
|
|
|
|
if (jsonParam.columnValue.IsNotEmptyOrNull()) |
|
|
|
|
whereExpression.And(x => (x.StaffName.Contains(jsonParam.columnValue.ToString()) || |
|
|
|
|
x.StaffEname.Contains(jsonParam.columnValue.ToString()) || |
|
|
|
|
x.Tags.Contains(jsonParam.columnValue.ToString()) || |
|
|
|
|
x.RemarkSz.Contains(jsonParam.columnValue.ToString()) || |
|
|
|
|
x.School.Contains(jsonParam.columnValue.ToString()))); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
RefAsync<int> total = 0; |
|
|
|
|
var entitys = await query |
|
|
|
|
.WhereIF(condition.IsNotEmptyOrNull(), condition) |
|
|
|
|
.Where(whereExpression.ToExpression()) |
|
|
|
|
.ToPageListAsync(filter.pageNum, filter.pageSize, total); |
|
|
|
|
var result = new ServicePageResult<Ghrh_ResumeDto>(filter.pageNum, total, filter.pageSize, Mapper.Map(entitys).ToANew<List<Ghrh_ResumeDto>>()); |
|
|
|
|
var list = result.result.DT_TableDataT1; |
|
|
|
|
var ids = list.Select(x => x.Id).ToList(); |
|
|
|
|
var titleIds = list.Where(x => x.TitleId != null).Select(x => x.TitleId.Value).Distinct().ToList(); |
|
|
|
@ -85,7 +197,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins |
|
|
|
|
#region 获取查询条件 |
|
|
|
|
public async Task<ServiceResult<List<ResumeCondition>>> QueryConditions() |
|
|
|
|
{ |
|
|
|
|
string str = "[\r\n\t{\r\n\t\t\"Key\": \"Education\",\r\n\t\t\"Name\": \"学历要求\",\r\n\t\t\"ParaMasterNo\": \"EducationalBGLevel\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"WorkYears\",\r\n\t\t\"Name\": \"经验要求\",\r\n\t\t\"ParaMasterNo\": \"EducationalBGLevel\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Age\",\r\n\t\t\"Name\": \"年龄要求\",\r\n\t\t\"ParaMasterNo\": \"AgePeriodSetup\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Gender\",\r\n\t\t\"Name\": \"性 别\",\r\n\t\t\"ParaMasterNo\": \"Gender\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"SalaryPeriod\",\r\n\t\t\"Name\": \"薪资区间\",\r\n\t\t\"ParaMasterNo\": \"SalaryPeriodSetup\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"ApplyStatus\",\r\n\t\t\"Name\": \"求职状态\",\r\n\t\t\"ParaMasterNo\": \"ResumeApplyStatus\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Tags\",\r\n\t\t\"Name\": \"标签\",\r\n\t\t\"ParaMasterNo\": \"ResumeTag\"\r\n\t}\r\n]"; |
|
|
|
|
string str = "[\r\n\t{\r\n\t\t\"Key\": \"Education\",\r\n\t\t\"Name\": \"学历要求\",\r\n\t\t\"ParaMasterNo\": \"EducationalBGLevel\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"WorkYears\",\r\n\t\t\"Name\": \"经验要求\",\r\n\t\t\"ParaMasterNo\": \"ResumeWorkYears\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Age\",\r\n\t\t\"Name\": \"年龄要求\",\r\n\t\t\"ParaMasterNo\": \"AgePeriodSetup\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Gender\",\r\n\t\t\"Name\": \"性 别\",\r\n\t\t\"ParaMasterNo\": \"Gender\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"SalaryPeriod\",\r\n\t\t\"Name\": \"薪资区间\",\r\n\t\t\"ParaMasterNo\": \"SalaryPeriodSetup\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"ApplyStatus\",\r\n\t\t\"Name\": \"求职状态\",\r\n\t\t\"ParaMasterNo\": \"ResumeApplyStatus\"\r\n\t},\r\n\t{\r\n\t\t\"Key\": \"Tags\",\r\n\t\t\"Name\": \"标签\",\r\n\t\t\"ParaMasterNo\": \"ResumeTag\"\r\n\t}\r\n]"; |
|
|
|
|
var tabs = JsonHelper.JsonToObj<List<ResumeCondition>>(str); |
|
|
|
|
|
|
|
|
|
tabs.ForEach(async x => |
|
|
|
|