From 0016ccaa41cf066b4691d6d7e70317a0a9b4180d Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Sat, 10 Oct 2026 10:53:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B1=E7=94=A8=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=8C=89=E5=90=88=E5=90=8C=E4=B8=BB=E4=BD=93=E5=8F=8A=E7=BB=8F?= =?UTF-8?q?=E5=8A=9E=E4=BA=BA=E5=AE=9E=E5=90=8D=E5=8F=91=E8=B5=B7=E7=AD=BE?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/CourierAgreementSignatures.php | 8 +-- .../CourierAgreementSignatureService.php | 20 +++++++- .../agreement-signing.blade.php | 21 +++++--- .../Business/AgreementSigningPageTest.php | 5 +- .../CourierAgreementSignatureWorkflowTest.php | 50 ++++++++++++++++++- 5 files changed, 89 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Business/CourierAgreementSignatures.php b/app/Http/Controllers/Business/CourierAgreementSignatures.php index 8ab884b0..b3ce5381 100644 --- a/app/Http/Controllers/Business/CourierAgreementSignatures.php +++ b/app/Http/Controllers/Business/CourierAgreementSignatures.php @@ -64,7 +64,9 @@ class CourierAgreementSignatures extends Controller } $data = $request->validate($this->rules(), [ - 'operator_name.required_if' => '请填写快递方经办人的 E 签宝实名认证姓名。', + 'operator_name.required_if' => $requestedType === 'shared-contract' + ? '请填写合同主体经办人的 E 签宝实名认证姓名。' + : '请填写快递方经办人的 E 签宝实名认证姓名。', 'secondary_operator_name.required_if' => '请填写我方 E 签宝账号绑定的实名认证姓名。', ]); $type = $data['document_type']; @@ -317,7 +319,7 @@ class CourierAgreementSignatures extends Controller 'signing_deadline' => $date, 'esign_account' => ['required', 'string', 'max:255'], 'secondary_esign_account' => ['required_if:document_type,entity-change,cooperation-contract,authorization', 'nullable', 'string', 'max:255'], - 'operator_name' => ['required_if:document_type,cooperation-contract', 'nullable', 'string', 'min:2', 'max:100'], + 'operator_name' => ['required_if:document_type,cooperation-contract,shared-contract', 'nullable', 'string', 'min:2', 'max:100'], 'secondary_operator_name' => ['required_if:document_type,cooperation-contract', 'nullable', 'string', 'min:2', 'max:100'], 'counterparty_organization_name' => ['required_if:document_type,account-proof,account-change', 'nullable', 'string', 'min:2', 'max:255'], 'counterparty_signer_type' => ['required_if:document_type,account-proof,account-change', 'nullable', 'in:organization,person'], @@ -408,7 +410,7 @@ class CourierAgreementSignatures extends Controller { return match ($data['document_type']) { 'account-proof', 'account-change' => trim((string) $data['counterparty_organization_name']), - 'shared-contract' => trim((string) (($data['shared_courier_names'][0] ?? null) ?: ($data['shared_courier_name'] ?? $data['courier_name']))), + 'shared-contract' => trim((string) $data['contract_partner_name']), 'entity-change' => trim((string) ($data['former_company_name'] ?? $data['courier_name'])), 'authorization' => trim((string) ($data['principal_name'] ?? $data['courier_name'])), default => trim((string) $data['courier_name']), diff --git a/app/Support/CourierAgreementSignatureService.php b/app/Support/CourierAgreementSignatureService.php index f0f6fe46..7084ad2a 100644 --- a/app/Support/CourierAgreementSignatureService.php +++ b/app/Support/CourierAgreementSignatureService.php @@ -92,6 +92,7 @@ final class CourierAgreementSignatureService $flowCreationStarted = false; try { + $signers = $this->signersFor($signature); $client = app(EsignClient::class); $bytes = Storage::disk('uploads')->get($signature->source_pdf_path); $fileName = 'agreement-' . $signature->business_no . '.pdf'; @@ -103,11 +104,13 @@ final class CourierAgreementSignatureService $signer = [ 'flow_title' => $this->safeTitle($signature->company_full_name . ' ' . $signature->documentLabel()), 'organization_name' => $signature->organization_name, - 'operator_name' => $signature->operator_name ?: $signature->courier_name, + 'operator_name' => $signature->document_type === 'shared-contract' + ? $signature->operator_name + : ($signature->operator_name ?: $signature->courier_name), 'operator_account' => $signature->operator_account, 'notice_types' => '1', ]; - $signer['signers'] = $this->signersFor($signature); + $signer['signers'] = $signers; $flowCreationStarted = true; $signFlowId = $client->createSignFlow($fileId, $fileName, $signer, $signature->expires_at->getTimestampMs()); @@ -284,6 +287,19 @@ final class CourierAgreementSignatureService { $payload = $signature->payload ?? []; + if ($signature->document_type === 'shared-contract') { + if (blank($signature->operator_name)) { + throw new RuntimeException('请填写合同主体经办人的 E 签宝实名认证姓名。'); + } + + return [[ + 'signer_type' => 1, + 'organization_name' => $signature->organization_name, + 'operator_name' => $signature->operator_name, + 'operator_account' => $signature->operator_account, + ]]; + } + if (in_array($signature->document_type, ['account-proof', 'account-change'], true)) { $isPerson = ($payload['counterparty_signer_type'] ?? 'organization') === 'person'; diff --git a/resources/views/business/pages/courier-payables/agreement-signing.blade.php b/resources/views/business/pages/courier-payables/agreement-signing.blade.php index 5b7b529e..629229a6 100644 --- a/resources/views/business/pages/courier-payables/agreement-signing.blade.php +++ b/resources/views/business/pages/courier-payables/agreement-signing.blade.php @@ -1509,7 +1509,7 @@
仅用于 E 签宝身份核验,不是收款人姓名;收款人姓名请填写在下方账户资料中。
+仅用于 E 签宝身份核验,不是收款人姓名;收款人姓名请填写在下方账户资料中。
该企业作为本证明的签署主体,名称须与 E 签宝企业认证一致。
填写与快递公司甲共用同一份合同的快递公司,可添加多个。
+填写归属上述合同主体、共用合同和打款资料的快递名称,可添加多个。