mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
fix issue #I42IFB 获取Oracle结构异常
fix issue #I462OD JSON解析异常 增加主表ParentId,可以同时添加主、从表结构 可以动态控制复杂界面显示编辑权限,采用代码生成的表定义来控制
This commit is contained in:
@@ -29,10 +29,11 @@ namespace OpenAuth.App
|
||||
throw new CommonException("登录已过期", Define.INVALID_TOKEN);
|
||||
}
|
||||
|
||||
//todo:普通账号如何分配明细的字段????先写死😰
|
||||
|
||||
var properties = _dbExtension.GetProperties("WmsInboundOrderDtbl");
|
||||
|
||||
var properties = loginContext.GetTableColumns("WmsInboundOrderDtbl");
|
||||
if (properties == null || properties.Count == 0)
|
||||
{
|
||||
throw new Exception("请在代码生成界面配置WmsInboundOrderDtbl表的字段属性");
|
||||
}
|
||||
var result = new TableData();
|
||||
var objs = UnitWork.Find<WmsInboundOrderDtbl>(null);
|
||||
if (!string.IsNullOrEmpty(request.InboundOrderId))
|
||||
@@ -45,8 +46,8 @@ namespace OpenAuth.App
|
||||
objs = objs.Where(u => u.GoodsId.Contains(request.key));
|
||||
}
|
||||
|
||||
var propertyStr = string.Join(',', properties.Select(u => u.Key));
|
||||
result.columnHeaders = properties;
|
||||
var propertyStr = string.Join(',', properties.Select(u => u.ColumnName));
|
||||
result.columnFields = properties;
|
||||
result.data = objs.OrderBy(u => u.Id)
|
||||
.Skip((request.page - 1) * request.limit)
|
||||
.Take(request.limit).Select($"new ({propertyStr})");
|
||||
|
@@ -29,22 +29,28 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
var properties = loginContext.GetProperties("WmsInboundOrderTbl");
|
||||
|
||||
if (properties == null || properties.Count == 0)
|
||||
{
|
||||
throw new Exception("当前登录用户没有访问该模块字段的权限,请联系管理员配置");
|
||||
}
|
||||
|
||||
|
||||
|
||||
var columns = loginContext.GetTableColumns("WmsInboundOrderTbl");
|
||||
if (columns == null || columns.Count == 0)
|
||||
{
|
||||
throw new Exception("请在代码生成界面配置WmsInboundOrderTbl表的字段属性");
|
||||
}
|
||||
|
||||
var result = new TableData();
|
||||
|
||||
result.columnHeaders = properties;
|
||||
result.columnFields = columns;
|
||||
|
||||
var objs = GetDataPrivilege("u");
|
||||
if (!string.IsNullOrEmpty(request.key))
|
||||
{
|
||||
objs = objs.Where(u => u.Id.Contains(request.key));
|
||||
}
|
||||
|
||||
var propertyStr = string.Join(',', properties.Select(u => u.Key));
|
||||
result.columnHeaders = properties;
|
||||
result.data = objs.OrderBy(u => u.Id)
|
||||
.Skip((request.page - 1) * request.limit)
|
||||
.Take(request.limit).Select($"new ({propertyStr})");
|
||||
|
Reference in New Issue
Block a user