From 81ef9284b771db39844ce44ab45c01c1fb5fe906 Mon Sep 17 00:00:00 2001 From: jl Date: Mon, 23 Jun 2025 18:50:32 +0800 Subject: [PATCH] --- Epost.BLL/CommandBLL.cs | 102 +++++++++--------- Epost.BLL/ErrorLogBLL.cs | 13 +++ Epost.BLL/Work_ScanThread.cs | 48 +++++---- Epost.DAL/ErrorLogDAL.cs | 10 +- Epost.Model/ErrorLogModel.cs | 4 +- .../PublishProfiles/Toolsweb.pubxml.user | 30 +++--- 6 files changed, 117 insertions(+), 90 deletions(-) diff --git a/Epost.BLL/CommandBLL.cs b/Epost.BLL/CommandBLL.cs index ac1c838..47b21af 100644 --- a/Epost.BLL/CommandBLL.cs +++ b/Epost.BLL/CommandBLL.cs @@ -30,61 +30,63 @@ namespace Epost.BLL public ResultModel Initialization_T(bool isback = true) { ResultModel resultModel = new ResultModel(); - List list = new List(); - try - { - DataTable dt = addrBLL.getControlList(); - bool result = false; - if (dt != null && dt.Rows.Count > 0) - { - foreach (DataRow item in dt.Rows) - { - LabelParamModel model = new LabelParamModel(); - model.ControlIP = item["ControlIP"].ToString(); - model.Address = "9999"; - model.Command = "FORMAT_JOB_DATA"; - model.Parameter = "50"; - model.Timeout = "0.5"; - list.Add(model); - model = new LabelParamModel(); - model.ControlIP = item["ControlIP"].ToString(); - model.Address = "9999"; - model.Command = "CONNECT"; - model.Parameter = IP; - model.Timeout = "0.5"; - list.Add(model); - model = new LabelParamModel(); - model.ControlIP = item["ControlIP"].ToString(); - model.Address = "9999"; - model.Parameter = "11111000"; - model.Command = "UNLOCK"; - model.Timeout = "0.5"; - list.Add(model); - model = new LabelParamModel(); - model.ControlIP = item["ControlIP"].ToString(); - model.Address = "9999"; - model.Command = "LED_OFF"; - model.Timeout = "0.5"; - list.Add(model); + //List list = new List(); + //try + //{ + // DataTable dt = addrBLL.getControlList(); + // bool result = false; + // if (dt != null && dt.Rows.Count > 0) + // { + // foreach (DataRow item in dt.Rows) + // { + // LabelParamModel model = new LabelParamModel(); + // model.ControlIP = item["ControlIP"].ToString(); + // model.Address = "9999"; + // model.Command = "FORMAT_JOB_DATA"; + // model.Parameter = "50"; + // model.Timeout = "0.5"; + // list.Add(model); + // model = new LabelParamModel(); + // model.ControlIP = item["ControlIP"].ToString(); + // model.Address = "9999"; + // model.Command = "CONNECT"; + // model.Parameter = IP; + // model.Timeout = "0.5"; + // list.Add(model); + // model = new LabelParamModel(); + // model.ControlIP = item["ControlIP"].ToString(); + // model.Address = "9999"; + // model.Parameter = "11111000"; + // model.Command = "UNLOCK"; + // model.Timeout = "0.5"; + // list.Add(model); + // model = new LabelParamModel(); + // model.ControlIP = item["ControlIP"].ToString(); + // model.Address = "9999"; + // model.Command = "LED_OFF"; + // model.Timeout = "0.5"; + // list.Add(model); - } - if (list.Any()) - { - resultModel = SendALL_Init(list); - } + // } + // if (list.Any()) + // { + // resultModel = SendALL_Init(list); + // } - } - return resultModel; + // } + // return resultModel; - } - catch (Exception ex) - { + //} + //catch (Exception ex) + //{ - resultModel.result = "0"; - resultModel.msg = "初始化失败!"; - LogHelper.WriteLogInfo("初始化异常:" + ex.Message); + // resultModel.result = "0"; + // resultModel.msg = "初始化失败!"; + // LogHelper.WriteLogInfo("初始化异常:" + ex.Message); - } + //} + resultModel.result = "0"; + resultModel.msg = "成功"; return resultModel; } #endregion diff --git a/Epost.BLL/ErrorLogBLL.cs b/Epost.BLL/ErrorLogBLL.cs index 9b34306..0d2fda3 100644 --- a/Epost.BLL/ErrorLogBLL.cs +++ b/Epost.BLL/ErrorLogBLL.cs @@ -96,6 +96,19 @@ namespace Epost.BLL logBLL.InsertErrorLog(error_model); } + public void SaveShowMesError(string Title, string Remark, string type = "999") + { + + + ErrorLogBLL logBLL = new ErrorLogBLL(); + ErrorLogModel error_model = new ErrorLogModel(); + error_model.Type = type; + error_model.Title = Title; + error_model.Remark = Remark; + + logBLL.InsertErrorLog(error_model); + + } } } diff --git a/Epost.BLL/Work_ScanThread.cs b/Epost.BLL/Work_ScanThread.cs index cb35a1a..cc32840 100644 --- a/Epost.BLL/Work_ScanThread.cs +++ b/Epost.BLL/Work_ScanThread.cs @@ -28,6 +28,7 @@ namespace Epost.BLL WorkIngCacheDAL workbll = new WorkIngCacheDAL(); SkuInfoBLL skuBLL = new SkuInfoBLL(); UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL(); + ErrorLogBLL logBLL = new ErrorLogBLL(); public void ScanList() { GetScanList(tblock); @@ -142,15 +143,19 @@ namespace Epost.BLL { //手动加波次信息 DataTable matdt = orderbll.GetMatchOrderList(); - if (matdt != null && matdt.Rows.Count > 0) - { - UserCodeModel umodel = new UserCodeModel(); - umodel.Matchid = matdt.Rows[0]["matchid"].ToString(); - umodel.Block = sblock; - umodel.Area = sarea; - UserCacheDAL.UpdateUserCodeList(new List { umodel }, EUserCommend.Create); - } + if (matdt != null && matdt.Rows.Count > 0) + { + UserCodeModel umodel = new UserCodeModel(); + umodel.Matchid = matdt.Rows[0]["matchid"].ToString(); + umodel.Block = sblock; + umodel.Area = sarea; + UserCacheDAL.UpdateUserCodeList(new List { umodel }, EUserCommend.Create); } + else { + logBLL.SaveShowMesError("无待拣选的波次", "无待拣选的波次"); + + } + } ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea); if (ulist.Any()) { matchid = ulist.FirstOrDefault().Matchid; } @@ -346,11 +351,13 @@ namespace Epost.BLL { //无待启动的商品 LogHelper.WriteLogInfo("无待启动的商品,请先扫描商品"+scanStr,LogHelper.Log_Type.ERROR); + logBLL.SaveShowMesError("无待启动的商品,请先扫描商品", "无待启动的商品,请先扫描商品"); } } else { //无此工号 LogHelper.WriteLogInfo("扫描工号不存在"+scanStr, LogHelper.Log_Type.ERROR); + logBLL.SaveShowMesError("扫描工号不存在" , "扫描工号不存在" + scanStr); } @@ -453,6 +460,8 @@ namespace Epost.BLL else { LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR); + logBLL.SaveShowMesError("无波次信息!", "无波次信息"); + } } @@ -484,6 +493,7 @@ namespace Epost.BLL else { LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR); + logBLL.SaveShowMesError("无波次信息!", "无波次信息"); } } @@ -491,16 +501,18 @@ namespace Epost.BLL { //提示无任务 - ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = "商品:" + scanStr + "无任务!"; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - show.Block = data.Block; - show.Area = data.Area; - show.Type = 8; - show.Islock = false; - comBLL.ShowBoxMessage_M(show); - downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - } + //ShowMessageModel_M show = new ShowMessageModel_M(); + //show.Title = "商品:" + scanStr + "无任务!"; + //show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); + //show.Block = data.Block; + //show.Area = data.Area; + //show.Type = 8; + //show.Islock = false; + //comBLL.ShowBoxMessage_M(show); + //downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); + logBLL.SaveShowMesError("商品:" + scanStr + "无任务!", "商品:" + scanStr + "无任务!"); + + } #endregion } diff --git a/Epost.DAL/ErrorLogDAL.cs b/Epost.DAL/ErrorLogDAL.cs index 13a0c41..5205bd1 100644 --- a/Epost.DAL/ErrorLogDAL.cs +++ b/Epost.DAL/ErrorLogDAL.cs @@ -19,15 +19,13 @@ namespace Epost.DAL { try { - - string sql = string.Format("insert into errorlog(username,ControlIP,ControlID,Address,ErrorDate,Type,BkAddress,Remark) values('{0}','{1}','{2}','{3}','{4}',{5},'{6}','{7}')", + + string sql = string.Format("insert into errorlog(username,ErrorDate,Type,title,Remark) values('{0}','{1}','{2}','{3}','{4}')", model.UserName, - model.ControlIP, - model.ControlID, - model.Address, + DateTime.Now.ToString(), model.Type, - model.BkAddress, + model.Title, model.Remark); int x = db.InsertSql(sql); if (x > 0) diff --git a/Epost.Model/ErrorLogModel.cs b/Epost.Model/ErrorLogModel.cs index e481128..6a32daf 100644 --- a/Epost.Model/ErrorLogModel.cs +++ b/Epost.Model/ErrorLogModel.cs @@ -20,7 +20,7 @@ namespace Epost.Model private string _UserName = string.Empty; public int _PageIndex = 0; public int _PageSize = 0; - + private string _Title = string.Empty; public int PageIndex { get @@ -172,5 +172,7 @@ namespace Epost.Model _ID = value; } } + + public string Title { get => _Title; set => _Title = value; } } } diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index 3e5c50e..f07cfe1 100644 --- a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user +++ b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user @@ -7,7 +7,7 @@ <_PublishTargetUrl>D:\驿传\GuangzhouHuiFeng_DAS - True|2025-06-16T08:39:46.1896351Z||;True|2025-06-04T15:01:49.8008687+08:00||;True|2025-01-16T15:37:40.8814043+08:00||;True|2024-12-19T15:11:44.2536385+08:00||;True|2024-12-10T19:10:26.6514077+08:00||;True|2024-12-10T18:30:34.7211512+08:00||;True|2024-12-09T14:06:46.4112259+08:00||;True|2024-12-03T14:23:26.2134334+08:00||;True|2024-11-27T18:53:48.7373661+08:00||;True|2024-11-27T14:27:33.0840789+08:00||;True|2024-11-27T14:08:15.6442660+08:00||;True|2024-11-27T12:10:03.9412549+08:00||;True|2024-11-27T11:45:31.3775097+08:00||;True|2024-11-27T11:32:00.8297320+08:00||;True|2024-11-23T20:50:04.5476409+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|2025-06-23T10:49:19.8150434Z||;False|2025-06-23T18:47:53.8200239+08:00||;True|2025-06-23T18:13:17.9954519+08:00||;True|2025-06-16T16:39:46.1896351+08:00||;True|2025-06-04T15:01:49.8008687+08:00||;True|2025-01-16T15:37:40.8814043+08:00||;True|2024-12-19T15:11:44.2536385+08:00||;True|2024-12-10T19:10:26.6514077+08:00||;True|2024-12-10T18:30:34.7211512+08:00||;True|2024-12-09T14:06:46.4112259+08:00||;True|2024-12-03T14:23:26.2134334+08:00||;True|2024-11-27T18:53:48.7373661+08:00||;True|2024-11-27T14:27:33.0840789+08:00||;True|2024-11-27T14:08:15.6442660+08:00||;True|2024-11-27T12:10:03.9412549+08:00||;True|2024-11-27T11:45:31.3775097+08:00||;True|2024-11-27T11:32:00.8297320+08:00||;True|2024-11-23T20:50:04.5476409+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 - 06/16/2025 16:39:42 + 06/23/2025 18:13:15 - 06/16/2025 16:39:42 + 06/23/2025 18:13:15 02/24/2020 15:29:24 - 06/16/2025 16:29:30 + 06/23/2025 17:11:31 - 06/16/2025 16:29:30 + 06/23/2025 17:11:31 04/29/2020 16:50:14 @@ -63,31 +63,31 @@ 10/23/2017 13:15:20 - 06/16/2025 16:29:31 + 06/23/2025 17:22:01 - 06/16/2025 16:29:31 + 06/23/2025 17:22:01 08/26/2020 18:09:48 - 06/16/2025 16:29:30 + 06/23/2025 17:11:31 - 06/16/2025 16:29:30 + 06/23/2025 17:11:31 - 06/16/2025 16:39:25 + 06/23/2025 17:22:03 - 06/16/2025 16:39:25 + 06/23/2025 17:22:03 - 06/16/2025 16:29:29 + 06/23/2025 17:11:31 - 06/16/2025 16:29:29 + 06/23/2025 17:11:31 09/06/2018 11:57:11 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 06/16/2025 16:39:28 + 06/23/2025 18:13:08 04/04/2018 15:45:12 @@ -7572,7 +7572,7 @@ 07/04/2022 14:22:38 - 06/16/2025 16:39:26 + 06/23/2025 18:13:07 \ No newline at end of file