diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index ec9c0dda..0b881111 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -241,13 +241,20 @@ public class GainfoService : IGainfoService { var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == userCode).SingleAsync(); 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); var deviceCodes = await _devicePermissionService.GetAssignDeviceCodesAsync(gainfo.No); var dhDevices = await _dbContext.Queryable().LeftJoin((x, xt) => x.TemplateCode == xt.Code) - .Where((x, xt) => xt.Brand == "大华") + .Where((x, xt) => xt.Name == "大华人脸机") .Where(x => deviceCodes.Contains(x.Code)) .ToListAsync();