tjx
2025-10-17 266afcd9d3b53e97b9a81e61efd095bbdbc8de9e
service/Warehouse/MesItemQtManager.cs
@@ -117,33 +117,23 @@
        if (existingBarcode) throw new Exception("此条码已经扫码出库,勿重复扫描!");
        // 获取条码信息
        MesInvItemBarcodes barcode;
        try
        {
            barcode = Db.Queryable<MesInvItemBarcodes>()
                .Where(it => it.ItemBarcode == p_item_barcode)
                .First();
        }
        catch
        {
            throw new Exception($"MES中不存在此条码,条码号:{p_item_barcode},请核对!");
        }
        var barcode = Db.Queryable<MesInvItemBarcodes>()
            .Where(it => it.ItemBarcode == p_item_barcode)
            .First();
        if (barcode == null)
            throw new Exception($"mes中不存在此条码,请核对!{p_item_barcode}");
        // 获取库存信息
        MesInvItemStocks stock;
        try
        {
            stock = Db.Queryable<MesInvItemStocks>()
                .Where(it => it.ItemBarcode == p_item_barcode && it.Quantity > 0)
                .First();
        }
        catch
        {
            throw new Exception($"库存中无此条码,条码号:{p_item_barcode},请检查条码是否未入库或已出库!");
        }
        var stock = Db.Queryable<MesInvItemStocks>()
            .Where(it => it.ItemBarcode == p_item_barcode && it.Quantity > 0)
            .First();
        if (stock == null)
            throw new Exception($"库存中无此条码,请检查条码是否未入库或已出库!{p_item_barcode}");
        if (string.IsNullOrEmpty(stock.DepotsCode))