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 =>
{
//Polly 重试3次
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
{
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder =>
policyBuilder.WaitAndRetryAsync(
3,
i => TimeSpan.FromSeconds(Math.Pow(2, i))
)
);
});
//options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
//{
// clientBuilder.AddTransientHttpErrorPolicy(policyBuilder =>
// policyBuilder.WaitAndRetryAsync(
// 3,
// i => TimeSpan.FromSeconds(Math.Pow(2, i))
// )
// );
//});
//默认添加Authorization Header: Bearer Token
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))
{
var productReceiptJson = JsonSerializer.Deserialize<ProductReceiptNoteEditInput>(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)
{

4
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",

Loading…
Cancel
Save