From c73f73f421357a76d351cc952c30c27faefddafe Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 3 Mar 2025 14:16:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Ghre/Ghre_PlanController.cs | 18 ++++- Tiobon.Core.Api/Tiobon.Core.Model.xml | 70 +++++++++++++++++++ .../Ghre/IGhre_PlanServices.cs | 7 +- .../Base/Ghre/Ghre_Plan.Dto.Base.cs | 41 ++++++++++- .../Insert/Ghre/Ghre_Plan.Dto.InsertInput.cs | 4 +- Tiobon.Core.Model/Models/Ghre/Ghre_Plan.cs | 41 ++++++++++- Tiobon.Core.Services/CommonServices.cs | 4 +- .../Ghre/Ghre_ExamServices.cs | 2 +- .../Ghre/Ghre_PlanServices.cs | 33 +++------ Tiobon.Core/Tiobon.Core.Model.xml | 70 +++++++++++++++++++ 10 files changed, 257 insertions(+), 33 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_PlanController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_PlanController.cs index 045c62b7..fbb50196 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_PlanController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_PlanController.cs @@ -12,8 +12,6 @@ public class Ghre_PlanController : BaseController /// 根据条件查询数据 @@ -32,4 +30,20 @@ public class Ghre_PlanController : BaseController UpdateStatus(string status, [FromBody] InsertGhre_PlanInput input) + { + return await _service.UpdateStatus(input, status); + } + #endregion + + #region 新增 + [HttpPost("Insert/{status}")] + public async Task> InsertByStatus([FromBody] InsertGhre_PlanInput insertModel, string status) + { + return await _service.InsertByStatus(insertModel, status); + } + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index f12f9f67..8bdbe430 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -5640,6 +5640,41 @@ 计划实施月份 + + + 状态 + + + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 备注 @@ -20856,6 +20891,41 @@ 计划实施月份 + + + 状态 + + + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 备注 diff --git a/Tiobon.Core.IServices/Ghre/IGhre_PlanServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_PlanServices.cs index bfc4bfae..4bbf81ec 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_PlanServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_PlanServices.cs @@ -1,8 +1,13 @@ -namespace Tiobon.Core.IServices; +using Tiobon.Core.Model; + +namespace Tiobon.Core.IServices; /// /// 培训计划(自定义服务接口) /// public interface IGhre_PlanServices : IBaseServices { + Task> InsertByStatus(InsertGhre_PlanInput insertModel, string status); + + Task UpdateStatus(InsertGhre_PlanInput input, string status); } \ No newline at end of file diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_Plan.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_Plan.Dto.Base.cs index 812c310e..e93d3861 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_Plan.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_Plan.Dto.Base.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2025/2/27 14:48:56 SimonHsiao 初版 +*V0.01 2025/3/3 13:13:42 SimonHsiao 初版 * * Copyright(c) 2025 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -64,8 +64,47 @@ public class Ghre_PlanBase /// /// 计划实施月份 /// + [Display(Name = "Month"), Description("计划实施月份"), MaxLength(32, ErrorMessage = "计划实施月份 不能超过 32 个字符")] public string Month { get; set; } + /// + /// 状态 + /// + [Display(Name = "Status"), Description("状态"), MaxLength(32, ErrorMessage = "状态 不能超过 32 个字符")] + public string Status { 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; } + /// /// 备注 /// diff --git a/Tiobon.Core.Model/Insert/Ghre/Ghre_Plan.Dto.InsertInput.cs b/Tiobon.Core.Model/Insert/Ghre/Ghre_Plan.Dto.InsertInput.cs index 9fbbf228..79285d8b 100644 --- a/Tiobon.Core.Model/Insert/Ghre/Ghre_Plan.Dto.InsertInput.cs +++ b/Tiobon.Core.Model/Insert/Ghre/Ghre_Plan.Dto.InsertInput.cs @@ -13,7 +13,7 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ namespace Tiobon.Core.Model.Models; @@ -23,4 +23,6 @@ namespace Tiobon.Core.Model.Models; /// public class InsertGhre_PlanInput : Ghre_PlanBase { + public List Ids { get; set; } + public string Reason { get; set; } } diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_Plan.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_Plan.cs index 2aee6838..4147b907 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_Plan.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_Plan.cs @@ -6,7 +6,7 @@ * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── -*V0.01 2025/2/27 14:48:56 SimonHsiao 初版 +*V0.01 2025/3/3 13:13:42 SimonHsiao 初版 * * Copyright(c) 2025 Tiobon Corporation. All Rights Reserved. *┌──────────────────────────────────┐ @@ -65,8 +65,47 @@ public class Ghre_Plan : BasePoco /// /// 计划实施月份 /// + [Display(Name = "Month"), Description("计划实施月份"), MaxLength(32, ErrorMessage = "计划实施月份 不能超过 32 个字符")] public string Month { get; set; } + /// + /// 状态 + /// + [Display(Name = "Status"), Description("状态"), MaxLength(32, ErrorMessage = "状态 不能超过 32 个字符")] + public string Status { 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; } + /// /// 备注 /// diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 9ec25172..565d9c59 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -2097,7 +2097,7 @@ public partial class CommonServices : BaseServices>, ICommon result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() { display = true, - fnKey = "TBD6YN", + fnKey = "TBD7YN", fnTitle = await QueryLangValue("F_Training_Demand_ToConfirm_Reject", param.langId, "拒绝"), fnType = "table", icon = "ess-icon-reject", @@ -2106,7 +2106,7 @@ public partial class CommonServices : BaseServices>, ICommon result.JM_PageControlT1.Toolbar.Insert(0, new Toolbar() { display = true, - fnKey = "TBD5YN", + fnKey = "TBD6YN", fnTitle = await QueryLangValue("F_Training_Demand_ToConfirm_Agree", param.langId, "同意"), fnType = "table", icon = "ess-icon-approval", diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index c31e0ee4..6131ba22 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -727,7 +727,7 @@ public class Ghre_ExamServices : BaseServices x.fnKey == "UpdateYN")) x.canEdit = 0; diff --git a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs index 6547a7c8..cdca3363 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs @@ -70,7 +70,7 @@ public class Ghre_PlanServices : BaseServices>(StaffIds); return result; - } - + } - public async Task> InsertByStatus(InsertGhre_RequestInput insertModel, string status) + public async Task> InsertByStatus(InsertGhre_PlanInput insertModel, string status) { + + if (insertModel.StaffIdList != null) + insertModel.StaffIds = JsonHelper.ObjToJson(insertModel.StaffIdList); var data = ServiceResult.OprateSuccess("新增成功", 0); insertModel.Status = status; var id = await Add(insertModel); @@ -96,30 +98,19 @@ public class Ghre_PlanServices : BaseServices.OprateFailed("发布成功!"); + return ServiceResult.OprateFailed("失败!"); return data; } - public override async Task> QueryForm(QueryForm body) - { - var result = await base.QueryForm(body); - string trainStaffId = result.result.DT_TableDataT1[0].TrainStaffId; - if (!string.IsNullOrWhiteSpace(trainStaffId)) - result.result.DT_TableDataT1[0].TrainStaffIds = JsonHelper.JsonToObj>(trainStaffId); - else result.result.DT_TableDataT1[0].TrainStaffIds = new List(); - return result; - - } - - public async Task UpdateStatus(InsertGhre_RequestInput input, string status) + public async Task UpdateStatus(InsertGhre_PlanInput input, string status) { HttpRequest request = UserContext.Context.Request; var api = request.Path.ObjToString().TrimEnd('/').ToLower(); var ip = GetUserIp(UserContext.Context); - var entities = new List(); + var entities = new List(); foreach (var id in input.Ids) { if (!BaseDal.Any(id)) @@ -150,12 +141,6 @@ public class Ghre_PlanServices : BaseServices + + + 状态 + + + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 备注 @@ -20856,6 +20891,41 @@ 计划实施月份 + + + 状态 + + + + + 同意人 + + + + + 同意时间 + + + + + 同意理由 + + + + + 拒绝人 + + + + + 拒绝时间 + + + + + 拒绝理由 + + 备注