开班转入发布、开课、结案接口

master
xiaochanghai 4 months ago
parent 3e7b3d1649
commit c356dd7a31
  1. 24
      Tiobon.Core.Api/Controllers/Ghre/Ghre_OpenClassController.cs
  2. 2
      Tiobon.Core.IServices/Ghre/IGhre_OpenClassServices.cs
  3. 32
      Tiobon.Core.Services/CommonServices.cs
  4. 11
      Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs

@ -114,4 +114,28 @@ public class Ghre_OpenClassController : BaseController<IGhre_OpenClassServices,
#endregion
#region 转入已发布
[HttpPost, Route("TransferPublished/{Id}")]
public async Task<ServiceResult> TransferPublished(long Id) => await _service.UpdateStatus([Id], "Publish");
[HttpPost, Route("TransferPublished")]
public async Task<ServiceResult> TransferPublished([FromBody] List<long> Ids) => await _service.UpdateStatus(Ids, "Publish");
#endregion
#region 转入已开课
[HttpPost, Route("TransferOpening/{Id}")]
public async Task<ServiceResult> TransferOpening(long Id) => await _service.UpdateStatus([Id], "Opening");
[HttpPost, Route("TransferOpening")]
public async Task<ServiceResult> TransferOpening([FromBody] List<long> Ids) => await _service.UpdateStatus(Ids, "Opening");
#endregion
#region 转入已结案
[HttpPost, Route("TransferClose/{Id}")]
public async Task<ServiceResult> TransferClose(long Id) => await _service.UpdateStatus([Id], "Close");
[HttpPost, Route("TransferClose")]
public async Task<ServiceResult> TransferClose([FromBody] List<long> Ids) => await _service.UpdateStatus(Ids, "Close");
#endregion
}

@ -23,4 +23,6 @@ public interface IGhre_OpenClassServices : IBaseServices<Ghre_OpenClass, Ghre_Op
Task<ServiceResult<Ghre_OpenClassDto>> QuerySummary(long Id);
Task<ServiceResult> InsertSummary(long Id, InsertGhre_OpenClassInput entity);
Task<ServiceResult> UpdateStatus(List<long> ids, string status);
}

@ -1970,7 +1970,16 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, 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<RootEntityTkey<int>>, 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<RootEntityTkey<int>>, 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();

@ -309,4 +309,15 @@ public class Ghre_OpenClassServices : BaseServices<Ghre_OpenClass, Ghre_OpenClas
return ServiceResult.OprateSuccess();
}
#endregion
#region 修改状态
public async Task<ServiceResult> UpdateStatus(List<long> ids, string status)
{
await Db.Updateable<Ghre_OpenClass>()
.SetColumns(it => new Ghre_OpenClass() { Status = status })
.Where(it => ids.Contains(it.Id))
.ExecuteCommandAsync();
return ServiceResult.OprateSuccess();
}
#endregion
}
Loading…
Cancel
Save