fix: 修复库存盘点已盘数量卡在500的问题
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user