From 6e36cad158902f8339a5692452eec06f85762224 Mon Sep 17 00:00:00 2001 From: cheche <717840555@qq.com> Date: Tue, 12 Mar 2024 16:02:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=AE=BE=E5=A4=87=E6=8F=90=E9=86=92=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/Implements/GainfoPermissions.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs index 14707aa6..2bcc5fe4 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs @@ -8,6 +8,7 @@ using Dlhis.Entity.Canteen.Entities; using Dlhis.Entity.Canteen.Enums; using Dlhis.Entity.Device.Entities; using Dlhis.Entity.Device.Enums; +using Kurisu.AspNetCore.Utils.Extensions; using Kurisu.Core.DataAccess.Dto; using Kurisu.SqlSugar.Extensions; using Kurisu.SqlSugar.Services; @@ -72,7 +73,8 @@ public class GainfoPermissions : IGainfoPermissions public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, string deviceGroupCode) { var deviceGroups = await _dbContext.Queryable().ToListAsync(); - var currentGroup = deviceGroups.Where(x => x.Code.ToString() == deviceGroupCode).First(); + var currentGroup = deviceGroups.Where(x => x.Code.ToString() == deviceGroupCode).FirstOrDefault(); + currentGroup.ThrowIfNull($"{deviceGroupCode}在设备组中不存在"); var groups = RecursionGetNext(currentGroup, deviceGroups).ToList(); @@ -100,8 +102,16 @@ public class GainfoPermissions : IGainfoPermissions Type = d.Type, BusinessPlaceCode = bp.Code, BusinessPlaceName = bp.Name, - LastHeartbeatTime = dr.LastHeartbeatTime - }) + LastHeartbeatTime = dr.LastHeartbeatTime, + UniqueNo = d.UniqueNo, + Supplier = d.Supplier, + DeployPlace = d.DeployPlace, + DeployPosition = d.DeployPosition, + DeployDirection = d.DeployDirection, + TemplateCode = dt.Code, + ConnectionInfo = d.ConnectionInfo, + Enable = d.Enable, + }) .ToListAsync(); var deviceUniqueNos = page.Select(x => x.UniqueNo).ToList();