diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs
index 84ab0fb5..3e5a39b3 100644
--- a/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs
+++ b/Src/Dlhis.Basic/Organization/Controllers/GainfoPermissionsController.cs
@@ -1,10 +1,8 @@
-using System.ComponentModel.DataAnnotations;
-using Dlhis.Basic.BusinessPlace.Response;
+using Dlhis.Basic.BusinessPlace.Response;
using Dlhis.Basic.Device.Response;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
using Dlhis.Basic.Organization.Services;
-using Dlhis.Basic.Organization.Services.Implements;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -42,7 +40,7 @@ public class GainfoPermissionsController : ControllerBase
///
///
[HttpGet("devicesUnderGroupByUserNo")]
- public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, string deviceGroupCode)
+ public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode)
{
return await _gainfoPermissions.GetDevicesUnderGroupByUserNoAsync(userNo, deviceGroupCode);
}
diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoPermissions.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoPermissions.cs
index 7b1f6183..0e146416 100644
--- a/Src/Dlhis.Basic/Organization/Services/IGainfoPermissions.cs
+++ b/Src/Dlhis.Basic/Organization/Services/IGainfoPermissions.cs
@@ -2,7 +2,6 @@
using Dlhis.Basic.Device.Response;
using Dlhis.Basic.Organization.Request;
using Dlhis.Basic.Organization.Response;
-using Dlhis.Basic.Organization.Services.Implements;
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.Basic.Organization.Services;
@@ -11,7 +10,7 @@ public interface IGainfoPermissions : IScopeDependency
{
Task> GetPlaceByGainfoAsync(DeviceAssRequest request);
- Task> GetDevicesUnderGroupByUserNoAsync(string userNo, string deviceGroupCode);
+ Task> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode);
Task> GetAssignDeviceCodesAsync(DeviceAssRequest request);
}
diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs
index 2bcc5fe4..bda8b03e 100644
--- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs
+++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoPermissions.cs
@@ -8,12 +8,9 @@ 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;
-using Org.BouncyCastle.Asn1.Ocsp;
-using Org.BouncyCastle.Crypto;
using SqlSugar;
namespace Dlhis.Basic.Organization.Services.Implements;
@@ -48,8 +45,8 @@ public class GainfoPermissions : IGainfoPermissions
return await _dbContext.Queryable()
.LeftJoin((x, dr) => x.UniqueNo == dr.DeviceUniqueNo)
.LeftJoin((x, dr, place) => dr.BusinessPlaceCode == place.Code)
- .LeftJoin((x,dr,place, ps) => x.Code == ps.PlaceCode)
- .LeftJoin((x, dr, place, ps,s) => s.Code == ps.ShiftCode)
+ .LeftJoin((x, dr, place, ps) => x.Code == ps.PlaceCode)
+ .LeftJoin((x, dr, place, ps, s) => s.Code == ps.ShiftCode)
.Where(x => x.Type == DeviceTypeEnumType.Meal)
.Where(x => deviceCodes.Contains(x.Code))
.Where((x, dr) => !string.IsNullOrEmpty(dr.BusinessPlaceCustomCode))
@@ -70,11 +67,14 @@ public class GainfoPermissions : IGainfoPermissions
.ToPageListAsync(request);
}
- public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, string deviceGroupCode)
+ public async Task> GetDevicesUnderGroupByUserNoAsync(string userNo, Guid deviceGroupCode)
{
var deviceGroups = await _dbContext.Queryable().ToListAsync();
- var currentGroup = deviceGroups.Where(x => x.Code.ToString() == deviceGroupCode).FirstOrDefault();
- currentGroup.ThrowIfNull($"{deviceGroupCode}在设备组中不存在");
+ var currentGroup = deviceGroups.Where(x => x.Code == deviceGroupCode).FirstOrDefault();
+ if (currentGroup == null)
+ {
+ return new List();
+ }
var groups = RecursionGetNext(currentGroup, deviceGroups).ToList();
@@ -96,21 +96,21 @@ public class GainfoPermissions : IGainfoPermissions
.LeftJoin((d, dt, dr, bp) => dr.BusinessPlaceCode == bp.Code)
.Where(d => nos.Contains(d.UniqueNo))
.Select((d, dt, dr, bp) => new DevicePageResponse
- {
- FuncsStr = d.Funcs.ToString(),
- Brand = dt.Brand,
- Type = d.Type,
- BusinessPlaceCode = bp.Code,
- BusinessPlaceName = bp.Name,
- 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,
+ {
+ FuncsStr = d.Funcs.ToString(),
+ Brand = dt.Brand,
+ Type = d.Type,
+ BusinessPlaceCode = bp.Code,
+ BusinessPlaceName = bp.Name,
+ 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();
@@ -146,9 +146,9 @@ public class GainfoPermissions : IGainfoPermissions
return lst;
}
- public async Task> GetAssignDeviceCodesAsync(DeviceAssRequest request)
+ public async Task> GetAssignDeviceCodesAsync(DeviceAssRequest request)
{
- var ids = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
+ var ids = await _devicePermissionService.GetAssignDeviceCodesAsync(request.UserNo);
var page = await _dbContext.Queryable()
.LeftJoin((d, dt) => d.TemplateCode == dt.Code)