diff --git a/Common/AgvHelper.cs b/Common/AgvHelper.cs index 5be02bc..96b1386 100644 --- a/Common/AgvHelper.cs +++ b/Common/AgvHelper.cs @@ -12,6 +12,8 @@ namespace Epost.Common public class AgvHelper { string agvSchedulingTaskUrl = ConfigurationManager.AppSettings["agvSchedulingTaskUrl"]; + string bindCtnrAndBinUrl = ConfigurationManager.AppSettings["bindCtnrAndBinUrl"]; + HttpHelper http = new HttpHelper(); #region 生成任务单 public AgvResultModel genAgvSchedulingTask(AgvSchedulingTaskModel model) @@ -103,5 +105,44 @@ namespace Epost.Common } #endregion + + #region 绑定解绑 + + public bindCtnrAndBinResponse bindCtnrAndBin(string agvloc, string type) + { + bindCtnrAndBinReq reqModel = new bindCtnrAndBinReq(); + bindCtnrAndBinResponse resmodel = new bindCtnrAndBinResponse(); + reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + reqModel.ctnrTyp = "1";//agv提供 + reqModel.indBind = "1"; + reqModel.stgBinCode = agvloc; + reqModel.ctnrCode = agvloc; + + string reqstr = JsonHelper.SerializeObject(reqModel); + LogHelper.WriteLogInfo("调用AGV绑定解绑接口请求参数" + reqstr, LogHelper.Log_Type.INFO); + string resultStr = http.HttpPost_Old(bindCtnrAndBinUrl, reqstr); + + + LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回" + resultStr, LogHelper.Log_Type.INFO); + if (!string.IsNullOrEmpty(resultStr)) + { + resmodel = JsonHelper.DeserializeObject(resultStr); + if (resmodel.code == "0") + { + LogHelper.WriteLogInfo("调用AGV绑定解绑接口成功", LogHelper.Log_Type.INFO); + } + else + { + + LogHelper.WriteLogInfo("调用AGV绑定解绑接口失败" + resmodel.data, LogHelper.Log_Type.ERROR); + } + } + else + { + LogHelper.WriteLogInfo("调用AGV绑定解绑接口返回失败", LogHelper.Log_Type.ERROR); + } + return resmodel; + } + #endregion } } diff --git a/Epost.BLL/InboundOrdersBLL.cs b/Epost.BLL/InboundOrdersBLL.cs index 87250de..461b3f7 100644 --- a/Epost.BLL/InboundOrdersBLL.cs +++ b/Epost.BLL/InboundOrdersBLL.cs @@ -53,14 +53,16 @@ namespace Epost.BLL #endregion #region 查询坐标信息 - public string GetLocation(string strwhere) + public string GetLocation(string strwhere,out string type1) { DataTable dt= dal.GetLocation(strwhere); if (dt != null && dt.Rows.Count > 0) { + type1 = dt.Rows[0]["type"].ToString(); return dt.Rows[0]["agvloc"].ToString(); } else { + type1 =""; return ""; } diff --git a/Epost.TestToolsWeb/Controllers/TaskAPIController.cs b/Epost.TestToolsWeb/Controllers/TaskAPIController.cs index 176b3cf..537636d 100644 --- a/Epost.TestToolsWeb/Controllers/TaskAPIController.cs +++ b/Epost.TestToolsWeb/Controllers/TaskAPIController.cs @@ -316,7 +316,8 @@ namespace Epost.DPS.Controllers reqModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); reqModel.ctnrTyp = "1";//agv提供 reqModel.indBind = item.indBind; - string agvloc = inOrderBLL.GetLocation(" and wmsloc = '" + item.positionCode + "'"); + string type = string.Empty; + string agvloc = inOrderBLL.GetLocation(" and wmsloc = '" + item.positionCode + "'",out type ); reqModel.stgBinCode = agvloc; if (item.indBind == "1") { diff --git a/Epost.TestToolsWeb/Global.asax.cs b/Epost.TestToolsWeb/Global.asax.cs index 73a4ff3..8750974 100644 --- a/Epost.TestToolsWeb/Global.asax.cs +++ b/Epost.TestToolsWeb/Global.asax.cs @@ -48,11 +48,20 @@ namespace Epost.TestToolsWeb reqmodel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString()+ row["id"].ToString();; List positionList = new List(); Positioncodepath pathModel = new Positioncodepath(); - pathModel.positionCode = inboundBLL.GetLocation(" and wmsloc ='"+ row["spositionCode"].ToString() + "'"); + string type = string.Empty; + pathModel.positionCode = inboundBLL.GetLocation(" and wmsloc ='"+ row["spositionCode"].ToString() + "'",out type); + #region 手动绑定点位-- + + if (type == "1") + { + LogHelper.WriteLogInfo("绑定点位"+ pathModel.positionCode); + agv.bindCtnrAndBin(pathModel.positionCode, type); + } + #endregion pathModel.type = "05";//agv提供 positionList.Add(pathModel); Positioncodepath pathModel2 = new Positioncodepath(); - pathModel2.positionCode = inboundBLL.GetLocation(" and wmsloc = '"+ row["dpositionCode"].ToString() + "'"); + pathModel2.positionCode = inboundBLL.GetLocation(" and wmsloc = '"+ row["dpositionCode"].ToString() + "'",out type ); pathModel2.type = "05"; positionList.Add(pathModel2); reqmodel.positionCodePath = positionList; diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index 45fae91..17c3a50 100644 --- a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user +++ b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user @@ -7,7 +7,7 @@ <_PublishTargetUrl>D:\驿传\zhuyou_wcs - True|2024-12-04T01:59:41.1980682Z;True|2024-11-29T15:21:54.3789957+08:00;True|2024-11-29T14:43:30.2764537+08:00;True|2024-11-29T14:05:34.1608373+08:00;True|2024-11-29T13:24:48.7549546+08:00;True|2024-11-29T11:33:32.4546950+08:00;True|2024-11-26T10:08:16.7734518+08:00;True|2024-11-22T14:00:39.7806019+08:00;False|2024-11-04T17:48:25.2781696+08:00;True|2024-11-01T16:04:56.3535724+08:00;True|2024-09-01T10:13:37.1598955+08:00;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00; + True|2024-12-05T03:08:47.6560918Z;True|2024-12-04T09:59:41.1980682+08:00;True|2024-11-29T15:21:54.3789957+08:00;True|2024-11-29T14:43:30.2764537+08:00;True|2024-11-29T14:05:34.1608373+08:00;True|2024-11-29T13:24:48.7549546+08:00;True|2024-11-29T11:33:32.4546950+08:00;True|2024-11-26T10:08:16.7734518+08:00;True|2024-11-22T14:00:39.7806019+08:00;False|2024-11-04T17:48:25.2781696+08:00;True|2024-11-01T16:04:56.3535724+08:00;True|2024-09-01T10:13:37.1598955+08:00;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00; @@ -33,19 +33,19 @@ 04/04/2018 15:45:12 - 12/04/2024 15:40:40 + 12/05/2024 11:08:44 - 12/04/2024 15:40:40 + 12/05/2024 11:08:44 02/24/2020 15:29:24 - 12/04/2024 09:59:19 + 12/05/2024 11:08:26 - 12/04/2024 09:59:19 + 12/05/2024 11:08:26 04/29/2020 16:50:14 @@ -63,25 +63,25 @@ 10/23/2017 13:15:20 - 12/04/2024 09:59:19 + 12/05/2024 11:08:27 - 12/04/2024 09:59:19 + 12/05/2024 11:08:27 08/26/2020 18:09:48 - 12/04/2024 09:59:19 + 12/05/2024 11:08:26 - 12/04/2024 09:59:19 + 12/05/2024 11:08:26 - 12/04/2024 15:40:25 + 12/05/2024 11:08:29 - 12/04/2024 15:40:25 + 12/05/2024 11:08:29 12/04/2024 09:59:18 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 12/04/2024 15:40:26 + 12/05/2024 11:08:31 04/04/2018 15:45:12