fix 移除无效代码

This commit is contained in:
2024-03-29 10:42:22 +08:00
parent 780fff9e97
commit 1d2572e617

View File

@@ -264,14 +264,6 @@ public class DevicePermissionService : IDevicePermissionService
var deivces = await _dbContext.Queryable<DeviceEntity>().Where(x => deviceCodes.Contains(x.Code)).ToListAsync(); var deivces = await _dbContext.Queryable<DeviceEntity>().Where(x => deviceCodes.Contains(x.Code)).ToListAsync();
deviceCodes = deivces.Select(x => x.Code).ToList(); deviceCodes = deivces.Select(x => x.Code).ToList();
var userInfo = await _dbContext.Queryable<GainfoEntity>()
.LeftJoin<DepartmentEntity>((ga, department) => department.No == ga.DepartmentNo)
.Where(ga => ga.No == userNo)
.Select(ga => new
{
ga.Code
})
.SingleAsync();
var tasks = deviceCodes.Select(x => new DeviceTaskEntity var tasks = deviceCodes.Select(x => new DeviceTaskEntity
{ {
@@ -281,7 +273,8 @@ public class DevicePermissionService : IDevicePermissionService
UserNo = userNo, UserNo = userNo,
CancellationId = 0, CancellationId = 0,
Version = 0, Version = 0,
}).ToList(); })
.ToList();
await _dbContext.InsertAsync(tasks); await _dbContext.InsertAsync(tasks);
} }