111
啊鑫
2025-09-24 4db3ba3f84456c27fdd9be76ff76c17101270914
service/Warehouse/MesItemQtManager.cs
@@ -117,23 +117,33 @@
        if (existingBarcode) throw new Exception("此条码已经扫码出库,勿重复扫描!");
        // 获取条码信息
        var barcode = Db.Queryable<MesInvItemBarcodes>()
            .Where(it => it.ItemBarcode == p_item_barcode)
            .First();
        if (barcode == null)
            throw new Exception($"mes中不存在此条码,请核对!{p_item_barcode}");
        MesInvItemBarcodes barcode;
        try
        {
            barcode = Db.Queryable<MesInvItemBarcodes>()
                .Where(it => it.ItemBarcode == p_item_barcode)
                .First();
        }
        catch
        {
            throw new Exception($"MES中不存在此条码,条码号:{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}");
        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},请检查条码是否未入库或已出库!");
        }
        if (string.IsNullOrEmpty(stock.DepotsCode))