fix: 修复库存盘点已盘数量卡在500的问题

This commit is contained in:
DXC
2026-04-24 13:19:57 +08:00
parent f0c200a15f
commit 996056d46a
2 changed files with 14 additions and 10 deletions

View File

@ -325,11 +325,21 @@ def get_drafts():
total = len(items)
start = (page - 1) * limit
end = start + limit
# 计算真实的去重"已盘数量"
counted_items_set = set()
for draft_item in items:
if draft_item.get('qty_actual') is not None:
unique_key = f"{draft_item.get('source_table', '')}_{draft_item.get('stock_id', '')}"
counted_items_set.add(unique_key)
total_scanned_unique = len(counted_items_set)
paginated_items = items[start:end]
return jsonify({
'items': paginated_items,
'total': total,
'total_scanned': total_scanned_unique,
'page': page,
'limit': limit
}), 200