|
|
@ -1,6 +1,7 @@ |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.Extensions.Caching.Memory; |
|
|
using Microsoft.Extensions.Caching.Memory; |
|
|
|
|
|
using NPOI.POIFS.Properties; |
|
|
using Shentun.Peis.CustomerOrgRegisters; |
|
|
using Shentun.Peis.CustomerOrgRegisters; |
|
|
using Shentun.Peis.Enums; |
|
|
using Shentun.Peis.Enums; |
|
|
using Shentun.Peis.HelperDto; |
|
|
using Shentun.Peis.HelperDto; |
|
|
@ -271,6 +272,37 @@ namespace Shentun.Peis.CustomerOrgs |
|
|
return dataList.OrderBy(o => o.DisplayOrder).ToList(); |
|
|
return dataList.OrderBy(o => o.DisplayOrder).ToList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据父ID获取单位列表 分级获取
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("api/app/CustomerOrg/GetCustomerOrgByParentId")] |
|
|
|
|
|
public async Task<List<CustomerOrgBaseDto>> GetCustomerOrgByParentIdAsync(ParentIdInputDto input) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var parentIds = (await Repository.GetQueryableAsync()).Where(m => m.ParentId != null).Select(s => s.ParentId).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var query = await Repository.GetQueryableAsync(); |
|
|
|
|
|
|
|
|
|
|
|
query = query.Where(m => m.ParentId == input.ParentId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entListDto = query.ToList().Select(s => new CustomerOrgBaseDto |
|
|
|
|
|
{ |
|
|
|
|
|
CustomerOrgCode = s.CustomerOrgCode, |
|
|
|
|
|
ParentId = s.ParentId, |
|
|
|
|
|
DisplayName = s.DisplayName, |
|
|
|
|
|
DisplayOrder = s.DisplayOrder, |
|
|
|
|
|
Id = s.Id, |
|
|
|
|
|
ShortName = s.ShortName, |
|
|
|
|
|
SimpleCode = s.SimpleCode, |
|
|
|
|
|
IsChild = parentIds.Any() && parentIds.Contains(s.Id) ? 'Y' : 'N', |
|
|
|
|
|
}).OrderBy(o => o.DisplayOrder).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
return entListDto; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 获取单位树型结构
|
|
|
/// 获取单位树型结构
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -351,7 +383,7 @@ namespace Shentun.Peis.CustomerOrgs |
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.AddRange(customerOrgTreeChildList); |
|
|
result.AddRange(customerOrgTreeChildList); |
|
|
|