feat 退款接口
This commit is contained in:
@@ -19,10 +19,12 @@ namespace Dlhis.Canteen.Order.Controllers;
|
||||
public class BalancesController : ControllerBase
|
||||
{
|
||||
private readonly IBalanceService _balanceService;
|
||||
private readonly IHainingBalanceService _hainingBalanceService;
|
||||
|
||||
public BalancesController(IBalanceService balanceService)
|
||||
public BalancesController(IBalanceService balanceService, IHainingBalanceService hainingBalanceService)
|
||||
{
|
||||
_balanceService = balanceService;
|
||||
_hainingBalanceService = hainingBalanceService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -47,6 +49,17 @@ public class BalancesController : ControllerBase
|
||||
await _balanceService.SupplementBalanceAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 退款
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
[HttpPost("refund")]
|
||||
[Transactional(IsolationLevel.ReadCommitted)]
|
||||
public async Task<OrderResultResponse> RefundAsync(BalanceRecordRefundRequest request)
|
||||
{
|
||||
return await _balanceService.RefundAsync(request.No);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 营业点消费明细
|
||||
@@ -135,7 +148,7 @@ public class BalancesController : ControllerBase
|
||||
[HttpPost("haining/import")]
|
||||
public async Task Import(BalanceHainingImportRequest request)
|
||||
{
|
||||
await _balanceService.HainingImportAsync(request);
|
||||
await _hainingBalanceService.HainingImportAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -147,7 +160,7 @@ public class BalancesController : ControllerBase
|
||||
[HttpGet("haining/list")]
|
||||
public async Task<List<BalanceHainingDownloadResponse>> HainingDownloadAsync([Required(ErrorMessage = "工号不能为空")] string userCode)
|
||||
{
|
||||
return await _balanceService.HainingDownloadAsync(userCode);
|
||||
return await _hainingBalanceService.HainingDownloadAsync(userCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -174,6 +187,6 @@ public class BalancesController : ControllerBase
|
||||
[Transactional(IsolationLevel.ReadCommitted)]
|
||||
public async Task ReCalcAsync(BalanceReCalcRequest request)
|
||||
{
|
||||
await _balanceService.ReCalcAsync(request);
|
||||
await _balanceService.ReCalcAsync(request.UserCode);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user