diff --git a/modules/EcommerceFinance/View/NonStoreAccountMonitorPageData.php b/modules/EcommerceFinance/View/NonStoreAccountMonitorPageData.php index a60f393b..e13b33d1 100644 --- a/modules/EcommerceFinance/View/NonStoreAccountMonitorPageData.php +++ b/modules/EcommerceFinance/View/NonStoreAccountMonitorPageData.php @@ -832,6 +832,9 @@ final class NonStoreAccountMonitorPageData '中信' => '中信银行', '北京' => '北京银行', '杭州' => '杭州银行', + '江苏江南农村商业银行' => '江南农商行', + '江南农村商业银行' => '江南农商行', + '江南银行' => '江南农商行', '农商' => '江南农商行', '平安' => '平安银行', '交通' => '交通银行', diff --git a/tests/Feature/Business/NonStoreAccountMonitorTest.php b/tests/Feature/Business/NonStoreAccountMonitorTest.php index 57ab1ee4..e18ed7bc 100644 --- a/tests/Feature/Business/NonStoreAccountMonitorTest.php +++ b/tests/Feature/Business/NonStoreAccountMonitorTest.php @@ -293,6 +293,61 @@ class NonStoreAccountMonitorTest extends FeatureTestCase ->assertSee('data-retained-period-blocked="20000"', false); } + public function test_jiangnan_rural_commercial_bank_variants_share_one_bank_group(): void + { + $connection = DB::connection('business_mirror'); + foreach ([ + [ + 'company_name' => '江南全称测试公司', + 'account_short' => '江南银行-全称测试', + 'bank_name' => '江苏江南农村商业银行股份有限公司常州市崔桥支行', + 'current_balance' => 100, + ], + [ + 'company_name' => '江南标准名称测试公司', + 'account_short' => '江南农村商业银行测试', + 'bank_name' => '江南农村商业银行崔桥支行', + 'current_balance' => 200, + ], + [ + 'company_name' => '江南简称测试公司', + 'account_short' => '江南农商行测试', + 'bank_name' => '江南农商行南夏墅支行', + 'current_balance' => 300, + ], + ] as $index => $account) { + $connection->table('fin_accounts')->insert([ + ...$account, + 'account_type' => '公户', + 'account_no' => 'JN-TEST-' . $index, + 'company_plan' => '保留', + 'account_should_keep' => '是', + 'daily_available' => $account['current_balance'], + 'blocked_amount' => 0, + ]); + } + + $this->loginAs()->get($this->pageUrl())->assertOk(); + $fundOverview = app(\Modules\EcommerceFinance\View\NonStoreAccountMonitorPageData::class) + ->page()['fundOverview']; + $distribution = collect($fundOverview['bank_distribution']); + $jiangnan = $distribution->firstWhere('bank', '江南农商行'); + $accounts = collect($fundOverview['bank_accounts'])->whereIn('account_short', [ + '江南银行-全称测试', + '江南农村商业银行测试', + '江南农商行测试', + ]); + + $this->assertNotNull($jiangnan); + $this->assertSame(3, $jiangnan['count']); + $this->assertCount(3, $accounts); + $this->assertTrue($accounts->every( + static fn (array $row): bool => $row['platform_label'] === '江南农商行', + )); + $this->assertFalse($distribution->contains('bank', '江苏江南农村商业银行股份有限公司常州市崔桥支行')); + $this->assertFalse($distribution->contains('bank', '江南农村商业银行崔桥支行')); + } + public function test_direct_account_income_expense_and_balance_follow_bank_bills(): void { $connection = DB::connection('business_mirror');