From 6fe629acb2b0fe127485120de24bd1c91fcc2a8f Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 12 Feb 2025 15:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E5=90=88=E5=89=8D=E7=AB=AF=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=BC=80=E7=8F=AD=E5=91=98=E5=B7=A5=E3=80=81=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_OpenClassController.cs | 19 ++++++++++++ Tiobon.Core.Api/Tiobon.Core.xml | 15 ++++++++++ .../Ghre/IGhre_OpenClassServices.cs | 4 +++ Tiobon.Core.Services/BASE/BaseServices.cs | 5 ++-- Tiobon.Core.Services/CommonServices.cs | 1 + .../Ghre/Ghre_OpenClassServices.cs | 29 +++++++++++++++---- Tiobon.Core/Tiobon.Core.xml | 15 ++++++++++ 7 files changed, 81 insertions(+), 7 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs index b023416a..5a6d1e86 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs @@ -72,5 +72,24 @@ public class Ghre_OpenClassController : BaseController [HttpPost, Route("QueryPersonalFee/{Id}")] public async Task>> QueryPersonalFee(long Id) => await _service.QueryPersonalFee(Id); + + + /// + /// 学员费用 + /// + /// 开班ID + /// 费用信心 + /// + [HttpPost, Route("InsertFee/{Id}")] + public async Task InsertFee(long Id, [FromBody] InsertGhre_OpenClassFeeInput fee) => await _service.InsertFee(Id, fee); + + + /// + /// 费用删除 + /// + /// 费用数据ID列表 + /// + [HttpPost, Route("DeleteFee")] + public async Task DeleteFee([FromBody] List ids) => await _service.DeleteFee(ids); #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index e4dabdce..ac1b44d0 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -1190,6 +1190,21 @@ 开班ID + + + 学员费用 + + 开班ID + 费用信心 + + + + + 费用删除 + + 费用数据ID列表 + + 开班费用(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs index 4a09bd4a..597aae52 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs @@ -15,4 +15,8 @@ public interface IGhre_OpenClassServices : IBaseServices>> QueryGroupFee(long Id); Task>> QueryPersonalFee(long Id); + + Task InsertFee(long Id, InsertGhre_OpenClassFeeInput fee); + + Task DeleteFee(List feeIds); } \ No newline at end of file diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index 2857ee28..84912332 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -1266,7 +1266,7 @@ public class BaseServices : IBaseServ int sequence; #region 查询 - DbSelect dbSelect = new (tableCode + " A", "A", null); + DbSelect dbSelect = new(tableCode + " A", "A", null); dbSelect.IsInitDefaultValue = false; if (!string.IsNullOrEmpty(prefixTemp)) @@ -1668,7 +1668,8 @@ ORDER BY SortNo ASC"; if (dataRole.@DeptType == 6) { var dept = depts.Where(x => x.DeptID == @UserStaffID).FirstOrDefault(); - var depts1 = await GetDeptList(depts, dept.DeptID); + if (dept != null) + await GetDeptList(depts, dept.DeptID); } //5 部门助理(不含下阶) diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index f8bc0c66..47524222 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1961,6 +1961,7 @@ public partial class CommonServices : BaseServices>, ICommon break; case "F_OpenCLassTemporary": + case "F_OpenCLassPublish": toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD1YN"; toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault(); diff --git a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs index 6230c15d..47403812 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs @@ -132,11 +132,13 @@ public class Ghre_OpenClassServices : BaseServices InsertStaff(long Id, List staffIds) { - var inserts = staffIds.Select(x => new InsertGhre_OpenClassStaffInput() - { - StaffId = x, - OpenClassId = Id - }).ToList(); + var staffIds1 = await Db.Queryable().Select(s => s.StaffId).ToListAsync(); + var inserts = staffIds.Where(x => !staffIds1.Contains(x)) + .Select(x => new InsertGhre_OpenClassStaffInput() + { + StaffId = x, + OpenClassId = Id + }).Distinct().ToList(); await _ghre_OpenClassStaffServices.Add(inserts); return ServiceResult.OprateSuccess(); } @@ -162,5 +164,22 @@ public class Ghre_OpenClassServices : BaseServices>.OprateSuccess("查询成功!", result.result.DT_TableDataT1); } + + + public async Task InsertFee(long Id, InsertGhre_OpenClassFeeInput fee) + { + fee.OpenClassId = Id; + await _ghre_OpenClassFeeServices.Add(fee); + return ServiceResult.OprateSuccess(); + } + + public async Task DeleteFee(List feeIds) + { + await Db.Updateable() + .SetColumns(it => new Ghre_OpenClassFee() { IsEnable = 0 }) + .Where(it => feeIds.Contains(it.Id)) + .ExecuteCommandAsync(); + return ServiceResult.OprateSuccess(); + } #endregion } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index e4dabdce..ac1b44d0 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -1190,6 +1190,21 @@ 开班ID + + + 学员费用 + + 开班ID + 费用信心 + + + + + 费用删除 + + 费用数据ID列表 + + 开班费用(Controller)