diff --git a/Epost.BLL/InboundOrdersBLL.cs b/Epost.BLL/InboundOrdersBLL.cs index f07c26a..87250de 100644 --- a/Epost.BLL/InboundOrdersBLL.cs +++ b/Epost.BLL/InboundOrdersBLL.cs @@ -44,6 +44,28 @@ namespace Epost.BLL return dal.GetInOrderList(strwhere); } #endregion + + #region 查询订单信息 + public DataTable GetV_InOrders(string strwhere) + { + return dal.GetV_InOrders(strwhere); + } + #endregion + + #region 查询坐标信息 + public string GetLocation(string strwhere) + { + DataTable dt= dal.GetLocation(strwhere); + if (dt != null && dt.Rows.Count > 0) + { + return dt.Rows[0]["agvloc"].ToString(); + } + else { + return ""; + } + + } + #endregion #region 添加订单 public bool InsertOrder(DataTable dt, Dictionary diclist) { @@ -57,8 +79,16 @@ namespace Epost.BLL return dal.UpInOrderList(id,state,data); } + + public bool UpInOrder(string id, string errormsg) + { + + return dal.UpInOrder(id, errormsg); + } #endregion + + #region 根据agv单号更新订单状态 public bool UpInOrderListByAgvid(string agvid, string state) { diff --git a/Epost.DAL/InboundOrdersDAL.cs b/Epost.DAL/InboundOrdersDAL.cs index bbb4aa5..1b85eea 100644 --- a/Epost.DAL/InboundOrdersDAL.cs +++ b/Epost.DAL/InboundOrdersDAL.cs @@ -88,13 +88,27 @@ namespace Epost.DAL } #endregion + #region 查询订单信息 + public DataTable GetV_InOrders(string strwhere) + { + string sql = string.Format("select * from v_InboundOrders where 1=1 " + strwhere); + return db.GetsqlForDT(sql); + } + #endregion + #region 查询坐标信息 + public DataTable GetLocation(string strwhere) + { + string sql = string.Format("select * from locationInfo where 1=1 " + strwhere); + return db.GetsqlForDT(sql); + } + #endregion #region 更新订单状态 public bool UpInOrderList(string id,string state,string data) { string upstr = string.Empty; if (!string.IsNullOrEmpty(data)) { - upstr = ",agvid='"+data+"'"; + upstr = ",agvmsg='',agvid='" + data+"'"; } string sql = string.Format("update InboundOrders set state ='{0}'"+ upstr + " where id ='{1}'", state,id); @@ -105,6 +119,19 @@ namespace Epost.DAL } #endregion + #region 更新订单状态 + public bool UpInOrder(string id,string errormsg) + { + + string sql = string.Format("update InboundOrders set agvmsg='{0}' where id ='{1}'", + errormsg, id); + long x = db.UpdateSql(sql); + if (x > 0) + return true; + return false; + } + #endregion + #region 根据agv单号更新订单状态 public bool UpInOrderListByAgvid(string agvid, string state) { diff --git a/Epost.Model/TaskModel.cs b/Epost.Model/TaskModel.cs index cea3a06..456c0d8 100644 --- a/Epost.Model/TaskModel.cs +++ b/Epost.Model/TaskModel.cs @@ -82,7 +82,7 @@ namespace Epost.Model public class ResponseModel { - public ReturnRes _return { get; set; } + public ReturnRes returnnode { get; set; } } public class ReturnRes diff --git a/Epost.TestToolsWeb/Controllers/TaskAPIController.cs b/Epost.TestToolsWeb/Controllers/TaskAPIController.cs index 79a81d0..50ae922 100644 --- a/Epost.TestToolsWeb/Controllers/TaskAPIController.cs +++ b/Epost.TestToolsWeb/Controllers/TaskAPIController.cs @@ -19,9 +19,10 @@ namespace Epost.DPS.Controllers Sys_operate_logBLL logBLL = new Sys_operate_logBLL(); [Route("agvPutTask")] [HttpPost] - public string agvPutTask([FromBody] TaskModel model) + public RetMesModel agvPutTask([FromBody] TaskModel model) { - + RetMesModel retMes = new RetMesModel(); + ResponseModel response = new ResponseModel(); ReturnRes res = new ReturnRes(); try { @@ -135,9 +136,11 @@ namespace Epost.DPS.Controllers res.returnCode = "0001"; res.returnFlag = "0"; } - string resinfo = "{\"Response\":{\"return\":" + JsonHelper.SerializeObject(res) + " } }"; + response.returnnode = res; + retMes.Response = response; + string resinfo = JsonHelper.SerializeObject(retMes) ; logBLL.InsertLog("生成任务单", "agvPutTask", "/api/TaskAPI/agvPutTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now); - return resinfo; + return retMes; } #region 添加托盘明细 @@ -209,9 +212,10 @@ namespace Epost.DPS.Controllers [Route("agvCancleTask")] [HttpPost] - public string agvCancleTask([FromBody]AgvCancleModel model) + public RetMesModel agvCancleTask([FromBody]AgvCancleModel model) { - + RetMesModel retMes = new RetMesModel(); + ResponseModel response = new ResponseModel(); ReturnRes res = new ReturnRes(); try { @@ -261,18 +265,21 @@ namespace Epost.DPS.Controllers res.returnCode = "0001"; res.returnFlag = "0"; } - string resinfo = "{\"Response\":{\"return\":" + JsonHelper.SerializeObject(res) + " } }"; + response.returnnode = res; + retMes.Response = response; + string resinfo = JsonHelper.SerializeObject(retMes) ; logBLL.InsertLog("取消任务接口", "agvCancleTask", "/api/TaskAPI/agvCancleTask", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now); - return resinfo; + return retMes; } [Route("agvBindPodAndBerth")] [HttpPost] - public string agvBindPodAndBerth([FromBody] agvBindPodModel model) + public RetMesModel agvBindPodAndBerth([FromBody] agvBindPodModel model) { - + RetMesModel retMes = new RetMesModel(); + ResponseModel response = new ResponseModel(); ReturnRes res = new ReturnRes(); try { @@ -311,10 +318,12 @@ namespace Epost.DPS.Controllers res.returnCode = "0001"; res.returnFlag = "0"; } - - string resinfo = "{\"Response\":{\"return\":" + JsonHelper.SerializeObject(res) + " } }"; + + response.returnnode = res; + retMes.Response = response; + string resinfo = JsonHelper.SerializeObject(retMes); logBLL.InsertLog("agv绑定解绑接口", "agvBindPodAndBerth", "/api/TaskAPI/agvBindPodAndBerth", JsonHelper.SerializeObject(model), resinfo, 0, res.returnDesc, DateTime.Now); - return resinfo; + return retMes; } } } diff --git a/Epost.TestToolsWeb/Epost.DPS.csproj.user b/Epost.TestToolsWeb/Epost.DPS.csproj.user index 2eaafac..425431a 100644 --- a/Epost.TestToolsWeb/Epost.DPS.csproj.user +++ b/Epost.TestToolsWeb/Epost.DPS.csproj.user @@ -11,7 +11,7 @@ False 600 E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml - Debug|Any CPU + Release|Any CPU @@ -21,29 +21,5 @@ ApiControllerEmptyScaffolder root/Common/Web API - - - - - - - CurrentPage - True - False - False - False - - - - - - - - - True - False - - - - + \ No newline at end of file diff --git a/Epost.TestToolsWeb/Global.asax.cs b/Epost.TestToolsWeb/Global.asax.cs index 3b18649..9123d39 100644 --- a/Epost.TestToolsWeb/Global.asax.cs +++ b/Epost.TestToolsWeb/Global.asax.cs @@ -22,6 +22,7 @@ namespace Epost.TestToolsWeb public class MvcApplication : System.Web.HttpApplication { InboundOrdersBLL inboundBLL = new InboundOrdersBLL(); + protected void Application_Start() { AreaRegistration.RegisterAllAreas(); @@ -47,11 +48,11 @@ namespace Epost.TestToolsWeb reqmodel.reqCode =DateTime.Now.Month+DateTime.Now.Day+ row["id"].ToString();; List positionList = new List(); Positioncodepath pathModel = new Positioncodepath(); - pathModel.positionCode = row["spositionCode"].ToString(); + pathModel.positionCode = inboundBLL.GetLocation(" and wmsloc ='"+ row["spositionCode"].ToString() + "'"); pathModel.type = "05";//agv提供 positionList.Add(pathModel); Positioncodepath pathModel2 = new Positioncodepath(); - pathModel2.positionCode = row["dpositionCode"].ToString(); + pathModel2.positionCode = inboundBLL.GetLocation(" and wmsloc = '"+ row["dpositionCode"].ToString() + "'"); pathModel2.type = "05"; positionList.Add(pathModel2); reqmodel.positionCodePath = positionList; @@ -61,7 +62,11 @@ namespace Epost.TestToolsWeb if (res.code == "0") { //调用agv成功 更新订单状态 - inboundBLL.UpInOrderList(row["id"].ToString(),"1",res.data); + inboundBLL.UpInOrderList(row["id"].ToString(), "1", res.data); + } + else if (res.code == "1") + { + inboundBLL.UpInOrder(row["id"].ToString(),"AGV告警:"+res.message); } } } diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index cc9d864..56e59ea 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-11-26T02:08:16.7734518Z;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-11-29T07:21:54.3789957Z;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 - 11/26/2024 17:03:14 + 11/29/2024 15:21:52 - 11/26/2024 17:03:14 + 11/29/2024 15:21:51 02/24/2020 15:29:24 - 11/26/2024 10:21:58 + 11/29/2024 11:24:21 - 11/26/2024 10:21:58 + 11/29/2024 11:24:21 04/29/2020 16:50:14 @@ -63,31 +63,31 @@ 10/23/2017 13:15:20 - 11/26/2024 10:21:58 + 11/29/2024 15:21:40 - 11/26/2024 10:21:58 + 11/29/2024 15:21:40 08/26/2020 18:09:48 - 11/26/2024 10:21:58 + 11/29/2024 15:21:39 - 11/26/2024 10:21:58 + 11/29/2024 15:21:39 - 11/26/2024 17:02:58 + 11/29/2024 15:21:44 - 11/26/2024 17:02:58 + 11/29/2024 15:21:44 - 11/26/2024 10:21:57 + 11/29/2024 11:24:20 - 11/26/2024 10:21:57 + 11/29/2024 11:24:20 09/06/2018 11:57:11 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 11/26/2024 17:03:00 + 11/29/2024 15:21:45 04/04/2018 15:45:12 @@ -7572,7 +7572,7 @@ 07/04/2022 14:22:38 - 11/26/2024 10:07:59 + 11/29/2024 11:33:14 \ No newline at end of file