fix 优化分组
This commit is contained in:
@@ -24,10 +24,20 @@ public class GainfoGroupTreeResponse
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否编辑
|
||||
/// 是否可编辑
|
||||
/// </summary>
|
||||
public bool Editable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否为业务默认分组
|
||||
/// </summary>
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许设置下级
|
||||
/// </summary>
|
||||
public bool AbleSetNext => IsDefault;
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public string TenantId { get; set; }
|
||||
|
||||
@@ -59,14 +59,12 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
{
|
||||
var entity = request.Adapt<GainfoGroupEntity>();
|
||||
entity.Code = Guid.NewGuid();
|
||||
entity.Editable = true;
|
||||
await _dbContext.InsertAsync(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = await _dbContext.Queryable<GainfoGroupEntity>().Where(x => x.Id == request.Id).SingleAsync();
|
||||
request.Adapt(entity);
|
||||
entity.Editable = true;
|
||||
await _dbContext.UpdateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user