diff --git a/inventory-backend/app/services/outbound_service.py b/inventory-backend/app/services/outbound_service.py index 23f0fe1..327ae2a 100644 --- a/inventory-backend/app/services/outbound_service.py +++ b/inventory-backend/app/services/outbound_service.py @@ -250,9 +250,9 @@ class OutboundService: ).subquery() # 合并三种来源的匹配单号 - all_matches = db.session.query(buy_match.outbound_no).union( - db.session.query(semi_match.outbound_no), - db.session.query(product_match.outbound_no) + all_matches = db.session.query(buy_match.c.outbound_no).union( + db.session.query(semi_match.c.outbound_no), + db.session.query(product_match.c.outbound_no) ).subquery() # 主搜索条件:单号、领用人、SKU + 物料名称/规格匹配的单号 diff --git a/inventory-backend/app/services/trans_service.py b/inventory-backend/app/services/trans_service.py index 104acc6..af17500 100644 --- a/inventory-backend/app/services/trans_service.py +++ b/inventory-backend/app/services/trans_service.py @@ -242,9 +242,9 @@ class TransService: ).subquery() # 合并三种来源的匹配 ID - all_matches = db.session.query(buy_match.id).union( - db.session.query(semi_match.id), - db.session.query(product_match.id) + all_matches = db.session.query(buy_match.c.id).union( + db.session.query(semi_match.c.id), + db.session.query(product_match.c.id) ).subquery() # 主搜索条件:借用人、SKU、单号 + 物料名称/规格匹配