fix 简化代码

This commit is contained in:
2024-12-12 11:54:18 +08:00
parent 57e4028880
commit 5103c5adbb
3 changed files with 36 additions and 66 deletions

View File

@@ -127,39 +127,6 @@ public class DevicePermissionService : IDevicePermissionService
Priority = 0,
TenantId = currentTenantId
}).ToList());
// await GenerateDeviceTasksAsync(async () =>
// {
// await _dbContext.DeleteAsync(p);
//
// //保存配置的权限
// if (request.Values.IsPresent())
// {
// var nos = await _dbContext.Client.Queryable<GainfoEntity>()
// .Where(gainfo => factories.Contains(gainfo.Factory) || SqlFunc.Subqueryable<BusinessTripEntity>()
// .Where(x => factories.Contains(x.Destination) && SqlFunc.DateIsSame(x.BeginDate, today))
// .Any()
// )
// .Where(gainfo => request.Values.Contains(gainfo.Code) || request.Values.Contains(gainfo.No) || request.Values.Contains(gainfo.IdNo))
// .Select(gainfo => gainfo.No)
// .ToListAsync();
//
// //todo 临时注释
// //(gainfoNos.Count != request.Values.Count).ThrowIfTrue("存在非当前权限访问的人员,操作禁止!");
//
// var devicePermissions = nos.Select(v => new DevicePermissionEntity
// {
// UniqueType = request.UniqueType,
// UniqueValue = request.UniqueValue,
// AssignType = request.AssignType,
// AssignValue = v,
// TenantId = currentTenantId,
// Type = request.Type
// }).ToList();
//
// await _dbContext.InsertAsync(devicePermissions);
// }
// }, gainfoNos);
}
/// <inheritdoc />