修复SqlSugarSetup类名修改后,nlog不打印日志问题,日期时间转换类增加格式,暂存区块和字段关联
This commit is contained in:
@@ -26,7 +26,7 @@ public class DataFieldFilter : ActionFilterAttribute
|
||||
|
||||
public Type ResultType { get; set; }
|
||||
|
||||
public string RulePath { get; set; }
|
||||
public string Path { get; set; }
|
||||
|
||||
public override void OnResultExecuting(ResultExecutingContext context)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace ZR.ServiceCore.Model;
|
||||
[SugarTable("sys_block")]
|
||||
[Tenant("0")]
|
||||
public class SysBlock
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -13,6 +13,4 @@ public class SysField
|
||||
public string FullName { get; set; }
|
||||
|
||||
public string FieldType { get; set; }
|
||||
|
||||
public string IsClass { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace ZR.ServiceCore.Model;
|
||||
[SugarTable("sys_field_block")]
|
||||
[Tenant("0")]
|
||||
public class SysFieldBlock
|
||||
{
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long BlockId { get; set; }
|
||||
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long FieldId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using ZR.Service;
|
||||
using ZR.ServiceCore.Model;
|
||||
|
||||
namespace ZR.ServiceCore.Services.IService;
|
||||
|
||||
public interface ISysBlockService : IBaseService<SysBlock>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using ZR.Service;
|
||||
using ZR.ServiceCore.Model;
|
||||
|
||||
namespace ZR.ServiceCore.Services.IService;
|
||||
|
||||
public interface ISysFieldBlockService : IBaseService<SysFieldBlock>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Infrastructure.Attribute;
|
||||
using ZR.Service;
|
||||
using ZR.ServiceCore.Model;
|
||||
using ZR.ServiceCore.Services.IService;
|
||||
|
||||
namespace ZR.ServiceCore.Services;
|
||||
|
||||
[AppService(ServiceType = typeof(ISysBlockService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class SysBlockService : BaseService<SysBlock>, ISysBlockService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Infrastructure.Attribute;
|
||||
using ZR.Service;
|
||||
using ZR.ServiceCore.Model;
|
||||
using ZR.ServiceCore.Services.IService;
|
||||
|
||||
namespace ZR.ServiceCore.Services;
|
||||
|
||||
[AppService(ServiceType = typeof(ISysFieldBlockService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class SysFieldBlockService : BaseService<SysFieldBlock>, ISysFieldBlockService
|
||||
{
|
||||
|
||||
}
|
||||
@@ -19,11 +19,13 @@ public class SysFieldService : BaseService<SysField>, ISysFieldService
|
||||
{
|
||||
var fields = await Queryable()
|
||||
.Where(it => it.FullName == fullName)
|
||||
.WithCache(10 * 60)
|
||||
.ToListAsync();
|
||||
var roleFields = await _sysRoleFieldService
|
||||
.Queryable()
|
||||
.Where(it => it.RoleId == roleId)
|
||||
.Select(it => it.FieldId)
|
||||
.WithCache()
|
||||
.ToListAsync();
|
||||
var list = fields.Select(it => new SysFieldDto
|
||||
{
|
||||
@@ -31,7 +33,7 @@ public class SysFieldService : BaseService<SysField>, ISysFieldService
|
||||
FieldType = it.FieldType,
|
||||
FullName = it.FullName,
|
||||
Id = it.Id,
|
||||
IsClass = it.IsClass,
|
||||
// IsClass = it.IsClass,
|
||||
IsPermission = !roleFields.Contains(it.Id)
|
||||
}).ToList();
|
||||
return list;
|
||||
@@ -67,7 +69,7 @@ public class SysFieldService : BaseService<SysField>, ISysFieldService
|
||||
FieldName = property.FieldName,
|
||||
FullName = serviceCoreModel.FullName,
|
||||
FieldType = property.FieldType,
|
||||
IsClass = property.IsClass ? "1" : "0"
|
||||
// IsClass = property.IsClass ? "1" : "0"
|
||||
}).ToList();
|
||||
await Deleteable()
|
||||
.Where(it =>
|
||||
|
||||
Reference in New Issue
Block a user