From 86722aca20973a1e73d0a446c124eb6a5790496b Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 17 十二月 2024 09:34:17 +0800 Subject: [PATCH] 任务优化,工单状态修改优化 --- Tiger.Business.WMS/Transaction/OutWorkOrder.cs | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Tiger.Business.WMS/Transaction/OutWorkOrder.cs b/Tiger.Business.WMS/Transaction/OutWorkOrder.cs index ac6ab1b..f0b24b6 100644 --- a/Tiger.Business.WMS/Transaction/OutWorkOrder.cs +++ b/Tiger.Business.WMS/Transaction/OutWorkOrder.cs @@ -240,7 +240,7 @@ { if (!input.Code.IsNullOrEmpty()) { - Biz.Db.Deleteable<WMS_ITEM_POOL>().Where(q => CurPoolList.Select(q => q.SN).Contains(q.SN)).ExecuteCommand(); + Biz.Db.Deleteable<WMS_ITEM_POOL>().Where(q => q.TRANS_CODE == req.BILLCODE).ExecuteCommand(); //濡傛灉涓婁竴娆℃帹鑽愭湁鏁版嵁锛屽垯鍏堢伃鎺変寒鐨勭伅 if (Suggests.Any()) { @@ -297,16 +297,7 @@ Suggests.RemoveAll(q => q.poolItem.IsNullOrEmpty()); //淇濆瓨鐗╂枡姹犲埌鏁版嵁搴� - var db = Biz.Db; - var dbTran = db.UseTran(() => - { - db.Deleteable<WMS_ITEM_POOL>().Where(q => q.TRANS_CODE == req.BILLCODE).ExecuteCommand(); - db.Insertable(CurPoolList).ExecuteCommand(); - }); - if (!dbTran.IsSuccess) - { - throw dbTran.ErrorException; - } + Biz.Db.Insertable(CurPoolList).ExecuteCommand(); action = await LightAll(new() { AuthOption = input.AuthOption, ReqType = ReqType.IsWhole, Color = LedColor.Blue,ItemCode = input.Code }); } } @@ -429,7 +420,7 @@ //} var MaxDC = CurPoolList.Any(x => x.ITEM_CODE == CurInv.ItemInfo.ITEM_CODE) ? CurPoolList.Where(x => x.ITEM_CODE == CurInv.ItemInfo.ITEM_CODE).Max(t => t.PROD_DATE) : DateTime.MinValue; //鍒ゆ柇绯荤粺鍙傛暟鏄惁璁剧疆鍏堣繘鍏堝嚭 - if (Biz.SysParam["YesOrNo"].PARAM_VALUE == "Y") + if (Cache.SysParam["YesOrNo"].PARAM_VALUE == "Y") { if (CurInv.Items.Max(x => x.PROD_DATE).Date > MaxDC.Date) { @@ -784,10 +775,10 @@ } //鍙戦�佸埌MES - var isSend = Biz.SysParam["IsSend", "SendToMES"].PARAM_VALUE.ToString() == "Y"; + var isSend = Cache.SysParam["IsSend", "SendToMES"].PARAM_VALUE.ToString() == "Y"; if (isSend && !isCutting) { - var mesApi = _factory != null ? _factory.MES_API : Biz.SysParam["apiUrl", "SendToMES"].PARAM_VALUE.ToString(); + var mesApi = _factory != null ? _factory.MES_API : Cache.SysParam["apiUrl", "SendToMES"].PARAM_VALUE.ToString(); var response = HttpHelper.PostAsync(mesApi, JsonConvert.SerializeObject(toMes)).Result; var _action = JsonConvert.DeserializeObject<ApiAction>(response.Message); Logger.Interface.Info($"宸ュ崟棰嗘枡 =>鍙戞枡瀹屾垚锛屽崟鍙穂{req.BILLCODE}]锛屾潯鐮乕{CurInv.SN}]锛岀姸鎬乕{req.STATUS.GetEnumDesc<BIZ_ERP_PROD_OUT.STATUSs>()}]锛孧ES杩斿洖锛歿response.Message}"); -- Gitblit v1.9.3