39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using EntrustSettle.Common;
|
|
using EntrustSettle.Controllers;
|
|
using EntrustSettle.IServices;
|
|
using EntrustSettle.Model;
|
|
using EntrustSettle.Model.Dtos;
|
|
using Mapster;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace EntrustSettle.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 发票
|
|
/// </summary>
|
|
public class InvoiceController : BaseApiController
|
|
{
|
|
private readonly IInvoiceApplyService invoiceApplyService;
|
|
public InvoiceController(IInvoiceApplyService invoiceApplyService)
|
|
{
|
|
this.invoiceApplyService = invoiceApplyService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取当前登陆人最后一次使用的开票信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public async Task<MessageModel<InvoiceInfoDto>> GetLastInfo()
|
|
{
|
|
var invoiceApply = await invoiceApplyService.AsQueryable().Where(x => x.CreateId == App.User.ID).OrderByDescending(x => x.Id).FirstAsync();
|
|
if (invoiceApply == null)
|
|
{
|
|
return Success<InvoiceInfoDto>(null);
|
|
}
|
|
var result = invoiceApply.Adapt<InvoiceInfoDto>();
|
|
return Success(result);
|
|
}
|
|
}
|
|
}
|