fix 优化分组

This commit is contained in:
2024-03-05 20:38:00 +08:00
parent eada9b6af9
commit 8157f0a01b
8 changed files with 50 additions and 46 deletions

View File

@@ -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; }

View File

@@ -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);
}
}