新增参数配置

master
xiaochanghai 9 months ago
parent 5a40db98d6
commit 94ec9557fa
  1. 10
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ConfigController.cs
  2. 2
      Tiobon.Core.Api/Controllers/Ghre/Ghre_RequestController.cs
  3. 6
      Tiobon.Core.Api/Tiobon.Core.xml
  4. 2
      Tiobon.Core.IServices/Ghre/IGhre_ConfigServices.cs
  5. 15
      Tiobon.Core.Services/Ghre/Ghre_ConfigServices.cs
  6. 6
      Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs
  7. 6
      Tiobon.Core/Tiobon.Core.xml

@ -11,4 +11,14 @@ public class Ghre_ConfigController : BaseController<IGhre_ConfigServices, Ghre_C
public Ghre_ConfigController(IGhre_ConfigServices service) : base(service) public Ghre_ConfigController(IGhre_ConfigServices service) : base(service)
{ {
} }
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="entitys"></param>
[HttpPost, Route("BulkUpdateValue")]
public virtual async Task<ServiceResult> BulkUpdateValue([FromBody] List<Ghre_ConfigDto> entitys)
{
return await _service.BulkUpdateValue(entitys);
}
} }

@ -26,6 +26,8 @@ public class Ghre_RequestController : BaseController<IGhre_RequestServices, Ghre
{ {
if (status == "Active") if (status == "Active")
return await _service.QueryFilterPage(body, $"(Status ='{status}' OR (WorkID IS NOT NULL AND WorkState IN (0,1)))"); return await _service.QueryFilterPage(body, $"(Status ='{status}' OR (WorkID IS NOT NULL AND WorkState IN (0,1)))");
else if (status == "Disable")
return await _service.QueryFilterPage(body, null, false);
else else
return await _service.QueryFilterPage(body, $"Status ='{status}' AND WorkID IS NULL"); return await _service.QueryFilterPage(body, $"Status ='{status}' AND WorkID IS NULL");
} }

@ -649,6 +649,12 @@
参数配置(Controller) 参数配置(Controller)
</summary> </summary>
</member> </member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ConfigController.BulkUpdateValue(System.Collections.Generic.List{Tiobon.Core.Model.Models.Ghre_ConfigDto})">
<summary>
批量更新数据
</summary>
<param name="entitys"></param>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseClassController"> <member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseClassController">
<summary> <summary>
Ghre_CourseClass(Controller) Ghre_CourseClass(Controller)

@ -1,4 +1,5 @@
using Tiobon.Core.IServices.BASE; using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models; using Tiobon.Core.Model.Models;
namespace Tiobon.Core.IServices namespace Tiobon.Core.IServices
@ -8,5 +9,6 @@ namespace Tiobon.Core.IServices
/// </summary> /// </summary>
public interface IGhre_ConfigServices :IBaseServices<Ghre_Config, Ghre_ConfigDto, InsertGhre_ConfigInput, EditGhre_ConfigInput> public interface IGhre_ConfigServices :IBaseServices<Ghre_Config, Ghre_ConfigDto, InsertGhre_ConfigInput, EditGhre_ConfigInput>
{ {
Task<ServiceResult> BulkUpdateValue(List<Ghre_ConfigDto> entitys);
} }
} }

@ -4,6 +4,7 @@ using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE; using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base; using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Common.Caches; using Tiobon.Core.Common.Caches;
using Tiobon.Core.Model;
namespace Tiobon.Core.Services namespace Tiobon.Core.Services
{ {
@ -19,5 +20,19 @@ namespace Tiobon.Core.Services
base.BaseDal = dal; base.BaseDal = dal;
base._caching = caching; base._caching = caching;
} }
public async Task<ServiceResult> BulkUpdateValue(List<Ghre_ConfigDto> entitys)
{
for (int i = 0; i < entitys.Count; i++)
{
await Db.Updateable<Ghre_Config>()
.SetColumns(it => new Ghre_Config()
{
ConfigValue = entitys[i].ConfigValue
})
.Where(x => x.Id == entitys[i].Id).ExecuteCommandAsync();
}
return ServiceResult.OprateSuccess();
}
} }
} }

@ -32,7 +32,11 @@ public class Ghre_RequestServices : BaseServices<Ghre_Request, Ghre_RequestDto,
public override async Task<ServicePageResult<Ghre_RequestDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) public override async Task<ServicePageResult<Ghre_RequestDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true)
{ {
var sql = "update A set A.CourseName= B.CourseName FROM Ghre_Request A join Ghre_Course B on A.CourseId = B.Id and A.CourseName != B.CourseName"; var sql = @"UPDATE A
SET A.CourseName = B.CourseName
FROM Ghre_Request A
JOIN Ghre_Course B
ON A.CourseId = B.Id AND (A.CourseName ! = B.CourseName OR A.CourseName IS NULL)";
await Db.Ado.ExecuteCommandAsync(sql); await Db.Ado.ExecuteCommandAsync(sql);
var result = await base.QueryFilterPage(filter, condition, IsEnable); var result = await base.QueryFilterPage(filter, condition, IsEnable);

@ -649,6 +649,12 @@
参数配置(Controller) 参数配置(Controller)
</summary> </summary>
</member> </member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ConfigController.BulkUpdateValue(System.Collections.Generic.List{Tiobon.Core.Model.Models.Ghre_ConfigDto})">
<summary>
批量更新数据
</summary>
<param name="entitys"></param>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseClassController"> <member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseClassController">
<summary> <summary>
Ghre_CourseClass(Controller) Ghre_CourseClass(Controller)

Loading…
Cancel
Save