|
@ -1,5 +1,6 @@ |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
|
using Microsoft.Extensions.Options; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using Polly; |
|
|
using Polly; |
|
|
using Polly.Retry; |
|
|
using Polly.Retry; |
|
@ -14,6 +15,7 @@ using WmsWebApi.BackgroundJobs; |
|
|
using WmsWebApi.EntityFrameworkCore; |
|
|
using WmsWebApi.EntityFrameworkCore; |
|
|
using WmsWebApi.Enums; |
|
|
using WmsWebApi.Enums; |
|
|
using WmsWebApi.Jsons; |
|
|
using WmsWebApi.Jsons; |
|
|
|
|
|
using WmsWebApi.Options; |
|
|
using WmsWebApi.Wms; |
|
|
using WmsWebApi.Wms; |
|
|
|
|
|
|
|
|
namespace WmsWebApi.OtherZll; |
|
|
namespace WmsWebApi.OtherZll; |
|
@ -36,6 +38,7 @@ public class OtherZllService : ApplicationService, IOtherZllService |
|
|
private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; |
|
|
private readonly IBackgroundJobRequestRetry _backgroundJobRequestRetry; |
|
|
private readonly IOtherZllJsonRepository _otherZllJsonRepository; |
|
|
private readonly IOtherZllJsonRepository _otherZllJsonRepository; |
|
|
private readonly AsyncRetryPolicy _asyncRetryPolicy; |
|
|
private readonly AsyncRetryPolicy _asyncRetryPolicy; |
|
|
|
|
|
private readonly OtherZllConfigOptions _otherZllConfigOptions; |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 是否是请求重试
|
|
|
/// 是否是请求重试
|
|
@ -52,7 +55,9 @@ public class OtherZllService : ApplicationService, IOtherZllService |
|
|
TmPgWmsUpdate tmPgWmsUpdate, |
|
|
TmPgWmsUpdate tmPgWmsUpdate, |
|
|
Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, |
|
|
Volo.Abp.Uow.IUnitOfWorkManager unitOfWorkManager, |
|
|
IBackgroundJobRequestRetry backgroundJobRequestRetry, |
|
|
IBackgroundJobRequestRetry backgroundJobRequestRetry, |
|
|
IOtherZllJsonRepository otherZllJsonRepository) |
|
|
IOtherZllJsonRepository otherZllJsonRepository, |
|
|
|
|
|
IOptionsMonitor<CustomConfigOptions> customConfigOptions, |
|
|
|
|
|
IOptionsMonitor<OtherZllConfigOptions> otherZllConfigOptions) |
|
|
{ |
|
|
{ |
|
|
_tsStockDetailRepository = tsStockDetailRepository; |
|
|
_tsStockDetailRepository = tsStockDetailRepository; |
|
|
_tbProductReceiveRepository = tbProductReceiveRepository; |
|
|
_tbProductReceiveRepository = tbProductReceiveRepository; |
|
@ -75,6 +80,7 @@ public class OtherZllService : ApplicationService, IOtherZllService |
|
|
{ |
|
|
{ |
|
|
Logger.LogInformation($"执行失败,第 {retryCount} 次重试"); |
|
|
Logger.LogInformation($"执行失败,第 {retryCount} 次重试"); |
|
|
}); |
|
|
}); |
|
|
|
|
|
_otherZllConfigOptions = otherZllConfigOptions.CurrentValue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost("add")] |
|
|
[HttpPost("add")] |
|
@ -93,6 +99,17 @@ public class OtherZllService : ApplicationService, IOtherZllService |
|
|
result.MESSAGE = "Json格式不正确,详细信息:" + ex.Message; |
|
|
result.MESSAGE = "Json格式不正确,详细信息:" + ex.Message; |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (_dtoList != null && _dtoList.Count() > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
//根据配置文件过滤ERNAM
|
|
|
|
|
|
var ernamFilters = _otherZllConfigOptions.ErnamFilters; |
|
|
|
|
|
if (ernamFilters != null && ernamFilters.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
_dtoList = _dtoList.FindAll(e => !ernamFilters.Contains(e.ERNAM)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (_dtoList == null || _dtoList.Count() <= 0) |
|
|
if (_dtoList == null || _dtoList.Count() <= 0) |
|
|
{ |
|
|
{ |
|
|
bErr = true; |
|
|
bErr = true; |
|
|