费用模板明细删除

usertest
嵇文龙 3 months ago
parent 4f95d809c4
commit 05d3b7b085

@ -0,0 +1,26 @@
using DS.Module.Core;
using DS.WMS.Core.Invoice.Dtos;
namespace DS.WMS.Core.Invoice.Interface
{
/// <summary>
/// 发票开具
/// </summary>
public interface IInvoiceIssuanceService
{
/// <summary>
/// 发起开票请求
/// </summary>
/// <param name="ids">开票的发票ID</param>
/// <returns></returns>
Task<DataResult<string>> InitiateAsync(params long[] ids);
/// <summary>
/// 添加租户信息
/// </summary>
/// <param name="tenant">租户信息</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException">当<paramref name="tenant"/>为null时引发。</exception>
Task<string> AddTenantAsync(Tenant tenant);
}
}

@ -96,5 +96,19 @@ namespace DS.WMS.FeeApi.Controllers
return await _invokeService.DeleteAsync(model);
}
/// <summary>
/// 根据ID删除明细
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("DeleteDetails")]
public async Task<DataResult> DeleteAsync([FromServices] IFeeCustTemplateDetailService detailService, [FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await detailService.DeleteAsync(model);
}
}
}

@ -31,22 +31,11 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetApplicationList")]
public async Task<DataResult<List<InvoiceApplicationDto>>> GetApplicationListAsync([FromBody]PageRequest request)
public async Task<DataResult<List<InvoiceApplicationDto>>> GetApplicationListAsync([FromBody] PageRequest request)
{
return await _service.GetApplicationListAsync(request);
}
/// <summary>
/// 获取发票申请明细
/// </summary>
/// <param name="id">申请单ID</param>
/// <returns></returns>
[HttpGet, Route("GetApplicationDetails")]
public async Task<DataResult<List<InvoiceApplicationDetailDto>>> GetApplicationDetailsAsync([FromQuery]long id)
{
return await _service.GetApplicationDetailsAsync(id);
}
/// <summary>
/// 获取发票申请明细
/// </summary>
@ -78,7 +67,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request">请求参数</param>
/// <returns></returns>
[HttpPost, Route("Save")]
public async Task<DataResult<Invoice>> SaveAsync([FromBody]InvoiceRequest<Invoice> request)
public async Task<DataResult<Invoice>> SaveAsync([FromBody] InvoiceRequest<Invoice> request)
{
if (!ModelState.IsValid)
return DataResult<Invoice>.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
@ -142,5 +131,33 @@ namespace DS.WMS.FeeApi.Controllers
bool isLocked = Convert.ToBoolean(model.Value);
return await _service.SetLockAsync(isLocked, model.Ids);
}
/// <summary>
/// 发起开票请求
/// </summary>
/// <param name="issuanceService"></param>
/// <param name="idModel">开票的发票ID</param>
/// <returns></returns>
[HttpPost, Route("Initiate")]
public async Task<DataResult<string>> InitiateAsync([FromServices] IInvoiceIssuanceService issuanceService,
[FromBody] IdModel idModel)
{
if (!ModelState.IsValid)
return DataResult<string>.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await issuanceService.InitiateAsync(idModel.Ids);
}
/// <summary>
/// 添加租户信息
/// </summary>
/// <param name="issuanceService"></param>
/// <param name="tenant">租户信息</param>
/// <returns></returns>
[HttpPost, Route("AddTenant")]
public async Task<string> AddTenantAsync([FromServices] IInvoiceIssuanceService issuanceService, Tenant tenant)
{
return await issuanceService.AddTenantAsync(tenant);
}
}
}

Loading…
Cancel
Save