|
|
@@ -32,7 +32,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
/// </summary> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet] |
|
|
|
public ActionResult Form() { |
|
|
|
public ActionResult Form() |
|
|
|
{ |
|
|
|
return View(); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
@@ -40,7 +41,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
/// </summary> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet] |
|
|
|
public ActionResult TableIndex() { |
|
|
|
public ActionResult TableIndex() |
|
|
|
{ |
|
|
|
return View(); |
|
|
|
} |
|
|
|
|
|
|
@@ -85,13 +87,11 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet] |
|
|
|
[AjaxOnly] |
|
|
|
public ActionResult GetList(string databaseLinkId,string tableName) |
|
|
|
public ActionResult GetList(string databaseLinkId, string tableName) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetTableList(databaseLinkId, tableName); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -106,10 +106,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetDraftList(string queryJson) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = dbDraftIBLL.GetList(queryJson); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -122,12 +120,11 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet] |
|
|
|
[AjaxOnly] |
|
|
|
public ActionResult GetFieldList(string databaseLinkId, string tableName) { |
|
|
|
public ActionResult GetFieldList(string databaseLinkId, string tableName) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetTableFiledList(databaseLinkId, tableName); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -146,10 +143,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetTableDataList(string databaseLinkId, string tableName, string field, string logic, string keyword, string pagination) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
Pagination paginationobj = pagination.ToObject<Pagination>(); |
|
|
|
var data = databaseTableIBLL.GetTableDataList(databaseLinkId, tableName, field, logic, keyword, paginationobj); |
|
|
|
var jsonData = new |
|
|
@@ -172,10 +167,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetTableDataAllList(string databaseLinkId, string tableName) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetTableDataList(databaseLinkId, tableName); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -189,10 +182,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetTreeList(string parentId) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetTreeList(parentId); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -205,10 +196,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetFieldTreeList(string databaseLinkId, string tableName) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetFiledTreeList(databaseLinkId, tableName); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -221,10 +210,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
public ActionResult GetSqlColName(string databaseLinkId, string strSql) |
|
|
|
{ |
|
|
|
var user = LoginUserInfo.Get(); |
|
|
|
if (user.Description != "管理员") |
|
|
|
{ |
|
|
|
if (user.Description != "管理员" && !user.roleIds.Contains("d61e1853-cdee-4d49-a5e1-e230f1098e52")) |
|
|
|
return Fail("不允许的操作"); |
|
|
|
} |
|
|
|
var data = databaseTableIBLL.GetSqlColName(databaseLinkId, strSql); |
|
|
|
return JsonResult(data); |
|
|
|
} |
|
|
@@ -264,7 +251,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost] |
|
|
|
[AjaxOnly] |
|
|
|
public ActionResult SaveTable(string databaseLinkId, string draftId, string tableName,string tableRemark,string strColList) |
|
|
|
public ActionResult SaveTable(string databaseLinkId, string draftId, string tableName, string tableRemark, string strColList) |
|
|
|
{ |
|
|
|
List<DatabaseTableFieldModel> colList = strColList.ToObject<List<DatabaseTableFieldModel>>(); |
|
|
|
string res = databaseTableIBLL.CreateTable(databaseLinkId, tableName, tableRemark, colList); |
|
|
@@ -276,7 +263,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers |
|
|
|
} |
|
|
|
return Success("创建成功"); |
|
|
|
} |
|
|
|
else { |
|
|
|
else |
|
|
|
{ |
|
|
|
return Fail(res); |
|
|
|
} |
|
|
|
} |
|
|
|