This commit is contained in:
jl
2024-12-25 10:15:41 +08:00
parent 43d0c7e249
commit 78b193a52a
7 changed files with 98 additions and 57 deletions

View File

@ -0,0 +1,18 @@
using Epost.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.BLL
{
public class AgvLogInfoBLL
{
AgvLogInfoDAL dal = new AgvLogInfoDAL();
public bool insertAgvLogInfo(string reqCode, string reqTime, string robotCode, string beginDate, string warnContent, string taskCode)
{
return dal.insertAgvLogInfo(reqCode,reqTime,robotCode,beginDate,warnContent,taskCode);
}
}
}

View File

@ -92,6 +92,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AddressstorageBLL.cs" />
<Compile Include="AgvLogInfoBLL.cs" />
<Compile Include="BoxPickBLL.cs" />
<Compile Include="BoxQueueBLL.cs" />
<Compile Include="CommandBLL.cs" />

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.DAL
{
public class AgvLogInfoDAL
{
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
public bool insertAgvLogInfo(string reqCode, string reqTime, string robotCode, string beginDate, string warnContent, string taskCode)
{
string sql = string.Format("insert into agvLogInfo(reqCode ,reqTime,robotCode,beginDate,warnContent,taskCode,addtime) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
reqCode,reqTime,robotCode,beginDate,warnContent,
taskCode,DateTime.Now.ToString());
long x =db.InsertSql(sql);
if (x > 0)
return true;
return false;
}
}
}

View File

@ -99,6 +99,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AddressstorageDAL.cs" />
<Compile Include="AgvLogInfoDAL.cs" />
<Compile Include="BoxPickDAL.cs" />
<Compile Include="BoxQueueDAL.cs" />
<Compile Include="Cache\BoxCodeCacheDAL.cs" />

View File

