From 2deb67daea7b0e069ef976512b4555957f318681 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 12 Sep 2024 14:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Tiobon.Web.pdm | 170 ++++++++++++------ .../Ghre/Ghre_RequestController.cs | 4 +- Tiobon.Core.Api/Tiobon.Core.Model.xml | 60 +++++++ .../Ghre/IGhre_RequestServices.cs | 2 +- .../Base/Ghre/Ghre_Request.Dto.Base.cs | 34 +++- .../Ghre/Ghre_Request.Dto.InsertInput.cs | 1 + Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs | 36 +++- .../View/Ghre/Ghre_Request.Dto.View.cs | 7 +- .../Ghre/Ghre_RequestServices.cs | 40 ++++- Tiobon.Core/Tiobon.Core.Model.xml | 60 +++++++ 10 files changed, 352 insertions(+), 62 deletions(-) diff --git a/Model/Tiobon.Web.pdm b/Model/Tiobon.Web.pdm index 8255d564..37637d35 100644 --- a/Model/Tiobon.Web.pdm +++ b/Model/Tiobon.Web.pdm @@ -1,5 +1,5 @@ - + @@ -104591,7 +104591,7 @@ CheckRequested=Yes SystemManager11 1713342619 Administrator -1725949523 +1726118240 Administrator [DisplayPreferences] @@ -123189,7 +123189,7 @@ LABL 0 Arial Unicode MS,8,N Ghre_Request 1725601887 Administrator -1725949495 +1726118109 Administrator 培训需求 @@ -123701,6 +123701,74 @@ LABL 0 Arial Unicode MS,8,N 2000 +9962AE20-8143-49FE-AF4E-1D9285089331 +同意人 +AgreeUserId +1726107836 +Administrator +1726118231 +Administrator +同意人 +bigint + + +6F7B9F42-3721-4BDB-97B2-6C57CF5D0B74 +同意时间 +AgreeTime +1726107836 +Administrator +1726118231 +Administrator +同意时间 +datetime + + +519A31E4-44FB-439A-926C-F164E9224204 +同意理由 +AgreeReason +1726107836 +Administrator +1726118231 +Administrator +同意理由 +nvarchar(2000) +2000 + + +BADAFBF4-2C0F-4EAA-B8A5-B34FB40E171F +拒绝人 +RefuseUserId +1726107836 +Administrator +1726118200 +Administrator +拒绝人 +bigint + + +63390978-FC60-4F8F-8997-1AC99FE68CA3 +拒绝时间 +RefuseTime +1726107836 +Administrator +1726118200 +Administrator +拒绝时间 +datetime + + +A58C50B5-829E-468A-8093-5B404F2BD040 +拒绝理由 +RefuseReason +1726107836 +Administrator +1726118200 +Administrator +拒绝理由 +nvarchar(2000) +2000 + + EADE602A-E3DB-4538-9DC6-F3E7E35AA914 预留字段1 Reverse1 @@ -123712,7 +123780,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 64A9C288-7C6E-41DE-B71B-6E45A636FFDC 预留字段2 Reverse2 @@ -123724,7 +123792,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 1EF93DDC-749A-494B-AE41-EB5383983DEA 预留字段3 Reverse3 @@ -123736,7 +123804,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 79BCAF24-90F1-4D18-BB23-5F79ABBABF49 预留字段4 Reverse4 @@ -123748,7 +123816,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + B31BA803-5B42-4852-B99B-F71E4FB05E68 预留字段5 Reverse5 @@ -123760,7 +123828,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 2DF2FAC6-C04C-4E02-9475-D85588C730CA 预留字段6 Reverse6 @@ -123772,7 +123840,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + B2DD1AAE-02D8-4C52-A54F-EAA20D26116E 预留字段7 Reverse7 @@ -123784,7 +123852,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 9C65DF57-2D56-4B14-9071-42B0AB2F3064 预留字段8 Reverse8 @@ -123796,7 +123864,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 2B14DC76-7D19-4A76-A34B-B191511EFA74 预留字段9 Reverse9 @@ -123808,7 +123876,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 0A8DC580-6DF2-457C-8A23-9B28825CEB36 预留字段10 Reverse10 @@ -123820,7 +123888,7 @@ LABL 0 Arial Unicode MS,8,N nvarchar(1000) 1000 - + 7631A223-D8AD-4EDD-8E48-8B32F4966A94 预留字段I1 ReverseI1 @@ -123832,7 +123900,7 @@ LABL 0 Arial Unicode MS,8,N 0 int - + 332CDAB6-C6CC-48BB-A1DE-1E3352BD3BFF 预留字段I2 ReverseI2 @@ -123846,7 +123914,7 @@ LABL 0 Arial Unicode MS,8,N - + 081CBB58-53E2-472A-8704-04FF1B29D1E6 Key_1 Key_1 @@ -123860,10 +123928,10 @@ LABL 0 Arial Unicode MS,8,N - + - + @@ -123887,7 +123955,7 @@ LABL 0 Arial Unicode MS,8,N - + 7F0DCA7C-274D-48A8-B3D8-0FD7B707AFC2 1714101292 Administrator @@ -123921,7 +123989,7 @@ LABL 0 Arial Unicode MS,8,N - + D23C452C-4BB6-4C2A-AB2E-E8434D958A77 1714101335 Administrator @@ -123955,7 +124023,7 @@ LABL 0 Arial Unicode MS,8,N - + D4016F9D-5631-4F9E-A70D-D42133A4EBB7 1714107872 Administrator @@ -123989,7 +124057,7 @@ LABL 0 Arial Unicode MS,8,N - + BEBA3346-CCC6-41D9-B95B-12B8F81188BF 1714108449 Administrator @@ -124023,7 +124091,7 @@ LABL 0 Arial Unicode MS,8,N - + FC69BEF9-F863-4A65-903E-CB2850197526 1714109221 Administrator @@ -124057,7 +124125,7 @@ LABL 0 Arial Unicode MS,8,N - + ACE0AB02-0D27-4F1C-BF71-738C20DF96C2 1714120556 Administrator @@ -124091,7 +124159,7 @@ LABL 0 Arial Unicode MS,8,N - + B95672ED-9976-4742-9FFC-52B326620682 1715565535 Administrator @@ -124125,7 +124193,7 @@ LABL 0 Arial Unicode MS,8,N - + B6E89235-A6E0-460D-9228-DCA8C58EE2AD 1715570661 Administrator @@ -124159,7 +124227,7 @@ LABL 0 Arial Unicode MS,8,N - + 5D4938F3-7934-4F74-891C-97DC9DC47B1B 1716798640 Administrator @@ -124193,7 +124261,7 @@ LABL 0 Arial Unicode MS,8,N - + 179079CB-7169-4B19-A07A-A61C331F59CD 1716876897 Administrator @@ -124227,7 +124295,7 @@ LABL 0 Arial Unicode MS,8,N - + DD965546-2361-4301-82D7-446B823BDCFD 1717481682 Administrator @@ -124261,7 +124329,7 @@ LABL 0 Arial Unicode MS,8,N - + E78B14FB-C2C3-4DCA-A3B4-CA471817B9FC 1717726229 Administrator @@ -124295,7 +124363,7 @@ LABL 0 Arial Unicode MS,8,N - + 8C71D6B9-780B-4547-ADFD-986E619F4DCD 1719381914 Administrator @@ -124329,7 +124397,7 @@ LABL 0 Arial Unicode MS,8,N - + EB9D1A5A-99AB-44AD-9B1A-D45E66C0CFDE 1719468257 Administrator @@ -124363,7 +124431,7 @@ LABL 0 Arial Unicode MS,8,N - + ACF1454B-2C3F-40E5-ADC5-4A48787EB937 1720488320 Administrator @@ -124397,7 +124465,7 @@ LABL 0 Arial Unicode MS,8,N - + 55351100-6B8C-411A-838F-ADF17D7249C7 1721372650 Administrator @@ -124431,7 +124499,7 @@ LABL 0 Arial Unicode MS,8,N - + CE1833FA-A783-4FAC-87BF-AA0FF8008532 1721280283 Administrator @@ -124465,7 +124533,7 @@ LABL 0 Arial Unicode MS,8,N - + 18F2EFF3-BD41-4F96-96C8-D8B15C7E2644 1721372603 Administrator @@ -124499,7 +124567,7 @@ LABL 0 Arial Unicode MS,8,N - + F7ECB7BC-BA8B-4606-B521-999C20FD5C43 1722318917 Administrator @@ -124521,7 +124589,7 @@ LABL 0 Arial Unicode MS,8,N - + A1DD77B6-E48E-4C9D-947D-D42E3C5240C2 dbo dbo @@ -124534,7 +124602,7 @@ LABL 0 Arial Unicode MS,8,N - + C012A467-0031-4F3C-9D9D-13408491E147 DefaultSchema 1597196432 @@ -124542,12 +124610,12 @@ LABL 0 Arial Unicode MS,8,N 1597196433 ttsoftxch - + - + 41D2B655-5319-49C5-9BA6-133BB8B097CA dbo dbo @@ -124559,7 +124627,7 @@ LABL 0 Arial Unicode MS,8,N - + 2153E033-C4DC-4F90-B2F4-3B0F44BD33D5 文本 TEXT @@ -124569,7 +124637,7 @@ LABL 0 Arial Unicode MS,8,N ttsoftxch text - + AC8799D0-82CA-4B70-ADAC-18D8797720A9 图片 IMAGE @@ -124579,7 +124647,7 @@ LABL 0 Arial Unicode MS,8,N Administrator image - + DEC04470-B84A-413E-9B2A-C265C5506182 加密 ENCRYPT_STRING @@ -124647,7 +124715,7 @@ LABL 0 Arial Unicode MS,8,N varchar(4000) 4000 - + 703A2917-B6C4-4BC6-B2CB-6AB8E2B49D30 短字符串 SHORT_STRING @@ -124658,7 +124726,7 @@ LABL 0 Arial Unicode MS,8,N varchar(64) 64 - + 89A476D2-A1C0-428C-9875-26A50B7AFE1A 长字符串 LONG_STRING @@ -124680,7 +124748,7 @@ LABL 0 Arial Unicode MS,8,N varchar(2000) 2000 - + @@ -124758,7 +124826,7 @@ LABL 0 Arial Unicode MS,8,N varchar(32) 32 - + CB2F08D6-BE17-4046-B94A-4FD00EDA9015 文件 FILE @@ -124781,7 +124849,7 @@ LABL 0 Arial Unicode MS,8,N - + B41C21E8-76E9-4031-8EF0-34743E5525C5 PUBLIC PUBLIC @@ -124790,13 +124858,13 @@ LABL 0 Arial Unicode MS,8,N 1597196433 ttsoftxch - - + + - + 02EF92C9-49BF-45C7-934A-23BA290D5595 Microsoft SQL Server 2008 MSSQLSRV2008 diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_RequestController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_RequestController.cs index 3bd0cc51..32966369 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_RequestController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_RequestController.cs @@ -31,9 +31,9 @@ public class Ghre_RequestController : BaseController UpdateStatus(string status, [FromBody] long[] ids) + public async Task UpdateStatus(string status, [FromBody] InsertGhre_RequestInput input) { - return await _service.UpdateStatus(ids, status); + return await _service.UpdateStatus(input, status); } #endregion diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 7a539e0a..a0db92b3 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -4105,6 +4105,36 @@ ConfirmComment + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 预留字段1 @@ -11066,6 +11096,36 @@ ConfirmComment + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 预留字段1 diff --git a/Tiobon.Core.IServices/Ghre/IGhre_RequestServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_RequestServices.cs index a2470599..80cff99e 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_RequestServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_RequestServices.cs @@ -9,7 +9,7 @@ namespace Tiobon.Core.IServices; /// public interface IGhre_RequestServices : IBaseServices { - Task UpdateStatus(long[] ids, string status); + Task UpdateStatus(InsertGhre_RequestInput input, string status); Task> InsertByStatus(InsertGhre_RequestInput insertModel, string status); } \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs index 7a0ff2bd..5f1ca259 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/9/10 14:28:24 SimonHsiao 初版 +*V0.01 2024/9/12 13:18:47 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -196,6 +196,38 @@ namespace Tiobon.Core.Model.Models [Display(Name = "ConfirmComment"), Description("ConfirmComment"), MaxLength(2000, ErrorMessage = "ConfirmComment 不能超过 2000 个字符")] public string ConfirmComment { get; set; } + /// + /// 同意人 + /// + public long? AgreeUserId { get; set; } + + /// + /// 同意时间 + /// + public DateTime? AgreeTime { get; set; } + + /// + /// 同意理由 + /// + [Display(Name = "AgreeReason"), Description("同意理由"), MaxLength(2000, ErrorMessage = "同意理由 不能超过 2000 个字符")] + public string AgreeReason { get; set; } + + /// + /// 拒绝人 + /// + public long? RefuseUserId { get; set; } + + /// + /// 拒绝时间 + /// + public DateTime? RefuseTime { get; set; } + + /// + /// 拒绝理由 + /// + [Display(Name = "RefuseReason"), Description("拒绝理由"), MaxLength(2000, ErrorMessage = "拒绝理由 不能超过 2000 个字符")] + public string RefuseReason { get; set; } + /// /// 预留字段1 /// diff --git a/Tiobon.Core.Model/Insert/Ghre/Ghre_Request.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghre/Ghre_Request.Dto.InsertInput.cs index 30a800e8..c7a7e070 100644 --- a/Tiobon.Core.Model/Insert/Ghre/Ghre_Request.Dto.InsertInput.cs +++ b/Tiobon.Core.Model/Insert/Ghre/Ghre_Request.Dto.InsertInput.cs @@ -25,5 +25,6 @@ namespace Tiobon.Core.Model.Models { public List TrainStaffIds { get; set; } + public List Ids { get; set; } } } diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs index d93177d7..129a73c4 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2024/9/10 14:28:24 SimonHsiao 初版 +*V0.01 2024/9/12 13:18:47 SimonHsiao 初版 * * Copyright(c) 2024 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -25,7 +25,7 @@ namespace Tiobon.Core.Model.Models /// /// 培训需求 (Model) /// - [SugarTable("Ghre_Request", "Ghre_Request"), Entity(TableCnName = "Ghre_Request", TableName = "Ghre_Request")] + [SugarTable("Ghre_Request", "Ghre_Request"), Entity(TableCnName = "培训需求", TableName = "Ghre_Request")] public class Ghre_Request : BasePoco { @@ -198,6 +198,38 @@ namespace Tiobon.Core.Model.Models [Display(Name = "ConfirmComment"), Description("ConfirmComment"), MaxLength(2000, ErrorMessage = "ConfirmComment 不能超过 2000 个字符")] public string ConfirmComment { get; set; } + /// + /// 同意人 + /// + public long? AgreeUserId { get; set; } + + /// + /// 同意时间 + /// + public DateTime? AgreeTime { get; set; } + + /// + /// 同意理由 + /// + [Display(Name = "AgreeReason"), Description("同意理由"), MaxLength(2000, ErrorMessage = "同意理由 不能超过 2000 个字符")] + public string AgreeReason { get; set; } + + /// + /// 拒绝人 + /// + public long? RefuseUserId { get; set; } + + /// + /// 拒绝时间 + /// + public DateTime? RefuseTime { get; set; } + + /// + /// 拒绝理由 + /// + [Display(Name = "RefuseReason"), Description("拒绝理由"), MaxLength(2000, ErrorMessage = "拒绝理由 不能超过 2000 个字符")] + public string RefuseReason { get; set; } + /// /// 预留字段1 /// diff --git a/Tiobon.Core.Model/View/Ghre/Ghre_Request.Dto.View.cs b/Tiobon.Core.Model/View/Ghre/Ghre_Request.Dto.View.cs index dacde2eb..8e466e6e 100644 --- a/Tiobon.Core.Model/View/Ghre/Ghre_Request.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghre/Ghre_Request.Dto.View.cs @@ -45,9 +45,14 @@ public class Ghre_RequestDto : Ghre_Request public string InOrOutLabel { get; set; } public string TeacherClassLabel { get; set; } - + public string SponsorName { get; set; } + public string TrainStaffNames { get; set; } + public string AgreeUserName { get; set; } + + public string RefuseUserName { get; set; } + public string WorkStateLabel { get; set; } } diff --git a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs index 48527ead..a5b7cba4 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs @@ -9,6 +9,7 @@ using Tiobon.Core.Common.UserManager; using Tiobon.Core.Model; using Tiobon.Core.Common.Helper; using Tiobon.Core.Common; +using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; @@ -39,7 +40,8 @@ public class Ghre_RequestServices : BaseServices().Where(x => deptIds.Contains(x.DeptID)).ToListAsync(); var sponsorIds = result.result.DT_TableDataT1.Where(x => x.SponsorId != null).Select(x => x.SponsorId).Distinct().ToList(); - + var userIds = result.result.DT_TableDataT1.Where(x => x.RefuseUserId != null).Select(x => x.RefuseUserId).Distinct().ToList(); + userIds.AddRange(result.result.DT_TableDataT1.Where(x => x.AgreeUserId != null).Select(x => x.AgreeUserId).Distinct()); result.result.DT_TableDataT1.ForEach(x => { string trainStaffId = x.TrainStaffId; @@ -54,6 +56,7 @@ public class Ghre_RequestServices : BaseServices().Where(x => sponsorIds.Contains(x.StaffID)).ToListAsync(); + var users = await Db.Queryable().Where(x => userIds.Contains(x.UserId)).ToListAsync(); result.result.DT_TableDataT1.ForEach(async x => { x.CourseSourceLabel = await GetParaLabel("TrainingRequestCourseSource", x.CourseSource); @@ -73,6 +76,20 @@ public class Ghre_RequestServices : BaseServices x.SponsorId == o.StaffID).FirstOrDefault()?.StaffName; if (x.TrainStaffIds.IsNotEmptyOrNull()) x.TrainStaffNames = string.Join("、", staffs.Where(o => x.TrainStaffIds.Contains(o.StaffID)).Select(o => o.StaffName)); + + + if (x.AgreeUserId != null) + x.AgreeUserName = users.Where(o => x.AgreeUserId == o.UserId).FirstOrDefault()?.UserName; + + + if (x.RefuseUserId != null) + x.RefuseUserName = users.Where(o => x.RefuseUserId == o.UserId).FirstOrDefault()?.UserName; + + if (x.WorkState.IsNotEmptyOrNull()) + { + if (x.WorkState == 0) x.WorkStateLabel = "审批中"; + if (x.WorkState == 1) x.WorkStateLabel = "审批通过"; + } }); return result; @@ -127,7 +144,7 @@ public class Ghre_RequestServices : BaseServices UpdateStatus(long[] ids, string status) + public async Task UpdateStatus(InsertGhre_RequestInput input, string status) { HttpRequest request = UserContext.Context.Request; @@ -135,13 +152,28 @@ public class Ghre_RequestServices : BaseServices(); - foreach (var id in ids) + foreach (var id in input.Ids) { - if (id == null || !BaseDal.Any(id)) + if (!BaseDal.Any(id)) continue; var entity = await BaseDal.QueryById(id); + + switch (status) + { + case DIC_REQUEST_STATUS.Active: + entity.AgreeReason = input.Reason; + entity.AgreeTime = DateTime.Now; + entity.AgreeUserId = App.User.ID; + break; + case DIC_REQUEST_STATUS.Temporary: + entity.RefuseReason = input.Reason; + entity.RefuseTime = DateTime.Now; + entity.RefuseUserId = App.User.ID; + break; + } + entity.UpdateIP = ip; entity.UpdateProg = api; entity.Status = status; diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 7a539e0a..a0db92b3 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -4105,6 +4105,36 @@ ConfirmComment + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 预留字段1 @@ -11066,6 +11096,36 @@ ConfirmComment + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 预留字段1