|
|
@ -66,8 +66,9 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase |
|
|
|
foreach (var incomingToWms in incomingToWmsList) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
await AddOrUpdateWmsAsync(workerContext, incomingToWms).ConfigureAwait(false); |
|
|
|
{ |
|
|
|
await AddOrUpdateWmsAsync(workerContext, incomingToWms).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
@ -168,8 +169,8 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase |
|
|
|
|
|
|
|
private async Task SendProductReceipt(PeriodicBackgroundWorkerContext workerContext, IncomingToWms incomingToWms) |
|
|
|
{ // 定义请求的 URL
|
|
|
|
string apiUrl = "http://dev.ccwin-in.com:60085/api/wms/store/product-receipt-note"; |
|
|
|
string authUrl = "http://dev.ccwin-in.com:60083"; |
|
|
|
string apiUrl = "http://10.164.113.31:60085/api/wms/store/product-receipt-note"; |
|
|
|
|
|
|
|
var productReceiptJson = JsonSerializer.Deserialize<ProductReceiptNoteEditInput>(incomingToWms.DataContent); |
|
|
|
try |
|
|
|
{ |
|
|
@ -195,20 +196,17 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase |
|
|
|
// 处理请求异常
|
|
|
|
// 可以记录日志或者抛出异常
|
|
|
|
Console.WriteLine(ex.Message); |
|
|
|
incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, ex.Message); |
|
|
|
//incomingToWms.SetError(EnumExchangeDataErrorCode.Exception, ex.Message);
|
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
//Resolve dependencies
|
|
|
|
var incomingToWmsManager = workerContext.ServiceProvider.GetRequiredService<IIncomingToWmsManager>(); |
|
|
|
//Do the work
|
|
|
|
var incomingToWmsList = await incomingToWmsManager.GetToBeProcessedListAsync().ConfigureAwait(false); |
|
|
|
//归档并删除
|
|
|
|
await incomingToWmsManager.ArchiveAutoSaveAsync(incomingToWms).ConfigureAwait(false); |
|
|
|
//finally
|
|
|
|
//{
|
|
|
|
// //Resolve dependencies
|
|
|
|
// var incomingToWmsManager = workerContext.ServiceProvider.GetRequiredService<IIncomingToWmsManager>();
|
|
|
|
|
|
|
|
// //归档并删除
|
|
|
|
// await incomingToWmsManager.ArchiveAutoSaveAsync(incomingToWms).ConfigureAwait(false);
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false);
|
|
|
|
//}
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|