diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs index 15a0fd8c..038050fa 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs @@ -114,4 +114,28 @@ public class Ghre_OpenClassController : BaseController TransferPublished(long Id) => await _service.UpdateStatus([Id], "Publish"); + + [HttpPost, Route("TransferPublished")] + public async Task TransferPublished([FromBody] List Ids) => await _service.UpdateStatus(Ids, "Publish"); + #endregion + + #region 转入已开课 + [HttpPost, Route("TransferOpening/{Id}")] + public async Task TransferOpening(long Id) => await _service.UpdateStatus([Id], "Opening"); + + [HttpPost, Route("TransferOpening")] + public async Task TransferOpening([FromBody] List Ids) => await _service.UpdateStatus(Ids, "Opening"); + #endregion + + #region 转入已结案 + [HttpPost, Route("TransferClose/{Id}")] + public async Task TransferClose(long Id) => await _service.UpdateStatus([Id], "Close"); + + [HttpPost, Route("TransferClose")] + public async Task TransferClose([FromBody] List Ids) => await _service.UpdateStatus(Ids, "Close"); + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs index e9308fa1..27e604b1 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs @@ -23,4 +23,6 @@ public interface IGhre_OpenClassServices : IBaseServices> QuerySummary(long Id); Task InsertSummary(long Id, InsertGhre_OpenClassInput entity); + + Task UpdateStatus(List ids, string status); } \ No newline at end of file diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index d9c98862..c21564f2 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1970,7 +1970,16 @@ public partial class CommonServices : BaseServices>, ICommon toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD4YN"; - + index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD1YN"); + result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar() + { + display = true, + fnKey = "TBD5YN", + fnTitle = "发布", + fnType = "table", + icon = "ghr-publish", + position = "left" + }); break; case "F_OpenCLassPublish": toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); @@ -1981,6 +1990,16 @@ public partial class CommonServices : BaseServices>, ICommon if (toolbar != null) toolbar.fnKey = "TBD3YN"; toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD4YN"; + index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD1YN"); + result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar() + { + display = true, + fnKey = "TBD5YN", + fnTitle = "开课", + fnType = "table", + icon = "ghr-publish", + position = "left" + }); break; case "F_OpenCLassOpening": toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); @@ -1991,6 +2010,17 @@ public partial class CommonServices : BaseServices>, ICommon if (toolbar != null) toolbar.fnKey = "TBD3YN"; toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault(); if (toolbar != null) toolbar.fnKey = "TBD4YN"; + + index = result.JM_PageControlT1.Toolbar.FindIndex(x => x.fnKey == "TBD1YN"); + result.JM_PageControlT1.Toolbar.Insert(index + 1, new Toolbar() + { + display = true, + fnKey = "TBD5YN", + fnTitle = "结案", + fnType = "table", + icon = "ghr-publish", + position = "left" + }); break; case "F_OpenCLassClose": toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault(); diff --git a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs index 29350fa6..b1ddd4d2 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs @@ -309,4 +309,15 @@ public class Ghre_OpenClassServices : BaseServices UpdateStatus(List ids, string status) + { + await Db.Updateable() + .SetColumns(it => new Ghre_OpenClass() { Status = status }) + .Where(it => ids.Contains(it.Id)) + .ExecuteCommandAsync(); + return ServiceResult.OprateSuccess(); + } + #endregion } \ No newline at end of file