更新发票号码

dev
嵇文龙 4 weeks ago
parent 41e95fa6c5
commit e28c3e739a

@ -18,9 +18,9 @@ namespace DS.WMS.Core.Invoice.Interface
/// <summary>
/// 更新发票号码
/// </summary>
/// <param name="sn">开票流水号</param>
/// <param name="id"></param>
/// <returns></returns>
Task<DataResult> UpdateInvoiceNumberAsync(string sn);
Task<DataResult> UpdateInvoiceNumberAsync(long id);
/// <summary>
/// 发票冲红

@ -134,9 +134,9 @@ namespace DS.WMS.Core.Invoice.Method
var invoices = ids.Select(x => new Entity.Invoice { Id = x, SN = sn, ApiType = InvoiceApiType.Default }).ToList();
await TenantDb.Updateable(invoices).UpdateColumns(x => new { x.SN, x.ApiType }).ExecuteCommandAsync();
UpdateInvoiceNumberAsync(sn);
await UpdateInvoiceNumberAsync(sn);
return DataResult.Success;
return DataResult.Successed("开票已提交", data: sn);
}
else
{
@ -175,9 +175,9 @@ namespace DS.WMS.Core.Invoice.Method
if (queryResult == null || !queryResult.Success)
return DataResult.Failed(queryResult?.Message);
List<Entity.Invoice> invoices = [];
if (queryResult.Data.Order?.Count > 0)
{
List<Entity.Invoice> invoices = [];
foreach (var item in queryResult.Data.Order)
{
var inv = new Entity.Invoice
@ -218,7 +218,24 @@ namespace DS.WMS.Core.Invoice.Method
}).ExecuteCommandAsync();
}
return DataResult.Success;
var result2 = DataResult.Success;
result2.Data = invoices;
return result2;
}
/// <summary>
/// 更新发票号码
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult> UpdateInvoiceNumberAsync(long id)
{
var model = await TenantDb.Queryable<Entity.Invoice>().Where(x => x.Id == id)
.Select(x => new { x.Id, x.SN, x.SaleDeptId, x.ApiType }).FirstAsync();
if (model == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
return await UpdateInvoiceNumberAsync(model.SN);
}
/// <summary>

@ -146,6 +146,18 @@ namespace DS.WMS.FeeApi.Controllers
return await _service.SetLockAsync(isLocked, model.Ids);
}
/// <summary>
/// 请求开票API查询发票状态
/// </summary>
/// <param name="issuanceService"></param>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost, Route("ApiQuery")]
public async Task<DataResult> ApiQueryAsync([FromServices] IInvoiceIssuanceService issuanceService, long id)
{
return await issuanceService.UpdateInvoiceNumberAsync(id);
}
/// <summary>
/// 发起开票请求
/// </summary>

Loading…
Cancel
Save