修复逆向账单纯数字实退单号比较 (#1743)

This commit is contained in:
limeng 2026-12-04 18:25:31 +08:00
parent 303972e90a
commit 6952d6c3b7
2 changed files with 10 additions and 0 deletions

View File

@ -80,6 +80,7 @@ final class ReturnPickupLookup
$items = $db->table(self::ITEMS)->whereIn('mainTableId', array_keys($ids))->orderBy('id')->get()->groupBy('mainTableId');
$truth = $db->table(self::TRUTH)->whereIn('mId', array_keys($ids))->get(['mId', 'truthExpressNumber'])->groupBy('mId');
foreach ($links as $number => $set) {
$number = (string) $number;
$candidates = $mains->only(array_keys($set))->filter(fn ($m) => isset(self::CARRIERS[trim((string) $m->express_company)]));
if ($candidates->isEmpty()) continue;
$main = $candidates->first();

View File

@ -166,4 +166,13 @@ final class ReverseCourierBillTest extends FeatureTestCase
$this->assertSame(9.0, $row['qc_miandan']);
$this->assertSame(47.0, $row['qc_freight']);
}
public function test_numeric_actual_waybill_is_not_misclassified_as_replaced(): void
{
$this->pickup(1, '98234567', ['express_company' => '德邦']);
DB::connection('business_mirror')->table('js_ekf_return_pickup_truth_express')->insert(['mId' => 1, 'truthExpressNumber' => '98234567']);
$row = app(ReturnPickupLookup::class)->details(['98234567'], ['常州德邦逆向'])['98234567'];
$this->assertArrayNotHasKey('_unshipped', $row);
$this->assertNotNull($row['qc_freight']);
}
}