Files
ai_site/ai-service/make_sample_excel.py
2026-07-31 10:19:22 +08:00

15 lines
607 B
Python

"""生成测试用库存 Excel"""
from openpyxl import Workbook
from pathlib import Path
wb = Workbook()
ws = wb.active
ws.title = "库存"
ws.append(["SKU", "商品名称", "仓库", "数量", "单价", "状态", "更新时间"])
ws.append(["A-1001", "无线鼠标", "华东仓", 120, 59.9, "在售", "2026-07-01 10:00:00"])
ws.append(["A-1002", "机械键盘", "华南仓", 35, 299.0, "在售", "2026-07-02 11:00:00"])
ws.append(["B-2001", "显示器支架", "华北仓", 8, 129.0, "停售", "2026-07-03 12:00:00"])
out = Path(__file__).resolve().parent / "sample_inventory.xlsx"
wb.save(out)
print(out)