From 9c1873eb32dc81e62a7c97971da552d3257757a7 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Tue, 21 Jan 2025 11:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=E5=8F=82=E6=95=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=20=E6=96=B0=E5=A2=9E=E7=BB=84=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrh/Ghrh_ConfigGroupController.cs | 10 ++++++++++ Tiobon.Core.Api/Tiobon.Core.xml | 6 ++++++ .../Ghrh/IGhrh_ConfigGroupServices.cs | 2 ++ .../Ghrh/Ghrh_ConfigGroupServices.cs | 17 +++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 6 ++++++ 5 files changed, 41 insertions(+) diff --git a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ConfigGroupController.cs b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ConfigGroupController.cs index 6d05da9c..174e74b8 100644 --- a/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ConfigGroupController.cs +++ b/Tiobon.Core.Api/Controllers/Ghrh/Ghrh_ConfigGroupController.cs @@ -11,4 +11,14 @@ public class Ghrh_ConfigGroupController : BaseController + /// 批量更新数据 + /// + /// + [HttpPost, Route("BulkUpdateValue")] + public virtual async Task BulkUpdateValue([FromBody] List entitys) + { + return await _service.BulkUpdateValue(entitys); + } } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index d645663f..4c913ca6 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1310,6 +1310,12 @@ 招聘参数配置组(Controller) + + + 批量更新数据 + + + 人力需求维护(Controller) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs index ac7aed4e..5d5bcc7e 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs @@ -1,4 +1,5 @@ using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; @@ -8,4 +9,5 @@ namespace Tiobon.Core.IServices; /// public interface IGhrh_ConfigGroupServices : IBaseServices { + Task BulkUpdateValue(List entitys); } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ConfigGroupServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ConfigGroupServices.cs index 9061af0d..4ca9424d 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ConfigGroupServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ConfigGroupServices.cs @@ -26,4 +26,21 @@ public class Ghrh_ConfigGroupServices : BaseServices BulkUpdateValue(List entitys) + { + for (int i = 0; i < entitys.Count; i++) + { + for (int j = 0; j < entitys[i].Configs.Count; j++) + { + await Db.Updateable() + .SetColumns(it => new Ghrh_Config() + { + ConfigValue = entitys[i].Configs[j].ConfigValue + }, true) + .Where(x => x.Id == entitys[i].Configs[j].Id) + .ExecuteCommandAsync(); + } + } + return ServiceResult.OprateSuccess(); + } } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index d645663f..4c913ca6 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1310,6 +1310,12 @@ 招聘参数配置组(Controller) + + + 批量更新数据 + + + 人力需求维护(Controller)