Merge remote-tracking branch 'origin/main' into feature/yueyang-systemization-todo-structured-editing

This commit is contained in:
yueyang 2026-10-26 17:35:32 +08:00
commit 9df2fe3fd7
5 changed files with 47 additions and 8 deletions

View File

@ -8,7 +8,7 @@ CAIWU_BATCH_CALLER_DIR="$PWD"
export CAIWU_BATCH_CALLER_DIR
case "${1:-}" in
*:import|*:import-*|*:import:*|product:monthly-weighted-average:base) is_import=1 ;;
jushuitan:sync-shipping|store-receipt:order-match:sync|store-receipt:product-cost:sync|store-receipt:auto-resync|order-data:warm-shop-candidates|business-mirror:index-work-order-waybills|business-mirror:refresh-paid-sales|account-bills:exports:run|finance-ledger:recalculate|product:monthly-weighted-average:auto|product:monthly-weighted-average:compute|product:monthly-weighted-average:report|finance:monthly-weighted-product-cost:auto) ;;
jushuitan:sync-shipping|store-receipt:order-match:sync|store-receipt:product-cost:sync|store-receipt:auto-resync|order-data:warm-shop-candidates|business-mirror:sync-tables|business-mirror:index-work-order-waybills|business-mirror:refresh-paid-sales|account-bills:exports:run|finance-ledger:recalculate|product:monthly-weighted-average:auto|product:monthly-weighted-average:compute|product:monthly-weighted-average:report|finance:monthly-weighted-product-cost:auto) ;;
*) echo 'Unsupported finance batch command' >&2; exit 64 ;;
esac
cd "$REMOTE_DIR"

View File

@ -288,6 +288,18 @@ php artisan business-mirror:sync-tables
首次全量、历史回补和镜像校准由任务 Codex 自主执行:先备份受影响的系统配置、镜像表及同步状态,再在生产同步节点内使用现有上游互斥锁,按稳定游标分批执行或续传 `--full`,直至完成并核对源表/镜像和实际页面。无需负责人另行授权或代跑命令;开发机驱动不支持时直接通过 SSH 使用生产容器,不以本机不能同步为由停止任务。后续无参数命令只执行或继续受控增量,不对无关数据集批量全量。
生产同步节点对单个数据集执行历史回补时,也通过受限批入口分批续传,避免网页容器承担重型任务。每轮使用有限批次,返回“同步进行中”后以相同命令继续,直到显示“同步完成”:
```bash
sh /opt/caiwuxitong/run-finance-batch.sh business-mirror:sync-tables <dataset-key> --full --batch=500 --max-batches=20
```
首次全量完成后的定向增量去掉 `--full`,继续保留批次上限:
```bash
sh /opt/caiwuxitong/run-finance-batch.sh business-mirror:sync-tables <dataset-key> --batch=500 --max-batches=20
```
重型发货回填、业绩明细重算、商品成本重算和店铺候选全量核对,统一从生产节点使用受限任务入口:
```bash

View File

@ -30,7 +30,7 @@ class ProcessDetails extends Controller
return view('business.pages.financial-operations.process-details', [
'section' => ['slug' => 'financial-operations', 'title' => '财务经营报表'],
'page' => ['slug' => 'process-details', 'title' => '流程明细'],
'rows' => new LengthAwarePaginator(
'processRows' => new LengthAwarePaginator(
$result['data'],
$result['total'],
$perPage,
@ -53,7 +53,7 @@ class ProcessDetails extends Controller
return view('business.pages.financial-operations.process-details', [
'section' => ['slug' => 'financial-operations', 'title' => '财务经营报表'],
'page' => ['slug' => 'process-details', 'title' => '流程明细'],
'rows' => new LengthAwarePaginator([], 0, $perPage, $page, [
'processRows' => new LengthAwarePaginator([], 0, $perPage, $page, [
'path' => $request->url(),
'query' => $request->except('page'),
]),

View File

@ -1,5 +1,5 @@
@php
$rows = $rows ?? null;
$processRows = $processRows ?? null;
$filters = $filters ?? [];
$summary = $summary ?? [];
$months = $months ?? [];
@ -414,9 +414,9 @@
</tr>
</thead>
<tbody>
@forelse ($rows as $row)
@forelse ($processRows as $row)
<tr>
<td class="num">{{ ($rows->currentPage() - 1) * $rows->perPage() + $loop->iteration }}</td>
<td class="num">{{ ($processRows->currentPage() - 1) * $processRows->perPage() + $loop->iteration }}</td>
<td>{{ $row->business_id }}</td>
<td>{{ $text($row->originator_name) }}</td>
<td class="center">
@ -447,9 +447,9 @@
<div class="process-details-footer">
<span>
第 {{ $rows->currentPage() }} / {{ max($rows->lastPage(), 1) }} 页,共 {{ number_format($rows->total()) }} 行
第 {{ $processRows->currentPage() }} / {{ max($processRows->lastPage(), 1) }} 页,共 {{ number_format($processRows->total()) }} 行
</span>
<div>{{ $rows->links() }}</div>
<div>{{ $processRows->links() }}</div>
</div>
</div>
</x-slot>

View File

@ -93,4 +93,31 @@ class FinanceBatchIsolationTest extends TestCase
rmdir($directory);
}
}
public function test_business_mirror_history_backfill_runs_in_the_isolated_batch_profile(): void
{
$directory = sys_get_temp_dir() . '/caiwu-mirror-batch-' . bin2hex(random_bytes(6));
mkdir($directory);
$arguments = [
'business-mirror:sync-tables',
'jiansun.dbo.fys_Ticketing_install_item',
'--full',
'--batch=500',
'--max-batches=20',
];
try {
$process = $this->runBatch($directory, $arguments);
$this->assertTrue($process->isSuccessful(), $process->getErrorOutput());
$called = file($directory . '/called', FILE_IGNORE_NEW_LINES);
$this->assertContains('batch', $called);
$this->assertContains('--no-deps', $called);
$this->assertSame('image=123456789abc', $called[0]);
$this->assertSame($arguments, array_slice($called, -count($arguments)));
} finally {
foreach (glob($directory . '/*') as $path) {
unlink($path);
}
rmdir($directory);
}
}
}