From b13aaaa6b084dacce29055228546f3f2551fe01c Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Tue, 7 May 2024 13:57:18 +0800 Subject: [PATCH] agv --- Infrastructure/Helper/HttpHelper.cs | 11 +++++++++-- ZR.Admin.WebApi/appsettings.development.json | 6 +++--- ZR.Service/mes/mm/MaterialInputService.cs | 13 +++++++++++-- ZR.Service/mes/mm/MmFinishedwarehouseService.cs | 2 +- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Infrastructure/Helper/HttpHelper.cs b/Infrastructure/Helper/HttpHelper.cs index c01003b1..b1f3c804 100644 --- a/Infrastructure/Helper/HttpHelper.cs +++ b/Infrastructure/Helper/HttpHelper.cs @@ -34,8 +34,15 @@ namespace Infrastructure using HttpContent httpContent = new StringContent(postData, Encoding.UTF8); if (contentType != null) httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType); - - HttpResponseMessage response = client.PostAsync(url, httpContent).Result; + HttpResponseMessage response = null; + try + { + response = client.PostAsync(url, httpContent).Result; + }catch (Exception ex) + { + return "异常:"+ex.Message; + } + return response.Content.ReadAsStringAsync().Result; } diff --git a/ZR.Admin.WebApi/appsettings.development.json b/ZR.Admin.WebApi/appsettings.development.json index a54e6cb4..7ea8b2a6 100644 --- a/ZR.Admin.WebApi/appsettings.development.json +++ b/ZR.Admin.WebApi/appsettings.development.json @@ -11,14 +11,14 @@ { //本地连接服务器 - // "Conn": "Data Source=localhost;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", + // "Conn": "Data Source=localhost;User ID=root;Password=doantech123;Initial Catalog=ZrAdmin;", //外网连接服务器 - "Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", + // "Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", // 干巷服务器 // "Conn": "Data Source=192.168.60.251;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", //内网连接服务器 - //"Conn": "Data Source=192.168.0.36;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", + "Conn": "Data Source=192.168.0.36;Port=3306;User ID=root;Password=doantech123;Initial Catalog=ZrAdmin;", // "Conn": "Data Source=127.0.0.1;Port=3306;User ID=root;Password=123456;Initial Catalog=ZrAdmin;", "Type": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4, "ConfigId": "0", //多租户唯一标识 diff --git a/ZR.Service/mes/mm/MaterialInputService.cs b/ZR.Service/mes/mm/MaterialInputService.cs index ad95ef67..0ba9d031 100644 --- a/ZR.Service/mes/mm/MaterialInputService.cs +++ b/ZR.Service/mes/mm/MaterialInputService.cs @@ -85,7 +85,7 @@ namespace ZR.Service.mes.mm // 获取这一周中的第几天 DayOfWeek dayOfWeek = datetimespan.DayOfWeek; - int dayOfWeekNumber = (int)dayOfWeek + 1; // 将 DayOfWeek 枚举转换为从 1 开始的数字 + int dayOfWeekNumber = (int)dayOfWeek; // 将 DayOfWeek 枚举转换为从 1 开始的数字 @@ -93,8 +93,9 @@ namespace ZR.Service.mes.mm .Where(it => it.Year == year) .Where(it => it.Week == week) .Where(it => it.Date == dayOfWeekNumber) - .Where(it => it.Remark3 == "是") + .Where(it => it.Remark3 == "是"||it.Remark1=="调试") .ToList(); + foreach (ProWorkorder_v2 workorder in WorkorderList) { bool isExist = Context.Queryable() @@ -249,6 +250,14 @@ namespace ZR.Service.mes.mm AGVtask_third task = new AGVtask_third(); task.reqCode = SnowFlakeSingle.Instance.NextId().ToString(); task.taskTyp = "F01"; + // MmAgvLocation start_object = Context.Queryable().Where(it => it.Coordinate == start_point).First(); + // MmAgvLocation end_object = Context.Queryable().Where(it => it.Coordinate == end_point).First(); + //判断是否跨楼层 + if(end_point=="R1") + { + task.taskTyp = "KLC"; + } + task.positionCodePath = new List { new AGV_location_third() diff --git a/ZR.Service/mes/mm/MmFinishedwarehouseService.cs b/ZR.Service/mes/mm/MmFinishedwarehouseService.cs index 9a2896c5..4283d41e 100644 --- a/ZR.Service/mes/mm/MmFinishedwarehouseService.cs +++ b/ZR.Service/mes/mm/MmFinishedwarehouseService.cs @@ -19,7 +19,7 @@ namespace ZR.Service.mes.mm public string[] Finish_point() { List positions = Context.Queryable() - .Where(it => it.AreaCode == 4|| it.AreaCode == 5) + .Where(it => it.AreaCode == 4|| it.AreaCode == 5|| it.AreaCode == 8) .ToList(); string[] cors = new string[positions.Count];