Files
ccdi/docs/reports/implementation/2026-05-06-enterprise-autofill-four-source-retrotest.md

84 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 四类关联业务自动补入实体库回测记录
## 保存路径确认
- 本次实施记录保存于 `docs/reports/implementation/`
## 回测范围
- 员工亲属实体关联自动补入实体库。
- 信贷客户实体关联自动补入实体库。
- 中介关联机构自动补入实体库。
- 招投标供应商自动补入实体库。
## 本次调整
- 修正中介实体关联导入单元测试的旧断言:实体库缺失时不再失败,成功行应调用 `EnterpriseAutoFillService` 自动补入,失败行不补入。
- 修正本地供应商契约测试在 Maven 模块目录下读取仓库根 SQL 的路径口径。
- 业务代码未调整。
## 单元回归
执行命令:
```bash
mvn -pl ccdi-info-collection -am -Dtest=CcdiStaffEnterpriseRelationServiceImplTest,CcdiStaffEnterpriseRelationImportServiceImplTest,CcdiIntermediaryEnterpriseRelationImportServiceImplTest,CcdiIntermediaryServiceImplTest,CcdiPurchaseTransactionFeatureContractTest,CcdiEnterpriseBaseInfoImportServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false test
```
执行结果:
- `Tests run: 24, Failures: 0, Errors: 0, Skipped: 0`
- `BUILD SUCCESS`
## 真实接口回测
后端启动:
```bash
sh bin/restart_java_backend.sh restart
```
本轮使用测试前缀 `RT20260506`,先通过 `bin/mysql_utf8_exec.sh` 写入员工亲属、信贷客户关系人、中介本人三类前置数据,再调用真实后端接口:
| 来源 | 接口 | 统一社会信用代码 | 接口结果 |
| --- | --- | --- | --- |
| 员工亲属 | `POST /ccdi/staffEnterpriseRelation` | `91330100RT20260501` | 操作成功 |
| 信贷客户 | `POST /ccdi/custEnterpriseRelation` | `91330100RT20260502` | 操作成功 |
| 中介 | `POST /ccdi/intermediary/RT20260506IM001/enterprise-relation` | `91330100RT20260503` | 操作成功 |
| 供应商 | `POST /ccdi/purchaseTransaction` | `91330100RT20260504` | 操作成功 |
## 数据库回查
实体库回查结果:
| social_credit_code | enterprise_name | ent_source | data_source | risk_level | created_by |
| --- | --- | --- | --- | --- | --- |
| `91330100RT20260501` | 回测员工亲属自动补入企业 | `EMP_RELATION` | `MANUAL` | `NULL` | `admin` |
| `91330100RT20260502` | 回测信贷客户自动补入企业 | `CREDIT_CUSTOMER` | `MANUAL` | `NULL` | `admin` |
| `91330100RT20260503` | `NULL` | `INTERMEDIARY` | `MANUAL` | `1` | `admin` |
| `91330100RT20260504` | 回测供应商自动补入企业 | `SUPPLIER` | `MANUAL` | `NULL` | `admin` |
关系表回查:
- `ccdi_staff_enterprise_relation`1 条
- `ccdi_cust_enterprise_relation`1 条
- `ccdi_intermediary_enterprise_relation`1 条
- `ccdi_purchase_transaction_supplier`1 条
## 清理结果
执行 `bin/mysql_utf8_exec.sh output/sql/2026-05-06-enterprise-autofill-retrotest-cleanup.sql` 后回查:
- `enterprise_rows=0`
- `staff_relation_rows=0`
- `cust_relation_rows=0`
- `intermediary_relation_rows=0`
- `purchase_rows=0`
- `supplier_rows=0`
## 结论
- 四类来源均可通过真实接口自动补入 `ccdi_enterprise_base_info`
- 来源映射符合预期:员工亲属 `EMP_RELATION`、信贷客户 `CREDIT_CUSTOMER`、中介 `INTERMEDIARY`、供应商 `SUPPLIER`
- 中介来源风险等级自动落为 `1`,其余三类风险等级为空,符合既定规则。