kyy
2025-10-15 fb8b33fd8115592efa524b015e0d9889b696c70a
service/Warehouse/MesInvItemInCDetailsManager.cs
@@ -1223,6 +1223,18 @@
                "SELECT 1 FROM MES_INV_ITEM_CGYT_C_DETAILS WHERE ITEM_BARCODE = @barcode",
                sqlParams);
            // 使用参数化查询并忽略大小写(适用于支持的数据库)
            var itemBarcode = Db.Queryable<MesInvItemBarcodes>()
                .Where(it => it.ItemBarcode.Trim().ToLower() == entity.returnBarcode.Trim().ToLower())
                .First() ?? throw new InvalidOperationException($"未找到条码 '{entity.returnBarcode}' 的匹配信息");
            // 判断验退数量是否大于条码的数量(假设条码数量字段为Quantity)
            if (entity.returnQuantity > itemBarcode.Quantity)
            {
                throw new ArgumentException($"验退数量不能大于条码的数量,当前条码数量为: {itemBarcode.Quantity}", nameof(entity.returnQuantity));
            }
            // 将查询到的条码信息赋值给返回模型
            res.itemBarcodeDetails = itemBarcode;
            // 调用存储过程 prc_pda_bar_cf_before
            string strMsg = "";
@@ -1320,13 +1332,7 @@
                }
            }
            // 使用参数化查询并忽略大小写(适用于支持的数据库)
            var itemBarcode = Db.Queryable<MesInvItemBarcodes>()
                .Where(it => it.ItemBarcode.Trim().ToLower() == entity.returnBarcode.Trim().ToLower())
                .First() ?? throw new InvalidOperationException($"未找到条码 '{entity.returnBarcode}' 的匹配信息");
            // 将查询到的条码信息赋值给返回模型
            res.itemBarcodeDetails = itemBarcode;
            // 优化查询(去除空格并忽略大小写)
            var mesInvItemInCDetails = Db.Queryable<MesInvItemInCDetails>()