From 69fceac72d0ca0033549d0af0ee725ebb448a37d Mon Sep 17 00:00:00 2001
From: yueyang <2495544247@qq.com>
Date: Mon, 26 Oct 2026 17:26:59 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=B5=81=E7=A8=8B=E6=98=8E=E7=BB=86?=
=?UTF-8?q?=E5=88=86=E9=A1=B5=E5=8F=98=E9=87=8F=E9=81=BF=E5=BC=80=E5=B8=83?=
=?UTF-8?q?=E5=B1=80=E5=86=B2=E7=AA=81=20(#619)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Http/Controllers/ProcessDetails.php | 4 ++--
.../financial-operations/process-details.blade.php | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/EcommerceFinance/Http/Controllers/ProcessDetails.php b/modules/EcommerceFinance/Http/Controllers/ProcessDetails.php
index 73f52b29..887347ba 100644
--- a/modules/EcommerceFinance/Http/Controllers/ProcessDetails.php
+++ b/modules/EcommerceFinance/Http/Controllers/ProcessDetails.php
@@ -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'),
]),
diff --git a/resources/views/business/pages/financial-operations/process-details.blade.php b/resources/views/business/pages/financial-operations/process-details.blade.php
index 072c75b8..93ef75c3 100644
--- a/resources/views/business/pages/financial-operations/process-details.blade.php
+++ b/resources/views/business/pages/financial-operations/process-details.blade.php
@@ -1,5 +1,5 @@
@php
- $rows = $rows ?? null;
+ $processRows = $processRows ?? null;
$filters = $filters ?? [];
$summary = $summary ?? [];
$months = $months ?? [];
@@ -414,9 +414,9 @@
- @forelse ($rows as $row)
+ @forelse ($processRows as $row)
- | {{ ($rows->currentPage() - 1) * $rows->perPage() + $loop->iteration }} |
+ {{ ($processRows->currentPage() - 1) * $processRows->perPage() + $loop->iteration }} |
{{ $row->business_id }} |
{{ $text($row->originator_name) }} |
@@ -447,9 +447,9 @@
From 6c93e4c3c1396380157fe9cd112753c4e4afaaa6 Mon Sep 17 00:00:00 2001
From: qiuxiang <394405259@qq.com>
Date: Mon, 26 Oct 2026 17:34:09 +0800
Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=AE=89=E8=A3=85=E6=98=8E=E7=BB=86?=
=?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=9B=9E=E8=A1=A5=E4=BD=BF=E7=94=A8=E5=8F=97?=
=?UTF-8?q?=E6=8E=A7=E6=89=B9=E5=A4=84=E7=90=86=20(#620)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deploy/run-finance-batch.sh | 2 +-
docs/开发与部署SOP.md | 12 +++++++++
.../Deployment/FinanceBatchIsolationTest.php | 27 +++++++++++++++++++
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/deploy/run-finance-batch.sh b/deploy/run-finance-batch.sh
index eb3c5aa7..cc47643a 100644
--- a/deploy/run-finance-batch.sh
+++ b/deploy/run-finance-batch.sh
@@ -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"
diff --git a/docs/开发与部署SOP.md b/docs/开发与部署SOP.md
index 6011cf04..7c605a45 100644
--- a/docs/开发与部署SOP.md
+++ b/docs/开发与部署SOP.md
@@ -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 --full --batch=500 --max-batches=20
+```
+
+首次全量完成后的定向增量去掉 `--full`,继续保留批次上限:
+
+```bash
+sh /opt/caiwuxitong/run-finance-batch.sh business-mirror:sync-tables --batch=500 --max-batches=20
+```
+
重型发货回填、业绩明细重算、商品成本重算和店铺候选全量核对,统一从生产节点使用受限任务入口:
```bash
diff --git a/tests/Unit/Deployment/FinanceBatchIsolationTest.php b/tests/Unit/Deployment/FinanceBatchIsolationTest.php
index 5cf0e2c3..be669cb8 100644
--- a/tests/Unit/Deployment/FinanceBatchIsolationTest.php
+++ b/tests/Unit/Deployment/FinanceBatchIsolationTest.php
@@ -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);
+ }
+ }
}
|