From bad533bcc1f2ce83aba4eeee8e3f07f4285b8d0c Mon Sep 17 00:00:00 2001 From: jl Date: Thu, 12 Dec 2024 10:34:24 +0800 Subject: [PATCH] --- Epost.BLL/OrderBLL.cs | 12 +- Epost.BLL/OrderControlBLL.cs | 204 ++++----- Epost.BLL/Work_DisplayJobThread.cs | 26 +- Epost.BLL/Work_JobDownThread.cs | 425 +----------------- Epost.BLL/Work_ScanThread.cs | 12 +- Epost.DAL/OrdersDAL.cs | 31 +- Epost.TestToolsWeb/Epost.DPS.csproj.user | 2 +- .../PublishProfiles/Toolsweb.pubxml.user | 30 +- 8 files changed, 178 insertions(+), 564 deletions(-) diff --git a/Epost.BLL/OrderBLL.cs b/Epost.BLL/OrderBLL.cs index 8b37642..86e815b 100644 --- a/Epost.BLL/OrderBLL.cs +++ b/Epost.BLL/OrderBLL.cs @@ -912,16 +912,22 @@ namespace Epost.BLL { return dal.GetSumList(matchid, sku, block, area); } + + public DataTable GetSumList_Echo(string matchid, string sku, string block, string area = "") { return dal.GetSumList_Echo(matchid, sku, block, area); } //查询sku对应的所有任务 - public DataTable getOrderListBysku(string block, string sku,string area) + public DataTable getOrderListBysku(string block, string sku,string area, string matchid) { - return dal.getOrderListBysku(block, sku,area); + return dal.getOrderListBysku(block, sku,area,matchid); } - + public DataTable getOrderHisListBysku(string block, string sku, string area,string matchid) + { + return dal.getOrderHisListBysku(block, sku, area, matchid); + } + public bool UpOrderStateBybat(string id) { return dal.UpOrderStateBybat(id); diff --git a/Epost.BLL/OrderControlBLL.cs b/Epost.BLL/OrderControlBLL.cs index 126917a..30ce07f 100644 --- a/Epost.BLL/OrderControlBLL.cs +++ b/Epost.BLL/OrderControlBLL.cs @@ -166,125 +166,125 @@ namespace Epost.BLL #endregion #region 查询波次通道列表 - public void GetOrderQueue() - { - DataTable dt = queueBLL.getQueueOrderStateList(); - if (dt != null && dt.Rows.Count > 0) - { - foreach (DataRow item in dt.Rows) - { - if (item["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue)) - { - Mes_Echo(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString()); - } - else - { - showSummaryMes(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString()); - } + //public void GetOrderQueue() + //{ + // DataTable dt = queueBLL.getQueueOrderStateList(); + // if (dt != null && dt.Rows.Count > 0) + // { + // foreach (DataRow item in dt.Rows) + // { + // if (item["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue)) + // { + // Mes_Echo(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString()); + // } + // else + // { + // showSummaryMes(item["sku"].ToString(), item["taskblock"].ToString(), item["taskarea"].ToString(), 1, null, "", item["matchid"].ToString()); + // } - } - } + // } + // } - } + //} #endregion - #region 复核显示 - public void Mes_Echo(string scanStr, string sblock, string sarea, int type, ResultMessageModel data = null, string location = "", string matchid = "", bool islock = true) - { + //#region 复核显示 + //public void Mes_Echo(string scanStr, string sblock, string sarea, int type, ResultMessageModel data = null, string location = "", string matchid = "", bool islock = true) + //{ - DataTable sudt = orderbll.GetSumList_Echo("", scanStr, sblock); - if (type == 2) - { - sudt = orderbll.GetSumList_Echo("", scanStr, sblock, sarea); - } - //查询当前区任务队列 - DataTable qdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "1"); - if (sudt != null && sudt.Rows.Count > 0) - { - matchid = sudt.Rows[0]["matchid"].ToString(); - string sku = string.Empty; - string qty = string.Empty; - string color = string.Empty; - if (qdt != null && qdt.Rows.Count > 0) - { - sku = qdt.Rows[0]["sku"].ToString(); - qty = sudt.Rows[0]["SumQuantity"].ToString(); - color = qdt.Rows[0]["LightColor"].ToString(); - } + // DataTable sudt = orderbll.GetSumList_Echo("", scanStr, sblock); + // if (type == 2) + // { + // sudt = orderbll.GetSumList_Echo("", scanStr, sblock, sarea); + // } + // //查询当前区任务队列 + // DataTable qdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "1"); + // if (sudt != null && sudt.Rows.Count > 0) + // { + // matchid = sudt.Rows[0]["matchid"].ToString(); + // string sku = string.Empty; + // string qty = string.Empty; + // string color = string.Empty; + // if (qdt != null && qdt.Rows.Count > 0) + // { + // sku = qdt.Rows[0]["sku"].ToString(); + // qty = sudt.Rows[0]["SumQuantity"].ToString(); + // color = qdt.Rows[0]["LightColor"].ToString(); + // } - //规格 - // int discount = Convert.ToInt32(sudt.Rows[0]["discount"].ToString()); - //整件总数 - int SumCkQuantity = 0;// Convert.ToInt32(sudt.Rows[0]["SumCkQuantity"].ToString()); - //散件总数 - int SumQuantity = Convert.ToInt32(sudt.Rows[0]["SumQuantity"].ToString()); - //if (discount != 1) - //{ - // if (SumQuantity >= discount) - // { + // //规格 + // // int discount = Convert.ToInt32(sudt.Rows[0]["discount"].ToString()); + // //整件总数 + // int SumCkQuantity = 0;// Convert.ToInt32(sudt.Rows[0]["SumCkQuantity"].ToString()); + // //散件总数 + // int SumQuantity = Convert.ToInt32(sudt.Rows[0]["SumQuantity"].ToString()); + // //if (discount != 1) + // //{ + // // if (SumQuantity >= discount) + // // { - // SumCkQuantity = SumQuantity / discount; - // SumQuantity = SumQuantity % discount; - // } - //} + // // SumCkQuantity = SumQuantity / discount; + // // SumQuantity = SumQuantity % discount; + // // } + // //} - ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = sudt.Rows[0]["goodsname"].ToString(); - string mes = "复核显示"; - islock = false; + // ShowMessageModel_M show = new ShowMessageModel_M(); + // show.Title = sudt.Rows[0]["goodsname"].ToString(); + // string mes = "复核显示"; + // islock = false; - if (qdt != null && qdt.Rows.Count > 0) - { - show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes; - } - if (data != null) - { + // if (qdt != null && qdt.Rows.Count > 0) + // { + // show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes; + // } + // if (data != null) + // { - show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r"+ mes; - sku = data.Parameter; - } - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue); - show.Qty = SumQuantity.ToString(); - show.Wholeqty = SumCkQuantity; - show.Unit = "件"; - show.Type = 8; - show.Wholeunit = "箱"; - show.Block = sblock; - show.Area = sarea; - show.Islock = islock; - show.Location = "check"; - comBLL.ShowBoxMessage_M(show); + // show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r"+ mes; + // sku = data.Parameter; + // } + // show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue); + // show.Qty = SumQuantity.ToString(); + // show.Wholeqty = SumCkQuantity; + // show.Unit = "件"; + // show.Type = 8; + // show.Wholeunit = "箱"; + // show.Block = sblock; + // show.Area = sarea; + // show.Islock = islock; + // show.Location = "check"; + // comBLL.ShowBoxMessage_M(show); - if (data != null) - { + // if (data != null) + // { - data.Status = "1"; - } + // data.Status = "1"; + // } - } - else - { + // } + // else + // { - //查询当前区任务队列 - DataTable finshqdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "3"); - ShowMessageModel_M show = new ShowMessageModel_M(); - //根据sku获取商品名称 - string goodsname = orderbll.GetGoodsname(location); - show.Title = goodsname + "分播完成"; - show.Contents = scanStr + "\r请扫描继续作业"; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - show.Qty = "0"; - show.Type = 8; - show.Block = sblock; - show.Area = sarea; - show.Islock = true; - comBLL.ShowBoxMessage_M(show); - } - } - #endregion + // //查询当前区任务队列 + // DataTable finshqdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "3"); + // ShowMessageModel_M show = new ShowMessageModel_M(); + // //根据sku获取商品名称 + // string goodsname = orderbll.GetGoodsname(location); + // show.Title = goodsname + "分播完成"; + // show.Contents = scanStr + "\r请扫描继续作业"; + // show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); + // show.Qty = "0"; + // show.Type = 8; + // show.Block = sblock; + // show.Area = sarea; + // show.Islock = true; + // comBLL.ShowBoxMessage_M(show); + // } + //} + //#endregion #region 订单显示器中分提示 /// diff --git a/Epost.BLL/Work_DisplayJobThread.cs b/Epost.BLL/Work_DisplayJobThread.cs index 687d989..96e8181 100644 --- a/Epost.BLL/Work_DisplayJobThread.cs +++ b/Epost.BLL/Work_DisplayJobThread.cs @@ -101,19 +101,26 @@ namespace Epost.BLL showmodel.Block = nblock; showmodel.Color = queueDT.Rows[0]["lightcolor"].ToString();//EnumHelper.EMToDescriptionString(LightColor.Color.Red); showmodel.Title = queueDT.Rows[0]["Shopid"].ToString(); - showmodel.Islock = true; + showmodel.Islock = true; + showmodel.IsTwinkle = 0; + showmodel.Type = 8; + + DataTable skudt = orderbll.GetSumList(queueDT.Rows[0]["matchid"].ToString(), queueDT.Rows[0]["sku"].ToString(), nblock, shelfid); + if (queueDT.Rows[0]["lightcolor"].ToString() == "1") { showmodel.Islock = false; } - - - showmodel.IsTwinkle = 0; - showmodel.Type = 8; - DataTable skudt = orderbll.GetSumList(queueDT.Rows[0]["matchid"].ToString(), queueDT.Rows[0]["sku"].ToString(), nblock, shelfid); + else if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue)) + { + //复核显示 + skudt = orderbll.GetSumList_Echo(queueDT.Rows[0]["matchid"].ToString(), queueDT.Rows[0]["sku"].ToString(), nblock, shelfid); + showmodel.Title = "回显:"+queueDT.Rows[0]["Shopid"].ToString(); + } + if (skudt != null && skudt.Rows.Count > 0) - { - showmodel.Qty = skudt.Rows[0]["SumQuantity"].ToString(); + { + showmodel.Qty = skudt.Rows[0]["SumQuantity"].ToString(); int discount = Convert.ToInt32(skudt.Rows[0]["discount"].ToString()); //整件总数 int SumCkQuantity = 0;//= Convert.ToInt32(skudt.Rows[0]["SumCkQuantity"].ToString()); @@ -133,9 +140,8 @@ namespace Epost.BLL showmodel.Wholeqty = SumCkQuantity; showmodel.Unit = "件"; showmodel.Wholeunit = "箱"; - showmodel.Contents = queueDT.Rows[0]["sku"].ToString()+"\r规格: "+ discount + " \r总数量:" + zcount;; + showmodel.Contents = queueDT.Rows[0]["sku"].ToString() + "\r规格: " + discount + " \r总数量:" + zcount; ; } - comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签 #endregion displayOrder(queueDT, nblock, item.area, model); diff --git a/Epost.BLL/Work_JobDownThread.cs b/Epost.BLL/Work_JobDownThread.cs index d9f611a..e730c3c 100644 --- a/Epost.BLL/Work_JobDownThread.cs +++ b/Epost.BLL/Work_JobDownThread.cs @@ -342,68 +342,7 @@ namespace Epost.BLL #endregion - - #region 处理扫描条码 - public ResultModel BindJobList(ResultMessageModel data) - { - ResultModel res = new ResultModel(); - res.result = "0"; - try - { - string sblock = data.Block; - string scanStr = data.Parameter.Trim(); - string sarea = data.Area; - string name = string.Empty; - string matchid = string.Empty; - #region 提示请扫描波次号 - List ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);// - bool isnum = ConvertHexHelper.IsNum(scanStr.Substring(0, 1));//判断扫描首字母是否是数字 - - if (!ulist.Any()) - { - //手动加波次信息 - 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); - } - } - ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea); - if (ulist.Any()) - { matchid = ulist.FirstOrDefault().Matchid; } - - #endregion - if (data.Type == "5")//中分扫描枪 - { - - zhongfenBind(ulist, scanStr, data); - downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - } - else if (data.Type == "6")//播种扫描枪 - { - - xifenBind(ulist, scanStr, data, matchid, isnum); - - downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - } - - - return res; - } - catch (Exception ex) - { - res.result = "-1"; - res.msg = "绑定任务异常"; - LogHelper.WriteLogInfo("绑定任务异常:" + ex.Message); - return res; - } - - } - #endregion + #region 中分 @@ -524,308 +463,8 @@ namespace Epost.BLL } #endregion - #region 细分播种 - public void xifenBind(List ulist, string scanStr, ResultMessageModel data, string matchid, bool isnum) - { - //if (ulist.Any()) - //{ - // UserCodeModel usermodel = ulist.FirstOrDefault(); - //if (string.IsNullOrEmpty(usermodel.UserCode) && scanStr.Substring(0, 1) != "U")// - //{ - // #region 提示先扫描工号 - // ShowMessageModel_M show = new ShowMessageModel_M(); - // show.Title = "请先扫描工号!"; - // show.Contents = ""; - // show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - // show.Block = sblock; - // show.Area = sarea; - // show.Type = 8; - // show.Islock = true; - // comBLL.ShowBoxMessage_M(show); - // downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - // #endregion - //} - //else - //{ - - if (scanStr.Substring(0, 1) == "U") - { - #region 扫描工号 - if (ulist.Any()) - { - UserCodeModel umodel = ulist.FirstOrDefault(); - umodel.UserCode = scanStr; - #region 扫描工号 - ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = "请扫描sku开始作业!"; - show.Contents = ""; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - show.Block = data.Block; - show.Area = data.Area; - show.Type = 8; - show.Islock = true; - - comBLL.ShowBoxMessage_M(show); - #endregion - } - downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - #endregion - } - else - { - - #region 扫描商品 - - List hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888"); - - if (hangList.Any()) - { - - #region 挂起 - LogHelper.WriteLogInfo("挂起" + data.Parameter + "-------通道" + data.Block); - LabelParamModel FORMATEModel = new LabelParamModel(); - FORMATEModel.ControlIP = data.IP; - comBLL.FORMATE_JOB_DATA(FORMATEModel); - - - DataTable qdt = queueBLL.getQueuesOrderbyState(data.Block, data.Area, "1"); - if (qdt != null && qdt.Rows.Count > 0) - { - scanStr = qdt.Rows[0]["sku"].ToString(); - - // data.Parameter = scanStr; - Hangup_SKU(scanStr, data.Block, data.Area); - //删除sku对应缓存 - List sdown = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == scanStr || p.Parameter == qdt.Rows[0]["location"].ToString()); - downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute); - } - downCacheDAL.UpdateJobDownModelList(hangList, EdownCommend.Execute); - //刷新波次 - GetMatchOrder(); - #endregion - - } - else if (isnum)//sku - { - #region 扫描SKU - //根据扫描商品内码获取商品码 - data.ScanCode = data.Parameter; - DataTable sinfodt = skuBLL.GetSkuInfoList(data.Parameter); - string location = string.Empty; - if (sinfodt != null && sinfodt.Rows.Count > 0) - { - scanStr = sinfodt.Rows[0]["sku"].ToString(); - location = data.Parameter;// sinfodt.Rows[0]["tolocation"].ToString(); - } - data.Parameter = scanStr; - DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "3"); - List scanlist = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Address == data.Address && m.Parameter == scanStr && m.Parameter != "888888" && m.Block == data.Block && m.Area == data.Area); - - if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0)) - { //重复扫描 - //ShowMessageModel_M show = new ShowMessageModel_M(); - //show.Title = scanStr + "重复扫描/已拣配!"; - //show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - //show.Block = sblock; - //show.Area = sarea; - //show.Type = 8; - //comBLL.ShowBoxMessage_M(show); - downCacheDAL.UpdateJobDownModelList(new List { data }, EdownCommend.Execute); - - } - else - { - - DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block); - if (OrderDt != null && OrderDt.Rows.Count > 0) - { - - if (ulist.Any()) - { - UserCodeModel umodel = ulist.FirstOrDefault(); - data.Port = OrderDt.Rows[0]["matchid"].ToString(); - OrdersQueueModel qmodel = new OrdersQueueModel(); - qmodel.Sku = scanStr; - qmodel.Taskblock = data.Block; - qmodel.Taskarea = data.Area; - qmodel.UserCode = umodel.UserCode; - qmodel.Matchid = umodel.Matchid; - qmodel.Location = location; - qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - queueBLL.insertQueueOrders(qmodel); - //提示需要拣货总量/商品名称 - showSummaryMes(scanStr, data.Block, data.Area, 1, data, "", OrderDt.Rows[0]["matchid"].ToString()); - - } - else - { - LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR); - } - - } - else - { - #region 回显 - DataTable echoDt = orderbll.GetOrderList_echo(matchid, scanStr, data.Area, data.Block); - if (echoDt != null && echoDt.Rows.Count > 0) - { - - if (ulist.Any()) - { - UserCodeModel umodel = ulist.FirstOrDefault(); - data.Port = echoDt.Rows[0]["matchid"].ToString(); - OrdersQueueModel qmodel = new OrdersQueueModel(); - qmodel.Sku = scanStr; - qmodel.Taskblock = data.Block; - qmodel.Taskarea = data.Area; - qmodel.UserCode = umodel.UserCode; - qmodel.Matchid = umodel.Matchid; - // qmodel.Location = location; - qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Blue); - queueBLL.insertQueueOrders(qmodel); - //提示需要拣货总量/商品名称 - Mes_Echo(scanStr, data.Block, data.Area, 1, data, "", echoDt.Rows[0]["matchid"].ToString(), false); - - } - else - { - LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR); - } - - } - else - { - - //提示无任务 - 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); - } - - #endregion - } - - } - - - #endregion - - } - #endregion - } - - } - #endregion - #region 复核显示 - public void Mes_Echo(string scanStr, string sblock, string sarea, int type, ResultMessageModel data = null, string location = "", string matchid = "", bool islock = true) - { - - DataTable sudt = orderbll.GetSumList_Echo("", scanStr, sblock); - if (type == 2) - { - sudt = orderbll.GetSumList_Echo("", scanStr, sblock, sarea); - } - //查询当前区任务队列 - DataTable qdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "1"); - if (sudt != null && sudt.Rows.Count > 0) - { - matchid = sudt.Rows[0]["matchid"].ToString(); - string sku = string.Empty; - string qty = string.Empty; - string color = string.Empty; - if (qdt != null && qdt.Rows.Count > 0) - { - sku = qdt.Rows[0]["sku"].ToString(); - qty = sudt.Rows[0]["SumQuantity"].ToString(); - color = qdt.Rows[0]["LightColor"].ToString(); - } - - //规格 - int discount = Convert.ToInt32(sudt.Rows[0]["discount"].ToString()); - //整件总数 - int SumCkQuantity = 0;// Convert.ToInt32(sudt.Rows[0]["SumCkQuantity"].ToString()); - //散件总数 - int SumQuantity = Convert.ToInt32(sudt.Rows[0]["SumQuantity"].ToString()); - //if (discount != 1) - //{ - // if (SumQuantity >= discount) - // { - - // SumCkQuantity = SumQuantity / discount; - // SumQuantity = SumQuantity % discount; - // } - //} - - - ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = sudt.Rows[0]["goodsname"].ToString(); - string mes = "复核显示"; - islock = false; - - if (qdt != null && qdt.Rows.Count > 0) - { - show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r'); - } - if (data != null) - { - - show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes; - sku = data.Parameter; - } - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue); - show.Qty = SumQuantity.ToString(); - show.Wholeqty = SumCkQuantity; - show.Unit = "件"; - show.Type = 8; - show.Wholeunit = "箱"; - show.Block = sblock; - show.Area = sarea; - show.Islock = islock; - show.Location = "check"; - //ShowMesModel megmodel = new ShowMesModel(); - //megmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString(); - //megmodel.Sku = sku; - //megmodel.Area = sarea; - //megmodel.Block = sblock; - //megmodel.Matchid = matchid; - - // msgCache.UpdateMsgModelList(new List { megmodel }, EmsgCommend.Create); - comBLL.ShowBoxMessage_M(show); - - if (data != null) - { - - data.Status = "1"; - } - - - } - else - { - - //查询当前区任务队列 - DataTable finshqdt = queueBLL.getQueuesOrderbyState(sblock, sarea, "3"); - ShowMessageModel_M show = new ShowMessageModel_M(); - //根据sku获取商品名称 - string goodsname = orderbll.GetGoodsname(location); - show.Title = goodsname + "分播完成"; - show.Contents = scanStr + "\r请扫描继续作业"; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - show.Qty = "0"; - show.Type = 8; - show.Block = sblock; - show.Area = sarea; - show.Islock = true; - comBLL.ShowBoxMessage_M(show); - } - } - #endregion + + #region 订单显示器中分提示 /// @@ -966,63 +605,7 @@ namespace Epost.BLL } #endregion - #region SKU挂起/缺货 - public void Hangup_SKU(string sku, string block, string area, ResultMessageModel data = null) - { - List list = new List(); - //查询当前通道sku是否有任务 - DataTable dt = orderbll.getOrderListBysku(block, sku, area); - if (dt != null && dt.Rows.Count > 0) - { - // 将当前通道所有sku正在亮的设备熄灭 - foreach (DataRow item in dt.Rows) - { - if (item["oprationstate"].ToString() == "1") - { - LabelParamModel lamodel = new LabelParamModel(); - lamodel.Address = item["address"].ToString(); ; - lamodel.ControlIP = item["ControlIP"].ToString(); - lamodel.Command = "REMOVE_JOB"; - lamodel.Parameter = "01"; - list.Add(lamodel); - orderbll.UpOrderStateBybat(item["id"].ToString()); - } - } - if (list != null && list.Count > 0) - { - LogHelper.WriteLogInfo("挂起list——" + sku + "——————————————————:" + list.Count); - comBLL.DISPLAY_JOBALL(list); - } - } - - - //删除缓存中sku记录 - List jobList = JobCache.GetPlanJobList(); - List relist = jobList.FindAll(m => m.Sku == sku && m.Block == block); - JobModel model = new JobModel(); - if (relist.Any()) - { - model = relist.FirstOrDefault(); - JobCache.UpdateJobModelList(relist, EcommendType.Complete); - //删除Orderqueue中sku的记录 - bool bo = queueBLL.DelQueueOrder(sku, block, area); - LogHelper.WriteLogInfo("删除queue返回" + bo); - } - else - { - ShowMessageModel_M show = new ShowMessageModel_M(); - show.Title = "挂起商品:" + sku + "错误!"; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red); - show.Block = block; - show.Area = area; - show.Type = 8; - show.Islock = true; - comBLL.ShowBoxMessage_M(show); - } - //downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == sku && p.Block == block); - } - - #endregion + #region 查询波次通道列表 public void GetMatchOrder() diff --git a/Epost.BLL/Work_ScanThread.cs b/Epost.BLL/Work_ScanThread.cs index 8e90148..10eef79 100644 --- a/Epost.BLL/Work_ScanThread.cs +++ b/Epost.BLL/Work_ScanThread.cs @@ -375,7 +375,7 @@ namespace Epost.BLL comBLL.RemoveBoxMessage_M(show); // data.Parameter = scanStr; - Hangup_SKU(scanStr, data.Block, data.Area); + Hangup_SKU(scanStr, data.Block, data.Area,matchid); //删除sku对应缓存 List sdown = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == scanStr && p.Parameter == qdt.Rows[0]["sku"].ToString()&&p.Block == data.Block&&p.Area ==data.Area); downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute); @@ -505,11 +505,17 @@ namespace Epost.BLL #endregion #region SKU挂起/缺货 - public void Hangup_SKU(string sku, string block, string area, ResultMessageModel data = null) + public void Hangup_SKU(string sku, string block, string area,string matchid, ResultMessageModel data = null) { List list = new List(); //查询当前通道sku是否有任务 - DataTable dt = orderbll.getOrderListBysku(block, sku,area); + DataTable dt = orderbll.getOrderListBysku(block, sku,area, matchid); + if (dt == null || dt.Rows.Count == 0) + { + dt = orderbll.getOrderHisListBysku(block, sku, area, matchid); + //回显挂起 + } + if (dt != null && dt.Rows.Count > 0) { // 将当前通道所有sku正在亮的设备熄灭 diff --git a/Epost.DAL/OrdersDAL.cs b/Epost.DAL/OrdersDAL.cs index 13ca6fb..d723ec2 100644 --- a/Epost.DAL/OrdersDAL.cs +++ b/Epost.DAL/OrdersDAL.cs @@ -90,7 +90,7 @@ namespace Epost.DAL string sql = string.Empty; if (!string.IsNullOrEmpty(area)) { - 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 ", + 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_ordershis where 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, 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 ", + 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_ordershis where sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", sku, block); @@ -189,17 +189,17 @@ namespace Epost.DAL strwhere += " and matchid = '" + matchid + "'"; } - string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where state = 0 and oprationstate =3 and sku='{0}' and block='{1}' " + strwhere + " group by sku ,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode,goodsname", + string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_ordershis where sku='{0}' and oprationstate<>3 and block='{1}' " + strwhere +" group by sku, Discount,goodsname,unit,wholeunit,matchid ,goodscode", sku, block); - LogHelper.WriteLogInfo("获取订单信息-中分" + sql); + LogHelper.WriteLogInfo("获取回显订单信息-中分" + sql); return db.GetsqlForDT(sql); } catch (Exception ex) { - LogHelper.WriteLogInfo("获取订单信息-中分异常:" + ex.Message, LogHelper.Log_Type.ERROR); + LogHelper.WriteLogInfo("获取回显订单信息-中分异常:" + ex.Message, LogHelper.Log_Type.ERROR); return null; } } @@ -646,7 +646,7 @@ namespace Epost.DAL // } // truequantity = trueqty + 1; // } - string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ", + string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}',state=3 where matchid='{2}' and id='{4}' ", DateTime.Now.ToString(), truequantity, matchid, @@ -1245,15 +1245,28 @@ namespace Epost.DAL #region 查询sku对应的所有任务 - public DataTable getOrderListBysku(string block, string sku,string area) + public DataTable getOrderListBysku(string block, string sku,string area, string matchid) { - string sql = string.Format("select * from v_orders where block = '{0}' and area='{1}' and sku ='{2}' order by layer,slist ", + string sql = string.Format("select * from v_orders where block = '{0}' and area='{1}' and sku ='{2}'and matchid ='{3}' order by layer,slist ", block,area, - sku); + sku,matchid); LogHelper.WriteLogInfo("查询sku对应的所有任务:" + sql); DataTable dt = db.GetsqlForDT(sql); return dt; + } + #endregion + + #region 查询sku对应的所有任务 + public DataTable getOrderHisListBysku(string block, string sku, string area,string matchid) + { + string sql = string.Format("select * from v_ordershis where block = '{0}' and area='{1}' and sku ='{2}' and matchid ='{3}' order by layer,slist ", + block, area, + sku,matchid); + LogHelper.WriteLogInfo("查询sku对应的所有回显任务:" + sql); + DataTable dt = db.GetsqlForDT(sql); + return dt; + } #endregion #region 查询退货单号查询所在区 diff --git a/Epost.TestToolsWeb/Epost.DPS.csproj.user b/Epost.TestToolsWeb/Epost.DPS.csproj.user index 4d10158..2eaafac 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 - Release|Any CPU + Debug|Any CPU diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index 0dc2a09..9331858 100644 --- a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user +++ b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user @@ -7,7 +7,7 @@ <_PublishTargetUrl>D:\驿传\Wuxidingshi_DAS - True|2024-12-09T06:06:46.4112259Z;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|2024-12-10T11:10:26.6514077Z;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 - 12/09/2024 14:06:43 + 12/10/2024 19:10:22 - 12/09/2024 14:06:43 + 12/10/2024 19:10:22 02/24/2020 15:29:24 - 12/09/2024 14:06:22 + 12/10/2024 19:09:06 - 12/09/2024 14:06:22 + 12/10/2024 19:09:06 04/29/2020 16:50:14 @@ -63,31 +63,31 @@ 10/23/2017 13:15:20 - 12/09/2024 14:06:24 + 12/10/2024 19:09:10 - 12/09/2024 14:06:24 + 12/10/2024 19:09:10 08/26/2020 18:09:48 - 12/09/2024 14:06:23 + 12/10/2024 19:09:08 - 12/09/2024 14:06:23 + 12/10/2024 19:09:08 - 12/09/2024 14:06:27 + 12/10/2024 19:09:13 - 12/09/2024 14:06:27 + 12/10/2024 19:09:13 - 12/06/2024 14:38:44 + 12/10/2024 19:09:05 - 12/06/2024 14:38:44 + 12/10/2024 19:09:05 09/06/2018 11:57:11 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 12/09/2024 14:06:29 + 12/10/2024 19:10:07 04/04/2018 15:45:12 @@ -7572,7 +7572,7 @@ 07/04/2022 14:22:38 - 12/06/2024 14:42:01 + 12/10/2024 19:10:05 \ No newline at end of file