将定时任务改为,发布、订阅模式的消息队列执行任务

This commit is contained in:
alex
2023-08-15 13:53:04 +08:00
parent 4c1e3c8c40
commit 28b7800baf
13 changed files with 238 additions and 45 deletions

View File

@@ -75,7 +75,7 @@ namespace Tnb.WarehouseMgr
/// 齐套出库(新增状态)
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpPost, Timed(Name = nameof(KittingOutByAdd))]
public async Task KittingOutByAdd(CancellationTokenSource? cts = default)
{
var aToken = await _cacheManager.GetAsync("AsscessToken");
@@ -163,7 +163,7 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
JNPF.Logging.Log.Error("齐套出库,新增时出现错误", ex);
Log.Error("齐套出库,新增时出现错误", ex);
await curDb.Ado.RollbackTranAsync();
TimedTaskErrorInfo ei = new()
{
@@ -175,12 +175,16 @@ namespace Tnb.WarehouseMgr
cts?.Cancel();
throw timedTaskEx;
}
finally
{
}
}
/// <summary>
/// 齐套出库,(待配送状态)
/// </summary>
/// <returns></returns>
[HttpPost]
[HttpPost, Timed(Name = nameof(KittingOutByIsToBeShipped))]
public async Task KittingOutByIsToBeShipped(CancellationTokenSource? cts = default)
{
var aToken = await _cacheManager.GetAsync("AsscessToken");
@@ -272,7 +276,7 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
JNPF.Logging.Log.Error("齐套出库,待配送时出现错误", ex);
Log.Error("齐套出库,待配送时出现错误", ex);
TimedTaskErrorInfo ei = new()
{
RequestURL = App.HttpContext?.Request?.Path,