From a204df28fd20b4908bba80deb482f9c91ecc0877 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期三, 08 一月 2025 16:22:23 +0800 Subject: [PATCH] 11 --- service/Warehouse/InventoryManager.cs | 35 ++++++++++++----------------------- 1 files changed, 12 insertions(+), 23 deletions(-) diff --git a/service/Warehouse/InventoryManager.cs b/service/Warehouse/InventoryManager.cs index 4107f50..a5fc989 100644 --- a/service/Warehouse/InventoryManager.cs +++ b/service/Warehouse/InventoryManager.cs @@ -16,9 +16,7 @@ // 妫�鏌ュ簱浣嶄唬鐮佹槸鍚︿负绌� if (string.IsNullOrEmpty(p_section_code)) - { throw new Exception("002[璇锋壂搴撲綅鏉$爜锛�"); - } // 鏌ヨ搴撳尯搴撲綅淇℃伅 var depotSection = Db.Queryable<MesDepotSections, MesDepots>((a, b) => @@ -32,9 +30,7 @@ // 濡傛灉搴撲綅浠g爜涓嶅瓨鍦紝鍒欒繑鍥為敊璇俊鎭� if (depotSection == null) - { throw new Exception("搴撲綅缂栫爜 " + p_section_code + " 涓嶅瓨鍦紝璇风‘璁わ紒"); - } // 杩斿洖鎴愬姛淇℃伅 return "浠撳簱锛�" + depotSection.DepotName + " 搴撲綅锛�" + @@ -52,9 +48,7 @@ // 妫�鏌ュ簱浣嶄唬鐮佹槸鍚︿负绌� if (string.IsNullOrEmpty(p_section_code)) - { throw new Exception("002[璇锋壂搴撲綅鏉$爜锛�"); - } // 鏌ヨ搴撳尯搴撲綅淇℃伅 var depotSection = Db.Queryable<MesDepotSections, MesDepots>((a, b) => @@ -68,9 +62,7 @@ // 濡傛灉搴撲綅浠g爜涓嶅瓨鍦紝鍒欒繑鍥為敊璇俊鎭� if (depotSection == null) - { throw new Exception("搴撲綅缂栫爜 " + p_section_code + " 涓嶅瓨鍦紝璇风‘璁わ紒"); - } // 妫�鏌ユ槸鍚﹀凡缁忔敹璐� var c_num = Db.Queryable<MesInvItemIns, MesInvItemInCDetails>((a, b) => @@ -80,20 +72,14 @@ .Where((a, b) => b.ItemBarcode == p_item_barcode) .Count(); - if (c_num > 0) - { - throw new Exception("002[鏉$爜閲嶅鎵弿锛岃鏍稿锛�"); - } + if (c_num > 0) throw new Exception("002[鏉$爜閲嶅鎵弿锛岃鏍稿锛�"); // 鏌ヨ鏉$爜淇℃伅 c_num = Db.Queryable<MesInvItemStocks>() .Where(t => t.ItemBarcode == p_item_barcode) .Count(); - if (c_num > 0) - { - throw new Exception("002[鏉$爜宸插湪搴撳瓨涓紝璇锋牳瀵癸紒"); - } + if (c_num > 0) throw new Exception("002[鏉$爜宸插湪搴撳瓨涓紝璇锋牳瀵癸紒"); // 鏌ヨ鏉$爜璇︾粏淇℃伅 var c_mes_inv_item_barcodes = Db.Queryable<MesInvItemBarcodes>() @@ -101,14 +87,10 @@ .Single(); if (c_mes_inv_item_barcodes == null) - { throw new Exception("002[鏉$爜涓嶅瓨鍦紝璇锋牳瀵癸紒"); - } if (c_mes_inv_item_barcodes.ComeFlg != 0) - { throw new Exception("002[鏉$爜涓嶆槸鏈熷垵鏉$爜锛屾棤娉曠敤鏈熷垵鍏ュ簱锛�"); - } UseTransaction(db => { @@ -144,7 +126,12 @@ BillNo = billNo, SuppId = c_mes_inv_item_barcodes.SuppId, SuppNo = c_mes_inv_item_barcodes.SuppNo, - UrgentFlag = c_mes_inv_item_barcodes.UrgentFlag == null ? null : c_mes_inv_item_barcodes.UrgentFlag.Value ? "1" : "0", + UrgentFlag = c_mes_inv_item_barcodes.UrgentFlag == null + ? + null + : c_mes_inv_item_barcodes.UrgentFlag.Value + ? "1" + : "0", CbillNo = c_mes_inv_item_barcodes.BillNo, Fstatus = 0 }; @@ -226,7 +213,9 @@ ItemNo = c_mes_inv_item_barcodes.ItemNo, LotNo = c_mes_inv_item_barcodes.LotNo, Quantity = c_mes_inv_item_barcodes.Quantity, - EpFlag = c_mes_inv_item_barcodes.EpFlag == null ? null : (byte)(c_mes_inv_item_barcodes.EpFlag.Value ? 1 : 0), + EpFlag = c_mes_inv_item_barcodes.EpFlag == null + ? null + : (byte)(c_mes_inv_item_barcodes.EpFlag.Value ? 1 : 0), DepotsCode = depotSection.DepotCode, DepotsId = depotSection.DepotId, DepotSectionsCode = p_section_code, @@ -245,7 +234,7 @@ }); var mesItems = Db.Queryable<MesItems>() - .Where(s=>s.Id == c_mes_inv_item_barcodes.ItemId) + .Where(s => s.Id == c_mes_inv_item_barcodes.ItemId) .First(); query.itemNo = mesItems.ItemNo; -- Gitblit v1.9.3