应付款终版导入:支持 20 万行(流式读取 + 分片导入 + 进度显示) #361
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/sumu-import-20w-rows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
20 万行同步导入必然超时/爆内存:整表解析一次 25-30 秒、峰值 430MB,分块读完整表要 9 分钟。
改动
PayablesWorkbookStreamReader:xlsx 用 ZipArchive + XMLReader 逐行解析、共享字符串紧凑存放(几十兆级);支持日期样式单元格、GBK CSV、分隔符识别;xls 回退 PhpSpreadsheet。PayablesFinalImportRunner:上传时把工作簿转成行缓存(jsonl.gz),前端按片调用;每片 2 万行/25 秒预算;落库改为批量 upsert + 批量审计事件;上限 20 万行;完成后自动清理。import-upload/import-chunk(仅终版按表路由);导入弹窗改 AJAX 分片流程,带进度条与新增/更新计数,完成自动刷新。验证
PayablesFinalImportRunnerTest5 个用例(xlsx 流式读取+日期、GBK CSV、分片续跑与清理、上传/分片接口、页面接线)。