From 0d79772a79a766fe6daf372ef71f495e57c0035a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 26 Dec 2024 16:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Tiobon.Web.pdm | 6 +- Tiobon.Core.Api/Tiobon.Core.Model.xml | 15 ++++ .../Base/Ghrh/Ghrh_HumanRequest.Dto.Base.cs | 8 ++- .../Models/Ghrh/Ghrh_HumanRequest.cs | 8 ++- .../View/Ghrh/Ghrh_InterviewOrder.Dto.View.cs | 6 ++ Tiobon.Core.Services/CommonServices.cs | 1 + .../Ghrh/Ghrh_HumanRequestServices.cs | 7 +- .../Ghrh/Ghrh_InterviewOrderServices.cs | 71 +++++++++++++++++-- Tiobon.Core/Tiobon.Core.Model.xml | 15 ++++ 9 files changed, 126 insertions(+), 11 deletions(-) diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index 60690f8a..0abf5414 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -39732,10 +39732,10 @@ Ghra_staff_InsureBase D828CE04-9FAE-40AF-9BFA-40C4C105CD12 订单号 -OrderNo +RequestNo 1735198505 Administrator -1735198582 +1735199244 Administrator 订单号 nvarchar(32) diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 4147abef..632b4437 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -7185,6 +7185,11 @@ 预留字段12 + + + 订单号 + + 人力需求维护明细 (Dto.Base) @@ -20846,6 +20851,11 @@ 预留字段12 + + + 订单号 + + 人力需求维护明细 (Model) @@ -28042,6 +28052,11 @@ 状态 + + + 需求单号 + + 面试记录(Dto.View1) diff --git a/Tiobon.Core.Model/Base/Ghrh/Ghrh_HumanRequest.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrh/Ghrh_HumanRequest.Dto.Base.cs index 072ce744..45c271f7 100644 --- a/Tiobon.Core.Model/Base/Ghrh/Ghrh_HumanRequest.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghrh/Ghrh_HumanRequest.Dto.Base.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/12/19 11:14:16 SimonHsiao 初版 +*V0.01 2024/12/26 15:37:27 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -322,4 +322,10 @@ public class Ghrh_HumanRequestBase /// 预留字段12 /// public int? ReverseI2 { get; set; } + + /// + /// 订单号 + /// + [Display(Name = "RequestNo"), Description("订单号"), MaxLength(32, ErrorMessage = "订单号 不能超过 32 个字符")] + public string RequestNo { get; set; } } diff --git a/Tiobon.Core.Model/Models/Ghrh/Ghrh_HumanRequest.cs b/Tiobon.Core.Model/Models/Ghrh/Ghrh_HumanRequest.cs index 8cd6c210..8c2dcefa 100644 --- a/Tiobon.Core.Model/Models/Ghrh/Ghrh_HumanRequest.cs +++ b/Tiobon.Core.Model/Models/Ghrh/Ghrh_HumanRequest.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/12/19 11:14:16 SimonHsiao 初版 +*V0.01 2024/12/26 15:37:27 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -323,4 +323,10 @@ public class Ghrh_HumanRequest : BasePoco /// 预留字段12 /// public int? ReverseI2 { get; set; } + + /// + /// 订单号 + /// + [Display(Name = "RequestNo"), Description("订单号"), MaxLength(32, ErrorMessage = "订单号 不能超过 32 个字符")] + public string RequestNo { get; set; } } diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_InterviewOrder.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_InterviewOrder.Dto.View.cs index 6ea34693..7861a84f 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_InterviewOrder.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_InterviewOrder.Dto.View.cs @@ -86,4 +86,10 @@ public class Ghrh_InterviewOrderDto : Ghrh_InterviewOrder /// 状态 /// public string StatusLabel { get; set; } + + /// + /// 需求单号 + /// + public string RequestNo { get; set; } + } diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 4eb3db02..7c95cb94 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -3635,6 +3635,7 @@ public partial class CommonServices : BaseServices>, ICommon dict.Status = "WaitConfirm"; #endregion dict.ApplicantId = GetStaffId(); + dict.RequestNo = await GenerateContinuousSequence("Ghrh_HumanRequest", "RequestNo", "R"); id = await Db.Insertable(dict).ExecuteReturnSnowflakeIdAsync(); sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghrh_HumanRequest WHERE Id !='{id}'"; diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs index f5fbf505..bb743bbb 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs @@ -46,9 +46,9 @@ public class Ghrh_HumanRequestServices : BaseServices Add(InsertGhrh_HumanRequestInput entity) { entity.ApplicantId = GetStaffId(); - + entity.RequestNo = await GenerateContinuousSequence("Ghrh_HumanRequest", "RequestNo", "R"); var id = await base.Add(entity); - + var sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghrh_HumanRequest WHERE Id !='{id}'"; var id1 = await Db.Ado.GetLongAsync(sql); sql = $"UPDATE Ghrh_HumanRequest SET Id={id1} WHERE Id ='{id}'"; @@ -164,6 +164,9 @@ FROM Ghrh_YearHumanSettings A LEFT JOIN Ghra_Title B ON A.TitleId = B.TitleID LEFT JOIN Ghra_Job C ON A.JobId = C.JobID WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); + + if (entitys[i].WorkNo.IsNotEmptyOrNull()) + entitys[i].RequestNo = entitys[i].WorkNo; } var userIds = entitys.Where(x => x.RefuseUserId != null).Select(x => x.RefuseUserId).Distinct().ToList(); userIds.AddRange(entitys.Where(x => x.AgreeUserId != null).Select(x => x.AgreeUserId).Distinct()); diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_InterviewOrderServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_InterviewOrderServices.cs index 05e15548..650deb6a 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_InterviewOrderServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_InterviewOrderServices.cs @@ -62,13 +62,70 @@ public class Ghrh_InterviewOrderServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) { - var result = await base.QueryFilterPage(filter, condition, null); + if (string.IsNullOrWhiteSpace(filter.orderBy)) + filter.orderBy = "CreateTime1 DESC"; + + if (filter.pageSize == 0) + filter.pageSize = 10000; + + Type entityType = typeof(Ghrh_InterviewOrder); + + var countSql = @$" SELECT COUNT(1) FROM {entityType.GetEntityTableName()}"; + var sql1 = @$"DECLARE @langId INT = {filter.langId};"; + var sql = @$" SELECT *, + ISNULL ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END + FROM Ghrs_User B + WHERE B.UserId = A.CreateBy), + '') CreateDataInfo, + ISNULL ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END + FROM Ghrs_User B + WHERE B.UserId = A.UpdateBy), + '') UpdateDataInfo, ISNULL(A.UpdateTime, A.CreateTime) CreateTime1 + FROM {entityType.GetEntityTableName()} A"; + + string conditions = " WHERE 1=1 "; + + //if (IsEnable == true) + // conditions += " AND IsEnable = 1"; + //else if (IsEnable == false) + // conditions += " AND IsEnable = 0"; + + if (!string.IsNullOrWhiteSpace(condition)) + conditions += " AND " + condition; + + 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" || !properties.Any(x => x.Name == name)) + 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 resumeIds = list.Where(x => x.ResumeId != null).Select(x => x.ResumeId).ToList(); + var requestIds = list.Where(x => x.RequestId != null).Select(x => x.RequestId).ToList(); var resumes = await Db.Queryable().Where(x => resumeIds.Contains(x.Id)).ToListAsync(); + var requests = await Db.Queryable().Where(x => requestIds.Contains(x.Id)).ToListAsync(); var titleIds = resumes.Where(x => x.TitleId != null).Select(x => x.TitleId.Value).Distinct().ToList(); var titles = await Db.Queryable().Where(x => x.TitleID != null && titleIds.Contains(x.TitleID.Value)).ToListAsync(); var tagIds = new List(); @@ -117,18 +174,24 @@ public class Ghrh_InterviewOrderServices : BaseServices x.Id == entity.RequestId).FirstOrDefault(); + entity.RequestNo = request.RequestNo; + } } return result; diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 4147abef..632b4437 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -7185,6 +7185,11 @@ 预留字段12 + + + 订单号 + + 人力需求维护明细 (Dto.Base) @@ -20846,6 +20851,11 @@ 预留字段12 + + + 订单号 + + 人力需求维护明细 (Model) @@ -28042,6 +28052,11 @@ 状态 + + + 需求单号 + + 面试记录(Dto.View1)