From 9f88b92985e3784318c4cdbc5d624a05a0b42146 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Mon, 16 Mar 2026 15:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE:=20=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE40=E5=A4=A7=E9=A2=9D=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B5=81=E6=B0=B4=E5=B9=B6=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...03-16-project40-large-transaction-seed.sql | 326 ++++++++++++++++++ ...3-16-project40-large-transaction-report.md | 88 +++++ 2 files changed, 414 insertions(+) create mode 100644 assets/database/2026-03-16-project40-large-transaction-seed.sql create mode 100644 docs/implementation-reports/2026-03-16-project40-large-transaction-report.md diff --git a/assets/database/2026-03-16-project40-large-transaction-seed.sql b/assets/database/2026-03-16-project40-large-transaction-seed.sql new file mode 100644 index 00000000..fe7e2f06 --- /dev/null +++ b/assets/database/2026-03-16-project40-large-transaction-seed.sql @@ -0,0 +1,326 @@ +-- 项目40大额交易测试流水初始化脚本 +SET NAMES utf8mb4; +-- 依赖默认参数: +-- SINGLE_TRANSACTION_AMOUNT = 100000 +-- CUMULATIVE_TRANSACTION_AMOUNT = 50000001 +-- annual_turnover = 50000001 +-- LARGE_CASH_DEPOSIT = 2000001 +-- FREQUENT_CASH_DEPOSIT = 5 +-- FREQUENT_TRANSFER = 100001 + +DELETE FROM ccdi_bank_statement +WHERE project_id = 40; + +INSERT INTO ccdi_bank_statement ( + project_id, LE_ID, ACCOUNT_ID, group_id, + LE_ACCOUNT_NAME, LE_ACCOUNT_NO, ACCOUNTING_DATE_ID, ACCOUNTING_DATE, + TRX_DATE, CURRENCY, AMOUNT_DR, AMOUNT_CR, AMOUNT_BALANCE, + CASH_TYPE, CUSTOMER_LE_ID, CUSTOMER_ACCOUNT_NAME, CUSTOMER_ACCOUNT_NO, + customer_bank, customer_reference, USER_MEMO, BANK_COMMENTS, + BANK_TRX_NUMBER, BANK, TRX_FLAG, TRX_TYPE, EXCEPTION_TYPE, + internal_flag, batch_id, batch_sequence, CREATE_DATE, created_by, + meta_json, no_balance, begin_balance, end_balance, + override_bs_id, payment_method, cret_no +) VALUES + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400001, '2026-03-01', '2026-03-01 10:12:00', 'CNY', 680000.00, 0.00, 5420000.00, '对公转账', 0, '杭州贝壳房地产经纪有限公司', '913301001234000001', '中国银行杭州分行', '', '购买房产首付款', '购买房产首付款', 'P40-0001', 'BOC', '0', 0, '', 0, 40001, 1, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000102, 40, '模型测试家属', '6222024000000002', 400002, '2026-03-02', '2026-03-02 11:05:00', 'CNY', 258000.00, 0.00, 3165000.00, '对私转账', 0, '兰溪星耀汽车销售服务有限公司', '913307811234000002', '工商银行兰溪支行', '', '购车首付款', '购车首付款', 'P40-0002', 'ICBC', '0', 0, '', 0, 40001, 2, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101199001010022'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400003, '2026-03-03', '2026-03-03 09:15:00', 'CNY', 52000.00, 0.00, 4680000.00, '税费缴纳', 0, '国家金库兰溪支库', 'TG000000000000003', '中国建设银行兰溪支行', '', '个人所得税税款', '个人所得税税款', 'P40-0003', 'CCB', '0', 0, '', 0, 40001, 3, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000104, 40, '模型二测试家属', '6222024000000004', 400004, '2026-03-04', '2026-03-04 14:40:00', 'CNY', 18800.00, 0.00, 2230000.00, '税费缴纳', 0, '兰溪市税务局第一税务分局', 'TG000000000000004', '农业银行兰溪支行', '', '房产税务缴税', '房产税务缴税', 'P40-0004', 'ABC', '0', 0, '', 0, 40001, 4, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101199202020044'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400005, '2026-03-05', '2026-03-05 13:25:00', 'CNY', 0.00, 188000.00, 5608000.00, '来账', 0, '杭州启明咨询有限公司', '913301001234000005', '招商银行杭州分行', '', '项目合作分成', '项目合作分成', 'P40-0005', 'CMB', '0', 0, '', 0, 40001, 5, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400006, '2025-11-18', '2025-11-18 10:08:00', 'CNY', 0.00, 20500000.00, 25180000.00, '来账', 0, '浙江远望贸易有限公司', '913300001234000006', '交通银行杭州分行', '', '经营往来收入', '经营往来收入', 'P40-0006', 'BCM', '0', 0, '', 0, 40001, 6, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400007, '2026-01-15', '2026-01-15 15:18:00', 'CNY', 0.00, 20000000.00, 45180000.00, '来账', 0, '浙江远望贸易有限公司', '913300001234000006', '交通银行杭州分行', '', '经营往来收入', '经营往来收入', 'P40-0007', 'BCM', '0', 0, '', 0, 40001, 7, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400008, '2026-02-20', '2026-02-20 16:22:00', 'CNY', 0.00, 19800000.00, 64980000.00, '来账', 0, '浙江远望贸易有限公司', '913300001234000006', '交通银行杭州分行', '', '经营往来收入', '经营往来收入', 'P40-0008', 'BCM', '0', 0, '', 0, 40001, 8, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400009, '2026-02-25', '2026-02-25 11:41:00', 'CNY', 8000000.00, 0.00, 56980000.00, '对公转账', 0, '浙江腾越供应链有限公司', '913300001234000009', '中国银行义乌支行', '', '材料采购转账', '材料采购转账', 'P40-0009', 'BOC', '0', 0, '', 0, 40001, 9, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400010, '2026-03-06', '2026-03-06 12:05:00', 'CNY', 6000000.00, 0.00, 50980000.00, '对公转账', 0, '杭州诚誉科技有限公司', '913301001234000010', '宁波银行杭州分行', '', '服务采购转账', '服务采购转账', 'P40-0010', 'NBCB', '0', 0, '', 0, 40001, 10, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400011, '2026-03-10', '2026-03-10 09:00:00', 'CNY', 0.00, 2500000.00, 7598000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', '柜面现金存款', '柜面现金存款', 'P40-0011', 'LXNRCB', '0', 0, '', 0, 40001, 11, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400012, '2026-03-10', '2026-03-10 09:20:00', 'CNY', 0.00, 2100000.00, 9698000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', 'ATM现金存款', 'ATM现金存款', 'P40-0012', 'LXNRCB', '0', 0, '', 0, 40001, 12, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400013, '2026-03-10', '2026-03-10 10:05:00', 'CNY', 0.00, 2200000.00, 11898000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', '自助存款现金存入', '自助存款现金存入', 'P40-0013', 'LXNRCB', '0', 0, '', 0, 40001, 13, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400014, '2026-03-10', '2026-03-10 11:16:00', 'CNY', 0.00, 2300000.00, 14198000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', '柜面现金存款', '柜面现金存款', 'P40-0014', 'LXNRCB', '0', 0, '', 0, 40001, 14, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400015, '2026-03-10', '2026-03-10 13:02:00', 'CNY', 0.00, 2400000.00, 16598000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', 'CRS存款', 'CRS存款', 'P40-0015', 'LXNRCB', '0', 0, '', 0, 40001, 15, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400016, '2026-03-10', '2026-03-10 15:08:00', 'CNY', 0.00, 2350000.00, 18948000.00, '现金存款', 0, '', '', '兰溪农商行营业部', '', '本行ATM存款', '本行ATM存款', 'P40-0016', 'LXNRCB', '0', 0, '', 0, 40001, 16, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400017, '2026-03-11', '2026-03-11 10:33:00', 'CNY', 360000.00, 0.00, 50620000.00, '转账', 0, '杭州弘信商贸有限公司', '913301001234000017', '浦发银行杭州分行', '', '手机银行转账', '手机银行转账', 'P40-0017', 'SPDB', '0', 0, '', 0, 40001, 17, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400018, '2026-03-12', '2026-03-12 08:30:00', 'CNY', 0.00, 15000.00, 18963000.00, '代发工资', 0, '浙江兰溪农村商业银行股份有限公司', 'PAYROLL0000000018', '兰溪农商行营业部', '', '代发工资', '代发工资', 'P40-0018', 'LXNRCB', '0', 0, '', 0, 40001, 18, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000101, 40, '模型测试员工', '6222024000000001', 400019, '2026-03-12', '2026-03-12 18:15:00', 'CNY', 368.00, 0.00, 18962632.00, '消费', 0, '兰溪市银泰超市', 'SHOP000000000019', '工商银行兰溪支行', '', '超市消费', '超市消费', 'P40-0019', 'ICBC', '0', 0, '', 0, 40001, 19, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198801010011'), + (40, 0, 4000102, 40, '模型测试家属', '6222024000000002', 400020, '2026-03-13', '2026-03-13 19:10:00', 'CNY', 220.00, 0.00, 3164780.00, '生活缴费', 0, '兰溪市供电公司', 'UTIL000000000020', '建设银行兰溪支行', '', '水电费', '水电费', 'P40-0020', 'CCB', '0', 0, '', 0, 40001, 20, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101199001010022'), + (40, 0, 4000103, 40, '模型二测试员工', '6222024000000003', 400021, '2026-03-14', '2026-03-14 09:55:00', 'CNY', 0.00, 500000.00, 51120000.00, '内部划转', 0, '模型二测试员工', 'SELF000000000021', '兰溪农商行营业部', '', '本人账户划转', '本人账户划转', 'P40-0021', 'LXNRCB', '0', 0, '', 0, 40001, 21, '2026-03-16 16:00:00', 1, NULL, 0, 0, 0, 0, NULL, '330101198802020033'); + +SELECT 'project_40_total' AS check_name, COUNT(*) AS hit_count +FROM ccdi_bank_statement +WHERE project_id = 40; + +SELECT 'house_or_car_expense' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t2.bank_statement_id + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND ( + t2.user_memo LIKE '%购%房%' + OR t2.user_memo LIKE '%买%房%' + OR t2.user_memo LIKE '%购%车%' + OR t2.user_memo LIKE '%买%车%' + OR t2.user_memo LIKE '%车款%' + OR t2.user_memo LIKE '%房款%' + OR t2.user_memo LIKE '%首付%' + OR t2.user_memo LIKE '%房贷%' + OR t2.user_memo LIKE '%车贷%' + OR t2.customer_account_name LIKE '%汽车销售%' + OR t2.customer_account_name LIKE '%汽车金融%' + OR t2.customer_account_name LIKE '%4S店%' + OR t2.customer_account_name LIKE '%汽贸%' + OR t2.customer_account_name LIKE '%车行%' + OR t2.customer_account_name LIKE '%房地产%' + OR t2.customer_account_name LIKE '%置业%' + OR t2.customer_account_name LIKE '%置地%' + OR t2.customer_account_name LIKE '%地产%' + OR t2.customer_account_name LIKE '%房产%' + OR t2.customer_account_name LIKE '%不动产%' + OR t2.customer_account_name LIKE '%链家%' + OR t2.customer_account_name LIKE '%贝壳%' + OR t2.customer_account_name LIKE '%我爱我家%' + OR t2.customer_account_name LIKE '%房管局%' + ) + AND t2.amount_dr > 0 + UNION ALL + SELECT t2.bank_statement_id + FROM ccdi_staff_fmy_relation t1 + INNER JOIN ccdi_bank_statement t2 ON t1.relation_cert_no = t2.cret_no + WHERE t1.status = 1 + AND t2.project_id = 40 + AND ( + t2.user_memo LIKE '%购%房%' + OR t2.user_memo LIKE '%买%房%' + OR t2.user_memo LIKE '%购%车%' + OR t2.user_memo LIKE '%买%车%' + OR t2.user_memo LIKE '%车款%' + OR t2.user_memo LIKE '%房款%' + OR t2.user_memo LIKE '%首付%' + OR t2.user_memo LIKE '%房贷%' + OR t2.user_memo LIKE '%车贷%' + OR t2.customer_account_name LIKE '%汽车销售%' + OR t2.customer_account_name LIKE '%汽车金融%' + OR t2.customer_account_name LIKE '%4S店%' + OR t2.customer_account_name LIKE '%汽贸%' + OR t2.customer_account_name LIKE '%车行%' + OR t2.customer_account_name LIKE '%房地产%' + OR t2.customer_account_name LIKE '%置业%' + OR t2.customer_account_name LIKE '%置地%' + OR t2.customer_account_name LIKE '%地产%' + OR t2.customer_account_name LIKE '%房产%' + OR t2.customer_account_name LIKE '%不动产%' + OR t2.customer_account_name LIKE '%链家%' + OR t2.customer_account_name LIKE '%贝壳%' + OR t2.customer_account_name LIKE '%我爱我家%' + OR t2.customer_account_name LIKE '%房管局%' + ) + AND t2.amount_dr > 0 +) s; + +SELECT 'tax_expense' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t2.bank_statement_id + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND ( + t2.user_memo LIKE '%税务%' + OR t2.user_memo LIKE '%缴税%' + OR t2.user_memo LIKE '%税款%' + OR t2.customer_account_name LIKE '%税务%' + OR t2.customer_account_name LIKE '%税务局%' + OR t2.customer_account_name LIKE '%国库%' + OR t2.customer_account_name LIKE '%国家金库%' + OR t2.customer_account_name LIKE '%财政%' + ) + AND t2.amount_dr > 0 + UNION ALL + SELECT t2.bank_statement_id + FROM ccdi_staff_fmy_relation t1 + INNER JOIN ccdi_bank_statement t2 ON t1.relation_cert_no = t2.cret_no + WHERE t1.status = 1 + AND t2.project_id = 40 + AND ( + t2.user_memo LIKE '%税务%' + OR t2.user_memo LIKE '%缴税%' + OR t2.user_memo LIKE '%税款%' + OR t2.customer_account_name LIKE '%税务%' + OR t2.customer_account_name LIKE '%税务局%' + OR t2.customer_account_name LIKE '%国库%' + OR t2.customer_account_name LIKE '%国家金库%' + OR t2.customer_account_name LIKE '%财政%' + ) + AND t2.amount_dr > 0 +) s; + +SELECT 'single_large_income' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t2.bank_statement_id + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + LEFT JOIN ccdi_staff_fmy_relation t3 + ON t1.id_card = t3.person_id + AND t2.customer_account_name = t3.relation_name + WHERE t2.project_id = 40 + AND t2.le_account_name <> t2.customer_account_name + AND NOT ( + t2.customer_account_name = '浙江兰溪农村商业银行股份有限公司' + AND ( + t2.user_memo LIKE '%代发%' + OR t2.user_memo LIKE '%工资%' + OR t2.user_memo LIKE '%奖金%' + OR t2.user_memo LIKE '%薪酬%' + OR t2.user_memo LIKE '%薪金%' + OR t2.user_memo LIKE '%补贴%' + OR t2.user_memo LIKE '%薪%' + OR t2.user_memo LIKE '%年终奖%' + OR t2.user_memo LIKE '%年金%' + OR t2.user_memo LIKE '%加班费%' + OR t2.user_memo LIKE '%劳务费%' + OR t2.user_memo LIKE '%劳务外包%' + OR t2.user_memo LIKE '%提成%' + OR t2.user_memo LIKE '%劳务派遣%' + OR t2.user_memo LIKE '%绩效%' + OR t2.user_memo LIKE '%酬劳%' + OR t2.cash_type LIKE '%代发%' + OR t2.cash_type LIKE '%工资%' + OR t2.cash_type LIKE '%劳务费%' + ) + ) + AND t2.amount_cr > 100000 + AND t3.person_id IS NULL +) s; + +SELECT 'cumulative_large_income' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t1.id_card, t2.customer_account_name, SUM(t2.amount_cr) AS sum_amount_cr + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + LEFT JOIN ccdi_staff_fmy_relation t3 + ON t1.id_card = t3.person_id + AND t2.customer_account_name = t3.relation_name + WHERE t2.project_id = 40 + AND t2.le_account_name <> t2.customer_account_name + AND NOT ( + t2.customer_account_name = '浙江兰溪农村商业银行股份有限公司' + AND ( + t2.user_memo LIKE '%代发%' + OR t2.user_memo LIKE '%工资%' + OR t2.cash_type LIKE '%代发%' + OR t2.cash_type LIKE '%工资%' + ) + ) + AND t2.amount_cr > 0 + AND t3.person_id IS NULL + GROUP BY t1.id_card, t2.customer_account_name + HAVING SUM(t2.amount_cr) > 50000001 +) s; + +SELECT 'annual_turnover' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t1.id_card, SUM(t2.amount_dr + t2.amount_cr) AS annual_trans_amount + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND STR_TO_DATE(LEFT(t2.TRX_DATE, 10), '%Y-%m-%d') >= DATE_SUB(CURDATE(), INTERVAL 12 MONTH) + AND t2.le_account_name <> t2.customer_account_name + GROUP BY t1.id_card + HAVING SUM(t2.amount_dr + t2.amount_cr) > 50000001 +) s; + +SELECT 'large_cash_deposit' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t2.bank_statement_id + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND t2.amount_cr > 2000001 + AND ( + ( + ( + (t2.user_memo LIKE '%现金%' AND t2.user_memo NOT LIKE '%金管理%' AND t2.user_memo NOT LIKE '%金添利%' AND t2.user_memo NOT LIKE '%现金利%' AND t2.user_memo NOT LIKE '%现金宝%' AND t2.user_memo NOT LIKE '%金分析%') + OR t2.user_memo LIKE '%存现%' + OR t2.user_memo LIKE '%现存%' + OR t2.cash_type LIKE '%现金%' + OR t2.cash_type LIKE '%存现%' + OR t2.cash_type LIKE '%现存%' + OR t2.cash_type LIKE '%金存入%' + OR t2.user_memo LIKE '%金存入%' + OR (t2.user_memo LIKE '%ATM%' AND (t2.user_memo LIKE '%存款%' OR t2.user_memo LIKE '%转入%')) + OR (t2.cash_type LIKE '%ATM%' AND (t2.cash_type LIKE '%存款%' OR t2.cash_type LIKE '%转入%')) + ) + AND (t2.customer_account_name = '' OR t2.customer_account_name = '无' OR t2.customer_account_name LIKE '%存现%') + ) + OR t2.user_memo LIKE '%DEPOSIT%' + OR ( + t2.customer_account_name = '库存现金' + OR (((t2.user_memo LIKE '%现金存款%' OR t2.user_memo LIKE '%自助存款%' OR t2.user_memo LIKE '%CRS存款%' OR t2.cash_type LIKE '%现金存款%' OR t2.cash_type LIKE '%自助存款%' OR t2.cash_type LIKE '%本行CRS存款%' OR t2.cash_type LIKE '%柜面%' OR t2.user_memo LIKE '%柜面%') AND t2.customer_account_name = '')) + OR (t2.customer_account_name = '现金' AND t2.user_memo NOT LIKE '%借款%') + OR t2.user_memo LIKE '%本行ATM%' + ) + ) +) s; + +SELECT 'frequent_cash_deposit' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t1.id_card, LEFT(t2.trx_date, 10) AS cash_trans_date, COUNT(1) AS cash_count + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND t2.amount_cr > 2000001 + AND ( + ( + ( + (t2.user_memo LIKE '%现金%' AND t2.user_memo NOT LIKE '%金管理%' AND t2.user_memo NOT LIKE '%金添利%' AND t2.user_memo NOT LIKE '%现金利%' AND t2.user_memo NOT LIKE '%现金宝%' AND t2.user_memo NOT LIKE '%金分析%') + OR t2.user_memo LIKE '%存现%' + OR t2.user_memo LIKE '%现存%' + OR t2.cash_type LIKE '%现金%' + OR t2.cash_type LIKE '%存现%' + OR t2.cash_type LIKE '%现存%' + OR t2.cash_type LIKE '%金存入%' + OR t2.user_memo LIKE '%金存入%' + OR (t2.user_memo LIKE '%ATM%' AND (t2.user_memo LIKE '%存款%' OR t2.user_memo LIKE '%转入%')) + OR (t2.cash_type LIKE '%ATM%' AND (t2.cash_type LIKE '%存款%' OR t2.cash_type LIKE '%转入%')) + ) + AND (t2.customer_account_name = '' OR t2.customer_account_name = '无' OR t2.customer_account_name LIKE '%存现%') + ) + OR t2.user_memo LIKE '%DEPOSIT%' + OR ( + t2.customer_account_name = '库存现金' + OR (((t2.user_memo LIKE '%现金存款%' OR t2.user_memo LIKE '%自助存款%' OR t2.user_memo LIKE '%CRS存款%' OR t2.cash_type LIKE '%现金存款%' OR t2.cash_type LIKE '%自助存款%' OR t2.cash_type LIKE '%本行CRS存款%' OR t2.cash_type LIKE '%柜面%' OR t2.user_memo LIKE '%柜面%') AND t2.customer_account_name = '')) + OR (t2.customer_account_name = '现金' AND t2.user_memo NOT LIKE '%借款%') + OR t2.user_memo LIKE '%本行ATM%' + ) + ) + GROUP BY t1.id_card, LEFT(t2.trx_date, 10) + HAVING COUNT(1) > 5 +) s; + +SELECT 'large_transfer' AS check_name, COUNT(*) AS hit_count +FROM ( + SELECT t2.bank_statement_id + FROM ccdi_base_staff t1 + INNER JOIN ccdi_bank_statement t2 ON t1.id_card = t2.cret_no + WHERE t2.project_id = 40 + AND t2.amount_dr > 100001 + AND ( + t2.customer_account_name LIKE '%转账%' + OR t2.user_memo LIKE '%转帐%' + OR t2.user_memo LIKE '%转账%' + OR t2.user_memo LIKE '%汇入%' + OR t2.user_memo LIKE '%转存%' + OR t2.user_memo LIKE '%红包%' + OR t2.user_memo LIKE '%汇款%' + OR t2.user_memo LIKE '%网转%' + OR t2.user_memo LIKE '%转入%' + OR t2.cash_type LIKE '%转帐%' + OR t2.cash_type LIKE '%转账%' + OR t2.cash_type LIKE '%汇入%' + OR t2.cash_type LIKE '%转存%' + OR t2.cash_type LIKE '%红包%' + OR t2.cash_type LIKE '%汇款%' + OR t2.cash_type LIKE '%网转%' + OR t2.cash_type LIKE '%转入%' + ) + AND t2.user_memo NOT LIKE '%款%' + AND t2.le_account_name <> t2.customer_account_name +) s; diff --git a/docs/implementation-reports/2026-03-16-project40-large-transaction-report.md b/docs/implementation-reports/2026-03-16-project40-large-transaction-report.md new file mode 100644 index 00000000..6f0605a9 --- /dev/null +++ b/docs/implementation-reports/2026-03-16-project40-large-transaction-report.md @@ -0,0 +1,88 @@ +# 项目40大额交易测试流水实施报告 + +## 执行概况 + +- 执行时间:2026-03-16 +- 目标项目:`project_id=40` +- 项目名称:大额交易模型测试 +- 执行方式:直接向开发库 `ccdi_bank_statement` 插入测试流水 +- 数据脚本:[2026-03-16-project40-large-transaction-seed.sql](/D:/ccdi/ccdi/assets/database/2026-03-16-project40-large-transaction-seed.sql) + +本次执行前先清理了 `project_id=40` 的旧流水,再重新插入测试数据。最终共落库 `21` 条流水,涉及两名员工和两名家属。 + +## 复用身份 + +- 员工:模型测试员工,身份证 `330101198801010011` +- 家属:模型测试家属,身份证 `330101199001010022` +- 员工:模型二测试员工,身份证 `330101198802020033` +- 家属:模型二测试家属,身份证 `330101199202020044` + +## 阈值依据 + +`project_id=40` 当前没有项目级模型参数,命中判断使用 `project_id=0` 的系统默认参数: + +- 单笔大额收入:`100000` +- 累计大额收入:`50000001` +- 年累计交易额:`50000001` +- 单笔大额存现:`2000001` +- 单日多次存现次数:`5` +- 单笔大额转账金额:`100001` + +## 校验结果 + +### 总量 + +- 项目流水总数:`21` + +### 指标命中 + +- 房车消费支出:命中 `2` 条,流水号 `34262,34263` + - `34262`:模型测试员工,`购买房产首付款`,对手方 `杭州贝壳房地产经纪有限公司` + - `34263`:模型测试家属,`购车首付款`,对手方 `兰溪星耀汽车销售服务有限公司` +- 税务支出交易:命中 `2` 条,流水号 `34264,34265` + - `34264`:模型二测试员工,`个人所得税税款` + - `34265`:模型二测试家属,`房产税务缴税` +- 单笔大额收入:命中 `10` 条 + - 典型流水:`34266`,模型测试员工,收入 `188000.00`,对手方 `杭州启明咨询有限公司` + - 说明:累计收入和存现样本也满足“单笔收入超 100000”的口径,因此命中数大于 1 +- 累计收入超限:命中 `1` 组 + - 命中对象:`330101198802020033` + - 对手方:`浙江远望贸易有限公司` + - 累计收入:`60300000.00` + - 典型流水:`34267,34268,34269` +- 年流水交易额超限:命中 `1` 人 + - 命中对象:`330101198802020033` + - 年交易总额:`74712000.00` + - 主要流水:`34267-34271,34278` +- 单笔大额存现:命中 `6` 条,流水号 `34272,34273,34274,34275,34276,34277` +- 单日多次存现:命中 `1` 组 + - 命中对象:`330101198801010011` + - 日期:`2026-03-10` + - 次数:`6` +- 单笔大额转账:命中 `3` 条,流水号 `34270,34271,34278` + - 典型流水:`34278`,模型二测试员工,`手机银行转账`,支出 `360000.00` + +## 噪声数据 + +为避免页面只出现极端命中样本,补充了少量非命中或用于排除逻辑验证的流水: + +- `34279`:工资代发收入,对手方 `浙江兰溪农村商业银行股份有限公司` +- `34280`:超市消费 +- `34281`:水电费支出 +- `34282`:本人账户划转 + +## 前端验证建议 + +前端本次无需代码改造,直接使用现有项目流水明细页面验证即可。建议按以下方式检查: + +- 进入项目 `40` 的流水明细页,确认可见 `21` 条新增流水 +- 搜索摘要 `首付款`,应能看到 `34262,34263` +- 搜索摘要 `税款` 或对手方 `税务局`,应能看到 `34264,34265` +- 按金额倒序查看收入,应能在前列看到 `34267,34268,34269` +- 按金额倒序查看支出,应能看到 `34270,34271,34278` +- 查看 `34272-34277` 的详情,确认现金存入类摘要与金额展示正常 + +## 执行说明 + +- 首次通过 PowerShell 管道执行时,中文文本被写成了 `?`,随后改用 MySQL `source` 命令并显式指定 `utf8mb4` 后重新导入,最终数据已正确写入。 +- 脚本可重复执行;每次都会先删除 `project_id=40` 现有流水,再重建本次测试数据。