From 908a2ddb4e433db3108e472675cea74d69c8de69 Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 6 Aug 2024 21:48:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=99=BD=E5=90=8D=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Services/Implements/GainfoService.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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();