From 3a864bfb3c3e9f21f4cc2b909ee4c3fa2a373be9 Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Sat, 5 Dec 2026 10:26:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=99=84=E5=8A=A0=E8=B4=B9=E5=AF=B9?= =?UTF-8?q?=E8=B4=A6):=20=E6=8C=89=E6=8A=A5=E4=BB=B7=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=8D=95=E4=BB=B7=E8=87=AA=E5=8A=A8=E6=A0=B8=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BillSurchargeQuoteCalculator.php | 91 +++++++++++++++++-- docs/附加费账单匹配.md | 2 + .../Business/BillSurchargeMatchingTest.php | 88 +++++++++++++++++- 3 files changed, 170 insertions(+), 11 deletions(-) diff --git a/app/Support/CourierBills/BillSurchargeQuoteCalculator.php b/app/Support/CourierBills/BillSurchargeQuoteCalculator.php index 6f9a7f939..a31b500ba 100644 --- a/app/Support/CourierBills/BillSurchargeQuoteCalculator.php +++ b/app/Support/CourierBills/BillSurchargeQuoteCalculator.php @@ -38,9 +38,11 @@ final class BillSurchargeQuoteCalculator $shipping = app(ShippingLookup::class); $ships = $shipping->details($waybills, $allowedCouriers); $freights = $shipping->summaries($waybills, $allowedCouriers); - $needsService = $rules->contains(fn ($r) => $r->mode === '聚工单客服核实' + $needsService = $rules->contains(fn ($r) => in_array($r->mode, ['聚工单客服核实', '固定单价'], true) || ($r->mode === '取发出运费' && trim($r->condition) === '查件扣单并且买家原因')); $workOrders = $needsService ? $this->workOrders($waybills, $month) : []; + $returns = $rules->contains(fn ($r) => $r->mode === '固定单价' && str_contains($r->condition, '已退回')) + ? $this->receivedReturns($workOrders, $month) : []; $confirmations = $this->buyerConfirmations($rules, $workOrders, $month); $rows = $notes = $metadata = []; $window = self::window($month); @@ -64,7 +66,8 @@ final class BillSurchargeQuoteCalculator continue; } // 买家原因必须按当前工单核验,缺少依据时不能回退到旧结算金额。 - if ($rule->mode === '取发出运费' && trim($rule->condition) === '查件扣单并且买家原因') $rows[$wb][$type] = []; + if ($rule->mode === '固定单价' + || ($rule->mode === '取发出运费' && trim($rule->condition) === '查件扣单并且买家原因')) $rows[$wb][$type] = []; if ($date < $window['from']) { $notes[$wb][$type] = '发货日期超出匹配范围:' . $window['from'] . ' 至 ' . Carbon::parse($window['until'])->subDay()->toDateString(); continue; @@ -75,7 +78,7 @@ final class BillSurchargeQuoteCalculator 'shop_name' => $ship['shop_name'] ?? null, 'online_order_no' => $ship['trade_no'] ?? null, 'source_kind' => 'bill_quote', 'source_key' => $wb . '|' . $type, 'outbound_io_id' => null]; $result = $this->price($rule, $type, $ship, $freights[$wb] ?? [], $workOrders[$wb] ?? [], - $confirmations[$rule->id][$wb] ?? []); + $confirmations[$rule->id][$wb] ?? [], $returns); if (is_string($result)) { $notes[$wb][$type] = '报价 #' . $rule->id . ':' . $result; continue; } foreach ($result as $price) $rows[$wb][$type][] = (object) array_replace($base, $price, ['settlement_status' => '已计算', 'evidence' => '报价 #' . $rule->id . ';' . $price['evidence']]); @@ -83,8 +86,9 @@ final class BillSurchargeQuoteCalculator return compact('rows', 'notes', 'metadata'); } - private function price(object $rule, string $type, array $ship, array $freight, array $orders, array $confirmations): array|string + private function price(object $rule, string $type, array $ship, array $freight, array $orders, array $confirmations, array $returns): array|string { + if ($rule->mode === '固定单价') return $this->fixedPrice($rule, $type, $orders, $returns); if ($rule->mode === '取发出运费') { if (! in_array(trim($rule->condition), ['取发出运费', '等于发出运费', '查件扣单并且买家原因'], true)) return '计费条件尚未支持自动核验'; if (! in_array(trim($rule->standard), ['取发出运费', '等于发出运费'], true)) return '计价标准尚未支持自动核验'; @@ -140,7 +144,7 @@ final class BillSurchargeQuoteCalculator return $result ?: ($found ? '对应工单附加费未审核通过' : '未找到对应单号、费用类型和快递的客服费用明细'); } - private function buyerReason(object $rule, array $orders, array $confirmations): array|string + private function buyerReason(object $rule, array $orders, array $confirmations, bool $requireBuyer = true): array|string { $reasons = []; foreach ($orders as $order) { @@ -148,7 +152,8 @@ final class BillSurchargeQuoteCalculator if (($fields['logisticsField'] ?? '') !== $rule->courier || substr($order->created, 0, 10) < substr($rule->effective_at, 0, 10) || in_array($order->status, ['CANCELLED', 'CANCELED', 'DELETED', '取消', '已取消'], true)) continue; - $reasons[] = ['order' => $order, 'reason' => trim((string) ($fields['SELECT_CASCADEField1413856620250813172526'] ?? ''))]; + $reasons[] = ['order' => $order, 'order_id' => (string) ($fields['o_id'] ?? ''), + 'reason' => trim((string) ($fields['SELECT_CASCADEField1413856620250813172526'] ?? ''))]; } if ($reasons === []) return '未找到有效的同快递查件工单,无法核实买家原因'; // 同票多工单以最新扣单原因核验;其他查件操作不覆盖扣单原因,费用仍按票只计一次。 @@ -156,16 +161,82 @@ final class BillSurchargeQuoteCalculator $deductions = array_values(array_filter($reasons, fn ($r) => trim(explode('/', $r['reason'], 2)[0]) === '扣单')); $latest = $deductions[0] ?? $reasons[0]; [$operation, $cause] = array_map('trim', array_pad(explode('/', $latest['reason'], 2), 2, '')); - if ($operation === '' || $cause === '' || $cause === '买家-') return '查件工单原因不完整,无法核实买家原因'; - $eligible = $operation === '扣单' && str_starts_with($cause, '买家-'); + if ($operation === '' || ($requireBuyer && ($cause === '' || $cause === '买家-'))) return '查件工单原因不完整,无法核实买家原因'; + $eligible = $operation === '扣单' && (! $requireBuyer || str_starts_with($cause, '买家-')); $confirmation = $confirmations[$latest['order']->woNo] ?? []; if (! $eligible && $operation === '扣单' && ($confirmation['buyer_reason_confirmed'] ?? false) === true && ($confirmation['original_reason'] ?? '') === $latest['reason'] && trim($confirmation['evidence'] ?? '') !== '') { return ['eligible' => true, 'evidence' => '聚工单 ' . $latest['order']->woNo . ' 原因:' . $latest['reason'] . ';人工确认买家原因:' . $confirmation['evidence']]; } - return ['eligible' => $eligible, 'evidence' => '聚工单 ' . $latest['order']->woNo . ' 原因:' . $latest['reason'] - . ($eligible ? ',符合买家原因条件' : ',不符合扣单且买家原因条件,不计费')]; + return ['eligible' => $eligible, 'order_id' => $latest['order_id'], 'operation' => $operation, + 'evidence' => '聚工单 ' . $latest['order']->woNo . ' 原因:' . $latest['reason'] + . ($eligible ? ($requireBuyer ? ',符合买家原因条件' : ',符合扣单条件') : ',不符合扣单且买家原因条件,不计费')]; + } + + private function fixedPrice(object $rule, string $type, array $orders, array $returns): array|string + { + if (! preg_match('/^(\d{1,9}(?:\.\d{1,2})?)\s*元?\s*\/\s*(?:单|票)$/u', trim($rule->standard), $price)) { + return '固定单价格式不支持,请填写如30元/单'; + } + $condition = trim($rule->condition); + $evidence = ''; + if (in_array($condition, ['查件扣单', '查件扣单并且买家原因', '查件扣单并且买家原因已退回', '查件扣单并且买家原因已退回的'], true)) { + $reason = $this->buyerReason($rule, $orders, [], $condition !== '查件扣单'); + if (is_string($reason)) return $reason; + if (! $reason['eligible']) return [['settlement_amount' => 0, 'evidence' => $reason['evidence']]]; + $evidence = $reason['evidence']; + if (str_contains($condition, '已退回')) { + $received = $returns[$reason['order_id']] ?? null; + if ($received === null) return '未找到对应订单在匹配范围内的有效退回进仓明细,待核实'; + $evidence .= ';退回进仓 ' . $received; + } + } elseif (in_array($condition, ['聚工单客服回复通过', '改地址客服回复通过'], true)) { + $approved = false; + foreach ($orders as $order) { + $fields = array_column(json_decode($order->businessFieldList, true, 512, JSON_THROW_ON_ERROR) ?: [], null, 'fieldId'); + if (($fields['logisticsField']['value'] ?? '') !== $rule->courier + || substr($order->created, 0, 10) < substr($rule->effective_at, 0, 10) + || in_array($order->status, ['CANCELLED', 'CANCELED', 'DELETED', '取消', '已取消'], true)) continue; + foreach ($fields[ServiceFees::FEE_TABLE]['childFieldList'] ?? [] as $line) { + $values = array_column($line, 'value', 'fieldId'); + if (SurchargeSettlementMatcher::type((string) ($values[ServiceFees::FEE_TYPE] ?? '')) === $type + && ($values[ServiceFees::FEE_APPROVAL] ?? '') === '通过') { + $approved = true; + $evidence = '聚工单 ' . $order->woNo . ' 对应费用客服审核通过'; + } + } + } + if (! $approved) return '未找到同快递、同费用类型的客服审核通过明细'; + } elseif (! in_array($condition, ['', '固定单价', '按单收取', '每单收取'], true)) { + return '固定单价的计费条件尚未支持自动核验'; + } + $amount = (float) $price[1]; + return [['settlement_amount' => $amount, 'evidence' => ($evidence === '' ? '' : $evidence . ';') + . '固定单价 ' . number_format($amount, 2, '.', '') . ' 元/单,按票计一次']]; + } + + /** 只按本批工单订单ID关联已有售后镜像,使用o_id/as_id索引,不扫描退回件全表。 */ + private function receivedReturns(array $orders, string $month): array + { + $ids = []; + foreach ($orders as $records) foreach ($records as $order) { + $fields = array_column(json_decode($order->businessFieldList, true, 512, JSON_THROW_ON_ERROR) ?: [], 'value', 'fieldId'); + $id = trim((string) ($fields['o_id'] ?? '')); + if (ctype_digit($id) && $id !== '0') $ids[$id] = true; + } + if ($ids === []) return []; + $db = DB::connection(config('upstream_mirrors.connection', 'business_mirror')); + if (! $db->getSchemaBuilder()->hasTable('ops_jst_return_refund_info') || ! $db->getSchemaBuilder()->hasTable('ops_jst_return_refund_item')) return []; + $result = []; + foreach (array_chunk(array_keys($ids), 300) as $chunk) { + $rows = $db->table('ops_jst_return_refund_info as h')->join('ops_jst_return_refund_item as i', 'i.as_id', '=', 'h.as_id') + ->whereIn('h.o_id', $chunk)->where('i.r_qty', '>', 0) + ->where('i.receive_date', '>=', self::window($month)['from'])->where('i.receive_date', '<', self::window($month)['until']) + ->select('h.o_id')->selectRaw('MIN(' . $db->getQueryGrammar()->wrap('i.receive_date') . ') AS received_at')->groupBy('h.o_id')->get(); + foreach ($rows as $row) $result[(string) $row->o_id] = $row->received_at; + } + return $result; } private function buyerConfirmations(iterable $rules, array $orders, string $month): array diff --git a/docs/附加费账单匹配.md b/docs/附加费账单匹配.md index 2e4100e8c..ec8d89318 100644 --- a/docs/附加费账单匹配.md +++ b/docs/附加费账单匹配.md @@ -16,4 +16,6 @@ 负责人逐票确认的买家原因,复用 `supplier_payable_overrides` 的 `courier-surcharge-buyer-confirmations` 数据集及其事件审计保存,不修改上游工单。确认绑定报价、账单月份、完整单号、工单号及原始原因,并保留确认依据;重新匹配继续使用同一确认。换工单、换报价或原因变更后需重新核实,其他破损单不自动视为买家原因。真实单号和确认记录不得进入 Git。 +固定单价自动核价读取报价中的金额(如30元/单、30/单),每票同类费用只计一次,不乘商品数量。空条件或“按单收取”按票计费;“查件扣单”核对同快递有效工单;带“买家原因”的条件核对扣单原因;带“已退回”的条件还要求该工单订单在最近三个自然月有实退数量大于0的进仓记录。退回状态通过已接入售后镜像的订单和售后单索引关联读取,无需全表扫描;缺少进仓依据保持未匹配,不推测已退回。客服通过类条件仍要求同单号、同快递、同费用类型的审核通过明细,金额取报价固定单价,不取客服填写的金额。暂不支持的条件或金额格式保留未匹配原因,不能回退到旧结算金额绕过条件。 + 客服费用通过现有单号索引读取共享工单,要求同一快递、费用类型一致、逐项审核通过且工单在账单月份结束前创建;按工单归集,不按商品数重复计费。“重量60kg以上”先检查本票已核算计费重量,低于门槛计0;缺重量、缺审核、无报价分别显示原因。原始账单、报价和发货运费均不改写。 diff --git a/tests/Feature/Business/BillSurchargeMatchingTest.php b/tests/Feature/Business/BillSurchargeMatchingTest.php index abb510141..3434a45e1 100644 --- a/tests/Feature/Business/BillSurchargeMatchingTest.php +++ b/tests/Feature/Business/BillSurchargeMatchingTest.php @@ -177,7 +177,7 @@ class BillSurchargeMatchingTest extends FeatureTestCase 'standard'=>$standard,'condition'=>$condition,'effective_at'=>'2026-01-01','status'=>'active','created_at'=>now(),'updated_at'=>now()]); } - private function workOrder(string $no,string $courier,string $type,string $amount,?string $approved,string $created='2026-11-03 10:00:00',?string $reason=null,string $status='WAIT_CONFIRM'): void + private function workOrder(string $no,string $courier,string $type,string $amount,?string $approved,string $created='2026-11-03 10:00:00',?string $reason=null,string $status='WAIT_CONFIRM',?int $orderId=null): void { $schema=Schema::connection('business_mirror'); if(!$schema->hasTable('js_jst_work_order_info'))$schema->create('js_jst_work_order_info',function(Blueprint $t){ @@ -190,6 +190,7 @@ class BillSurchargeMatchingTest extends FeatureTestCase ['fieldId'=>\Modules\EcommerceFinance\Services\CustomerServiceSurchargeSynchronizer::FEE_APPROVAL,'value'=>$approved], ]]]]; if($reason!==null)$fields[]=['fieldId'=>'SELECT_CASCADEField1413856620250813172526','value'=>$reason]; + if($orderId!==null)$fields[]=['fieldId'=>'o_id','value'=>$orderId]; $db=DB::connection('business_mirror');$id=$db->table('js_jst_work_order_info')->count()+1; $row=['_mirror_key'=>'work-'.$id,'Id'=>$id,'woNo'=>'GD-'.$id,'title'=>'查件','status'=>$status,'created'=>$created,'businessFieldList'=>json_encode($fields)]; $db->table('js_jst_work_order_info')->insert($row); @@ -328,6 +329,91 @@ class BillSurchargeMatchingTest extends FeatureTestCase $this->assertCount(1,$store->listRows($calc::BUYER_CONFIRMATIONS,(int)$this->company->id)); } + public function test_fixed_price_import_counts_once_per_waybill_and_preserves_metadata(): void + { + $store=app(DropshipFreightStore::class);$factory=$store->saveFactory(null,['name'=>'固定单价测试','warehouse'=>'测试仓','keywords'=>'测试']); + $this->quote('测试固定','拦截费','固定单价','30元/单','按单收取'); + $this->ship('FIXED0001','测试固定');$this->ship('FIXED0002','其他固定'); + $db=$store->db();$db->table('jst_oms_shipping')->where('express_no','FIXED0001')->update(['barcode'=>'FIX-SKU','shop_name'=>'固定测试店','trade_no'=>'FIX-ORDER']); + $path=$this->book(['账单'=>[['单号','运费'],['FIXED0001',10]],'附加费'=>[['快递单号','附加费金额','附加费类型'],['FIXED0001',999,'拦截费'],['FIXED0001',999,'拦截退回'],['FIXED0002',999,'拦截费']]]); + $store->uploadFor('固定测试11月.xlsx',$path,'2026-11',$factory,'测试'); + foreach([1,2] as $_){app(SurchargeSettlementMatcher::class)->dropship($factory,'2026-11');$rows=app(SurchargeSettlementMatcher::class)->query('dropship',$factory,'2026-11')->orderBy('row_no')->get(); + $this->assertEquals(30,$rows[0]->self_amount);$this->assertEquals(0,$rows[1]->self_amount);$this->assertNull($rows[2]->self_amount); + $this->assertSame('FIX-SKU',$rows[0]->product_code);$this->assertSame('固定测试店',$rows[0]->shop_name);$this->assertSame('FIX-ORDER',$rows[0]->online_order_no);} + } + + public function test_fixed_buyer_return_condition_requires_buyer_reason_and_received_goods(): void + { + $this->quote('测试固定','拦截费','固定单价','30/单','查件扣单并且买家原因已退回的'); + $db=DB::connection('business_mirror');$schema=Schema::connection('business_mirror'); + $schema->create('ops_jst_return_refund_info',function(Blueprint $t){$t->integer('as_id');$t->integer('o_id')->index();}); + $schema->create('ops_jst_return_refund_item',function(Blueprint $t){$t->integer('as_id')->index();$t->integer('r_qty');$t->dateTime('receive_date')->nullable();}); + $cases=[['FIXRET001','扣单/买家-不想要','2026-09-01 00:00:00',1,30],['FIXRET002','扣单/买家-不想要',null,0,null], + ['FIXRET003','扣单/快递-破损','2026-11-01',1,0],['FIXRET004','扣单/买家-不想要','2026-12-01',1,null], + ['FIXRET005','扣单/买家-不想要','2026-08-31 23:59:59',1,null],['FIXRET006','扣单/买家-不想要','2026-11-30 23:59:59',0,null]]; + $input=[]; + foreach($cases as $i=>[$no,$reason,$received,$qty,$amount]){ + $this->ship($no,'测试固定');$this->workOrder($no,'测试固定','','',null,'2026-11-03',$reason,'WAIT_CONFIRM',$i+1); + $db->table('ops_jst_return_refund_info')->insert(['as_id'=>$i+1,'o_id'=>$i+1]); + $db->table('ops_jst_return_refund_item')->insert(['as_id'=>$i+1,'r_qty'=>$qty,'receive_date'=>$received]); + $input[]=['waybill_no'=>$no,'item'=>'拦截费']; + } + $result=app(\App\Support\CourierBills\BillSurchargeQuoteCalculator::class)->calculate($input,'dropship','2026-11',['测试固定']); + foreach($cases as [$no,$reason,$received,$qty,$amount]){ + if($amount===null){$this->assertSame([],$result['rows'][$no]['拦截费']);$this->assertStringContainsString('退回进仓',$result['notes'][$no]['拦截费']);} + else $this->assertEquals($amount,$result['rows'][$no]['拦截费'][0]->settlement_amount); + } + $db->table('ops_jst_return_refund_item')->insert(['as_id'=>1,'r_qty'=>5,'receive_date'=>'2026-11-10']); + $repeated=app(\App\Support\CourierBills\BillSurchargeQuoteCalculator::class)->calculate([$input[0]],'dropship','2026-11',['测试固定']); + $this->assertCount(1,$repeated['rows']['FIXRET001']['拦截费']);$this->assertEquals(30,$repeated['rows']['FIXRET001']['拦截费'][0]->settlement_amount); + $schema->drop('ops_jst_return_refund_item'); + $missing=app(\App\Support\CourierBills\BillSurchargeQuoteCalculator::class)->calculate([$input[0]],'dropship','2026-11',['测试固定']); + $this->assertStringContainsString('退回进仓',$missing['notes']['FIXRET001']['拦截费']); + } + + public function test_fixed_customer_approval_uses_quote_price_and_enforces_type_courier_status(): void + { + $this->quote('测试固定','改地址','固定单价','30元/单','改地址客服回复通过'); + $cases=[['FIXAPP001','测试固定','改地址费','通过','WAIT_CONFIRM',30],['FIXAPP002','测试固定','改地址',null,'WAIT_CONFIRM',null], + ['FIXAPP003','其他固定','改地址','通过','WAIT_CONFIRM',null],['FIXAPP004','测试固定','改地址','通过','CANCELLED',null], + ['FIXAPP005','测试固定','上楼费','通过','WAIT_CONFIRM',null]];$input=[]; + foreach($cases as [$no,$courier,$type,$approval,$status,$amount]){ + $this->ship($no,'测试固定');$this->workOrder($no,$courier,$type,'999',$approval,'2026-11-03',null,$status);$input[]=['waybill_no'=>$no,'item'=>'改地址']; + } + $result=app(\App\Support\CourierBills\BillSurchargeQuoteCalculator::class)->calculate($input,'dropship','2026-11',['测试固定']); + foreach($cases as [$no,$courier,$type,$approval,$status,$amount]){ + if($amount===null){$this->assertSame([],$result['rows'][$no]['改地址']);$this->assertStringContainsString('审核通过',$result['notes'][$no]['改地址']);} + else $this->assertEquals($amount,$result['rows'][$no]['改地址'][0]->settlement_amount); + } + } + + public function test_fixed_rate_rejects_unknown_conditions_and_price_formats_without_old_settlement_fallback(): void + { + $rule=$this->quote('测试固定','拦截费','固定单价','30元/单','未知条件');$this->ship('FIXINVALID','测试固定');$this->fee('FIXINVALID','拦截费',999,'测试固定'); + $calc=app(\App\Support\CourierBills\BillSurchargeQuoteCalculator::class);$input=[['waybill_no'=>'FIXINVALID','item'=>'拦截费']]; + $this->assertStringContainsString('计费条件',$calc->calculate($input,'dropship','2026-11',['测试固定'])['notes']['FIXINVALID']['拦截费']); + DB::table('business_courier_surcharge_quotes')->where('id',$rule)->update(['condition'=>'按单收取']); + foreach(['30元/公斤','-30元/单','30.001元/单','30元/单另加10元'] as $bad){DB::table('business_courier_surcharge_quotes')->where('id',$rule)->update(['standard'=>$bad]); + $this->assertStringContainsString('格式不支持',$calc->calculate($input,'dropship','2026-11',['测试固定'])['notes']['FIXINVALID']['拦截费']);} + DB::table('business_courier_surcharge_quotes')->where('id',$rule)->update(['standard'=>'0.50元/票']); + $this->assertEquals(0.5,$calc->calculate($input,'dropship','2026-11',['测试固定'])['rows']['FIXINVALID']['拦截费'][0]->settlement_amount); + } + + public function test_fixed_deduction_requires_only_the_registered_condition_and_keeps_old_results_from_bypassing_it(): void + { + $store=app(DropshipFreightStore::class);$factory=$store->saveFactory(null,['name'=>'固定扣单测试','warehouse'=>'测试仓','keywords'=>'测试']); + $this->quote('测试固定','拦截费','固定单价','1元/单','查件扣单'); + $this->ship('DEDUCT001','测试固定');$this->ship('DEDUCT002','测试固定'); + $this->workOrder('DEDUCT001','测试固定','','',null,'2026-11-03','扣单'); + $this->workOrder('DEDUCT002','测试固定','','',null,'2026-11-03','扣单','CANCELLED'); + $this->fee('DEDUCT002','拦截费',99,'测试固定'); + $path=$this->book(['账单'=>[['单号','运费'],['DEDUCT001',10]],'附加费'=>[['快递单号','附加费金额','附加费类型'],['DEDUCT001',30,'拦截费'],['DEDUCT002',99,'拦截费']]]); + $store->uploadFor('固定扣单11月.xlsx',$path,'2026-11',$factory,'测试'); + $rows=app(SurchargeSettlementMatcher::class)->query('dropship',$factory,'2026-11')->orderBy('row_no')->get(); + $this->assertEquals(1,$rows[0]->self_amount);$this->assertStringContainsString('GD-1',$rows[0]->match_note); + $this->assertNull($rows[1]->self_amount);$this->assertStringContainsString('未找到有效',$rows[1]->match_note); + } + public function test_customer_service_approval_weight_gate_and_missing_rule_are_explicit(): void { $store=app(CourierBillStore::class);$group=$store->saveGroup(null,['name'=>'测试德邦','express_names'=>['测试德邦']]); -- 2.47.2