From 1eaf30332bd68016b52efe205d20f9f65fcb4531 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 21 Nov 2024 09:11:41 +0800 Subject: [PATCH] =?UTF-8?q?ESS=E7=AB=AF=E6=9F=A5=E8=AF=A2=E9=9D=A2?= =?UTF-8?q?=E8=AF=95=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Ghrh/Ghrh_ResumeController.cs | 22 +-- .../Ghrh/Ghrh_ResumeServices.cs | 130 +++++++++++++++++- 2 files changed, 129 insertions(+), 23 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index a515f951..d05d7dff 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -393,27 +393,7 @@ public class Ghrh_ResumeController : BaseController> QueryESS([FromBody] QueryBody body) { - var condition = "1!=1"; - string status = DIC_INTERVIEW_ORDER_STATUS.HasRecommended; - switch (status) - { - //case DIC_INTERVIEW_ORDER_STATUS.HasRecommended://待筛选 - // condition = $"A.Status ='{DIC_INTERVIEW_ORDER_STATUS.HasRecommended}'"; - // break; - //case DIC_INTERVIEW_ORDER_STATUS.WaitAppointment://待预约 - // condition = $"Status ='{DIC_INTERVIEW_ORDER_STATUS.WaitAppointment}' "; - // break; - - //case "Fail"://不合适 - // condition = $"(A.Status ='{status}' OR Status ='{DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer}' OR Status ='{DIC_INTERVIEW_ORDER_STATUS.HasSendOffer}' OR Status ='{DIC_INTERVIEW_ORDER_STATUS.HasOffer}')"; - // break; - //case DIC_INTERVIEW_ORDER_STATUS.WaitInterview://待面试 - // condition = $"Status ='{DIC_INTERVIEW_ORDER_STATUS.WaitInterview}' "; - // break; - default: - condition = $"A.Status ='{status}' "; - break; - } + var condition = "1=1"; return await _service.QueryESS(body, condition); } #endregion diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index ba87b375..b7d4c6ce 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -1826,7 +1826,7 @@ END"; int? staffId = GetStaffId(); RefAsync totalCount = 0; var dt = DateTime.Now.Date; - string sql = @$"SELECT B.Id, + string sql = @$"SELECT C.Id, A.Id ResumeId, A.CreateBy, C.CreateTime, @@ -1920,13 +1920,139 @@ END"; FROM Ghrh_Resume A JOIN Ghrh_InterviewOrder B ON A.ID = B.ResumeId JOIN Ghrh_InterviewRecord C - ON B.ID = C.OrderId AND B.[Round] = C.[Round] + ON B.ID = C.OrderId + -- AND B.[Round] = C.[Round] WHERE A.IsEnable = 1 AND C.IsEnable = 1"; if (string.IsNullOrWhiteSpace(filter.orderBy)) filter.orderBy = "CreateTime ASC"; sql += $" AND C.StaffId={staffId}"; + + #region 处理查询条件 + //Expression> whereExpression = new Expression>(); + var whereExpression = Expressionable.Create(); + 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(value); + + switch (name) + { + case "WaitRecommend": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitRecommended}'"; + break; + case "HasRecommended": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasRecommended}'"; + break; + case "WaitAppointment": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitAppointment}'"; + break; + case "WaitInterview": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitInterview}'"; + break; + case "HasInterview": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}'"; + break; + case "WaitSendOffer": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer}'"; + break; + case "HasSendOffer": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasSendOffer}'"; + break; + case "HasOffer": + if (jsonParam.columnValue.ObjToInt() == 1) + sql += $"C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasOffer}'"; + break; + + case "SalaryPeriod": + case "Education": + case "ApplyStatus": + case "Gender": + //if (jsonParam.columnValue.IsNotEmptyOrNull()) + //{ + // var ids1 = JsonHelper.JsonToObj>(jsonParam.columnValue.ToString()); + // if (!ids1.Any(x => x == "NoFliter")) + // whereExpression.And(x => ids1.Contains(x.Education)); + //} + + if (jsonParam.columnValue != null) + { + var ids1 = JsonHelper.JsonToObj>(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>(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>(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 sql += " AND " + condition; if (filter.pageSize == 0) filter.pageSize = 10000;