diff --git a/Epost.BLL/AgvLogInfoBLL.cs b/Epost.BLL/AgvLogInfoBLL.cs index c9c113a..2d0f08a 100644 --- a/Epost.BLL/AgvLogInfoBLL.cs +++ b/Epost.BLL/AgvLogInfoBLL.cs @@ -1,6 +1,7 @@ using Epost.DAL; using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -14,5 +15,10 @@ namespace Epost.BLL { return dal.insertAgvLogInfo(reqCode,reqTime,robotCode,beginDate,warnContent,taskCode); } + + public DataTable getAgvLogList(string strwhere) + { + return dal.getAgvLogList(strwhere); + } } } diff --git a/Epost.DAL/AgvLogInfoDAL.cs b/Epost.DAL/AgvLogInfoDAL.cs index 7976f35..4c4c4cb 100644 --- a/Epost.DAL/AgvLogInfoDAL.cs +++ b/Epost.DAL/AgvLogInfoDAL.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -20,5 +21,11 @@ namespace Epost.DAL return true; return false; } + + public DataTable getAgvLogList(string strwhere) + { + string sql = string.Format("select * from agvLogInfo where 1=1 "+strwhere); + return db.GetsqlForDT(sql); + } } } diff --git a/Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs b/Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs index d1904db..22a06b5 100644 --- a/Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs +++ b/Epost.TestToolsWeb/Controllers/AgvTaskApiController.cs @@ -124,6 +124,7 @@ namespace Epost.DPS.Controllers List headerlist = new List(); List datalist = data.data; string reqcode = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(); + bool istrue = true; if (datalist.Any()) { foreach (warnCallbackData item in datalist) @@ -134,9 +135,18 @@ 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); + DataTable logdt= logbll.getAgvLogList(" and robotCode='"+ item.robotCode + "' and warnContent='"+ item.warnContent + "' and addtime>dateadd(minute,-10,GETDATE())"); + if (logdt != null && logdt.Rows.Count > 0) + { + istrue = false; + } + else { + logbll.insertAgvLogInfo(reqcode, item.beginDate, item.robotCode, item.beginDate, item.warnContent, item.taskCode); + } + } } + if (istrue) { agvexHeader.list = taskList; agvexHeader.clientCode = data.clientCode; agvexHeader.reqCode = reqcode; @@ -152,8 +162,8 @@ namespace Epost.DPS.Controllers logBLL.InsertLog("WCS->WMS告警通知", "warnCallback", agvexTaskUrl, reqstr, resultStr, 0, "", DateTime.Now); - // } - + // } + } retModel.message = "成功!"; retModel.code = "0"; retModel.reqCode = data.reqCode; diff --git a/Epost.TestToolsWeb/Global.asax.cs b/Epost.TestToolsWeb/Global.asax.cs index 8750974..bb41831 100644 --- a/Epost.TestToolsWeb/Global.asax.cs +++ b/Epost.TestToolsWeb/Global.asax.cs @@ -39,7 +39,7 @@ namespace Epost.TestToolsWeb { //在这里编写需要定时执行的逻辑代码 LogHelper.WriteLogInfo("任务执行中"); - DataTable dt = inboundBLL.GetInOrderList(" and state =0"); + DataTable dt = inboundBLL.GetInOrderList(" and state =0 order by priority,id"); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index 44da464..bc78689 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-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; + True|2024-12-25T02:39:08.4069954Z;True|2024-12-24T14:23:59.6498280+08:00;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; @@ -33,19 +33,19 @@ 04/04/2018 15:45:12 - 12/24/2024 16:28:51 + 12/25/2024 16:29:27 - 12/24/2024 16:28:51 + 12/25/2024 16:29:27 02/24/2020 15:29:24 - 12/24/2024 14:23:36 + 12/25/2024 10:38:45 - 12/24/2024 14:23:36 + 12/25/2024 10:38:45 04/29/2020 16:50:14 @@ -63,25 +63,25 @@ 10/23/2017 13:15:20 - 12/24/2024 14:23:37 + 12/25/2024 10:38:46 - 12/24/2024 14:23:37 + 12/25/2024 10:38:46 08/26/2020 18:09:48 - 12/24/2024 14:23:37 + 12/25/2024 10:38:46 - 12/24/2024 14:23:37 + 12/25/2024 10:38:46 - 12/24/2024 16:28:43 + 12/25/2024 16:29:12 - 12/24/2024 16:28:43 + 12/25/2024 16:29:12 12/24/2024 14:23:36 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 12/24/2024 16:28:44 + 12/25/2024 16:29:13 04/04/2018 15:45:12