From dc1e5cd2c50bdcd712b5f95b2170bf7d421db4f0 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 30 四月 2025 13:19:09 +0800 Subject: [PATCH] 来料打印更新 --- Tiger.Business.WMS/Transaction/ReprintLabel.cs | 88 ++++++++++++++++++++++---------------------- 1 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Tiger.Business.WMS/Transaction/ReprintLabel.cs b/Tiger.Business.WMS/Transaction/ReprintLabel.cs index d87b28a..143253e 100644 --- a/Tiger.Business.WMS/Transaction/ReprintLabel.cs +++ b/Tiger.Business.WMS/Transaction/ReprintLabel.cs @@ -150,11 +150,11 @@ } else { - if (Biz.Db.Queryable<WMS_ITEM>().Any(q=>q.SUPP_LOTNO == rePrints.BatchNo) && (Biz.Db.Queryable<WMS_ITEM>().Where(q=>q.SUPP_LOTNO == rePrints.BatchNo).Sum(x=>x.QTY)>= rePrints.BatchQty)) { - action.IsSuccessed = false; - action.LocaleMsg = Biz.L($"姝ゅ簱浣峓{LocationCode}]涓婄殑鎵规[{rePrints.BatchNo}]鏁伴噺宸茬粡澶熸暟锛屼笉鑳藉啀涓婃灦鐢熸垚鏍囩"); - return action; - } + //if (Biz.Db.Queryable<WMS_ITEM>().Any(q=>q.SUPP_LOTNO == rePrints.BatchNo) && (Biz.Db.Queryable<WMS_ITEM>().Where(q=>q.SUPP_LOTNO == rePrints.BatchNo && q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()).Sum(x=>x.QTY)>= rePrints.BatchQty)) { + // action.IsSuccessed = false; + // action.LocaleMsg = Biz.L($"姝ゅ簱浣峓{LocationCode}]涓婄殑鎵规[{rePrints.BatchNo}]鏁伴噺宸茬粡澶熸暟锛屼笉鑳藉啀涓婃灦鐢熸垚鏍囩"); + // return action; + //} foreach (var ent in rePrints.SnList) { string CurSN = DI.Resolve<ICodeRuleCache>()["InitialBarcode"]?.Generate($"{ent.SN}").Data.ToString() ?? ""; @@ -199,7 +199,7 @@ ITEM_CODE = inv.Barcode.ItemCode, AUTH_ORG = input.AuthOption.CurOrg, STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(), - QTY = inv.Barcode.Qty.ToDecimal(), + QTY = inv.Barcode.Qty.ToDouble(), PROD_DATE = inv.Barcode.DateCode.ToDateTime(), ERP_WH = CurScanShelf.WarehouseCode, UNIT = inv.Barcode.Unit, @@ -212,7 +212,7 @@ SN = inv.Barcode.SN, AUTH_ORG = input.AuthOption.CurOrg, ITEM_CODE = inv.Barcode.ItemCode, - QTY = inv.Barcode.Qty.ToDecimal(), + QTY = inv.Barcode.Qty.ToDouble(), ERP_WH = CurScanShelf.WarehouseCode, UNIT = inv.Barcode.Unit, }; @@ -235,11 +235,11 @@ } else if (inv.Items.Count == 1) { - inv.Items.First().QTY = inv.Barcode.Qty.ToDecimal(); + inv.Items.First().QTY = inv.Barcode.Qty.ToDouble(); inv.Items.First().ERP_WH = CurScanShelf.WarehouseCode; inv.Items.First().AUTH_ORG = input.AuthOption.CurOrg; - inv.Packages.First().QTY = inv.Barcode.Qty.ToDecimal(); + inv.Packages.First().QTY = inv.Barcode.Qty.ToDouble(); inv.Packages.First().ERP_WH = CurScanShelf.WarehouseCode; inv.Packages.First().AUTH_ORG = input.AuthOption.CurOrg; } @@ -289,43 +289,43 @@ //} //鎵ц涓婃灦 - foreach (var item in inv.Items) - { - item.TRANS_CODE = "ReprintLabel"; - item.TRANS_NO = $"ReprintLabel{DateTime.Now:yyyyMMdd}"; - } - Result<PutOnInfo> putonResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); - if (!putonResult.IsSuccessed) - { - action.IsSuccessed = false; - action.LocaleMsg = putonResult.LocaleMsg; - inv = null; - CurSN = ""; - return action; - } - PutOnInfo putOnInfo = putonResult.Data; - items.AddRange(putOnInfo.Items); - itemhiss.AddRange(putOnInfo.History); - itemPkgs.AddRange(putOnInfo.Packages); - itemExts.AddRange(putOnInfo.ItemsExt); + //foreach (var item in inv.Items) + //{ + // item.TRANS_CODE = "ReprintLabel"; + // item.TRANS_NO = $"ReprintLabel{DateTime.Now:yyyyMMdd}"; + //} + //Result<PutOnInfo> putonResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); + //if (!putonResult.IsSuccessed) + //{ + // action.IsSuccessed = false; + // action.LocaleMsg = putonResult.LocaleMsg; + // inv = null; + // CurSN = ""; + // return action; + //} + //PutOnInfo putOnInfo = putonResult.Data; + //items.AddRange(putOnInfo.Items); + //itemhiss.AddRange(putOnInfo.History); + //itemPkgs.AddRange(putOnInfo.Packages); + //itemExts.AddRange(putOnInfo.ItemsExt); } //淇濆瓨鍒版暟鎹簱 - var db = Business.Biz.Db; - var dbTran = db.UseTran(() => - { - //鍏ュ簱 - db.Storageable(items, UserCode).ExecuteCommand(); - db.Storageable(itemPkgs, UserCode).ExecuteCommand(); - db.Insertable(itemhiss, UserCode).ExecuteCommand(); - var x = db.Storageable(itemExts, UserCode).ToStorage(); - x.AsInsertable.ExecuteCommand();//涓嶅瓨鍦ㄦ彃鍏� - x.AsUpdateable.ExecuteCommand();//瀛樺湪鏇存柊 - }); - if (!dbTran.IsSuccess) - { - Logger.Default.Fatal(dbTran.ErrorException, "Database transaction save exception"); - throw dbTran.ErrorException; - } + //var db = Business.Biz.Db; + //var dbTran = db.UseTran(() => + //{ + // //鍏ュ簱 + // db.Storageable(items, UserCode).ExecuteCommand(); + // db.Storageable(itemPkgs, UserCode).ExecuteCommand(); + // db.Insertable(itemhiss, UserCode).ExecuteCommand(); + // var x = db.Storageable(itemExts, UserCode).ToStorage(); + // x.AsInsertable.ExecuteCommand();//涓嶅瓨鍦ㄦ彃鍏� + // x.AsUpdateable.ExecuteCommand();//瀛樺湪鏇存柊 + //}); + //if (!dbTran.IsSuccess) + //{ + // Logger.Default.Fatal(dbTran.ErrorException, "Database transaction save exception"); + // throw dbTran.ErrorException; + //} action.Data.Data = rePrints; action.LocaleMsg = Biz.L("搴撲綅鎵规鏉$爜涓婃灦鎴愬姛"); -- Gitblit v1.9.3