Files
jinko.yikatong/Src/Dlhis.ScheduledTask/RecursionHelper.cs
2025-07-07 12:42:04 +08:00

27 lines
800 B
C#

using Dlhis.Entity.Basic.Entity;
using Dlhis.Entity.Device.Entities;
namespace Dlhis.ScheduledTask;
public static class RecursionHelper
{
public static List<Guid> HandlerDeviceGroupNextCodes(Guid current, List<DeviceGroupEntity> data)
{
var result = new List<Guid> { current };
InternalHandlerCodes(current, data, result);
return result;
static void InternalHandlerCodes(Guid internalCurrent, List<DeviceGroupEntity> internalData, List<Guid> internalResult)
{
var next = internalData.Where(x => x.PCode == internalCurrent);
foreach (var item in next)
{
internalResult.Add(item.Code);
InternalHandlerCodes(item.Code, internalData, internalResult);
}
}
}
}