@ -22,9 +22,9 @@ namespace Epost.DPS.Controllers
InboundOrdersBLL inboundBLL = new InboundOrdersBLL();
string agvCallbackUrl = ConfigurationManager.AppSettings["agvCallbackUrl"];
string agvexTaskUrl = ConfigurationManager.AppSettings["agvexTaskUrl"];
HttpHelper http = new HttpHelper();
AgvHelper agv = new AgvHelper();
AgvLogInfoBLL logbll = new AgvLogInfoBLL();
[Route("agvCallback")]
[HttpPost]
public AgvResultModel agvCallback([FromBody] agvCallbackModel data)
@ -47,47 +47,13 @@ namespace Epost.DPS.Controllers
{
state = "4";
//更新任务已完成
DataTable dt = inboundBLL.GetInOrderList(" and agvid ='" + data.taskCode + "'");
if (dt != null && dt.Rows.Count > 0)
{
wmsCallbackModel backModel = new wmsCallbackModel();
List<callbackHeader> list = new List<callbackHeader>();
callbackHeader headModel = new callbackHeader();
headModel.warehouseId = dt.Rows[0]["warehouseId"].ToString();
headModel.groupTaskId = dt.Rows[0]["groupTaskId"].ToString();
headModel.wmsDocNo = dt.Rows[0]["wmsDocNo"].ToString();
headModel.currentPositionCode = data.currentPositionCode;
headModel.robotCode = data.robotCode;
headModel.taskCode = data.taskCode;
headModel.method = data.method;
headModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
headModel.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
callback back = new callback();
list.Add(headModel);
back.header = list;
backModel.data = back;
string reqstr = JsonHelper.SerializeObject(backModel);
LogHelper.WriteLogInfo("WCS->WMS任务执行通知请求" + reqstr + "===" + agvCallbackUrl);
string resultStr = http.HttpPost_Old(agvCallbackUrl, reqstr);
LogHelper.WriteLogInfo("WCS->WMS任务执行通知返回" + resultStr);
logBLL.InsertLog("WCS->WMS任务执行通知", "agvCallback", agvCallbackUrl, reqstr, resultStr, 0, "", DateTime.Now);
//if (!string.IsNullOrEmpty(resultStr))
//{
// RetMesModel resModel = JsonHelper.DeserializeObject<RetMesModel>(resultStr);
// if (resModel.Response.returnnode.returnCode == "0000")
// {
// LogHelper.WriteLogInfo("WCS->WMS任务执行通知成功");
// }
// else {
// LogHelper.WriteLogInfo("WCS->WMS任务执行通知失败");
// }
//}
}
wms_callback(data);
}
else if (data.method == "cancel")
{
state = "88";
wms_callback(data);
}
else { }
@ -109,6 +75,35 @@ namespace Epost.DPS.Controllers
return retModel;
}
public void wms_callback(agvCallbackModel data)
{
DataTable dt = inboundBLL.GetInOrderList(" and agvid ='" + data.taskCode + "'");
if (dt != null && dt.Rows.Count > 0)
{
wmsCallbackModel backModel = new wmsCallbackModel();
List<callbackHeader> list = new List<callbackHeader>();
callbackHeader headModel = new callbackHeader();
headModel.warehouseId = dt.Rows[0]["warehouseId"].ToString();
headModel.groupTaskId = dt.Rows[0]["groupTaskId"].ToString();
headModel.wmsDocNo = dt.Rows[0]["wmsDocNo"].ToString();
headModel.currentPositionCode = data.currentPositionCode;
headModel.robotCode = data.robotCode;
headModel.taskCode = data.taskCode;
headModel.method = data.method;
headModel.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
headModel.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
callback back = new callback();
list.Add(headModel);
back.header = list;
backModel.data = back;
string reqstr = JsonHelper.SerializeObject(backModel);
LogHelper.WriteLogInfo("WCS->WMS任务执行通知请求" + reqstr + "===" + agvCallbackUrl);
string resultStr = http.HttpPost_Old(agvCallbackUrl, reqstr);
LogHelper.WriteLogInfo("WCS->WMS任务执行通知返回" + resultStr);
logBLL.InsertLog("WCS->WMS任务执行通知", "agvCallback", agvCallbackUrl, reqstr, resultStr, 0, "", DateTime.Now);
}
}
[Route("warnCallback")]
[HttpPost]
public AgvResultModel warnCallback([FromBody]warnCallbackReq data)
@ -127,7 +122,8 @@ namespace Epost.DPS.Controllers
List<agvexTaskList> taskList = new List<agvexTaskList>();
agvexTaskHeader agvexHeader = new agvexTaskHeader();
List<agvexTaskHeader> headerlist = new List<agvexTaskHeader>();
List<warnCallbackData> datalist = data.data;
List<warnCallbackData> datalist = data.data;
string reqcode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
if (datalist.Any())
{
foreach (warnCallbackData item in datalist)
@ -138,16 +134,17 @@ namespace Epost.DPS.Controllers
agvextmodel.beginDate = item.beginDate;
agvextmodel.warnContent = item.warnContent;
taskList.Add(agvextmodel);
logbll.insertAgvLogInfo(reqcode, item.beginDate, item.robotCode, item.beginDate, item.warnContent, item.taskCode);
}
}
agvexHeader.list = taskList;
agvexHeader.clientCode = data.clientCode;
agvexHeader.reqCode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
agvexHeader.reqCode = reqcode;
agvexHeader.reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
headerlist.Add(agvexHeader);
taskdata.header = headerlist;
backModel.data = taskdata;
string reqstr = JsonHelper.SerializeObject(backModel);
LogHelper.WriteLogInfo("WCS->WMS告警通知请求" + reqstr + "===" + agvexTaskUrl);
string resultStr = http.HttpPost_Old(agvexTaskUrl, reqstr);

View File

