fix 补充被分配人校验
This commit is contained in:
@@ -161,6 +161,11 @@ public class WorkGridService : IWorkGridService
|
||||
/// <inheritdoc />
|
||||
public async Task ChangeAsync(string from, string to)
|
||||
{
|
||||
if (await _dbContext.Queryable<WorkGridEntity>().Where(x => x.LeaderUserCode == to).AnyAsync())
|
||||
{
|
||||
true.ThrowIfTrue($"{to}已存在网格,不可操作");
|
||||
}
|
||||
|
||||
var workGrid = await _dbContext.Queryable<WorkGridEntity>().Where(x => x.LeaderUserCode == from).SingleAsync();
|
||||
workGrid.ThrowIfNull($"{from}管理的网格不存在");
|
||||
|
||||
@@ -238,12 +243,12 @@ public class WorkGridService : IWorkGridService
|
||||
.SingleAsync();
|
||||
|
||||
myWorkGrid.ThrowIfNull("工作网格尚未配置,请联系管理员");
|
||||
|
||||
|
||||
var existsAssigned = await _dbContext.Queryable<WorkGridUserEntity>()
|
||||
.Where(x => request.UserCodes.Contains(x.UserCode))
|
||||
.AnyAsync();
|
||||
existsAssigned.ThrowIfTrue("存在已经分配人员,操作失败!");
|
||||
|
||||
|
||||
//检查配置的人员
|
||||
var count = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => x.Factory == currentFactory)
|
||||
|
||||
Reference in New Issue
Block a user