fix 白名单设置
This commit is contained in:
@@ -241,13 +241,20 @@ public class GainfoService : IGainfoService
|
|||||||
{
|
{
|
||||||
var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == userCode).SingleAsync();
|
var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == userCode).SingleAsync();
|
||||||
gainfo.ThrowIfNull("档案信息不存在");
|
gainfo.ThrowIfNull("档案信息不存在");
|
||||||
gainfo.Type = GainfoUserTypeEnumType.SecurityWhite;
|
|
||||||
|
gainfo.Type = gainfo.Type switch
|
||||||
|
{
|
||||||
|
GainfoUserTypeEnumType.Normal => GainfoUserTypeEnumType.SecurityWhite,
|
||||||
|
GainfoUserTypeEnumType.SecurityWhite => GainfoUserTypeEnumType.Normal,
|
||||||
|
_ => gainfo.Type
|
||||||
|
};
|
||||||
|
|
||||||
await _dbContext.UpdateAsync(gainfo);
|
await _dbContext.UpdateAsync(gainfo);
|
||||||
|
|
||||||
var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(gainfo.No);
|
var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(gainfo.No);
|
||||||
|
|
||||||
var dhDevices = await _dbContext.Queryable<DeviceEntity>().LeftJoin<DeviceTemplateEntity>((x, xt) => x.TemplateCode == xt.Code)
|
var dhDevices = await _dbContext.Queryable<DeviceEntity>().LeftJoin<DeviceTemplateEntity>((x, xt) => x.TemplateCode == xt.Code)
|
||||||
.Where((x, xt) => xt.Brand == "大华")
|
.Where((x, xt) => xt.Name == "大华人脸机")
|
||||||
.Where(x => deviceCodes.Contains(x.Code))
|
.Where(x => deviceCodes.Contains(x.Code))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user