@ -11,7 +11,7 @@
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\驿传\zhuyou_wcs</_PublishTargetUrl>
<History>True|2024-12-12T02:38:02.5914170Z;True|2024-12-05T11:08:47.6560918+08:00;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;</History>
<History>True|2024-12-24T06:23:59.6498280Z;True|2024-12-12T10:38:02.5914170+08:00;True|2024-12-05T11:08:47.6560918+08:00;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;</History>
<LastFailureDetails />
</PropertyGroup>
<ItemGroup>
@ -33,19 +33,19 @@
<publishTime>04/04/2018 15:45:12</publishTime>
</File>
<File Include="bin/App_global.asax.compiled">
<publishTime>12/12/2024 10:37:58</publishTime>
<publishTime>12/24/2024 16:28:51</publishTime>
</File>
<File Include="bin/App_global.asax.dll">
<publishTime>12/12/2024 10:37:58</publishTime>
<publishTime>12/24/2024 16:28:51</publishTime>
</File>
<File Include="bin/BouncyCastle.Crypto.dll">
<publishTime>02/24/2020 15:29:24</publishTime>
</File>
<File Include="bin/Common.dll">
<publishTime>12/12/2024 10:37:39</publishTime>
<publishTime>12/24/2024 14:23:36</publishTime>
</File>
<File Include="bin/Common.pdb">
<publishTime>12/12/2024 10:37:39</publishTime>
<publishTime>12/24/2024 14:23:36</publishTime>
</File>
<File Include="bin/ComposerSDK.dll">
<publishTime>04/29/2020 16:50:14</publishTime>
@ -63,31 +63,31 @@
<publishTime>10/23/2017 13:15:20</publishTime>
</File>
<File Include="bin/Epost.BLL.dll">
<publishTime>12/12/2024 10:37:40</publishTime>
<publishTime>12/24/2024 14:23:37</publishTime>
</File>
<File Include="bin/Epost.BLL.pdb">
<publishTime>12/12/2024 10:37:40</publishTime>
<publishTime>12/24/2024 14:23:37</publishTime>
</File>
<File Include="bin/Epost.BLL.XmlSerializers.dll">
<publishTime>08/26/2020 18:09:48</publishTime>
</File>
<File Include="bin/Epost.DAL.dll">
<publishTime>12/12/2024 10:37:39</publishTime>
<publishTime>12/24/2024 14:23:37</publishTime>
</File>
<File Include="bin/Epost.DAL.pdb">
<publishTime>12/12/2024 10:37:39</publishTime>
<publishTime>12/24/2024 14:23:37</publishTime>
</File>
<File Include="bin/Epost.DPS.dll">
<publishTime>12/12/2024 10:37:43</publishTime>
<publishTime>12/24/2024 16:28:43</publishTime>
</File>
<File Include="bin/Epost.DPS.pdb">
<publishTime>12/12/2024 10:37:43</publishTime>
<publishTime>12/24/2024 16:28:43</publishTime>
</File>
<File Include="bin/Epost.Model.dll">
<publishTime>12/12/2024 10:37:38</publishTime>
<publishTime>12/24/2024 14:23:36</publishTime>
</File>
<File Include="bin/Epost.Model.pdb">
<publishTime>12/12/2024 10:37:38</publishTime>
<publishTime>12/24/2024 14:23:36</publishTime>
</File>
<File Include="bin/Epost.TestToolsWeb.dll">
<publishTime>09/06/2018 11:57:11</publishTime>
@ -5652,7 +5652,7 @@
<publishTime>05/30/2022 16:58:47</publishTime>
</File>
<File Include="PrecompiledApp.config">
<publishTime>12/12/2024 10:37:45</publishTime>
<publishTime>12/24/2024 16:28:44</publishTime>
</File>
<File Include="Scripts/ai.0.22.9-build00167.js">
<publishTime>04/04/2018 15:45:12</publishTime>
@ -7572,7 +7572,7 @@
<publishTime>07/04/2022 14:22:38</publishTime>
</File>
<File Include="Web.config">
<publishTime>12/12/2024 10:37:44</publishTime>
<publishTime>12/24/2024 14:23:41</publishTime>
</File>
</ItemGroup>
</Project>