diff --git a/src/WmsWebApi.Application/Boms/BomService.cs b/src/WmsWebApi.Application/Boms/BomService.cs index f9bd976..63b4f20 100644 --- a/src/WmsWebApi.Application/Boms/BomService.cs +++ b/src/WmsWebApi.Application/Boms/BomService.cs @@ -27,7 +27,6 @@ public class BomService : ApplicationService, IBomService private readonly IBomManager _bomDtoRepository; private readonly TmPgWmsUpdate _tmPgWmsUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// @@ -41,7 +40,6 @@ public class BomService : ApplicationService, IBomService IBomManager bomDtoRepository, TmPgWmsUpdate tmPgWmsUpdate , Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager, IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tmPgPartgroupRepository = tmPgPartgroupRepository; @@ -50,7 +48,6 @@ public class BomService : ApplicationService, IBomService _bomDtoRepository = bomDtoRepository; _tmPgWmsUpdate = tmPgWmsUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; _backgroundJobRequestRetry = backgroundJobRequestRetry; } @@ -95,7 +92,6 @@ public class BomService : ApplicationService, IBomService try { - throw new Exception("异常了"); var _remark = DateTime.Now.ToString("yyyy-MM-dd") + "!" + Guid.NewGuid(); if (_bom.WERKS == "1000") { diff --git a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs index 61fcc07..942472d 100644 --- a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs +++ b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs @@ -11,7 +11,9 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.Purchase; using WmsWebApi.Wms; @@ -32,7 +34,7 @@ public class OtherZllService : ApplicationService, IOtherZllService private readonly ITLTransactionRepository _tlTransactionRepository; private readonly TmPgWmsUpdate _tmPgWmsUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -48,7 +50,7 @@ public class OtherZllService : ApplicationService, IOtherZllService ITLTransactionRepository tlTransactionRepository, TmPgWmsUpdate tmPgWmsUpdate, Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tsStockDetailRepository = tsStockDetailRepository; _tbProductReceiveRepository = tbProductReceiveRepository; @@ -59,7 +61,7 @@ public class OtherZllService : ApplicationService, IOtherZllService _tlTransactionRepository = tlTransactionRepository; _tmPgWmsUpdate = tmPgWmsUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -350,7 +352,7 @@ public class OtherZllService : ApplicationService, IOtherZllService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.OtherZllAdd, content.ToString()); } throw; @@ -376,25 +378,4 @@ public class OtherZllService : ApplicationService, IOtherZllService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.OtherZllAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/PPlan/PPlanService.cs b/src/WmsWebApi.Application/PPlan/PPlanService.cs index a10bf51..8d2cf53 100644 --- a/src/WmsWebApi.Application/PPlan/PPlanService.cs +++ b/src/WmsWebApi.Application/PPlan/PPlanService.cs @@ -9,7 +9,9 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.PPLan; using WmsWebApi.Wms; @@ -28,7 +30,7 @@ public class PPlanService : ApplicationService, IPPlanService private readonly IPPlanManager _pplanDtoRepository; private readonly TmPgWmsUpdate _tmPgWmsUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -42,7 +44,7 @@ public class PPlanService : ApplicationService, IPPlanService IPPlanManager pplanDtoRepository, TmPgWmsUpdate tmPgWmsUpdate, Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tmPgPartgroupRepository = tmPgPartgroupRepository; _tmPgPlanRepository = tmPgPlanRepository; @@ -51,7 +53,7 @@ public class PPlanService : ApplicationService, IPPlanService _pplanDtoRepository = pplanDtoRepository; _tmPgWmsUpdate = tmPgWmsUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -179,7 +181,7 @@ public class PPlanService : ApplicationService, IPPlanService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.PPlanAdd, content.ToString()); } throw new Exception($"接口异常,请稍后重试:{ex.GetBaseException().Message}", ex); @@ -217,25 +219,4 @@ public class PPlanService : ApplicationService, IPPlanService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.PPlanAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs b/src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs index b48cc7b..2534475 100644 --- a/src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs +++ b/src/WmsWebApi.Application/ProductRecieve/ProductRecieveService.cs @@ -11,8 +11,10 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.Domain; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.PPlan; using WmsWebApi.ProductRecieve; using WmsWebApi.Wms; @@ -35,7 +37,7 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService private readonly ITaStoreLocationRepository _taStoreLocationRepository; private readonly IConfiguration _configuration; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -52,7 +54,7 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService TmPgWmsUpdate tmPgWmsUpdate, IConfiguration configuration, IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tsStockDetailRepository = tsStockDetailRepository; _tbProductReceiveRepository = tbProductReceiveRepository; @@ -64,7 +66,7 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService _tmPgWmsUpdate = tmPgWmsUpdate; _configuration = configuration; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -264,7 +266,7 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.ProductRecieveAdd, content.ToString()); } throw new Exception($"接口异常,请稍后重试:{ex.GetBaseException().Message}", ex); @@ -299,25 +301,4 @@ public class ProductRecieveService : ApplicationService, IProductRecieveService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.ProductRecieveAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/Purchase/PurchaseService.cs b/src/WmsWebApi.Application/Purchase/PurchaseService.cs index ecbe645..4f501a6 100644 --- a/src/WmsWebApi.Application/Purchase/PurchaseService.cs +++ b/src/WmsWebApi.Application/Purchase/PurchaseService.cs @@ -9,8 +9,10 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.Domain; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.Purchase; using WmsWebApi.Wms; @@ -31,7 +33,7 @@ public class PurchaseService : ApplicationService, IPurchaseService private readonly ITLTransactionRepository _tlTransactionRepository; private readonly TmPgWmsUpdate _tmPgWmsUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -47,7 +49,7 @@ public class PurchaseService : ApplicationService, IPurchaseService ITLTransactionRepository tlTransactionRepository, TmPgWmsUpdate tmPgWmsUpdate, IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tsStockDetailRepository = tsStockDetailRepository; _tbProductReceiveRepository = tbProductReceiveRepository; @@ -58,7 +60,7 @@ public class PurchaseService : ApplicationService, IPurchaseService _tlTransactionRepository = tlTransactionRepository; _tmPgWmsUpdate = tmPgWmsUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -357,7 +359,7 @@ public class PurchaseService : ApplicationService, IPurchaseService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.PurchaseAdd, content.ToString()); } throw new Exception($"接口异常,请稍后重试:{ex.GetBaseException().Message}", ex); @@ -395,25 +397,4 @@ public class PurchaseService : ApplicationService, IPurchaseService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.PurchaseAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/StockMove/StockMoveService.cs b/src/WmsWebApi.Application/StockMove/StockMoveService.cs index a035c44..d1cc040 100644 --- a/src/WmsWebApi.Application/StockMove/StockMoveService.cs +++ b/src/WmsWebApi.Application/StockMove/StockMoveService.cs @@ -10,8 +10,10 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.Domain; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.StockMove; using WmsWebApi.Wms; @@ -33,7 +35,7 @@ public class StockMoveService : ApplicationService, IStockMoveService private readonly ITaStoreLocationRepository _taStoreLocationRepository; private readonly IConfiguration _configuration; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -50,7 +52,7 @@ public class StockMoveService : ApplicationService, IStockMoveService TmPgWmsUpdate tmPgWmsUpdate, IConfiguration configuration, IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tsStockDetailRepository = tsStockDetailRepository; _tbStockMoveRepository = tbStockMoveRepository; @@ -62,7 +64,7 @@ public class StockMoveService : ApplicationService, IStockMoveService _tmPgWmsUpdate = tmPgWmsUpdate; _configuration = configuration; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -393,7 +395,7 @@ public class StockMoveService : ApplicationService, IStockMoveService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.StockMoveAdd, content.ToString()); } throw new Exception($"接口异常,请稍后重试:{ex.GetBaseException().Message}", ex); @@ -424,25 +426,4 @@ public class StockMoveService : ApplicationService, IStockMoveService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.StockMoveAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/TbParts/PartService.cs b/src/WmsWebApi.Application/TbParts/PartService.cs index 37ab6e0..ddc142a 100644 --- a/src/WmsWebApi.Application/TbParts/PartService.cs +++ b/src/WmsWebApi.Application/TbParts/PartService.cs @@ -10,8 +10,10 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using WmsWebApi.BackgroundJob; +using WmsWebApi.BackgroundJobs; using WmsWebApi.Domain; using WmsWebApi.EntityFrameworkCore; +using WmsWebApi.Enums; using WmsWebApi.Wms; namespace WmsWebApi.Parts; @@ -28,7 +30,7 @@ public class PartService : ApplicationService, IPartService private readonly IPartManager _partDtoRepository; private readonly TmPgWmsUpdate _tmPgWmsUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -40,7 +42,7 @@ public class PartService : ApplicationService, IPartService IPartManager partDtoRepository, TmPgWmsUpdate tmPgWmsUpdate, IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _tmPgPartgroupRepository = tmPgPartgroupRepository; _taPartRepository = taPartRepository; @@ -48,7 +50,7 @@ public class PartService : ApplicationService, IPartService _partDtoRepository = partDtoRepository; _tmPgWmsUpdate = tmPgWmsUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -282,7 +284,7 @@ public class PartService : ApplicationService, IPartService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.PartAdd, content.ToString()); } throw new Exception($"接口异常,请稍后重试:{ex.GetBaseException().Message}", ex); @@ -320,25 +322,4 @@ public class PartService : ApplicationService, IPartService await uow.SaveChangesAsync(); } } - - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.PartAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } } \ No newline at end of file diff --git a/src/WmsWebApi.Application/WmsWebApiApplicationModule.cs b/src/WmsWebApi.Application/WmsWebApiApplicationModule.cs index 1eef0e8..3fcb8ae 100644 --- a/src/WmsWebApi.Application/WmsWebApiApplicationModule.cs +++ b/src/WmsWebApi.Application/WmsWebApiApplicationModule.cs @@ -44,7 +44,6 @@ namespace WmsWebApi { options.JobPollPeriod = 1000 * 60; // 轮询检索作业的间隔 options.DefaultTimeout = 60 * 60 * 24 * 10; // 作业被放弃前的默认超时值(as seconds) - options.DefaultTimeout = 60 * 60; // 作业被放弃前的默认超时值(as seconds) }); } diff --git a/src/WmsWebApi.Application/ZlldcjLogs/ZlldcjLogAppService.cs b/src/WmsWebApi.Application/ZlldcjLogs/ZlldcjLogAppService.cs index 2e9d699..01168ab 100644 --- a/src/WmsWebApi.Application/ZlldcjLogs/ZlldcjLogAppService.cs +++ b/src/WmsWebApi.Application/ZlldcjLogs/ZlldcjLogAppService.cs @@ -15,6 +15,8 @@ using Microsoft.EntityFrameworkCore; using Abp.Domain.Uow; using WmsWebApi.BackgroundJob; using Volo.Abp.BackgroundJobs; +using WmsWebApi.BackgroundJobs; +using WmsWebApi.Enums; namespace WmsWebApi.ZlldcjLogs; @@ -30,7 +32,7 @@ public class ZlldcjLogAppService : ApplicationService, IZlldcjLogAppService private readonly ITmOtherAskRepository _tbOtherInOutAskRepository; private readonly TmOtherAskRepositoryUpdate _tmOtherAskRepositoryUpdate; private readonly Volo.Abp.Uow.IUnitOfWorkManager _unitOfWorkManager; - private readonly IBackgroundJobManager _backgroundJobManager; + private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; /// /// 是否是请求重试 @@ -43,7 +45,7 @@ public class ZlldcjLogAppService : ApplicationService, IZlldcjLogAppService , ITmOtherAskRepository tbOtherInOutAskRepository , TmOtherAskRepositoryUpdate tmOtherAskRepositoryUpdate , Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, - IBackgroundJobManager backgroundJobManager) + IBackgroundJobRequestRetry backgroundJobRequestRetry) { _zlldcjLogManager = zlldcjLogManager; _tbBillRepository = tbBillRepository; @@ -51,7 +53,7 @@ public class ZlldcjLogAppService : ApplicationService, IZlldcjLogAppService _tbOtherInOutAskRepository = tbOtherInOutAskRepository; _tmOtherAskRepositoryUpdate = tmOtherAskRepositoryUpdate; _unitOfWorkManager = unitOfWorkManager; - _backgroundJobManager = backgroundJobManager; + _backgroundJobRequestRetry = backgroundJobRequestRetry; } [HttpPost("add")] @@ -240,7 +242,7 @@ public class ZlldcjLogAppService : ApplicationService, IZlldcjLogAppService if (IsRequestRetry == false) { - await AddBackgroundJobAsync(content.ToString()); + await _backgroundJobRequestRetry.AddBackgroundJobAsync(EnumActionName.ZlldcjLogAdd, content.ToString()); } throw; @@ -282,27 +284,6 @@ public class ZlldcjLogAppService : ApplicationService, IZlldcjLogAppService } } - /// - /// 添加后台工作者 - /// - /// Json参数 - /// - private async Task AddBackgroundJobAsync(string strJson) - { - if (strJson == null || strJson == "") { return; } - - using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: false)) - { - var requestRetryArgs = new RequestRetryArgs() - { - ActionName = Enums.EnumActionName.ZlldcjLogAdd, - StrJson = strJson - }; - await _backgroundJobManager.EnqueueAsync(requestRetryArgs, priority: BackgroundJobPriority.Normal, delay: TimeSpan.FromSeconds(60)); - await uow.SaveChangesAsync(); - } - } - [HttpPost("close")] //[UnitOfWork(false)] public async Task CloseAsync([FromBody] object content)//ZlldcjLogDto dto