From 4449debfe56d1653e0f271b264a610bee1afe4f6 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 6 Jan 2025 14:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=E9=9C=80=E6=B1=82=E6=B1=87?= =?UTF-8?q?=E6=80=BB=20=E5=BD=95=E7=94=A8=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrh/Ghrh_HumanRequestController.cs | 6 ++ .../Controllers/Ghrh/Ghrh_ResumeController.cs | 8 +++ .../Ghrh/IGhrh_HumanRequestServices.cs | 5 +- .../Ghrh/IGhrh_ResumeServices.cs | 2 + .../View/Ghrh/Ghrh_HumanRequest.Dto.View.cs | 4 ++ .../View/Ghrh/Ghrh_Resume.Dto.View.cs | 2 +- Tiobon.Core.Services/CommonServices.cs | 2 + .../Ghrh/Ghrh_HumanRequestServices.cs | 61 ++++++++++++++++- .../Ghrh/Ghrh_ResumeServices.cs | 68 +++++++++++++++++-- 9 files changed, 150 insertions(+), 8 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_HumanRequestController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_HumanRequestController.cs index bd6e643f..9e65aa7e 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_HumanRequestController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_HumanRequestController.cs @@ -29,6 +29,12 @@ public class Ghrh_HumanRequestController : BaseController> QueryFilterSummaryPage([FromBody] QueryBody body) + { + return await _service.QueryFilterSummaryPage(body); + } #endregion #region 状态修改 diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs index 7bd07a4d..ebbedffb 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ResumeController.cs @@ -554,4 +554,12 @@ public class Ghrh_ResumeController : BaseController> QueryWorkStationStatisticsChart(int langId) => await _service.QueryWorkStationStatisticsChart(langId); #endregion + + #region 录用名单 + [HttpPost, Route("QueryHireList")] + public async Task> QueryHireList([FromBody] QueryBody body) + { + return await _service.QueryHireList(body); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs index 6613ff73..4c2c616d 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs @@ -1,4 +1,5 @@ -using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Common; +using Tiobon.Core.IServices.BASE; using Tiobon.Core.Model; using Tiobon.Core.Model.Models; @@ -12,4 +13,6 @@ public interface IGhrh_HumanRequestServices : IBaseServices UpdateStatus(InsertGhrh_HumanRequestInput input, string status); Task> InsertByStatus(InsertGhrh_HumanRequestInput insertModel, string status); + + Task> QueryFilterSummaryPage(QueryBody filter); } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index 86c553b2..2bfa0e27 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -88,4 +88,6 @@ public interface IGhrh_ResumeServices : IBaseServices> QueryWorkstationInit(int langId , string menuName); Task> QueryWorkStationStatisticsChart(int langId = 1); + + Task> QueryHireList(QueryBody filter); } \ No newline at end of file diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_HumanRequest.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_HumanRequest.Dto.View.cs index ade5c67e..ea5ea774 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_HumanRequest.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_HumanRequest.Dto.View.cs @@ -127,5 +127,9 @@ public class Ghrh_HumanRequestDto : Ghrh_HumanRequest /// 经验要求 /// public List Experience { get; set; } + public int InCount { get; set; } + public int OutCount { get; set; } + public string Year { get; set; } + public string Month { get; set; } } diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs index 0a69a0d2..258a0323 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_Resume.Dto.View.cs @@ -186,7 +186,7 @@ public class Ghrh_ResumeDto : Ghrh_Resume /// 生日 /// public string Birthday1 { get; set; } - + public string Indate1 { get; set; } /// /// 录用公司 /// diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index a7691d45..d9583c77 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1810,7 +1810,9 @@ public partial class CommonServices : BaseServices>, ICommon // }); //} break; + case "F_InterviewHireList": case "F_OfferTemplate": + case "F_InterviewRequestSummary": toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD1YN"; toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs index 873a3e6a..8ccdc7c5 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs @@ -97,7 +97,11 @@ public class Ghrh_HumanRequestServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) { - var result = await base.QueryFilterPage(filter, $"dbo.[FUserDeptPriv] ({App.User.ID}, DeptId, getdate())=1", IsEnable); + if (condition.IsNotEmptyOrNull()) + condition += $" AND dbo.[FUserDeptPriv] ({App.User.ID}, DeptId, getdate())=1"; + else + condition = $"dbo.[FUserDeptPriv] ({App.User.ID}, DeptId, getdate())=1"; + var result = await base.QueryFilterPage(filter, condition, IsEnable); var entitys = result.result.DT_TableDataT1; var deptIds = entitys.Where(x => x.DeptId != null).Select(x => x.DeptId).ToList(); @@ -227,6 +231,61 @@ WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); result.result.DT_TableDataT1 = DT_TableDataT1; return result; } + public async Task> QueryFilterSummaryPage(QueryBody filter) + { + if (string.IsNullOrWhiteSpace(filter.orderBy)) + filter.orderBy = "YearMonth DESC"; + + if (filter.pageSize == 0) + filter.pageSize = 10000; + + Type entityType = typeof(Ghrh_InterviewOrder); + + var countSql = @$" SELECT COUNT(1) FROM Ghrh_HumanRequestSummary_V"; + var sql1 = @$"DECLARE @langId INT = {filter.langId};"; + var sql = @$" SELECT * + FROM Ghrh_HumanRequestSummary_V A"; + + string conditions = " WHERE 1=1 "; + + var properties = entityType.GetGenericProperties(); + + if (filter.jsonParam != null) + foreach (JProperty jProperty in filter.jsonParam.Properties()) + { + var name = jProperty.Name; + var value = jProperty.Value.ToString(); + if (name == "page" || name == "pageSize") + continue; + if (!string.IsNullOrWhiteSpace(value)) + conditions = DealConditions(conditions, name, value); + } + + sql += conditions; + countSql += conditions; + int total = await Db.Ado.GetIntAsync(countSql); + + sql = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + filter.orderBy + ") NUM FROM (SELECT * FROM (" + sql + " "; + sql += ") A ) B ) C"; + + sql += " WHERE NUM <= " + filter.pageNum * filter.pageSize + " AND NUM >" + (filter.pageNum - 1) * filter.pageSize; + sql = sql1 + sql; + var entitys = await Db.Ado.SqlQueryAsync(sql); + + var result = new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); + + var list = result.result.DT_TableDataT1; + var tagIds = new List(); + + tagIds = tagIds.Distinct().ToList(); + var tags = await Db.Queryable().Where(x => tagIds.Contains(x.Id)).ToListAsync(); + for (int i = 0; i < list.Count; i++) + { + + } + + return result; + } #endregion #region 更新 diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 9e6f644b..e0d801f5 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -134,6 +134,7 @@ public class Ghrh_ResumeServices : BaseServicesx.Status=="WaitInterview").FirstOrDefault()?.Count??0), new JProperty("Unit",peopleText), - new JProperty("MenuName","F_ESS_Candidate"), + new JProperty("MenuName","F_ESS_Interview"), new JProperty("TabKey","WaitInterview"), }; item = new JObject @@ -4400,12 +4401,12 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 { new JProperty("Count", sum), new JProperty("Unit",peopleText), - new JProperty("MenuName","F_ESS_Candidate"), + new JProperty("MenuName","F_ESS_Interview"), new JProperty("TabKey","HasInterview"), }; item = new JObject { - new JProperty("CanMore", 0), + new JProperty("CanMore", 1), new JProperty("ColNum", 6), new JProperty("RowNum", 0), new JProperty("Height", 17.2), @@ -4429,12 +4430,12 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 Detail = new JObject { new JProperty("Count", group1.Where(x=>x.Status=="HasOffer").FirstOrDefault()?.Count??0), new JProperty("Unit",peopleText), - new JProperty("MenuName","F_ESS_Candidate"), + new JProperty("MenuName","F_ESS_Hire"), new JProperty("TabKey","HasOffer"), }; item = new JObject { - new JProperty("CanMore", 0), + new JProperty("CanMore", 1), new JProperty("ColNum", 8), new JProperty("RowNum", 0), new JProperty("Height", 17.2), @@ -4688,6 +4689,63 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 } #endregion + #region 录用名单 + public async Task> QueryHireList(QueryBody filter) + { + if (string.IsNullOrWhiteSpace(filter.orderBy)) + filter.orderBy = "InDate DESC"; + + if (filter.pageSize == 0) + filter.pageSize = 10000; + + + var countSql = @$" SELECT COUNT(1) FROM Ghrh_ResumeHireList_V"; + var sql1 = @$"DECLARE @langId INT = {filter.langId};"; + var sql = @$" SELECT * + FROM Ghrh_ResumeHireList_V A"; + + string conditions = " WHERE 1=1 "; + + + if (filter.jsonParam != null) + foreach (JProperty jProperty in filter.jsonParam.Properties()) + { + var name = jProperty.Name; + var value = jProperty.Value.ToString(); + if (name == "page" || name == "pageSize") + continue; + if (!string.IsNullOrWhiteSpace(value)) + conditions = DealConditions(conditions, name, value); + } + + sql += conditions; + countSql += conditions; + int total = await Db.Ado.GetIntAsync(countSql); + + sql = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + filter.orderBy + ") NUM FROM (SELECT * FROM (" + sql + " "; + sql += ") A ) B ) C"; + + sql += " WHERE NUM <= " + filter.pageNum * filter.pageSize + " AND NUM >" + (filter.pageNum - 1) * filter.pageSize; + sql = sql1 + sql; + var entitys = await Db.Ado.SqlQueryAsync(sql); + + var result = new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); + + var list = result.result.DT_TableDataT1; + var tagIds = new List(); + + tagIds = tagIds.Distinct().ToList(); + var tags = await Db.Queryable().Where(x => tagIds.Contains(x.Id)).ToListAsync(); + for (int i = 0; i < list.Count; i++) + { + await SetLabel(list[i]); + } + + return result; + } + + #endregion + #region 通用方法 /// /// 记录日志