|
|
|
@ -1,4 +1,7 @@ |
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
using MathNet.Numerics.Distributions; |
|
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 开班管理 (服务) |
|
|
|
@ -126,6 +129,26 @@ public class Ghre_OpenClassServices : BaseServices<Ghre_OpenClass, Ghre_OpenClas |
|
|
|
|
var result = await _ghre_OpenClassStaffServices.QueryFilterPage(new QueryBody(), $"OpenClassId='{Id}'"); |
|
|
|
|
return ServiceResult<List<Ghre_OpenClassStaffDto>>.OprateSuccess("查询成功!", result.result.DT_TableDataT1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> InsertStaff(long Id, List<int> staffIds) |
|
|
|
|
{ |
|
|
|
|
var inserts = staffIds.Select(x => new InsertGhre_OpenClassStaffInput() |
|
|
|
|
{ |
|
|
|
|
StaffId = x, |
|
|
|
|
OpenClassId = Id |
|
|
|
|
}).ToList(); |
|
|
|
|
await _ghre_OpenClassStaffServices.Add(inserts); |
|
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult> DeleteStaff(long Id, List<int> staffIds) |
|
|
|
|
{ |
|
|
|
|
await Db.Updateable<Ghre_OpenClassStaff>() |
|
|
|
|
.SetColumns(it => new Ghre_OpenClassStaff() { IsEnable = 0 }) |
|
|
|
|
.Where(it => it.StaffId != null && it.OpenClassId == Id && staffIds.Contains(it.StaffId.Value)) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
return ServiceResult.OprateSuccess(); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 费用 |
|
|
|
|