fix 档案组分配人员控制

This commit is contained in:
2024-03-06 17:34:14 +08:00
parent 4bab1fd2fd
commit 6352ffd9af

View File

@@ -53,7 +53,7 @@ public class GainfoGroupService : IGainfoGroupService
{
_dbContext.Client.QueryFilter.Restore();
}
if (!request.Id.HasValue)
{
@@ -86,6 +86,9 @@ public class GainfoGroupService : IGainfoGroupService
public async Task AssignGainfosAsync(GainfoAssignRequest request)
{
var existsNextGroup = await _dbContext.Queryable<GainfoGroupEntity>().Where(x => x.PCode == request.GroupCode).AnyAsync();
existsNextGroup.ThrowIfTrue("存在下级分组,无法分配人员");
var relations = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().Where(x => x.GroupCode == request.GroupCode).ToListAsync();
await _dbContext.DeleteReallyAsync(relations);