From 820de98c292d31a600cdbe52c6dd5d21242333fc Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Tue, 24 Nov 2026 18:15:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=88=E4=BD=9C=E5=90=88=E5=90=8C?= =?UTF-8?q?=E4=BB=85=E7=94=B1=E5=90=88=E4=BD=9C=E6=96=B9=E7=AD=BE=E7=BD=B2?= =?UTF-8?q?=E5=B9=B6=E5=9C=A8=E5=BD=92=E6=A1=A3=E7=8A=B6=E6=80=81=E6=97=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=A0=E9=99=A4=20(#1377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/CourierAgreementSignatures.php | 16 +----- .../CourierAgreementSignatureService.php | 20 +++----- docs/esign-agreement-integration.md | 1 + .../agreement-signing.blade.php | 50 +++++++++--------- .../Business/AgreementSigningPageTest.php | 4 +- .../CourierAgreementSignatureWorkflowTest.php | 51 +++++++++---------- .../CourierAgreementTaskDeletionTest.php | 7 ++- 7 files changed, 67 insertions(+), 82 deletions(-) diff --git a/app/Http/Controllers/Business/CourierAgreementSignatures.php b/app/Http/Controllers/Business/CourierAgreementSignatures.php index 2f307311..f5662aa0 100644 --- a/app/Http/Controllers/Business/CourierAgreementSignatures.php +++ b/app/Http/Controllers/Business/CourierAgreementSignatures.php @@ -27,8 +27,6 @@ use Symfony\Component\HttpFoundation\StreamedResponse; class CourierAgreementSignatures extends Controller { - private const COOPERATION_SECONDARY_ESIGN_ACCOUNT = '18052733960'; - public function __construct( private readonly CourierAgreementSignatureService $service, private readonly CourierQuoteSignatureService $quoteSignatureService, @@ -66,13 +64,6 @@ class CourierAgreementSignatures extends Controller abort_unless(Schema::hasTable('business_courier_agreement_signatures'), 503, '协议签署数据表尚未完成迁移,请先执行数据库迁移。'); } - if ($request->input('document_type') === 'cooperation-contract' && $request->input('partner_type') === 'courier') { - // 合作合同统一由我方固定 E 签宝账号完成第二签署方签署。 - $request->merge([ - 'secondary_esign_account' => self::COOPERATION_SECONDARY_ESIGN_ACCOUNT, - ]); - } - if (in_array($requestedType, ['account-proof', 'account-change', 'entity-change', 'cooperation-contract', 'authorization', 'shared-contract', 'quote-confirmation'], true) && ! $request->filled('counterparty_signer_type')) { // Existing integrations omit this field and historically meant an @@ -158,14 +149,11 @@ class CourierAgreementSignatures extends Controller $party = $data['partner_type'] === 'supplier' ? '供应商' : '快递方'; throw ValidationException::withMessages(['operator_name' => "请填写{$party}企业经办人的 E 签宝实名认证姓名。"]); } - if (blank($data['secondary_operator_name'] ?? null)) { - throw ValidationException::withMessages(['secondary_operator_name' => '请填写我方 E 签宝账号绑定的实名认证姓名。']); - } $companyNames = [trim($data['cooperation_party_a_name'])]; if ($data['counterparty_signer_type'] === 'organization') { $companyNames[] = trim($data['cooperation_party_b_name']); } - foreach (['operator_name' => $data['partner_type'] === 'supplier' ? '供应商' : '快递方', 'secondary_operator_name' => '我方'] as $field => $party) { + foreach (['operator_name' => $data['partner_type'] === 'supplier' ? '供应商' : '快递方'] as $field => $party) { $data[$field] = trim($data[$field]); if (in_array($data[$field], $companyNames, true)) { throw ValidationException::withMessages([ @@ -495,7 +483,7 @@ class CourierAgreementSignatures extends Controller 'signature_date' => ['required', 'date'], 'signing_deadline' => $date, 'esign_account' => ['required', 'string', 'max:255'], - 'secondary_esign_account' => ['required_if:document_type,cooperation-contract,authorization', 'nullable', 'string', 'max:255'], + 'secondary_esign_account' => [Rule::excludeIf(request('document_type') === 'cooperation-contract'), 'required_if:document_type,authorization', 'nullable', 'string', 'max:255'], 'secondary_operator_name' => ['nullable', 'string', 'min:2', 'max:100'], 'operator_name' => ['nullable', 'string', 'min:2', 'max:100'], 'counterparty_organization_name' => ['required_if:document_type,account-proof,account-change,quote-confirmation', 'nullable', 'string', 'min:2', 'max:255'], diff --git a/app/Support/CourierAgreementSignatureService.php b/app/Support/CourierAgreementSignatureService.php index 6e96002b..352111ac 100644 --- a/app/Support/CourierAgreementSignatureService.php +++ b/app/Support/CourierAgreementSignatureService.php @@ -396,20 +396,12 @@ final class CourierAgreementSignatureService if ($signature->document_type === 'cooperation-contract') { $counterpartyIsPerson = ($payload['counterparty_signer_type'] ?? 'organization') === 'person'; - return [ - [ - 'signer_type' => 1, - 'organization_name' => $payload['cooperation_party_a_name'] ?? $signature->company_full_name, - 'operator_name' => $payload['secondary_operator_name'], - 'operator_account' => $payload['secondary_esign_account'] ?? $signature->operator_account, - ], - [ - 'signer_type' => $counterpartyIsPerson ? 0 : 1, - 'organization_name' => $counterpartyIsPerson ? null : ($payload['cooperation_party_b_name'] ?? $signature->courier_name), - 'operator_name' => $signature->operator_name, - 'operator_account' => $signature->operator_account, - ], - ]; + return [[ + 'signer_type' => $counterpartyIsPerson ? 0 : 1, + 'organization_name' => $counterpartyIsPerson ? null : ($payload['cooperation_party_b_name'] ?? $signature->courier_name), + 'operator_name' => $signature->operator_name, + 'operator_account' => $signature->operator_account, + ]]; } if ($signature->document_type === 'entity-change') { diff --git a/docs/esign-agreement-integration.md b/docs/esign-agreement-integration.md index 261ba501..4d9bc8af 100644 --- a/docs/esign-agreement-integration.md +++ b/docs/esign-agreement-integration.md @@ -8,6 +8,7 @@ - 回调复用现有 E签宝验签入口,校验原始 Body、时间戳、AppId 和 HmacSHA256;协议回调按流程 ID 幂等更新并排队归档。 - 收款账户证明及账户变更中的开户名称按实际银行卡持卡人姓名填写,不要求与营业执照或公司全称一致;签署主体和公司全称仍单独维护。 - 签署完成后只归档文件,不自动启用收款账户;账户、生效日期和收款人仍须财务复核。 +- 合作合同(快递与供应商)由甲方发起,仅合作方(乙方)签署,甲方不加入签署方列表,也不需要填写甲方的签署账号和实名姓名。主体变更及授权委托书仍按原规则由双方签署。已建立的 E 签宝流程保留原签署方,需采用新流程时另行处理原任务并重新发起。 - 证件补充默认关闭,仅适用于授权委托书与公司主体变更。收款账户变更没有证件上传入口。 - 授权委托书按需发送三份独立 PDF:主文件、身份证正反面合页推送单、银行卡正反面合页推送单。主体变更按需增加一份独立营业执照盖章推送单,共四份。 - 每张证件推送单仅有一处固定签署位置,分配给页面选定的证件签署方;营业执照要求企业盖章。主文件原有签署顺序保持不变。 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 b2c7572e..10b42a14 100644 --- a/resources/views/business/pages/courier-payables/agreement-signing.blade.php +++ b/resources/views/business/pages/courier-payables/agreement-signing.blade.php @@ -8,7 +8,6 @@ @php($supplierContractTemplates = \App\Support\SupplierCooperationTemplates::TEMPLATES) @php($supplierContractRequestKey = (string) \Illuminate\Support\Str::uuid()) @php($agreementQuoteVersions = $agreementQuoteVersions ?? collect()) -@php($agreementCooperationSecondaryEsignAccount = '18052733960') @php($agreementDefaultSubject = $agreementSubjects->firstWhere('is_default', true) ?: $agreementSubjects->first()) @php($agreementCompanyName = $agreementDefaultSubject?->name ?: company()?->name ?: '当前公司') @php($agreementSubjectPayload = $agreementSubjects->map(fn ($subject) => ['id' => $subject->id, 'name' => $subject->name, 'unified_social_credit_code' => $subject->unified_social_credit_code, 'is_default' => (bool) $subject->is_default])->values()) @@ -1440,6 +1439,14 @@