中介新增 修改接口
66
doc/README.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# 文档目录结构
|
||||
|
||||
本目录包含纪检初核系统的各类文档、测试数据和脚本。
|
||||
|
||||
## 目录说明
|
||||
|
||||
### 📁 docs/
|
||||
项目文档目录
|
||||
- `纪检初核系统功能说明书-V1.0.docx/md` - 系统功能说明书
|
||||
- `纪检初核系统模块划分方案.md` - 模块划分方案
|
||||
- `若依环境使用手册.docx` - 若依框架使用手册
|
||||
- `中介黑名单弹窗优化设计.md` - UI设计文档
|
||||
- `EasyExcel字典下拉框使用说明.md` - Excel导入使用说明
|
||||
|
||||
### 📁 api/
|
||||
API接口文档目录
|
||||
- `员工信息管理API文档.md` - 员工信息管理模块API
|
||||
- `中介黑名单管理API文档.md` - 中介黑名单管理模块API
|
||||
|
||||
### 📁 scripts/
|
||||
测试脚本目录
|
||||
- `test_import.py` - 导入功能测试脚本
|
||||
- `test_import_simple.py` - 简单导入测试脚本
|
||||
- `test_uniqueness_validation.py` - 唯一性校验测试脚本
|
||||
- `generate_test_data.py` - 测试数据生成脚本
|
||||
|
||||
### 📁 test-data/
|
||||
测试数据目录
|
||||
- `个人中介黑名单模板_1769667622015.xlsx` - 导入模板
|
||||
- `个人中介黑名单测试数据_1000条.xlsx` - 测试数据(第1批)
|
||||
- `个人中介黑名单测试数据_1000条_第2批.xlsx` - 测试数据(第2批)
|
||||
- `中介人员信息表.csv` - 中介人员数据
|
||||
- `中介主体信息表.csv` - 中介主体数据
|
||||
|
||||
### 📁 other/
|
||||
其他文件目录
|
||||
- `纪检初核系统-离线演示包/` - 离线演示包(解压版)
|
||||
- `纪检初核系统-离线演示包.zip` - 离线演示包(压缩版)
|
||||
- `ScreenShot_*.png` - 截图文件
|
||||
|
||||
### 📁 modules/
|
||||
模块设计文档目录
|
||||
- `01-项目管理模块/` - 项目管理模块文档
|
||||
- `02-项目工作台/` - 项目工作台模块文档
|
||||
- `03-信息维护模块.md` - 信息维护模块文档
|
||||
- `04-参数配置模块.md` - 参数配置模块文档
|
||||
- `05-系统管理模块.md` - 系统管理模块文档
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 生成测试数据
|
||||
```bash
|
||||
cd doc/scripts
|
||||
python generate_test_data.py
|
||||
```
|
||||
|
||||
### 运行测试脚本
|
||||
```bash
|
||||
cd doc/scripts
|
||||
python test_uniqueness_validation.py
|
||||
```
|
||||
|
||||
### 导入测试数据
|
||||
1. 从 `test-data/` 目录下载对应的Excel文件
|
||||
2. 在系统页面点击"导入"按钮
|
||||
3. 选择文件并上传
|
||||
@@ -134,7 +134,9 @@
|
||||
|
||||
### 3. 新增中介黑名单
|
||||
|
||||
**接口地址**: `POST /dpc/intermediary`
|
||||
#### 3.1 新增个人中介黑名单
|
||||
|
||||
**接口地址**: `POST /dpc/intermediary/person`
|
||||
|
||||
**权限要求**: `dpc:intermediary:add`
|
||||
|
||||
@@ -143,7 +145,15 @@
|
||||
{
|
||||
"name": "张三",
|
||||
"certificateNo": "110101199001011234",
|
||||
"intermediaryType": "1",
|
||||
"indivType": "中介",
|
||||
"indivSubType": "本人",
|
||||
"indivGender": "M",
|
||||
"indivCertType": "身份证",
|
||||
"indivPhone": "13800138000",
|
||||
"indivWechat": "zhangsan",
|
||||
"indivAddress": "北京市朝阳区",
|
||||
"indivCompany": "XX公司",
|
||||
"indivPosition": "经纪人",
|
||||
"status": "0",
|
||||
"remark": "测试数据"
|
||||
}
|
||||
@@ -153,9 +163,19 @@
|
||||
|
||||
| 字段名 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| name | String | 是 | 姓名/机构名称 |
|
||||
| certificateNo | String | 是 | 证件号/统一社会信用代码 |
|
||||
| intermediaryType | String | 是 | 中介类型(1=个人, 2=机构) |
|
||||
| name | String | 是 | 姓名 |
|
||||
| certificateNo | String | 是 | 证件号 |
|
||||
| indivType | String | 否 | 人员类型 |
|
||||
| indivSubType | String | 否 | 人员子类型 |
|
||||
| indivGender | String | 否 | 性别(M男 F女 O其他) |
|
||||
| indivCertType | String | 否 | 证件类型 |
|
||||
| indivPhone | String | 否 | 手机号码 |
|
||||
| indivWechat | String | 否 | 微信号 |
|
||||
| indivAddress | String | 否 | 联系地址 |
|
||||
| indivCompany | String | 否 | 所在公司 |
|
||||
| indivPosition | String | 否 | 职位/职务 |
|
||||
| indivRelatedId | String | 否 | 关联人员ID |
|
||||
| indivRelation | String | 否 | 关联关系 |
|
||||
| status | String | 是 | 状态(0=正常, 1=停用) |
|
||||
| remark | String | 否 | 备注 |
|
||||
|
||||
@@ -167,11 +187,72 @@
|
||||
}
|
||||
```
|
||||
|
||||
#### 3.2 新增机构中介黑名单
|
||||
|
||||
**接口地址**: `POST /dpc/intermediary/entity`
|
||||
|
||||
**权限要求**: `dpc:intermediary:add`
|
||||
|
||||
**请求体**:
|
||||
```json
|
||||
{
|
||||
"name": "XX中介公司",
|
||||
"corpCreditCode": "91110000XXXXXXXXXX",
|
||||
"corpType": "有限责任公司",
|
||||
"corpNature": "民企",
|
||||
"corpIndustryCategory": "房地产",
|
||||
"corpIndustry": "房地产业",
|
||||
"corpEstablishDate": "2020-01-01",
|
||||
"corpAddress": "北京市朝阳区",
|
||||
"corpLegalRep": "张三",
|
||||
"corpLegalCertType": "身份证",
|
||||
"corpLegalCertNo": "110101199001011234",
|
||||
"corpShareholder1": "李四",
|
||||
"corpShareholder2": "王五",
|
||||
"status": "0",
|
||||
"remark": "测试数据"
|
||||
}
|
||||
```
|
||||
|
||||
**字段说明**:
|
||||
|
||||
| 字段名 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| name | String | 是 | 机构名称 |
|
||||
| corpCreditCode | String | 是 | 统一社会信用代码 |
|
||||
| corpType | String | 否 | 主体类型 |
|
||||
| corpNature | String | 否 | 企业性质 |
|
||||
| corpIndustryCategory | String | 否 | 行业分类 |
|
||||
| corpIndustry | String | 否 | 所属行业 |
|
||||
| corpEstablishDate | Date | 否 | 成立日期 |
|
||||
| corpAddress | String | 否 | 注册地址 |
|
||||
| corpLegalRep | String | 否 | 法定代表人 |
|
||||
| corpLegalCertType | String | 否 | 法定代表人证件类型 |
|
||||
| corpLegalCertNo | String | 否 | 法定代表人证件号码 |
|
||||
| corpShareholder1-5 | String | 否 | 股东信息 |
|
||||
| status | String | 是 | 状态(0=正常, 1=停用) |
|
||||
| remark | String | 否 | 备注 |
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
**注意**:
|
||||
- 中介类型由系统自动设置,无需手动传递
|
||||
- 新增个人中介时,机构专属字段会被自动忽略
|
||||
- 新增机构中介时,证件号自动使用统一社会信用代码
|
||||
|
||||
---
|
||||
|
||||
### 4. 修改中介黑名单
|
||||
|
||||
**接口地址**: `PUT /dpc/intermediary`
|
||||
#### 4.1 修改个人中介黑名单
|
||||
|
||||
**接口地址**: `PUT /dpc/intermediary/person`
|
||||
|
||||
**权限要求**: `dpc:intermediary:edit`
|
||||
|
||||
@@ -181,13 +262,42 @@
|
||||
"intermediaryId": 1,
|
||||
"name": "张三",
|
||||
"certificateNo": "110101199001011234",
|
||||
"intermediaryType": "1",
|
||||
"indivType": "中介",
|
||||
"indivSubType": "本人",
|
||||
"indivGender": "M",
|
||||
"indivCertType": "身份证",
|
||||
"indivPhone": "13800138000",
|
||||
"indivWechat": "zhangsan",
|
||||
"indivAddress": "北京市朝阳区",
|
||||
"indivCompany": "XX公司",
|
||||
"indivPosition": "经纪人",
|
||||
"indivRelatedId": null,
|
||||
"indivRelation": null,
|
||||
"status": "0",
|
||||
"remark": "测试数据"
|
||||
}
|
||||
```
|
||||
|
||||
**字段说明**: 与新增接口相同,intermediaryId 为必填项。
|
||||
**字段说明**:
|
||||
|
||||
| 字段名 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| intermediaryId | Long | 是 | 中介ID |
|
||||
| name | String | 是 | 姓名 |
|
||||
| certificateNo | String | 否 | 证件号 |
|
||||
| indivType | String | 否 | 人员类型 |
|
||||
| indivSubType | String | 否 | 人员子类型 |
|
||||
| indivGender | String | 否 | 性别(M男 F女 O其他) |
|
||||
| indivCertType | String | 否 | 证件类型 |
|
||||
| indivPhone | String | 否 | 手机号码 |
|
||||
| indivWechat | String | 否 | 微信号 |
|
||||
| indivAddress | String | 否 | 联系地址 |
|
||||
| indivCompany | String | 否 | 所在公司 |
|
||||
| indivPosition | String | 否 | 职位/职务 |
|
||||
| indivRelatedId | String | 否 | 关联人员ID |
|
||||
| indivRelation | String | 否 | 关联关系 |
|
||||
| status | String | 是 | 状态(0=正常, 1=停用) |
|
||||
| remark | String | 否 | 备注 |
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
@@ -197,6 +307,72 @@
|
||||
}
|
||||
```
|
||||
|
||||
#### 4.2 修改机构中介黑名单
|
||||
|
||||
**接口地址**: `PUT /dpc/intermediary/entity`
|
||||
|
||||
**权限要求**: `dpc:intermediary:edit`
|
||||
|
||||
**请求体**:
|
||||
```json
|
||||
{
|
||||
"intermediaryId": 2,
|
||||
"name": "XX中介公司",
|
||||
"certificateNo": "91110000XXXXXXXXXX",
|
||||
"corpCreditCode": "91110000XXXXXXXXXX",
|
||||
"corpType": "有限责任公司",
|
||||
"corpNature": "民企",
|
||||
"corpIndustryCategory": "房地产",
|
||||
"corpIndustry": "房地产业",
|
||||
"corpEstablishDate": "2020-01-01",
|
||||
"corpAddress": "北京市朝阳区",
|
||||
"corpLegalRep": "张三",
|
||||
"corpLegalCertType": "身份证",
|
||||
"corpLegalCertNo": "110101199001011234",
|
||||
"corpShareholder1": "李四",
|
||||
"corpShareholder2": "王五",
|
||||
"corpShareholder3": null,
|
||||
"corpShareholder4": null,
|
||||
"corpShareholder5": null,
|
||||
"status": "0",
|
||||
"remark": "测试数据"
|
||||
}
|
||||
```
|
||||
|
||||
**字段说明**:
|
||||
|
||||
| 字段名 | 类型 | 必填 | 说明 |
|
||||
|--------|------|------|------|
|
||||
| intermediaryId | Long | 是 | 中介ID |
|
||||
| name | String | 是 | 机构名称 |
|
||||
| certificateNo | String | 否 | 证件号(统一社会信用代码) |
|
||||
| corpCreditCode | String | 否 | 统一社会信用代码 |
|
||||
| corpType | String | 否 | 主体类型 |
|
||||
| corpNature | String | 否 | 企业性质 |
|
||||
| corpIndustryCategory | String | 否 | 行业分类 |
|
||||
| corpIndustry | String | 否 | 所属行业 |
|
||||
| corpEstablishDate | Date | 否 | 成立日期 |
|
||||
| corpAddress | String | 否 | 注册地址 |
|
||||
| corpLegalRep | String | 否 | 法定代表人 |
|
||||
| corpLegalCertType | String | 否 | 法定代表人证件类型 |
|
||||
| corpLegalCertNo | String | 否 | 法定代表人证件号码 |
|
||||
| corpShareholder1-5 | String | 否 | 股东信息 |
|
||||
| status | String | 是 | 状态(0=正常, 1=停用) |
|
||||
| remark | String | 否 | 备注 |
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
**注意**:
|
||||
- 中介类型(intermediaryType)不允许修改,系统会自动根据接口设置正确的类型
|
||||
- 使用个人中介接口时,机构专属字段会被自动清空
|
||||
- 使用机构中介接口时,个人专属字段会被自动清空
|
||||
|
||||
---
|
||||
|
||||
### 5. 删除中介黑名单
|
||||
@@ -402,3 +578,5 @@
|
||||
|------|------|------|
|
||||
| 1.0.0 | 2026-01-29 | 初始版本,支持个人和机构分类管理 |
|
||||
| 1.1.0 | 2026-01-29 | 添加字典下拉框功能,分离个人/机构模板 |
|
||||
| 1.2.0 | 2026-01-29 | 修改接口分离:新增个人/机构专用修改接口,修复中介类型修改问题 |
|
||||
| 1.3.0 | 2026-01-29 | 新增接口分离:新增个人/机构专用新增接口,统一接口设计 |
|
||||
271
doc/api/中介黑名单管理API测试报告.md
Normal file
@@ -0,0 +1,271 @@
|
||||
# 中介黑名单管理API测试报告
|
||||
|
||||
## 测试概述
|
||||
|
||||
**测试时间:** 2026-01-29 16:43:11
|
||||
**测试环境:** http://localhost:8080
|
||||
**测试账号:** admin
|
||||
**测试脚本:** [test_intermediary_blacklist.sh](../scripts/test_intermediary_blacklist.sh)
|
||||
**测试通过率:** 100.00%
|
||||
|
||||
## 测试结果汇总
|
||||
|
||||
| 指标 | 数值 |
|
||||
|------|------|
|
||||
| 测试场景总数 | 11 |
|
||||
| 通过数量 | 11 |
|
||||
| 失败数量 | 0 |
|
||||
| 通过率 | 100.00% |
|
||||
|
||||
## 测试用例详情
|
||||
|
||||
### 1. 登录测试
|
||||
|
||||
**接口:** `POST /login/test`
|
||||
**描述:** 使用测试账号登录获取认证token
|
||||
|
||||
**请求参数:**
|
||||
```json
|
||||
{
|
||||
"username": "admin",
|
||||
"password": "admin123"
|
||||
}
|
||||
```
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功获取token
|
||||
- token格式正确
|
||||
|
||||
---
|
||||
|
||||
### 2. 查询中介黑名单列表
|
||||
|
||||
**接口:** `GET /dpc/intermediary/list`
|
||||
**描述:** 分页查询中介黑名单列表
|
||||
|
||||
**请求参数:**
|
||||
- pageNum: 1
|
||||
- pageSize: 10
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 返回分页数据结构正确
|
||||
- 包含 total 和 rows 字段
|
||||
- 数据格式符合预期
|
||||
|
||||
---
|
||||
|
||||
### 3. 新增个人中介黑名单
|
||||
|
||||
**接口:** `POST /dpc/intermediary`
|
||||
**描述:** 新增个人类型的中介黑名单记录
|
||||
|
||||
**请求参数:**
|
||||
```json
|
||||
{
|
||||
"name": "测试个人中介_20260129_164311",
|
||||
"certificateNo": "TESTCERT20260129_164311",
|
||||
"intermediaryType": "1",
|
||||
"remark": "自动化测试数据"
|
||||
}
|
||||
```
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功创建记录
|
||||
- 返回状态码 200
|
||||
- 成功获取到新创建的ID: 2005
|
||||
|
||||
---
|
||||
|
||||
### 4. 新增机构中介黑名单
|
||||
|
||||
**接口:** `POST /dpc/intermediary`
|
||||
**描述:** 新增机构类型的中介黑名单记录
|
||||
|
||||
**请求参数:**
|
||||
```json
|
||||
{
|
||||
"name": "测试机构中介_20260129_164311",
|
||||
"certificateNo": "TESTORG20260129_164311",
|
||||
"intermediaryType": "2",
|
||||
"remark": "自动化测试机构数据"
|
||||
}
|
||||
```
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功创建记录
|
||||
- 返回状态码 200
|
||||
- 成功获取到新创建的ID: 2006
|
||||
|
||||
---
|
||||
|
||||
### 5. 获取中介详情
|
||||
|
||||
**接口:** `GET /dpc/intermediary/{intermediaryId}`
|
||||
**描述:** 根据ID获取中介详细信息
|
||||
|
||||
**请求参数:**
|
||||
- intermediaryId: 2005
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功获取详情信息
|
||||
- 返回完整的数据结构
|
||||
- 包含所有必要字段
|
||||
|
||||
---
|
||||
|
||||
### 6. 修改中介黑名单
|
||||
|
||||
**接口:** `PUT /dpc/intermediary`
|
||||
**描述:** 修改已存在的中介信息
|
||||
|
||||
**请求参数:**
|
||||
```json
|
||||
{
|
||||
"intermediaryId": 2005,
|
||||
"name": "测试个人中介_修改",
|
||||
"certificateNo": "TESTCERT20260129_164311",
|
||||
"intermediaryType": "1",
|
||||
"status": "1",
|
||||
"remark": "修改后的自动化测试数据"
|
||||
}
|
||||
```
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功更新记录
|
||||
- 返回状态码 200
|
||||
- 数据修改生效
|
||||
|
||||
---
|
||||
|
||||
### 7. 导出中介黑名单列表
|
||||
|
||||
**接口:** `POST /dpc/intermediary/export`
|
||||
**描述:** 导出中介黑名单数据为Excel文件
|
||||
|
||||
**请求参数:**
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功导出Excel文件
|
||||
- 文件格式正确
|
||||
- 文件保存至: test_output/test6_export.xlsx
|
||||
|
||||
---
|
||||
|
||||
### 8. 下载个人中介导入模板
|
||||
|
||||
**接口:** `POST /dpc/intermediary/importPersonTemplate`
|
||||
**描述:** 下载个人中介导入Excel模板
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功下载模板文件
|
||||
- 文件格式正确
|
||||
- 文件保存至: test_output/test7_person_template.xlsx
|
||||
|
||||
---
|
||||
|
||||
### 9. 下载机构中介导入模板
|
||||
|
||||
**接口:** `POST /dpc/intermediary/importEntityTemplate`
|
||||
**描述:** 下载机构中介导入Excel模板
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功下载模板文件
|
||||
- 文件格式正确
|
||||
- 文件保存至: test_output/test8_entity_template.xlsx
|
||||
|
||||
---
|
||||
|
||||
### 10. 条件查询(按中介类型)
|
||||
|
||||
**接口:** `GET /dpc/intermediary/list`
|
||||
**描述:** 按中介类型筛选查询
|
||||
|
||||
**请求参数:**
|
||||
- pageNum: 1
|
||||
- pageSize: 10
|
||||
- intermediaryType: 1 (个人)
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 查询结果正确
|
||||
- 数据筛选生效
|
||||
- 返回指定类型的数据
|
||||
|
||||
---
|
||||
|
||||
### 11. 条件查询(按状态)
|
||||
|
||||
**接口:** `GET /dpc/intermediary/list`
|
||||
**描述:** 按状态筛选查询
|
||||
|
||||
**请求参数:**
|
||||
- pageNum: 1
|
||||
- pageSize: 10
|
||||
- status: 1
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 查询结果正确
|
||||
- 数据筛选生效
|
||||
- 返回指定状态的数据
|
||||
|
||||
---
|
||||
|
||||
### 12. 删除中介黑名单
|
||||
|
||||
**接口:** `DELETE /dpc/intermediary/{intermediaryIds}`
|
||||
**描述:** 批量删除中介黑名单记录
|
||||
|
||||
**请求参数:**
|
||||
- intermediaryIds: 2005,2006
|
||||
|
||||
**测试结果:** ✅ 通过
|
||||
- 成功删除记录
|
||||
- 返回状态码 200
|
||||
- 数据删除生效
|
||||
|
||||
---
|
||||
|
||||
## 测试文件清单
|
||||
|
||||
### 响应JSON文件
|
||||
- `test1_list_response.json` - 查询列表响应
|
||||
- `test2_add_person_response.json` - 新增个人中介响应
|
||||
- `test3_add_entity_response.json` - 新增机构中介响应
|
||||
- `test4_get_info_response.json` - 获取详情响应
|
||||
- `test5_edit_response.json` - 修改中介响应
|
||||
- `test9_remove_response.json` - 删除中介响应
|
||||
- `test10_query_by_type_response.json` - 按类型查询响应
|
||||
- `test11_query_by_status_response.json` - 按状态查询响应
|
||||
|
||||
### Excel文件
|
||||
- `test6_export.xlsx` - 导出的数据文件
|
||||
- `test7_person_template.xlsx` - 个人中介导入模板
|
||||
- `test8_entity_template.xlsx` - 机构中介导入模板
|
||||
|
||||
### 报告文件
|
||||
- `test_report_20260129_164311.txt` - 详细测试日志
|
||||
|
||||
## 结论
|
||||
|
||||
**所有测试用例均已通过,中介黑名单管理API功能完整且运行正常。**
|
||||
|
||||
### 主要验证点
|
||||
1. ✅ 认证授权机制正常
|
||||
2. ✅ CRUD操作功能完整
|
||||
3. ✅ 分页查询功能正常
|
||||
4. ✅ 条件筛选功能正常
|
||||
5. ✅ 文件导入导出功能正常
|
||||
6. ✅ 批量操作功能正常
|
||||
|
||||
### 建议
|
||||
1. 建议在实际部署前进行压力测试
|
||||
2. 建议添加更多的边界条件测试用例
|
||||
3. 建议完善错误码和错误信息的文档
|
||||
|
||||
---
|
||||
|
||||
**报告生成时间:** 2026-01-29 16:43:11
|
||||
**测试工具:** curl + bash
|
||||
**报告生成者:** Claude Code
|
||||
153
doc/docs/中介黑名单弹窗优化设计.md
Normal file
@@ -0,0 +1,153 @@
|
||||
# 中介黑名单弹窗优化设计
|
||||
|
||||
## 需求概述
|
||||
|
||||
优化中介黑名单的添加弹窗交互流程:
|
||||
1. 点击新增后先选择中介类型(个人/机构)
|
||||
2. 然后弹出对应类型的信息输入窗口
|
||||
3. 不需要tab栏,直接显示对应类型的表单
|
||||
4. 机构类型只需输入一次证件号,该值同时作为"证件号"和"统一社会信用代码"
|
||||
|
||||
## 设计方案
|
||||
|
||||
### 1. 交互流程
|
||||
|
||||
**新增操作流程:**
|
||||
|
||||
1. 用户点击"新增"按钮
|
||||
2. 弹出一个简洁的对话框,顶部有两个大卡片式按钮:【个人】和【机构】
|
||||
3. 用户点击其中一个类型按钮
|
||||
4. 对应的表单立即展开显示在下方(无需确认操作)
|
||||
5. 用户填写信息后点击"确定"提交
|
||||
|
||||
**修改操作:**
|
||||
- 修改时直接显示原有数据的表单,不允许切换类型
|
||||
|
||||
### 2. 界面布局
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ 添加中介黑名单 │
|
||||
├─────────────────────────────────────┤
|
||||
│ │
|
||||
│ ┌─────────┐ ┌─────────┐ │
|
||||
│ │ 个人 │ │ 机构 │ │ ← 大卡片式选择按钮(仅新增时显示)
|
||||
│ └─────────┘ └─────────┘ │
|
||||
│ │
|
||||
│ ──────────────────────────────── │ ← 分隔线
|
||||
│ │
|
||||
│ [对应类型的表单字段] │
|
||||
│ • 姓名/机构名称 │
|
||||
│ • 证件号 │
|
||||
│ • 机构类型:统一社会信用代码 │
|
||||
│ • 其他选填字段... │
|
||||
│ │
|
||||
├─────────────────────────────────────┤
|
||||
│ [ 确定 ] [ 取消 ] │
|
||||
└─────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### 3. 表单字段
|
||||
|
||||
**个人类型表单字段:**
|
||||
- 姓名/机构名称*(必填)
|
||||
- 证件号*(必填)
|
||||
- 人员类型
|
||||
- 人员子类型
|
||||
- 性别
|
||||
- 证件类型
|
||||
- 手机号码
|
||||
- 微信号
|
||||
- 联系地址
|
||||
- 所在公司
|
||||
- 职位
|
||||
- 关联人员ID
|
||||
- 关联关系
|
||||
- 备注
|
||||
|
||||
**机构类型表单字段:**
|
||||
- 姓名/机构名称*(必填)
|
||||
- 证件号*(必填,自动同步到统一社会信用代码)
|
||||
- 主体类型
|
||||
- 企业性质
|
||||
- 成立日期
|
||||
- 行业分类
|
||||
- 所属行业
|
||||
- 注册地址
|
||||
- 法定代表人
|
||||
- 法定代表人证件类型
|
||||
- 法定代表人证件号码
|
||||
- 股东1-5
|
||||
- 备注
|
||||
|
||||
### 4. 表单验证规则
|
||||
|
||||
**个人类型验证:**
|
||||
```javascript
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "姓名长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ required: true, message: "证件号不能为空", trigger: "blur" },
|
||||
{ max: 50, message: "证件号长度不能超过50个字符", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**机构类型验证:**
|
||||
```javascript
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "机构名称不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "机构名称长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ required: true, message: "证件号不能为空", trigger: "blur" },
|
||||
{ max: 18, message: "统一社会信用代码长度为18位", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 5. 边界情况处理
|
||||
|
||||
| 场景 | 处理方式 |
|
||||
|------|----------|
|
||||
| 用户点击新增后未选择类型就点确定 | 禁用"确定"按钮,直到选择类型 |
|
||||
| 用户选择类型后想重新选择 | 只有关闭弹窗重新打开才能选择 |
|
||||
| 修改操作时类型锁定 | 隐藏类型选择器,直接显示对应表单 |
|
||||
| 表单验证失败 | 高亮显示错误字段,滚动到第一个错误位置 |
|
||||
| 网络请求失败 | 显示错误提示,弹窗保持打开状态 |
|
||||
|
||||
### 6. 用户体验优化
|
||||
|
||||
1. **视觉反馈**:
|
||||
- 类型选择按钮在未选中时有hover效果
|
||||
- 选中后按钮变为高亮状态,其他按钮变灰
|
||||
- 表单展开有淡入动画
|
||||
|
||||
2. **输入提示**:
|
||||
- 个人类型的证件号字段下方显示提示:"请输入证件号码"
|
||||
- 机构类型的证件号字段下方显示提示:"统一社会信用代码(18位)"
|
||||
|
||||
3. **表单布局**:
|
||||
- 保持两列布局,充分利用空间
|
||||
- 必填项(姓名、证件号)标记红色星号
|
||||
|
||||
### 7. 技术实现要点
|
||||
|
||||
**状态管理:**
|
||||
- 新增模式:`isAddMode: true`,显示类型选择器
|
||||
- 修改模式:`isAddMode: false`,隐藏类型选择器
|
||||
- 已选类型:`selectedType: '1' | '2' | null`
|
||||
|
||||
**数据同步:**
|
||||
- 机构类型提交时,将 `form.certificateNo` 的值同时赋给 `form.corpCreditCode`
|
||||
|
||||
BIN
doc/other/ScreenShot_2026-01-29_155814_876.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
162
doc/other/中介黑名单导入功能修复说明.md
Normal file
@@ -0,0 +1,162 @@
|
||||
# 中介黑名单导入功能修复说明
|
||||
|
||||
## 问题描述
|
||||
|
||||
在导入机构中介黑名单数据时,出现以下错误:
|
||||
|
||||
```
|
||||
Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'certificate_no' cannot be null
|
||||
```
|
||||
|
||||
## 问题原因
|
||||
|
||||
1. **数据库约束**:`dpc_intermediary_blacklist` 表的 `certificate_no` 字段设置为 `NOT NULL`,不允许存储 null 值。
|
||||
|
||||
2. **代码缺陷**:在 `DpcIntermediaryBlacklistServiceImpl.java` 的 `importEntityIntermediary` 方法中,导入机构中介时只设置了 `corpCreditCode`(统一社会信用代码),但没有设置 `certificateNo` 字段,导致该字段为 null。
|
||||
|
||||
3. **批量插入失败**:`batchInsert` 方法明确插入 `certificate_no` 字段,当值为 null 时违反数据库约束。
|
||||
|
||||
## 解决方案
|
||||
|
||||
### 1. 代码修改
|
||||
|
||||
**文件**:[DpcIntermediaryBlacklistServiceImpl.java](d:\discipline-prelim-check\discipline-prelim-check\ruoyi-dpc\src\main\java\com\ruoyi\dpc\service\impl\DpcIntermediaryBlacklistServiceImpl.java)
|
||||
|
||||
**修改位置**:第 390-394 行
|
||||
|
||||
**修改前**:
|
||||
```java
|
||||
// 转换为实体
|
||||
DpcIntermediaryBlacklist intermediary = new DpcIntermediaryBlacklist();
|
||||
intermediary.setName(excel.getName());
|
||||
intermediary.setIntermediaryType("2");
|
||||
```
|
||||
|
||||
**修改后**:
|
||||
```java
|
||||
// 转换为实体
|
||||
DpcIntermediaryBlacklist intermediary = new DpcIntermediaryBlacklist();
|
||||
intermediary.setName(excel.getName());
|
||||
// 对于机构中介,使用统一社会信用代码作为证件号
|
||||
intermediary.setCertificateNo(excel.getCorpCreditCode());
|
||||
intermediary.setIntermediaryType("2");
|
||||
```
|
||||
|
||||
### 2. 验证逻辑增强
|
||||
|
||||
**文件**:[DpcIntermediaryBlacklistServiceImpl.java](d:\discipline-prelim-check\discipline-prelim-check\ruoyi-dpc\src\main\java\com\ruoyi\dpc\service\impl\DpcIntermediaryBlacklistServiceImpl.java)
|
||||
|
||||
**修改位置**:第 484-488 行
|
||||
|
||||
**修改前**:
|
||||
```java
|
||||
private void validateEntityIntermediaryData(DpcIntermediaryEntityExcel excel) {
|
||||
if (StringUtils.isEmpty(excel.getName())) {
|
||||
throw new RuntimeException("机构名称不能为空");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**修改后**:
|
||||
```java
|
||||
private void validateEntityIntermediaryData(DpcIntermediaryEntityExcel excel) {
|
||||
if (StringUtils.isEmpty(excel.getName())) {
|
||||
throw new RuntimeException("机构名称不能为空");
|
||||
}
|
||||
// 验证统一社会信用代码不能为空(因为会用作 certificate_no 字段)
|
||||
if (StringUtils.isEmpty(excel.getCorpCreditCode())) {
|
||||
throw new RuntimeException("统一社会信用代码不能为空");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 批量更新 XML 配置优化
|
||||
|
||||
**文件**:[DpcIntermediaryBlacklistMapper.xml](d:\discipline-prelim-check\discipline-prelim-check\ruoyi-dpc\src\main\resources\mapper\dpc\DpcIntermediaryBlacklistMapper.xml)
|
||||
|
||||
**修改位置**:第 125-127 行
|
||||
|
||||
**修改前**:
|
||||
```xml
|
||||
<if test="item.dataSource != null">data_source = #{item.dataSource},</if>
|
||||
update_by = #{item.updateBy},
|
||||
update_time = #{item.updateTime}
|
||||
```
|
||||
|
||||
**修改后**:
|
||||
```xml
|
||||
<if test="item.dataSource != null">data_source = #{item.dataSource},</if>
|
||||
<if test="item.certificateNo != null">certificate_no = #{item.certificateNo},</if>
|
||||
update_by = #{item.updateBy},
|
||||
update_time = #{item.updateTime}
|
||||
```
|
||||
|
||||
## 设计说明
|
||||
|
||||
### 为什么使用统一社会信用代码作为证件号?
|
||||
|
||||
1. **数据一致性**:统一社会信用代码本身就是机构的法定证件号,将其同时存储在 `certificate_no` 字段中可以保持数据的一致性。
|
||||
|
||||
2. **查询便利**:`certificate_no` 字段有索引,设置后可以快速查询机构中介。
|
||||
|
||||
3. **兼容性好**:个人中介和机构中介都使用 `certificate_no` 字段,查询逻辑更统一。
|
||||
|
||||
4. **不破坏现有结构**:不需要修改数据库表结构,只修改代码逻辑。
|
||||
|
||||
## 测试验证
|
||||
|
||||
### 测试用例
|
||||
|
||||
1. **个人中介导入**:正常导入个人中介数据,验证 `certificate_no` 字段正确存储身份证号。
|
||||
|
||||
2. **机构中介导入**:导入机构中介数据,验证 `certificate_no` 字段正确存储统一社会信用代码。
|
||||
|
||||
3. **统一社会信用代码为空**:验证当统一社会信用代码为空时,导入被正确拒绝并给出错误提示。
|
||||
|
||||
4. **批量更新**:验证批量更新时 `certificate_no` 字段能够正确更新。
|
||||
|
||||
### 测试脚本
|
||||
|
||||
测试脚本位于:[doc/test-data/test_import_fix.py](d:\discipline-prelim-check\discipline-prelim-check\doc\test-data\test_import_fix.py)
|
||||
|
||||
运行测试:
|
||||
```bash
|
||||
python doc/test-data/test_import_fix.py
|
||||
```
|
||||
|
||||
## 影响范围
|
||||
|
||||
### 已影响的功能
|
||||
- 机构中介批量导入功能
|
||||
|
||||
### 不影响的功能
|
||||
- 个人中介导入功能
|
||||
- 手动新增中介功能
|
||||
- 中介查询功能
|
||||
- 中介导出功能
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **数据迁移**:如果数据库中已存在机构中介数据且 `certificate_no` 为 null,需要执行以下 SQL 进行数据修复:
|
||||
|
||||
```sql
|
||||
UPDATE dpc_intermediary_blacklist
|
||||
SET certificate_no = corp_credit_code
|
||||
WHERE intermediary_type = '2' AND certificate_no IS NULL AND corp_credit_code IS NOT NULL;
|
||||
```
|
||||
|
||||
2. **Excel 模板**:确保导入模板中统一社会信用代码字段设置为必填项。
|
||||
|
||||
3. **前端验证**:建议在前端表单中也添加统一社会信用代码的必填验证。
|
||||
|
||||
## 修改文件列表
|
||||
|
||||
1. [DpcIntermediaryBlacklistServiceImpl.java](d:\discipline-prelim-check\discipline-prelim-check\ruoyi-dpc\src\main\java\com\ruoyi\dpc\service\impl\DpcIntermediaryBlacklistServiceImpl.java) - 服务层实现
|
||||
2. [DpcIntermediaryBlacklistMapper.xml](d:\discipline-prelim-check\discipline-prelim-check\ruoyi-dpc\src\main\resources\mapper\dpc\DpcIntermediaryBlacklistMapper.xml) - MyBatis 映射文件
|
||||
3. [test_import_fix.py](d:\discipline-prelim-check\discipline-prelim-check\doc\test-data\test_import_fix.py) - 测试脚本
|
||||
|
||||
## 版本历史
|
||||
|
||||
| 版本 | 日期 | 作者 | 说明 |
|
||||
|------|------|------|------|
|
||||
| 1.0 | 2026-01-29 | ruoyi | 初始版本,修复机构中介导入时 certificate_no 为 null 的问题 |
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 379 KiB After Width: | Height: | Size: 379 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 351 KiB After Width: | Height: | Size: 351 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 375 KiB After Width: | Height: | Size: 375 KiB |
|
Before Width: | Height: | Size: 665 KiB After Width: | Height: | Size: 665 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |