From 264a69dbdcd95421a1dd614aa2b92ce61ce77b16 Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Mon, 26 Oct 2026 20:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=A1=E6=AD=A3=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E4=BB=98=E6=AC=BE=E6=A0=A1=E9=AA=8C=E5=8F=A3?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/upstream_mirrors.php | 3 ++- .../DingProcessDetailMirrorSynchronizer.php | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/config/upstream_mirrors.php b/config/upstream_mirrors.php index 6cf2c275..162f5d10 100644 --- a/config/upstream_mirrors.php +++ b/config/upstream_mirrors.php @@ -103,8 +103,9 @@ return [ 'PROC-5AB333E3-4496-4DF3-A5C1-1FBFAB7C72C8' => [ 'document_type' => '板材流程', 'detail_table' => '收款费用明细', - 'detail_amount_fields' => ['实际需支付金额', '订单金额'], + 'detail_amount_fields' => ['订单金额'], 'amount_total_fields' => ['请款金额'], + 'payment_table' => '付款明细', ], 'PROC-657E5EEA-DEAA-4DC5-AD8B-A679FE9AD361' => [ 'document_type' => '板材流程', diff --git a/modules/EcommerceFinance/Services/DingProcessDetailMirrorSynchronizer.php b/modules/EcommerceFinance/Services/DingProcessDetailMirrorSynchronizer.php index 71219563..73dbb028 100644 --- a/modules/EcommerceFinance/Services/DingProcessDetailMirrorSynchronizer.php +++ b/modules/EcommerceFinance/Services/DingProcessDetailMirrorSynchronizer.php @@ -658,14 +658,29 @@ class DingProcessDetailMirrorSynchronizer ? $this->tableRows($fields[$paymentTable] ?? null, $workflow, $paymentTable, $issues) : []; $payments = []; + $declaredCents = $this->firstFieldMoneyCents( + $fields, + (array) ($process['payment_total_fields'] ?? []), + ); foreach ($rows as $row) { $amountCents = $this->moneyFromRow($row, ['付款金额', '付款总金额']); if ($amountCents === null) { + if (trim((string) ($row['对应序号'] ?? '')) === '' + && trim((string) ($row['科目编码'] ?? '')) === '' + && trim((string) ($row['科目名称'] ?? '')) === '') { + continue; + } $issues[] = (string) ($workflow['businessId'] ?? '') . ' 的付款明细存在空金额'; continue; } + $accountCode = trim((string) ($row['科目编码'] ?? '')); + if ($accountCode !== '' + && ! preg_match('/^1(?:001|002|012)(?:\.|$)/', $accountCode)) { + continue; + } + $payments[] = [ 'business_id' => mb_substr(trim((string) ($workflow['businessId'] ?? '')), 0, 32), 'process_instance_id' => mb_substr( @@ -677,7 +692,7 @@ class DingProcessDetailMirrorSynchronizer 'sequence_spec' => mb_substr(trim((string) ($row['对应序号'] ?? '')), 0, 255), 'amount' => $this->moneyString($amountCents), 'amount_cents' => $amountCents, - 'account_code' => mb_substr(trim((string) ($row['科目编码'] ?? '')), 0, 64), + 'account_code' => mb_substr($accountCode, 0, 64), 'account_name' => mb_substr(trim((string) ($row['科目名称'] ?? '')), 0, 255), 'payment_method' => mb_substr(trim((string) ($row['付款方式'] ?? '')), 0, 50), 'paid_at' => mb_substr(trim((string) ($row['打款时间'] ?? '')), 0, 50), @@ -688,10 +703,6 @@ class DingProcessDetailMirrorSynchronizer ]; } - $declaredCents = $this->firstFieldMoneyCents( - $fields, - (array) ($process['payment_total_fields'] ?? []), - ); $detailPaymentCents = array_sum(array_column($payments, 'amount_cents')); if ($declaredCents !== null) { -- 2.47.2