diff --git a/Epost.BLL/OrderBLL.cs b/Epost.BLL/OrderBLL.cs index 86e815b..5cd7de3 100644 --- a/Epost.BLL/OrderBLL.cs +++ b/Epost.BLL/OrderBLL.cs @@ -940,9 +940,9 @@ namespace Epost.BLL return dal.IsFinishWorkByCar(endcount, matchid, block); } - public bool UpdateStateByCar(string matchid, string block = "", string sku = "") + public bool UpdateStateByCar(string matchid, string area,string block = "", string sku = "") { - return dal.UpdateStateByCar(matchid, block, sku); + return dal.UpdateStateByCar(matchid,area, block, sku); } public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string matchid = "") diff --git a/Epost.BLL/Work_JobDownThread.cs b/Epost.BLL/Work_JobDownThread.cs index e730c3c..89bbd59 100644 --- a/Epost.BLL/Work_JobDownThread.cs +++ b/Epost.BLL/Work_JobDownThread.cs @@ -289,44 +289,41 @@ namespace Epost.BLL queueBLL.UpdateQueueTaskArea_Car(qumodel); #endregion - #region 刷新波次信息 - // showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid); - #endregion + Thread.Sleep(30); #region 整条通道当前用户所有任务分播结束 - bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block); - if (blockfinish) - { - #region 点亮显示器 + //bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block); + //if (blockfinish) + //{ + // #region 点亮显示器 - show.Title = "当前波次分播完成"; - show.Contents = "拍下熄灭所有设备\r请扫描继续作业"; - show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green); - show.Qty = "0"; - show.Type = 8; - show.Block = block; - show.Islock = false; - show.IsTwinkle = 1; + // show.Title = "当前波次分播完成"; + // show.Contents = "拍下熄灭所有设备\r请扫描继续作业"; + // show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green); + // show.Qty = "0"; + // show.Type = 8; + // show.Block = block; + // show.Islock = false; + // show.IsTwinkle = 1; - comBLL.ShowBoxMessage_M(show); - #endregion + // comBLL.ShowBoxMessage_M(show); + // #endregion - bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid); - if (allfinish)//判断整个波次是否已完成 - { //更新state状态为已完成 - orderbll.UpdateStateByCar(model.Matchid); - } - //删除波次信息 - List ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block); - UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute); + // bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid); + // if (allfinish)//判断整个波次是否已完成 + // { //更新state状态为已完成 + // orderbll.UpdateStateByCar(model.Matchid); + // } + // //删除波次信息 + // List ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block); + // UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute); - } + //} #endregion #region 区内sku播完回传 - // orderbll.UpdateStateByCar(model.Matchid, "", model.Sku); - + orderbll.UpdateStateByCar(model.Matchid,area, block, model.Sku); #endregion #region 清除当前区已做完的sku diff --git a/Epost.BLL/Work_ScanThread.cs b/Epost.BLL/Work_ScanThread.cs index 10eef79..68a8e4d 100644 --- a/Epost.BLL/Work_ScanThread.cs +++ b/Epost.BLL/Work_ScanThread.cs @@ -510,11 +510,11 @@ namespace Epost.BLL List list = new List(); //查询当前通道sku是否有任务 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) + //{ + // dt = orderbll.getOrderHisListBysku(block, sku, area, matchid); + // //回显挂起 + //} if (dt != null && dt.Rows.Count > 0) { diff --git a/Epost.DAL/OrdersDAL.cs b/Epost.DAL/OrdersDAL.cs index d723ec2..a7c8819 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_ordershis where 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 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_ordershis where 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 sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ", sku, block); @@ -189,7 +189,7 @@ namespace Epost.DAL strwhere += " and matchid = '" + matchid + "'"; } - 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", + 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 oprationstate<>3 and block='{1}' " + strwhere +" group by sku, Discount,goodsname,unit,wholeunit,matchid ,goodscode", sku, block); @@ -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}',state=3 where matchid='{2}' and id='{4}' ", + string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ", DateTime.Now.ToString(), truequantity, matchid, @@ -717,30 +717,39 @@ namespace Epost.DAL #endregion #region 修改当前小车拣货状态 - public bool UpdateStateByCar(string matchid, string block = "", string sku = "") + public bool UpdateStateByCar(string matchid,string area, string block = "", string sku = "") { try { string strwhere = string.Empty; if (!string.IsNullOrEmpty(block)) { - strwhere = " and workblock='" + block + "'"; + strwhere += " and block='" + block + "'"; + } + if (!string.IsNullOrEmpty(sku)) + { + strwhere += " and area='" + area + "'"; } if (!string.IsNullOrEmpty(sku)) { strwhere += " and sku='" + sku + "'"; } - string upsql = string.Format("update orders set state=3 where matchid = '{0}'" + strwhere, + string upsql = string.Format("insert into ordershis([id] ,[orderid] ,[sku],[matchid],[quantity],[tolocation],[batchid],[orderstate] ,[truequantity] ,[checkquantity] ,[downdate] ,[lighttime] ,[oprationtime] ,[oprationstate] ,[shopid] ,[classes] ,[oprationcode]\r\n ,[boxcode] ,[goodscode] ,[corlorcode] ,[discount] ,[barcode] ,[goodsname] ,[tasktype] ,[prino] ,[wmsboxcode] ,[orderway] ,[wmsorderid] ,[shopname] ,[state] ,[warehouseid] ,[workblock] ,[unit] ,[wholeunit] ) select [id],[orderid],[sku],[matchid],[quantity],[tolocation],[batchid],[orderstate],[truequantity],[checkquantity],[downdate],[lighttime],[oprationtime] ,[oprationstate],[shopid],[classes],[oprationcode],[boxcode],[goodscode],[corlorcode],[discount],[barcode],[goodsname],[tasktype] ,[prino],[wmsboxcode],[orderway],[wmsorderid],[shopname],[state],[warehouseid],[workblock],[unit],[wholeunit] from v_orders where matchid = '{0}'" + strwhere, matchid); - LogHelper.WriteLogInfo("修改波次拣货状态:" + upsql); - long x = db.UpdateSql(upsql); + LogHelper.WriteLogInfo("加入历史:" + upsql); + long x = db.InsertSql(upsql); if (x > 0) + { + string sql = "update ordershis set state=3 where state=0"; + db.UpdateSql(sql); return true; - return false; + } + else { return false; } + } catch (Exception ex) { - LogHelper.WriteLogInfo("修改当前小车拣货状态:" + ex.Message); + LogHelper.WriteLogInfo("加入历史异常:" + ex.Message); return false; } diff --git a/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user b/Epost.TestToolsWeb/Properties/PublishProfiles/Toolsweb.pubxml.user index 9331858..20a3d0f 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-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; + True|2024-12-19T07:11:44.2536385Z;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 - 12/10/2024 19:10:22 + 12/19/2024 15:11:40 - 12/10/2024 19:10:22 + 12/19/2024 15:11:40 02/24/2020 15:29:24 - 12/10/2024 19:09:06 + 12/19/2024 15:11:21 - 12/10/2024 19:09:06 + 12/19/2024 15:11:21 04/29/2020 16:50:14 @@ -63,31 +63,31 @@ 10/23/2017 13:15:20 - 12/10/2024 19:09:10 + 12/19/2024 15:11:22 - 12/10/2024 19:09:10 + 12/19/2024 15:11:22 08/26/2020 18:09:48 - 12/10/2024 19:09:08 + 12/19/2024 15:11:21 - 12/10/2024 19:09:08 + 12/19/2024 15:11:21 - 12/10/2024 19:09:13 + 12/19/2024 15:11:24 - 12/10/2024 19:09:13 + 12/19/2024 15:11:24 - 12/10/2024 19:09:05 + 12/12/2024 18:31:48 - 12/10/2024 19:09:05 + 12/12/2024 18:31:48 09/06/2018 11:57:11 @@ -5652,7 +5652,7 @@ 05/30/2022 16:58:47 - 12/10/2024 19:10:07 + 12/19/2024 15:11:26 04/04/2018 15:45:12 @@ -7572,7 +7572,7 @@ 07/04/2022 14:22:38 - 12/10/2024 19:10:05 + 12/12/2024 18:31:53 \ No newline at end of file