Browse Source

缴库接口修改

dev_DY_CC
lvzb 1 year ago
parent
commit
b0c97c9796
  1. 18
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
  2. 3
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs
  3. 4
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json

18
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs

@ -49,15 +49,15 @@ public class AgentModule : AbpModule
PreConfigure<AbpHttpClientBuilderOptions>(options => PreConfigure<AbpHttpClientBuilderOptions>(options =>
{ {
//Polly 重试3次 //Polly 重试3次
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => //options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
{ //{
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => // clientBuilder.AddTransientHttpErrorPolicy(policyBuilder =>
policyBuilder.WaitAndRetryAsync( // policyBuilder.WaitAndRetryAsync(
3, // 3,
i => TimeSpan.FromSeconds(Math.Pow(2, i)) // i => TimeSpan.FromSeconds(Math.Pow(2, i))
) // )
); // );
}); //});
//默认添加Authorization Header: Bearer Token //默认添加Authorization Header: Bearer Token
options.ProxyClientActions.Add((a, s, h) => options.ProxyClientActions.Add((a, s, h) =>

3
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)) if (!string.IsNullOrEmpty(_options.Value.IncomingOptions.apiUrl))
{ {
var productReceiptJson = JsonSerializer.Deserialize<ProductReceiptNoteEditInput>(incomingToWms.DataContent); var productReceiptJson = JsonSerializer.Deserialize<ProductReceiptNoteEditInput>(incomingToWms.DataContent);
var memos = productReceiptJson.Details.Select(r => r.Remark).ToList();
string memostr = String.Join(", ", memos);
productReceiptJson.Worker = "Mes"; productReceiptJson.Worker = "Mes";
try try
{ {
@ -256,6 +258,7 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase
// 读取响应内容并返回 // 读取响应内容并返回
string responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false); string responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
Logger.LogInformation("标签" + memostr);
} }
catch (HttpRequestException ex) catch (HttpRequestException ex)
{ {

4
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json

@ -42,14 +42,14 @@
"IncomingOptions": { "IncomingOptions": {
"Active": true, "Active": true,
"PeriodSeconds": 10, "PeriodSeconds": 10,
"RetryTimes": 3, "RetryTimes": 1,
"BatchSize": 100, "BatchSize": 100,
"apiUrl": "http://10.164.113.31:60085/" "apiUrl": "http://10.164.113.31:60085/"
}, },
"OutgoingOptions": { "OutgoingOptions": {
"Active": false, "Active": false,
"PeriodSeconds": 10, "PeriodSeconds": 10,
"RetryTimes": 3, "RetryTimes": 1,
"BatchSize": 100, "BatchSize": 100,
"BaseUrl": "https://localhost:7034/test", "BaseUrl": "https://localhost:7034/test",
"Username": "username", "Username": "username",

Loading…
Cancel
Save