|
|
|
@ -40,13 +40,17 @@ namespace Shentun.Peis.AbpUserDepartments |
|
|
|
public async Task CreateManyAsync(Guid UserId, List<Guid> OrganizationUnitIds) |
|
|
|
{ |
|
|
|
|
|
|
|
if (UserId == Guid.Empty || !OrganizationUnitIds.Any()) |
|
|
|
if (UserId == Guid.Empty) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"请求参数有误"); |
|
|
|
} |
|
|
|
|
|
|
|
await _abpUserDepartmentRepository.DeleteAsync(d => d.UserId == UserId, true); |
|
|
|
|
|
|
|
|
|
|
|
if (OrganizationUnitIds.Any()) |
|
|
|
{ |
|
|
|
|
|
|
|
List<AbpUserDepartment> entlist = new List<AbpUserDepartment>(); |
|
|
|
foreach (var org in OrganizationUnitIds) |
|
|
|
{ |
|
|
|
@ -60,6 +64,7 @@ namespace Shentun.Peis.AbpUserDepartments |
|
|
|
|
|
|
|
await _abpUserDepartmentRepository.InsertManyAsync(entlist, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|