V1-V6 收口移动视口与 PDF 发票上传
这个提交包含在:
@@ -19,11 +19,12 @@ function resolveInvoiceFiles() {
|
||||
const batchFiles = process.env.PLAYWRIGHT_OCR_LIVE_FILES?.split(/[\n,]/).map((item) => item.trim()).filter(Boolean) ?? [];
|
||||
const batchDir = process.env.PLAYWRIGHT_OCR_LIVE_DIR?.trim() ?? "";
|
||||
|
||||
if (directFile) {
|
||||
if (directFile && /\.pdf$/i.test(directFile)) {
|
||||
files.add(path.resolve(directFile));
|
||||
}
|
||||
|
||||
for (const file of batchFiles) {
|
||||
if (!/\.pdf$/i.test(file)) continue;
|
||||
files.add(path.resolve(file));
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ function resolveInvoiceFiles() {
|
||||
for (const entry of readdirSync(batchDir).sort((left, right) => left.localeCompare(right, "zh-CN"))) {
|
||||
const fullPath = path.join(batchDir, entry);
|
||||
if (!statSync(fullPath).isFile()) continue;
|
||||
if (!/\.(pdf|png|jpg|jpeg|webp)$/i.test(entry)) continue;
|
||||
if (!/\.pdf$/i.test(entry)) continue;
|
||||
files.add(path.resolve(fullPath));
|
||||
}
|
||||
}
|
||||
@@ -76,7 +77,7 @@ test("手工 live 腾讯 OCR 批量辅助复核:真实票样逐张上传并输
|
||||
test.skip(process.env.PLAYWRIGHT_OCR_LIVE !== "1", "仅在显式 live OCR 辅助复核模式下执行");
|
||||
|
||||
const invoiceFiles = resolveInvoiceFiles();
|
||||
test.skip(!invoiceFiles.length, "需要提供 PLAYWRIGHT_OCR_LIVE_FILE / PLAYWRIGHT_OCR_LIVE_FILES / PLAYWRIGHT_OCR_LIVE_DIR");
|
||||
test.skip(!invoiceFiles.length, "需要提供 PDF 格式的 PLAYWRIGHT_OCR_LIVE_FILE / PLAYWRIGHT_OCR_LIVE_FILES / PLAYWRIGHT_OCR_LIVE_DIR");
|
||||
|
||||
const results: BatchResult[] = [];
|
||||
const liveOcrUser = resolveLiveOcrUser(EMPLOYEE);
|
||||
|
||||
在新工单中引用
屏蔽一个用户