fix 工号匹配
This commit is contained in:
@@ -26,14 +26,11 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync()
|
||||
{
|
||||
var gainfoGroups = await _dbContext.Queryable<GainfoGroupEntity>()
|
||||
.Select<GainfoGroupTreeResponse>()
|
||||
.ToListAsync();
|
||||
.Select<GainfoGroupTreeResponse>()
|
||||
.ToListAsync();
|
||||
|
||||
var tops = gainfoGroups.Where(x => !x.PCode.HasValue).ToList();
|
||||
tops.ForEach(x =>
|
||||
{
|
||||
RecursionGetNext(x, gainfoGroups);
|
||||
});
|
||||
tops.ForEach(x => { RecursionGetNext(x, gainfoGroups); });
|
||||
|
||||
return tops;
|
||||
}
|
||||
@@ -80,9 +77,9 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
.ToListAsync();
|
||||
|
||||
var list = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => userNos.Contains(x.No))
|
||||
.Select<GainfoPageResponse>()
|
||||
.ToListAsync();
|
||||
.Where(x => userNos.Contains(x.No))
|
||||
.Select<GainfoPageResponse>()
|
||||
.ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -103,7 +100,10 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
var relations = await _dbContext.Queryable<GainfoGroupRelationshipEntity>().Where(x => x.GroupCode == request.GroupCode).ToListAsync();
|
||||
await _dbContext.DeleteReallyAsync(relations);
|
||||
|
||||
request.UserNos = await _dbContext.Queryable<GainfoEntity>().Where(x => request.UserNos.Contains(x.No)).Select(x => x.No).ToListAsync();
|
||||
request.UserNos = await _dbContext.Queryable<GainfoEntity>().Where(x => request.UserNos.Contains(x.No) || request.UserNos.Contains(x.Code))
|
||||
.Select(x => x.No)
|
||||
.ToListAsync();
|
||||
|
||||
var entities = request.UserNos.Select(x => new GainfoGroupRelationshipEntity
|
||||
{
|
||||
GroupCode = request.GroupCode,
|
||||
@@ -111,7 +111,6 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
}).ToList();
|
||||
|
||||
await _dbContext.InsertAsync(entities);
|
||||
|
||||
}, null);
|
||||
}
|
||||
|
||||
@@ -151,7 +150,6 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}).ToList();
|
||||
current.Next = next;
|
||||
foreach (var item in next)
|
||||
@@ -159,4 +157,4 @@ public class GainfoGroupService : IGainfoGroupService
|
||||
RecursionGetNext(item, gainfoGroups);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user