|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.Application.Dtos;
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
using DS.WMS.Core.Settlement.Dtos;
|
|
|
|
|
using DS.WMS.Core.Settlement.Entity;
|
|
|
|
|
using DS.WMS.Core.Settlement.Interface;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.FeeApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发票结算API
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class InvoiceSettlementController : ApiController
|
|
|
|
|
{
|
|
|
|
|
readonly IInvoiceSettlementService _service;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 初始化
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="service"></param>
|
|
|
|
|
public InvoiceSettlementController(IInvoiceSettlementService service)
|
|
|
|
|
{
|
|
|
|
|
_service = service;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取发票结算单详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">结算单ID</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet, Route("Get")]
|
|
|
|
|
public async Task<DataResult<ApplicationSettlementDto>> GetAsync(long id)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetAsync(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取待结算的发票列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetInvoiceList")]
|
|
|
|
|
public async Task<DataResult<List<InvoiceDto>>> GetInvoiceListAsync([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetInvoiceListAsync(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取发票申请费用明细
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idModel"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetInvoiceDetails")]
|
|
|
|
|
public async Task<DataResult<List<ApplicationDetailDto>>> GetInvoiceDetailsAsync([FromBody] IdModel idModel)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetInvoiceDetailsAsync(idModel.Ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取发票费用明细的原始币别
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="documents"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("GetExchanges")]
|
|
|
|
|
public async Task<DataResult<List<SettlementDocument>>> GetExchangesAsync([FromBody] List<SettlementDocument> documents)
|
|
|
|
|
{
|
|
|
|
|
return await _service.GetExchangesAsync(documents);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据发票创建结算单
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost, Route("Save")]
|
|
|
|
|
public async Task<DataResult<ApplicationSettlement>> SaveAsync([FromBody] SettlementRequest<ApplicationSettlement> request)
|
|
|
|
|
{
|
|
|
|
|
return await _service.SaveAsync(request);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|