28 lines
766 B
C#
28 lines
766 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Syc.Basic.Web.WMS.Entitys;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Syc.Basic.Web.WMS.ServiceTool
|
|
{
|
|
public class OrganizationTool
|
|
{
|
|
public List<Organization> GetOrganizationList(int? Pid, List<Organization> organizationsData)
|
|
{
|
|
List<Organization> list = new List<Organization>();
|
|
|
|
list = organizationsData.Where(x => x.Pid == Pid).ToList();
|
|
if (list.Any())
|
|
{
|
|
list.ForEach(item =>{item.Children = GetOrganizationList(item.Id, organizationsData);});
|
|
}
|
|
else
|
|
list = null;
|
|
return list;
|
|
}
|
|
}
|
|
}
|