# 2026-03-24 专项核查页员工家庭资产负债专项核查后端实施记录

## 本次新增文件

- 控制器
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/controller/CcdiProjectSpecialCheckController.java`
- 服务
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/ICcdiProjectSpecialCheckService.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/service/impl/CcdiProjectSpecialCheckServiceImpl.java`
- Mapper
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/mapper/CcdiProjectSpecialCheckMapper.java`
  - `ccdi-project/src/main/resources/mapper/ccdi/project/CcdiProjectSpecialCheckMapper.xml`
- DTO
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/dto/CcdiProjectFamilyAssetLiabilityListQueryDTO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/dto/CcdiProjectFamilyAssetLiabilityDetailQueryDTO.java`
- VO
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyAssetLiabilityListItemVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyAssetLiabilityListVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyIncomeDetailVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyAssetItemVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyAssetDetailVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyDebtItemVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyDebtDetailVO.java`
  - `ccdi-project/src/main/java/com/ruoyi/ccdi/project/domain/vo/CcdiProjectFamilyAssetLiabilityDetailVO.java`
- 测试
  - `ccdi-project/src/test/java/com/ruoyi/ccdi/project/controller/CcdiProjectSpecialCheckControllerContractTest.java`
  - `ccdi-project/src/test/java/com/ruoyi/ccdi/project/controller/CcdiProjectSpecialCheckControllerTest.java`
  - `ccdi-project/src/test/java/com/ruoyi/ccdi/project/mapper/CcdiProjectSpecialCheckMapperListSqlTest.java`
  - `ccdi-project/src/test/java/com/ruoyi/ccdi/project/mapper/CcdiProjectSpecialCheckMapperDetailSqlTest.java`
  - `ccdi-project/src/test/java/com/ruoyi/ccdi/project/service/impl/CcdiProjectSpecialCheckServiceImplTest.java`

## 接口与查询口径

### 查询范围

- 员工集合沿用项目内已入库流水命中且能匹配员工主数据的口径
- 员工范围由 `ccdi_bank_statement_tag_result` 结合 `ccdi_base_staff`、`ccdi_bank_statement`、`ccdi_staff_fmy_relation` 反查得到
- 仅对匹配成功的员工输出专项核查结果

### 收入口径

- 本人收入取自 `ccdi_base_staff.annual_income`
- 配偶收入取自 `ccdi_staff_fmy_relation` 中 `relation_type = '配偶'` 的 `annual_income`
- 家庭总年收入 = 本人收入 + 配偶收入，空值按 `0` 处理

### 资产口径

- 资产来源表为 `ccdi_asset_info`
- 以员工身份证号为 `family_id`
- 持有人范围仅统计员工本人身份证号与配偶身份证号
- 家庭总资产按 `current_value` 汇总

### 负债口径

- 负债来源表为 `ccdi_debts_info`
- 归属人范围仅统计员工本人身份证号与配偶身份证号
- 家庭总负债按 `principal_balance` 汇总

### 风险等级口径

- `comparisonAmount = totalIncome + totalDebt`
- `comparisonAmount <= totalAsset * 1.5` 判定为 `NORMAL / 正常`
- `comparisonAmount > totalAsset * 1.5 and <= totalAsset * 3` 判定为 `RISK / 存在风险`
- `comparisonAmount > totalAsset * 3` 判定为 `HIGH / 高风险`

## 详情返回结构

- `incomeDetail` 返回本人收入、配偶收入、家庭总收入
- `assetDetail` 返回本人资产小计、配偶资产小计、家庭总资产、资产明细列表
- `debtDetail` 返回本人负债小计、配偶负债小计、家庭总负债、负债明细列表
- `summary` 返回与列表同口径的汇总金额与风险等级

## 范围说明

- 本次实现仅覆盖员工本人及配偶
- 未扩展父母、子女、兄弟姐妹等其他家庭成员收入、资产、负债口径
- 未复用结果总览员工结果表，也未改动流水打标链路

## 增量调整

### 本人信息缺失口径

- 若员工本人名下不存在资产记录，则标记为“缺少资产信息”
- 若员工本人名下不存在负债记录，则标记为“缺少负债信息”
- 列表与详情 `summary` 统一处理为：
  - 只要本人缺少资产信息或负债信息任一项
  - 风险等级直接输出 `MISSING_INFO / 缺少信息`
  - 不再进入正常、存在风险、高风险三档计算

### 详情结构补充

- `assetDetail` 新增 `missingSelfAssetInfo`
- `debtDetail` 新增 `missingSelfDebtInfo`
- 供前端在详情卡片中控制资产/负债小计显隐
