fix 电子围栏增加部署方向
This commit is contained in:
@@ -49,6 +49,7 @@ public class EFenceService : IEFenceService
|
||||
Code = x.Code,
|
||||
Name = x.Name,
|
||||
Description = x.Description,
|
||||
DirectionType = x.DirectionType,
|
||||
DeviceCount = SqlFunc.Subqueryable<EFenceDeviceRelationEntity>().Where(p => p.EFenceCode == x.Code).Count(),
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
@@ -81,9 +82,8 @@ public class EFenceService : IEFenceService
|
||||
//查询设备
|
||||
var devices = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(d => deviceCodes.Contains(d.Code))
|
||||
.Where(d => d.DeployDirection.HasValue)
|
||||
.Where(d => SqlFunc.Subqueryable<EFenceDeviceRelationEntity>()
|
||||
.Where(p => p.EFenceCode == fence.Code && p.DeviceCode == d.Code)
|
||||
.Where(p => p.DeviceCode == d.Code)
|
||||
.NotAny() //不可重复分配
|
||||
)
|
||||
.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user