|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
using Furion.DatabaseAccessor;
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
using Furion.EventBus;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
@ -9,6 +8,7 @@ using Microsoft.Extensions.Logging;
|
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
|
using Myshipping.Application.Service.Fee.Dto;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
@ -30,6 +30,7 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly ILogger<FeeRecordService> _logger;
|
|
|
|
|
private readonly ISysCacheService _cache;
|
|
|
|
|
private readonly ISysUserRoleService _sysUserRoleService;
|
|
|
|
|
private readonly IDjyCustomerService _customerService;
|
|
|
|
|
|
|
|
|
|
private readonly IEventPublisher _publisher;
|
|
|
|
|
|
|
|
|
@ -37,11 +38,13 @@ namespace Myshipping.Application
|
|
|
|
|
ISysCacheService cache,
|
|
|
|
|
IEventPublisher publisher,
|
|
|
|
|
SqlSugarRepository<FeeRecord> repRecord,
|
|
|
|
|
ISysUserRoleService sysUserRoleService)
|
|
|
|
|
ISysUserRoleService sysUserRoleService,
|
|
|
|
|
IDjyCustomerService customerService)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_cache = cache;
|
|
|
|
|
_sysUserRoleService = sysUserRoleService;
|
|
|
|
|
_customerService = customerService;
|
|
|
|
|
|
|
|
|
|
_publisher = publisher;
|
|
|
|
|
|
|
|
|
@ -142,5 +145,58 @@ namespace Myshipping.Application
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据类型获取结算对象列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/FeeRecord/GetFeeCustomerList")]
|
|
|
|
|
public async Task<List<FeeCustomerDto>> GetFeeCustomerList(string code)
|
|
|
|
|
{
|
|
|
|
|
List<FeeCustomerDto> result = new();
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
// 船司
|
|
|
|
|
case "carrier":
|
|
|
|
|
{
|
|
|
|
|
List<CodeCarrier> list = await _cache.GetAllCodeCarrier();
|
|
|
|
|
return list.Select(x => new FeeCustomerDto()
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Name = x.CnName
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
// 船代
|
|
|
|
|
case "shipagency":
|
|
|
|
|
{
|
|
|
|
|
List<CodeForwarder> list = await _cache.GetAllCodeForwarder();
|
|
|
|
|
return list.Select(x => new FeeCustomerDto()
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Name = x.Name
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
// 场站
|
|
|
|
|
case "yard":
|
|
|
|
|
{
|
|
|
|
|
List<CodeYard> list = await _cache.GetAllCodeYard();
|
|
|
|
|
return list.Select(x => new FeeCustomerDto()
|
|
|
|
|
{
|
|
|
|
|
Code = x.Code,
|
|
|
|
|
Name = x.Name
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
// 往来单位
|
|
|
|
|
default:
|
|
|
|
|
{
|
|
|
|
|
List<(string codeName, string shortName)> list = await _customerService.QueryDjyCustomerByProp(new string[] { code });
|
|
|
|
|
return list.Select(x => new FeeCustomerDto()
|
|
|
|
|
{
|
|
|
|
|
Code = x.codeName,
|
|
|
|
|
Name = x.shortName
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|