|
|
@ -1,10 +1,12 @@ |
|
|
|
using System.Data; |
|
|
|
using System.Data; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
using AgileObjects.AgileMapper.Extensions; |
|
|
|
using AgileObjects.AgileMapper.Extensions; |
|
|
|
|
|
|
|
using Elasticsearch.Net; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json; |
|
|
|
|
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using SqlSugar; |
|
|
|
using SqlSugar; |
|
|
|
using Tiobon.Core.Common; |
|
|
|
using Tiobon.Core.Common; |
|
|
|
using Tiobon.Core.Common.DB.Dapper; |
|
|
|
using Tiobon.Core.Common.DB.Dapper; |
|
|
@ -24,6 +26,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon |
|
|
|
_logger = logger; |
|
|
|
_logger = logger; |
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
|
_httpContextAccessor = httpContextAccessor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region 获取菜单 |
|
|
|
#region 获取菜单 |
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 获取菜单 |
|
|
|
/// 获取菜单 |
|
|
@ -1032,4 +1035,65 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取模块信息 |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 获取模块信息 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="param"></param> |
|
|
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
|
|
public async Task<ServiceResult<CommonSelect>> GetSelectAsync(string type) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var result = new CommonSelect(); |
|
|
|
|
|
|
|
JArray TableColumn = new JArray(); |
|
|
|
|
|
|
|
JArray DT_TablePageInfoT1 = new JArray(); |
|
|
|
|
|
|
|
JArray DT_TableDataT1 = new JArray(); |
|
|
|
|
|
|
|
if (type == "Ghre_Course") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
JObject searchItem = [ |
|
|
|
|
|
|
|
new JProperty("defaultHidden", true), |
|
|
|
|
|
|
|
new JProperty("field","value"), |
|
|
|
|
|
|
|
new JProperty("label","课程ID"), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
TableColumn.Add(searchItem); |
|
|
|
|
|
|
|
searchItem = [ |
|
|
|
|
|
|
|
new JProperty("field","label"), |
|
|
|
|
|
|
|
new JProperty("label","课程编号"), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
TableColumn.Add(searchItem); |
|
|
|
|
|
|
|
searchItem = [ |
|
|
|
|
|
|
|
new JProperty("field","label1"), |
|
|
|
|
|
|
|
new JProperty("label1","课程名称"), |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
TableColumn.Add(searchItem); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string sql = "SELECT Id, CourseNo, CourseName FROM Ghre_Course"; |
|
|
|
|
|
|
|
DataTable dt = await Db.Ado.GetDataTableAsync(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < dt.Rows.Count; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
JObject item = [ |
|
|
|
|
|
|
|
new JProperty("value",long.Parse(dt.Rows[i]["Id"].ToString())), |
|
|
|
|
|
|
|
new JProperty("label",dt.Rows[i]["CourseNo"].ToString()), |
|
|
|
|
|
|
|
new JProperty("label1",dt.Rows[i]["CourseName"].ToString()) |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
DT_TableDataT1.Add(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JObject item1 = [ |
|
|
|
|
|
|
|
new JProperty("ListMax",100), |
|
|
|
|
|
|
|
new JProperty("ListMin",10), |
|
|
|
|
|
|
|
new JProperty("PageNum",1), |
|
|
|
|
|
|
|
new JProperty("PageSize",99999), |
|
|
|
|
|
|
|
new JProperty("TotalCount",dt.Rows.Count), |
|
|
|
|
|
|
|
new JProperty("UIType","Auto") |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
DT_TablePageInfoT1.Add(item1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
result.JM_TableColumnT1.TableColumn = TableColumn; |
|
|
|
|
|
|
|
result.DT_TableDataT1 = DT_TableDataT1; |
|
|
|
|
|
|
|
result.DT_TablePageInfoT1 = DT_TablePageInfoT1; |
|
|
|
|
|
|
|
return new ServiceResult<CommonSelect>() { Success = true, Message = "查询成功", Data = result, }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|