From d30ebc66bf7b36aa6e359c392909302c465373e5 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Tue, 19 Mar 2024 09:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/launchSettings.json | 8 ++++++++ .../AgentModule.cs | 20 +++++++++---------- .../IncomingToWmsWorker.cs | 3 +++ .../appsettings.json | 4 ++-- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/launchSettings.json diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/launchSettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/launchSettings.json new file mode 100644 index 000000000..33504c948 --- /dev/null +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "WSL": { + "commandName": "WSL2", + "distributionName": "" + } + } +} \ No newline at end of file diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs index 31b6599f3..ef33dc6dd 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs @@ -48,16 +48,16 @@ public class AgentModule : AbpModule { PreConfigure(options => { - //Polly 重试3次 - options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => - { - clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => - policyBuilder.WaitAndRetryAsync( - 3, - i => TimeSpan.FromSeconds(Math.Pow(2, i)) - ) - ); - }); + // Polly 重试3次 + //options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + //{ + // clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => + // policyBuilder.WaitAndRetryAsync( + // 1, + // i => TimeSpan.FromSeconds(Math.Pow(2, i)) + // ) + // ); + //}); //默认添加Authorization Header: Bearer Token options.ProxyClientActions.Add((a, s, h) => diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs index 02899143f..b9e81463a 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs @@ -237,6 +237,8 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase if (!string.IsNullOrEmpty(_options.Value.IncomingOptions.apiUrl)) { var productReceiptJson = JsonSerializer.Deserialize(incomingToWms.DataContent); + var memos = productReceiptJson.Details.Select(r => r.Remark).ToList(); + string memostr = String.Join(", ", memos); productReceiptJson.Worker = "Mes"; try { @@ -256,6 +258,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase // 读取响应内容并返回 string responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + Logger.LogInformation("标签"+memostr); } catch (HttpRequestException ex) { diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json index 3ff6fe613..156e965e2 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json @@ -42,14 +42,14 @@ "IncomingOptions": { "Active": true, "PeriodSeconds": 10, - "RetryTimes": 3, + "RetryTimes": 1, "BatchSize": 100, "apiUrl": "http://10.164.113.31:60085/" }, "OutgoingOptions": { "Active": false, "PeriodSeconds": 10, - "RetryTimes": 3, + "RetryTimes": 1, "BatchSize": 100, "BaseUrl": "https://localhost:7034/test", "Username": "username",