diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index e779085e..7dc4b672 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -7,10 +7,10 @@ using System.Linq.Expressions; using System.Reflection; using System.Runtime.InteropServices; using System.Text; +using System.Text.Encodings.Web; using System.Threading.Tasks; using Aop.Api.Domain; using Aspose.Cells.Drawing; -using Dm; using JNPF; using JNPF.Common.Contracts; using JNPF.Common.Core.Manager; @@ -29,9 +29,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.CodeAnalysis; using Newtonsoft.Json; -using NPOI.HPSF; -using NPOI.OpenXmlFormats.Wordprocessing; -using NPOI.SS.Formula.Functions; using Polly.Timeout; using Senparc.NeuChar.Helpers; using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen; @@ -331,19 +328,21 @@ namespace Tnb.WarehouseMgr } sw.Stop(); - JNPF.Logging.Log.Information($"程序运行耗时{sw.ElapsedMilliseconds}ms"); + Log.Information($"程序运行耗时{sw.ElapsedMilliseconds}ms"); await db.Ado.CommitTranAsync(); //调用AGV创建任务链接口 var requestCfg = App.Configuration.Build(); + var url = requestCfg.AgvRequestUrls.CreateTaskChainUrl; var taskChainCodeDic = disTasks.Where(t => !t.groups.IsNullOrWhiteSpace()).GroupBy(g => g.groups!) .ToDictionary(x => x.Key, x => x.Select(it => new { taskCode = it.bill_code, - sourceName = it.startlocation_code, - targetName = it.endlocation_code + sourceName = it.startpoint_code, + targetName = it.endpoint_code })); + Log.Information($"请求地址:{url}"); foreach (var (k, v) in taskChainCodeDic) { dynamic reqBody = new ExpandoObject(); @@ -352,8 +351,9 @@ namespace Tnb.WarehouseMgr reqBody.sequential = false; reqBody.taskChainPriority = 0; reqBody.taskList = v; - await HttpClientHelper.PostStreamAsync(requestCfg.AgvRequestUrls.CreateTaskChainUrl, reqBody, CancellationToken.None); - //await HttpClientHelper.HttpPostAsync(url, JsonConvert.SerializeObject(reqBody)); + Log.Information($"请求参数:{JsonConvert.SerializeObject(reqBody)}"); + var respBody = await HttpClientHelper.PostStreamAsync(url, reqBody, CancellationToken.None); + JNPF.Logging.Log.Information($"调用Agv接口响应结果:{respBody}"); } } } diff --git a/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json b/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json index 2f799d66..a15fe34b 100644 --- a/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json +++ b/apihost/Tnb.API.Entry/Configurations/AgvRequestCfgUrl.json @@ -1,6 +1,6 @@ { "AgvRequestUrls": { - "CreateTaskChainUrl": "http://192.168.11.104:1880/localhost/api/task‑chain/create", - "CancelTaskChainUrl": "http://192.168.11.104:1880/api/task‑chain/cancel" + "CreateTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/create", + "CancelTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/cancel" } } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Startup.cs b/apihost/Tnb.API.Entry/Startup.cs index d7748aae..9cc6b27e 100644 --- a/apihost/Tnb.API.Entry/Startup.cs +++ b/apihost/Tnb.API.Entry/Startup.cs @@ -63,10 +63,8 @@ public class Startup : AppStartup services.AddOverideVisualDev(); - #if !DEBUG //定时任务 services.AddHostedService(); - #endif } public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider, IOptions senparcSetting, IOptions senparcWeixinSetting)