diff --git a/Epost.BLL/AddressstorageBLL.cs b/Epost.BLL/AddressstorageBLL.cs index 047258d..9cfeb62 100644 --- a/Epost.BLL/AddressstorageBLL.cs +++ b/Epost.BLL/AddressstorageBLL.cs @@ -146,9 +146,9 @@ namespace Epost.BLL #endregion #region 获取控制器列表 - public DataTable getLabelList(string controlid) + public DataTable getLabelList(string controlid,string batchno) { - return dal.getLabelList(controlid); + return dal.getLabelList(controlid, batchno); } #endregion diff --git a/Epost.BLL/CommandBLL.cs b/Epost.BLL/CommandBLL.cs index e5432b5..25400f3 100644 --- a/Epost.BLL/CommandBLL.cs +++ b/Epost.BLL/CommandBLL.cs @@ -27,7 +27,7 @@ namespace Epost.BLL string IP = ConfigurationManager.AppSettings["WebAPIUrl"]; #region 初始化数据 - public ResultModel Initialization_M(bool isback = true) + public ResultModel Initialization_T(bool isback = true) { ResultModel resultModel = new ResultModel(); List list = new List(); @@ -60,6 +60,12 @@ namespace Epost.BLL 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()) @@ -84,7 +90,7 @@ namespace Epost.BLL #endregion #region 设备检测 查询所有标签 - public ResultModel GetAllLabelList_M() + public ResultModel GetAllLabelList_M(string batchno) { ResultModel model = new ResultModel(); try @@ -96,11 +102,12 @@ namespace Epost.BLL { foreach (DataRow item in dt.Rows) { - DataTable lableDt = addrBLL.getLabelList(item["id"].ToString()); + DataTable lableDt = addrBLL.getLabelList(item["id"].ToString(), batchno); if (lableDt != null && lableDt.Rows.Count > 0) { foreach (DataRow labelItem in lableDt.Rows) { + string shopid = labelItem["address"].ToString(); if (labelItem["addresstype"].ToString() == "2") { LabelParamModel CNlablemodel = new LabelParamModel(); @@ -115,12 +122,20 @@ namespace Epost.BLL } else { + if (!string.IsNullOrEmpty(labelItem["shopid"].ToString())) + { + shopid = labelItem["shopid"].ToString(); + if (shopid.Length > 4) + { + shopid = shopid.Substring(shopid.Length-4,4); + } + } LabelParamModel lablemodel = new LabelParamModel(); lablemodel.Address = labelItem["address"].ToString(); lablemodel.ControlIP = item["ControlIP"].ToString(); lablemodel.Command = "DISPLAY_JOB"; lablemodel.Type = "N"; - lablemodel.Quantity = labelItem["address"].ToString(); + lablemodel.Quantity = shopid; lablemodel.Uid = labelItem["address"].ToString(); lablemodel.Mode = "10"; list.Add(lablemodel); @@ -432,6 +447,7 @@ namespace Epost.BLL LabelParamModel model = new LabelParamModel(); model.ControlIP = item["ControlIP"].ToString(); FORMATE_JOB_DATA(model); + LED_OFF_CLEAR(item["ControlIP"].ToString()); } diff --git a/Epost.BLL/OrderBLL.cs b/Epost.BLL/OrderBLL.cs index c6c0ed2..50130d2 100644 --- a/Epost.BLL/OrderBLL.cs +++ b/Epost.BLL/OrderBLL.cs @@ -707,7 +707,7 @@ namespace Epost.BLL demodel.BatchId = item["BatchId"].ToString(); demodel.ID = item["ID"].ToString(); demodel.GoodsName = item["GoodsName"].ToString(); - demodel.GoodsType = item["GoodsType"].ToString(); + demodel.Quantity = Convert.ToInt32(item["Quantity"].ToString()); demodel.CheckQuantity = Convert.ToInt32(item["CheckQuantity"].ToString()); demodel.Sku = item["Sku"].ToString(); @@ -715,13 +715,13 @@ namespace Epost.BLL demodel.Matchid = item["Matchid"].ToString(); demodel.ShopID = item["shopid"].ToString(); demodel.BoxCode = item["boxcode"].ToString(); - demodel.LotNo = item["LotNo"].ToString(); + demodel.Discount = item["Discount"].ToString(); - demodel.ProdArea = item["ProdArea"].ToString(); + demodel.ColorCode = item["corlorcode"].ToString(); demodel.WholeUnit = item["WholeUnit"].ToString(); demodel.Unit = item["Unit"].ToString(); - demodel.TrayCode = item["bkbarcode"].ToString(); + #region 获取库位信息 demodel.Block = item["Block"].ToString(); demodel.Area = item["Area"].ToString(); diff --git a/Epost.BLL/OrderControlBLL.cs b/Epost.BLL/OrderControlBLL.cs index f054fbb..126917a 100644 --- a/Epost.BLL/OrderControlBLL.cs +++ b/Epost.BLL/OrderControlBLL.cs @@ -48,7 +48,7 @@ namespace Epost.BLL orderbll.UpOrderstate(); UserCacheDAL.ClearUserCodeList(); boxcache.ClearBoxList(); - ResultModel resultModel = comBLL.Initialization_M(); + ResultModel resultModel = comBLL.Initialization_T(); // GetOrderQueue(); //加载任务显示器信息 return resultModel; @@ -119,10 +119,10 @@ namespace Epost.BLL #region 设备检测 - public ResultModel TestStart() + public ResultModel TestStart(string batchno) { - ResultModel result = comBLL.GetAllLabelList_M(); + ResultModel result = comBLL.GetAllLabelList_M(batchno); return result; } diff --git a/Epost.BLL/Work_JobDownThread.cs b/Epost.BLL/Work_JobDownThread.cs index b0c9831..3b48c95 100644 --- a/Epost.BLL/Work_JobDownThread.cs +++ b/Epost.BLL/Work_JobDownThread.cs @@ -286,7 +286,7 @@ namespace Epost.BLL #endregion #region 刷新波次信息 - showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid); + // showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid); #endregion Thread.Sleep(30); diff --git a/Epost.BLL/Work_ScanThread.cs b/Epost.BLL/Work_ScanThread.cs index f1f6728..e6aedfc 100644 --- a/Epost.BLL/Work_ScanThread.cs +++ b/Epost.BLL/Work_ScanThread.cs @@ -267,7 +267,7 @@ namespace Epost.BLL ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = skudt.Rows[0]["sku_goodsname"].ToString(); + show.Title = skudt.Rows[0]["goodsname"].ToString(); show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); show.Block = data.Block; show.Islock = true; diff --git a/Epost.DAL/AddressstorageDAL.cs b/Epost.DAL/AddressstorageDAL.cs index f7f20a5..11dc56e 100644 --- a/Epost.DAL/AddressstorageDAL.cs +++ b/Epost.DAL/AddressstorageDAL.cs @@ -133,6 +133,16 @@ namespace Epost.DAL return dt; } #endregion + + #region 查询控制器下所有标签地址 + public DataTable getLabelList(string controlid,string batchno) + { + string sql = string.Format(" select distinct address, state, type, ControlID,addresstype,isnull(shopid,'') as shopid,name,batchno from v_storeaddress where type in (1, 2, 8) and Controlid = '{0}' and batchno='{1}' ", + controlid,batchno); + DataTable dt = db.GetsqlForDT(sql); + return dt; + } + #endregion #region 根据区域 查询显示箱号地址 public DataTable getAddressByBlock(string block) { diff --git a/Epost.DAL/OrdersDAL.cs b/Epost.DAL/OrdersDAL.cs index 54dd1df..0f0ea2e 100644 --- a/Epost.DAL/OrdersDAL.cs +++ b/Epost.DAL/OrdersDAL.cs @@ -48,7 +48,7 @@ namespace Epost.DAL string sql = string.Empty; if (!string.IsNullOrEmpty(area)) { - sql = string.Format("select id, ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ", + sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ", sku, block, area); @@ -56,7 +56,7 @@ namespace Epost.DAL } else { - sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", + sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode ,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", sku, block); @@ -90,7 +90,7 @@ namespace Epost.DAL string sql = string.Empty; if (!string.IsNullOrEmpty(area)) { - sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ", + sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ", sku, block, area); @@ -98,7 +98,7 @@ namespace Epost.DAL } else { - sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", + sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP, area , block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", sku, block); @@ -106,7 +106,7 @@ namespace Epost.DAL } - LogHelper.WriteLogInfo("获取订单信息location-" + sql); + LogHelper.WriteLogInfo("获取回显订单信息location-" + sql); return db.GetsqlForDT(sql); } catch (Exception ex) @@ -158,7 +158,7 @@ namespace Epost.DAL strwhere += " and matchid = '" + matchid + "'"; } - string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where sku='{0}' and block='{1}' " + strwhere + " group by sku,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode", + string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where sku='{0}' and block='{1}' " + strwhere + " group by sku, Discount,goodsname,unit,wholeunit,matchid ,goodscode", sku, block); LogHelper.WriteLogInfo("获取订单信息-中分" + sql); diff --git a/Epost.Model/ResultModel.cs b/Epost.Model/ResultModel.cs index 58bb6b0..e4e4340 100644 --- a/Epost.Model/ResultModel.cs +++ b/Epost.Model/ResultModel.cs @@ -37,4 +37,10 @@ namespace Epost.Model } } } + + public class BatchModel { + string _batchno = string.Empty; + + public string batchno { get => _batchno; set => _batchno = value; } + } } diff --git a/Epost.TestToolsWeb/Controllers/HomeController.cs b/Epost.TestToolsWeb/Controllers/HomeController.cs index 4e8149f..036362b 100644 --- a/Epost.TestToolsWeb/Controllers/HomeController.cs +++ b/Epost.TestToolsWeb/Controllers/HomeController.cs @@ -46,92 +46,6 @@ namespace Epost.TestToolsWeb.Controllers ViewBag.isWork = isWork; return View(); } - - - #region 初始化 - public ActionResult ClearALL() - { - - bool result = false; - isShow = true; - try - { - - ResultModel resultModel = contrbll.ClearALL(); - return Json(new { Success = resultModel.result, Message = resultModel.msg }); - } - catch (Exception) - { - - return Json(new { Success = result, Message = "失败" }); - } - - - } - #endregion - - #region 开始作业 - - public ActionResult StartWork() - { - isShow = true; - - contrbll.StartWork(); - isWork = 1; - return Json(new { Success = true, Message = "成功" }); - } - #endregion - - #region 设备检测 - public ActionResult TestStart() - { - - ResultModel result = contrbll.TestStart(); - if (result.result == "1") - { - return Json(new { Success = result, Message = result.msg }); - } - else - { - return Json(new { Success = result, Message = result.msg }); - } - - } - #endregion - - #region 停止检测 - public ActionResult TestEnd() - { - contrbll.TestEnd(); - return Json(new { Success = true, Message = "成功" }); - - - } - #endregion - - #region 结束作业 - public ActionResult EndWork() - { - try - { - - isShow = false; - isWork = 0; - isClear = 0; - contrbll.EndWork(); - return Json(new { Success = true, Message = "成功" }); - } - catch (Exception ex) - { - LogHelper.WriteLogInfo("结束作业异常" + ex.Message); - return Json(new { Success = false, Message = "失败" }); - } - - - } - #endregion - - } } \ No newline at end of file diff --git a/Epost.TestToolsWeb/Controllers/ServerController.cs b/Epost.TestToolsWeb/Controllers/ServerController.cs index 1fe2008..0e11b79 100644 --- a/Epost.TestToolsWeb/Controllers/ServerController.cs +++ b/Epost.TestToolsWeb/Controllers/ServerController.cs @@ -104,21 +104,21 @@ namespace Epost.DPS.Controllers #region 设备检测 [Route("TestStart")] [HttpPost] - public ResultModel TestStart() + public ResultModel TestStart(BatchModel model) { lock (lockinit) { ResultModel res = new ResultModel(); try { - ResultModel result = contrbll.TestStart(); + ResultModel result = contrbll.TestStart(model.batchno); return result; } catch (Exception ex) { - LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message); + LogHelper.WriteLogInfo("TestStart异常:" + ex.Message); res.msg = "请求异常!"; res.result = "-1"; return res; diff --git a/Epost.TestToolsWeb/Epost.DPS.csproj.user b/Epost.TestToolsWeb/Epost.DPS.csproj.user index 044be83..b1a2138 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 diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml index a23dedd..597e2b9 100644 --- a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml +++ b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml @@ -9,13 +9,13 @@ Release Any CPU - True - False - D:\驿传\T系列 - True - True - True - False + true + false + D:\驿传\Wuxidingshi_DAS + true + true + true + false DonotMerge \ No newline at end of file diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index f2234de..df11d90 100644 --- a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user +++ b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user @@ -6,8 +6,8 @@ - <_PublishTargetUrl>D:\驿传\T系列 - True|2024-09-01T02:13:37.1598955Z;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; + <_PublishTargetUrl>D:\驿传\Wuxidingshi_DAS + False|2024-11-04T09:48:25.2781696Z;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 - 09/01/2024 13:28:03 + 11/08/2024 11:47:18 - 09/01/2024 13:28:02 + 11/08/2024 11:47:17 02/24/2020 15:29:24 - 09/01/2024 10:13:03 + 11/06/2024 10:26:56 - 09/01/2024 10:13:03 + 11/06/2024 10:26:56 04/29/2020 16:50:14 @@ -63,31 +63,31 @@ 10/23/2017 13:15:20 - 09/01/2024 13:27:54 + 11/08/2024 11:47:07 - 09/01/2024 13:27:54 + 11/08/2024 11:47:07 08/26/2020 18:09:48 - 09/01/2024 11:27:24 + 11/08/2024 11:47:06 - 09/01/2024 11:27:24 + 11/08/2024 11:47:06 - 09/01/2024 13:27:56 + 11/08/2024 11:47:09 - 09/01/2024 13:27:56 + 11/08/2024 11:47:09 - 08/31/2024 17:27:44 + 11/06/2024 10:26:56 - 08/31/2024 17:27:44 + 11/06/2024 10:26:56 09/06/2018 11:57:11 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 09/01/2024 13:27:58 + 11/08/2024 11:47:11 04/04/2018 15:45:12 @@ -7572,7 +7572,7 @@ 07/04/2022 14:22:38 - 08/31/2024 19:13:15 + 11/01/2024 16:24:56 \ No newline at end of file diff --git a/Epost.TestToolsWeb/Web.config b/Epost.TestToolsWeb/Web.config index 8f73974..0322702 100644 --- a/Epost.TestToolsWeb/Web.config +++ b/Epost.TestToolsWeb/Web.config @@ -11,7 +11,7 @@ - + @@ -27,11 +27,11 @@ - + - +