1052 lines
26 KiB
Markdown
1052 lines
26 KiB
Markdown
|
|
# 流水分析接口更新实施计划
|
|||
|
|
|
|||
|
|
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
|||
|
|
|
|||
|
|
**目标:** 按照新版接口文档完全重构流水分析模块,更新接口2、3、4、7,删除接口5、6
|
|||
|
|
|
|||
|
|
**架构:** 基于Spring Boot 3的REST API客户端模块,使用RestTemplate进行HTTP调用,Lombok简化DTO定义
|
|||
|
|
|
|||
|
|
**技术栈:** Spring Boot 3.5.8, Java 17, Lombok, RestTemplate, SpringDoc OpenAPI
|
|||
|
|
|
|||
|
|
**前置条件:**
|
|||
|
|
- 项目已存在 ccdi-lsfx 模块
|
|||
|
|
- 现有7个接口的DTO和Client已实现
|
|||
|
|
- 需要参考新版文档:`doc/对接流水分析/兰溪-流水分析对接-新版.md`
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 任务概览
|
|||
|
|
|
|||
|
|
| 任务 | 说明 | 文件数 |
|
|||
|
|
|------|------|--------|
|
|||
|
|
| Task 1 | 更新配置文件 | 1 |
|
|||
|
|
| Task 2 | 删除废弃DTO类 | 3 |
|
|||
|
|
| Task 3 | 重构接口2(上传文件)Response | 1 |
|
|||
|
|
| Task 4 | 重构接口3(拉取行内流水)Request和Response | 2 |
|
|||
|
|
| Task 5 | 重构接口4(检查解析状态)Response | 1 |
|
|||
|
|
| Task 6 | 重构接口7(获取流水)Request和Response | 2 |
|
|||
|
|
| Task 7 | 更新Client客户端 | 1 |
|
|||
|
|
| Task 8 | 更新TestController | 1 |
|
|||
|
|
| Task 9 | 编译验证和测试 | - |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 1: 更新配置文件
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 修改: `ruoyi-admin/src/main/resources/application-dev.yml:105-130`
|
|||
|
|
|
|||
|
|
**步骤 1: 删除接口5和接口6的配置项**
|
|||
|
|
|
|||
|
|
定位到 `lsfx.api.endpoints` 部分,删除以下两行:
|
|||
|
|
|
|||
|
|
```yaml
|
|||
|
|
generate-report: /watson/api/project/confirmStageUploadLogs
|
|||
|
|
check-report-status: /watson/api/project/upload/getallpendings
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 更新接口7的路径**
|
|||
|
|
|
|||
|
|
修改 `get-bank-statement` 配置:
|
|||
|
|
|
|||
|
|
```yaml
|
|||
|
|
# 旧路径:get-bank-statement: /watson/api/project/upload/getBankStatement
|
|||
|
|
get-bank-statement: /watson/api/project/getBSByLogId # 新路径
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 验证配置**
|
|||
|
|
|
|||
|
|
完整的endpoints配置应该是:
|
|||
|
|
|
|||
|
|
```yaml
|
|||
|
|
endpoints:
|
|||
|
|
get-token: /account/common/getToken
|
|||
|
|
upload-file: /watson/api/project/remoteUploadSplitFile
|
|||
|
|
fetch-inner-flow: /watson/api/project/getJZFileOrZjrcuFile
|
|||
|
|
check-parse-status: /watson/api/project/upload/getpendings
|
|||
|
|
get-bank-statement: /watson/api/project/getBSByLogId
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 4: 提交配置更新**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ruoyi-admin/src/main/resources/application-dev.yml
|
|||
|
|
git commit -m "config(lsfx): 删除接口5、6配置,更新接口7路径"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 2: 删除废弃DTO类
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 删除: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/GenerateReportRequest.java`
|
|||
|
|
- 删除: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/GenerateReportResponse.java`
|
|||
|
|
- 删除: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/CheckReportStatusResponse.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 删除GenerateReportRequest.java**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
rm ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/GenerateReportRequest.java
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 删除GenerateReportResponse.java**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
rm ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/GenerateReportResponse.java
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 删除CheckReportStatusResponse.java**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
rm ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/CheckReportStatusResponse.java
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 4: 提交删除操作**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add -A ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/
|
|||
|
|
git commit -m "refactor(lsfx): 删除接口5(生成报告)和接口6(检查报告状态)的DTO类"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 3: 重构接口2(上传文件)Response DTO
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/UploadFileResponse.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 完全重写UploadFileResponse.java**
|
|||
|
|
|
|||
|
|
用以下完整代码替换整个文件:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.response;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
import java.util.List;
|
|||
|
|
import java.util.Map;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 上传文件响应(完整版,匹配新文档2.5节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class UploadFileResponse {
|
|||
|
|
|
|||
|
|
/** 返回码 */
|
|||
|
|
private String code;
|
|||
|
|
|
|||
|
|
/** 状态 */
|
|||
|
|
private String status;
|
|||
|
|
|
|||
|
|
/** 成功标识 */
|
|||
|
|
private Boolean successResponse;
|
|||
|
|
|
|||
|
|
/** 响应数据 */
|
|||
|
|
private UploadData data;
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class UploadData {
|
|||
|
|
/** 账号映射信息(key为logId) */
|
|||
|
|
private Map<String, List<AccountInfo>> accountsOfLog;
|
|||
|
|
|
|||
|
|
/** 上传日志列表 */
|
|||
|
|
private List<UploadLogItem> uploadLogList;
|
|||
|
|
|
|||
|
|
/** 上传状态 */
|
|||
|
|
private Integer uploadStatus;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class AccountInfo {
|
|||
|
|
/** 所属银行 */
|
|||
|
|
private String bank;
|
|||
|
|
|
|||
|
|
/** 账号名称 */
|
|||
|
|
private String accountName;
|
|||
|
|
|
|||
|
|
/** 账号 */
|
|||
|
|
private String accountNo;
|
|||
|
|
|
|||
|
|
/** 币种 */
|
|||
|
|
private String currency;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class UploadLogItem {
|
|||
|
|
/** 账号列表 */
|
|||
|
|
private List<String> accountNoList;
|
|||
|
|
|
|||
|
|
/** 银行名称 */
|
|||
|
|
private String bankName;
|
|||
|
|
|
|||
|
|
/** 数据类型信息 [格式, 分隔符] */
|
|||
|
|
private List<String> dataTypeInfo;
|
|||
|
|
|
|||
|
|
/** 下载文件名 */
|
|||
|
|
private String downloadFileName;
|
|||
|
|
|
|||
|
|
/** 企业名称列表 */
|
|||
|
|
private List<String> enterpriseNameList;
|
|||
|
|
|
|||
|
|
/** 文件包ID */
|
|||
|
|
private String filePackageId;
|
|||
|
|
|
|||
|
|
/** 文件大小(字节) */
|
|||
|
|
private Long fileSize;
|
|||
|
|
|
|||
|
|
/** 上传用户ID */
|
|||
|
|
private Integer fileUploadBy;
|
|||
|
|
|
|||
|
|
/** 上传用户名 */
|
|||
|
|
private String fileUploadByUserName;
|
|||
|
|
|
|||
|
|
/** 上传时间 */
|
|||
|
|
private String fileUploadTime;
|
|||
|
|
|
|||
|
|
/** 企业ID */
|
|||
|
|
private Integer leId;
|
|||
|
|
|
|||
|
|
/** 文件ID(重要) */
|
|||
|
|
private Integer logId;
|
|||
|
|
|
|||
|
|
/** 日志元数据 */
|
|||
|
|
private String logMeta;
|
|||
|
|
|
|||
|
|
/** 日志类型 */
|
|||
|
|
private String logType;
|
|||
|
|
|
|||
|
|
/** 登录企业ID */
|
|||
|
|
private Integer loginLeId;
|
|||
|
|
|
|||
|
|
/** 真实银行名称 */
|
|||
|
|
private String realBankName;
|
|||
|
|
|
|||
|
|
/** 行数 */
|
|||
|
|
private Integer rows;
|
|||
|
|
|
|||
|
|
/** 来源 */
|
|||
|
|
private String source;
|
|||
|
|
|
|||
|
|
/** 状态(-5表示成功) */
|
|||
|
|
private Integer status;
|
|||
|
|
|
|||
|
|
/** 模板名称 */
|
|||
|
|
private String templateName;
|
|||
|
|
|
|||
|
|
/** 总记录数 */
|
|||
|
|
private Integer totalRecords;
|
|||
|
|
|
|||
|
|
/** 交易结束日期ID */
|
|||
|
|
private Integer trxDateEndId;
|
|||
|
|
|
|||
|
|
/** 交易开始日期ID */
|
|||
|
|
private Integer trxDateStartId;
|
|||
|
|
|
|||
|
|
/** 上传文件名 */
|
|||
|
|
private String uploadFileName;
|
|||
|
|
|
|||
|
|
/** 上传状态描述 */
|
|||
|
|
private String uploadStatusDesc;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/UploadFileResponse.java
|
|||
|
|
git commit -m "refactor(lsfx): 重构接口2 Response,添加完整字段(accountsOfLog、uploadLogList)"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 4: 重构接口3(拉取行内流水)Request和Response DTO
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/FetchInnerFlowRequest.java`
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/FetchInnerFlowResponse.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 完全重写FetchInnerFlowRequest.java**
|
|||
|
|
|
|||
|
|
用以下代码替换整个文件:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.request;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 拉取行内流水请求参数(匹配新文档3.2节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class FetchInnerFlowRequest {
|
|||
|
|
|
|||
|
|
/** 项目ID */
|
|||
|
|
private Integer groupId;
|
|||
|
|
|
|||
|
|
/** 客户身份证号 */
|
|||
|
|
private String customerNo;
|
|||
|
|
|
|||
|
|
/** 数据渠道编码(固定值:ZJRCU) */
|
|||
|
|
private String dataChannelCode;
|
|||
|
|
|
|||
|
|
/** 发起请求的时间(格式:yyyyMMdd) */
|
|||
|
|
private Integer requestDateId;
|
|||
|
|
|
|||
|
|
/** 拉取开始日期(格式:yyyyMMdd) */
|
|||
|
|
private Integer dataStartDateId;
|
|||
|
|
|
|||
|
|
/** 拉取结束日期(格式:yyyyMMdd) */
|
|||
|
|
private Integer dataEndDateId;
|
|||
|
|
|
|||
|
|
/** 柜员号 */
|
|||
|
|
private Integer uploadUserId;
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 完全重写FetchInnerFlowResponse.java**
|
|||
|
|
|
|||
|
|
用以下代码替换整个文件:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.response;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 拉取行内流水响应(匹配新文档3.5节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class FetchInnerFlowResponse {
|
|||
|
|
|
|||
|
|
/** 返回码 */
|
|||
|
|
private String code;
|
|||
|
|
|
|||
|
|
/** 状态 */
|
|||
|
|
private String status;
|
|||
|
|
|
|||
|
|
/** 成功标识 */
|
|||
|
|
private Boolean successResponse;
|
|||
|
|
|
|||
|
|
/** 响应数据 */
|
|||
|
|
private FetchData data;
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class FetchData {
|
|||
|
|
/** 状态码(如:501014表示无行内流水文件) */
|
|||
|
|
private String code;
|
|||
|
|
|
|||
|
|
/** 消息(如:无行内流水文件) */
|
|||
|
|
private String message;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/FetchInnerFlowRequest.java
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/FetchInnerFlowResponse.java
|
|||
|
|
git commit -m "refactor(lsfx): 重构接口3 Request/Response,修正参数名和字段结构"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 5: 重构接口4(检查解析状态)Response DTO
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/CheckParseStatusResponse.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 完全重写CheckParseStatusResponse.java**
|
|||
|
|
|
|||
|
|
用以下代码替换整个文件:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.response;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
import java.util.List;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 检查文件解析状态响应(匹配新文档4.5节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class CheckParseStatusResponse {
|
|||
|
|
|
|||
|
|
/** 返回码 */
|
|||
|
|
private String code;
|
|||
|
|
|
|||
|
|
/** 状态 */
|
|||
|
|
private String status;
|
|||
|
|
|
|||
|
|
/** 成功标识 */
|
|||
|
|
private Boolean successResponse;
|
|||
|
|
|
|||
|
|
/** 响应数据 */
|
|||
|
|
private ParseStatusData data;
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class ParseStatusData {
|
|||
|
|
/** 是否正在解析(true=解析中,false=解析结束)- 关键字段 */
|
|||
|
|
private Boolean parsing;
|
|||
|
|
|
|||
|
|
/** 待处理文件列表 */
|
|||
|
|
private List<PendingItem> pendingList;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class PendingItem {
|
|||
|
|
/** 账号列表 */
|
|||
|
|
private List<String> accountNoList;
|
|||
|
|
|
|||
|
|
/** 银行名称 */
|
|||
|
|
private String bankName;
|
|||
|
|
|
|||
|
|
/** 数据类型信息 */
|
|||
|
|
private List<String> dataTypeInfo;
|
|||
|
|
|
|||
|
|
/** 下载文件名 */
|
|||
|
|
private String downloadFileName;
|
|||
|
|
|
|||
|
|
/** 企业名称列表 */
|
|||
|
|
private List<String> enterpriseNameList;
|
|||
|
|
|
|||
|
|
/** 文件包ID */
|
|||
|
|
private String filePackageId;
|
|||
|
|
|
|||
|
|
/** 文件大小(字节) */
|
|||
|
|
private Long fileSize;
|
|||
|
|
|
|||
|
|
/** 上传用户ID */
|
|||
|
|
private Integer fileUploadBy;
|
|||
|
|
|
|||
|
|
/** 上传用户名 */
|
|||
|
|
private String fileUploadByUserName;
|
|||
|
|
|
|||
|
|
/** 上传时间 */
|
|||
|
|
private String fileUploadTime;
|
|||
|
|
|
|||
|
|
/** 是否拆分 */
|
|||
|
|
private Integer isSplit;
|
|||
|
|
|
|||
|
|
/** 企业ID */
|
|||
|
|
private Integer leId;
|
|||
|
|
|
|||
|
|
/** 文件ID(重要) */
|
|||
|
|
private Integer logId;
|
|||
|
|
|
|||
|
|
/** 日志元数据 */
|
|||
|
|
private String logMeta;
|
|||
|
|
|
|||
|
|
/** 日志类型 */
|
|||
|
|
private String logType;
|
|||
|
|
|
|||
|
|
/** 登录企业ID */
|
|||
|
|
private Integer loginLeId;
|
|||
|
|
|
|||
|
|
/** 丢失的表头 */
|
|||
|
|
private List<String> lostHeader;
|
|||
|
|
|
|||
|
|
/** 真实银行名称 */
|
|||
|
|
private String realBankName;
|
|||
|
|
|
|||
|
|
/** 行数 */
|
|||
|
|
private Integer rows;
|
|||
|
|
|
|||
|
|
/** 来源 */
|
|||
|
|
private String source;
|
|||
|
|
|
|||
|
|
/** 状态(-5表示成功) */
|
|||
|
|
private Integer status;
|
|||
|
|
|
|||
|
|
/** 模板名称 */
|
|||
|
|
private String templateName;
|
|||
|
|
|
|||
|
|
/** 总记录数 */
|
|||
|
|
private Integer totalRecords;
|
|||
|
|
|
|||
|
|
/** 交易结束日期ID */
|
|||
|
|
private Integer trxDateEndId;
|
|||
|
|
|
|||
|
|
/** 交易开始日期ID */
|
|||
|
|
private Integer trxDateStartId;
|
|||
|
|
|
|||
|
|
/** 上传文件名 */
|
|||
|
|
private String uploadFileName;
|
|||
|
|
|
|||
|
|
/** 上传状态描述(data.wait.confirm.newaccount表示成功) */
|
|||
|
|
private String uploadStatusDesc;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/CheckParseStatusResponse.java
|
|||
|
|
git commit -m "refactor(lsfx): 重构接口4 Response,添加parsing字段和完整pendingList"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 6: 重构接口7(获取流水)Request和Response DTO
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/GetBankStatementRequest.java`
|
|||
|
|
- 重写: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/GetBankStatementResponse.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 完全重写GetBankStatementRequest.java**
|
|||
|
|
|
|||
|
|
用以下代码替换整个文件:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.request;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取银行流水请求参数(匹配新文档6.2节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class GetBankStatementRequest {
|
|||
|
|
|
|||
|
|
/** 项目ID */
|
|||
|
|
private Integer groupId;
|
|||
|
|
|
|||
|
|
/** 文件ID(新增必填参数) */
|
|||
|
|
private Integer logId;
|
|||
|
|
|
|||
|
|
/** 当前页码(原pageNum) */
|
|||
|
|
private Integer pageNow;
|
|||
|
|
|
|||
|
|
/** 每页数量 */
|
|||
|
|
private Integer pageSize;
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 2: 完全重写GetBankStatementResponse.java**
|
|||
|
|
|
|||
|
|
用以下完整代码替换整个文件(包含40+字段的BankStatementItem):
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
package com.ruoyi.lsfx.domain.response;
|
|||
|
|
|
|||
|
|
import lombok.Data;
|
|||
|
|
import java.math.BigDecimal;
|
|||
|
|
import java.util.List;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取银行流水响应(匹配新文档6.5节)
|
|||
|
|
*/
|
|||
|
|
@Data
|
|||
|
|
public class GetBankStatementResponse {
|
|||
|
|
|
|||
|
|
/** 返回码 */
|
|||
|
|
private String code;
|
|||
|
|
|
|||
|
|
/** 状态 */
|
|||
|
|
private String status;
|
|||
|
|
|
|||
|
|
/** 成功标识 */
|
|||
|
|
private Boolean successResponse;
|
|||
|
|
|
|||
|
|
/** 响应数据 */
|
|||
|
|
private BankStatementData data;
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class BankStatementData {
|
|||
|
|
/** 流水列表 */
|
|||
|
|
private List<BankStatementItem> bankStatementList;
|
|||
|
|
|
|||
|
|
/** 总条数 */
|
|||
|
|
private Integer totalCount;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@Data
|
|||
|
|
public static class BankStatementItem {
|
|||
|
|
// ===== 账号相关信息 =====
|
|||
|
|
|
|||
|
|
/** 流水ID */
|
|||
|
|
private Long bankStatementId;
|
|||
|
|
|
|||
|
|
/** 企业ID */
|
|||
|
|
private Integer leId;
|
|||
|
|
|
|||
|
|
/** 账号ID */
|
|||
|
|
private Long accountId;
|
|||
|
|
|
|||
|
|
/** 企业账号名称 */
|
|||
|
|
private String leName;
|
|||
|
|
|
|||
|
|
/** 企业银行账号 */
|
|||
|
|
private String accountMaskNo;
|
|||
|
|
|
|||
|
|
/** 账号日期ID */
|
|||
|
|
private Integer accountingDateId;
|
|||
|
|
|
|||
|
|
/** 账号日期 */
|
|||
|
|
private String accountingDate;
|
|||
|
|
|
|||
|
|
/** 交易日期 */
|
|||
|
|
private String trxDate;
|
|||
|
|
|
|||
|
|
/** 币种 */
|
|||
|
|
private String currency;
|
|||
|
|
|
|||
|
|
// ===== 交易金额 =====
|
|||
|
|
|
|||
|
|
/** 付款金额 */
|
|||
|
|
private BigDecimal drAmount;
|
|||
|
|
|
|||
|
|
/** 收款金额 */
|
|||
|
|
private BigDecimal crAmount;
|
|||
|
|
|
|||
|
|
/** 余额 */
|
|||
|
|
private BigDecimal balanceAmount;
|
|||
|
|
|
|||
|
|
/** 交易金额 */
|
|||
|
|
private BigDecimal transAmount;
|
|||
|
|
|
|||
|
|
// ===== 交易类型和标志 =====
|
|||
|
|
|
|||
|
|
/** 交易类型 */
|
|||
|
|
private String cashType;
|
|||
|
|
|
|||
|
|
/** 交易标志位 */
|
|||
|
|
private String transFlag;
|
|||
|
|
|
|||
|
|
/** 分类ID */
|
|||
|
|
private Integer transTypeId;
|
|||
|
|
|
|||
|
|
/** 异常类型 */
|
|||
|
|
private String exceptionType;
|
|||
|
|
|
|||
|
|
// ===== 对手方信息 =====
|
|||
|
|
|
|||
|
|
/** 对手方企业ID */
|
|||
|
|
private Integer customerId;
|
|||
|
|
|
|||
|
|
/** 对手方企业名称 */
|
|||
|
|
private String customerName;
|
|||
|
|
|
|||
|
|
/** 对手方账号 */
|
|||
|
|
private String customerAccountMaskNo;
|
|||
|
|
|
|||
|
|
/** 对手方银行 */
|
|||
|
|
private String customerBank;
|
|||
|
|
|
|||
|
|
/** 对手方备注 */
|
|||
|
|
private String customerReference;
|
|||
|
|
|
|||
|
|
// ===== 摘要和备注 =====
|
|||
|
|
|
|||
|
|
/** 用户交易摘要 */
|
|||
|
|
private String userMemo;
|
|||
|
|
|
|||
|
|
/** 银行交易摘要 */
|
|||
|
|
private String bankComments;
|
|||
|
|
|
|||
|
|
/** 银行交易号 */
|
|||
|
|
private String bankTrxNumber;
|
|||
|
|
|
|||
|
|
// ===== 银行信息 =====
|
|||
|
|
|
|||
|
|
/** 所属银行缩写 */
|
|||
|
|
private String bank;
|
|||
|
|
|
|||
|
|
// ===== 其他字段 =====
|
|||
|
|
|
|||
|
|
/** 是否为内部交易 */
|
|||
|
|
private Integer internalFlag;
|
|||
|
|
|
|||
|
|
/** 上传logId */
|
|||
|
|
private Integer batchId;
|
|||
|
|
|
|||
|
|
/** 项目id */
|
|||
|
|
private Integer groupId;
|
|||
|
|
|
|||
|
|
/** 覆盖标识 */
|
|||
|
|
private Long overrideBsId;
|
|||
|
|
|
|||
|
|
/** 交易方式 */
|
|||
|
|
private String paymentMethod;
|
|||
|
|
|
|||
|
|
/** 客户账号掩码号 */
|
|||
|
|
private String cretNo;
|
|||
|
|
|
|||
|
|
// ===== 附加字段 =====
|
|||
|
|
|
|||
|
|
/** 附件数量 */
|
|||
|
|
private Integer attachments;
|
|||
|
|
|
|||
|
|
/** 评论数 */
|
|||
|
|
private Integer commentsNum;
|
|||
|
|
|
|||
|
|
/** 归档标志 */
|
|||
|
|
private Integer archivingFlag;
|
|||
|
|
|
|||
|
|
/** 下付款标志 */
|
|||
|
|
private Integer downPaymentFlag;
|
|||
|
|
|
|||
|
|
/** 源目录ID */
|
|||
|
|
private Integer sourceCatalogId;
|
|||
|
|
|
|||
|
|
/** 拆分标志 */
|
|||
|
|
private Integer split;
|
|||
|
|
|
|||
|
|
/** 子流水ID */
|
|||
|
|
private Long subBankstatementId;
|
|||
|
|
|
|||
|
|
/** 待办标志 */
|
|||
|
|
private Integer toDoFlag;
|
|||
|
|
|
|||
|
|
/** 转换金额 */
|
|||
|
|
private BigDecimal transformAmount;
|
|||
|
|
|
|||
|
|
/** 转换收款金额 */
|
|||
|
|
private BigDecimal transformCrAmount;
|
|||
|
|
|
|||
|
|
/** 转换付款金额 */
|
|||
|
|
private BigDecimal transformDrAmount;
|
|||
|
|
|
|||
|
|
/** 转换余额 */
|
|||
|
|
private BigDecimal transfromBalanceAmount;
|
|||
|
|
|
|||
|
|
/** 交易余额 */
|
|||
|
|
private BigDecimal trxBalance;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/request/GetBankStatementRequest.java
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/domain/response/GetBankStatementResponse.java
|
|||
|
|
git commit -m "refactor(lsfx): 重构接口7 Request/Response,新路径、新参数、完整字段"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 7: 更新LsfxAnalysisClient客户端类
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 修改: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/client/LsfxAnalysisClient.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 删除接口5和接口6的相关代码**
|
|||
|
|
|
|||
|
|
删除以下内容:
|
|||
|
|
|
|||
|
|
1. 删除字段注入(约第48-52行):
|
|||
|
|
```java
|
|||
|
|
@Value("${lsfx.api.endpoints.generate-report}")
|
|||
|
|
private String generateReportEndpoint;
|
|||
|
|
|
|||
|
|
@Value("${lsfx.api.endpoints.check-report-status}")
|
|||
|
|
private String checkReportStatusEndpoint;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
2. 删除 `generateReport()` 方法(约第127-134行)
|
|||
|
|
|
|||
|
|
3. 删除 `checkReportStatus()` 方法(约第139-146行)
|
|||
|
|
|
|||
|
|
**步骤 2: 更新import语句**
|
|||
|
|
|
|||
|
|
确保import中已删除:
|
|||
|
|
```java
|
|||
|
|
// 确保这些import被删除
|
|||
|
|
import com.ruoyi.lsfx.domain.request.GenerateReportRequest;
|
|||
|
|
import com.ruoyi.lsfx.domain.response.GenerateReportResponse;
|
|||
|
|
import com.ruoyi.lsfx.domain.response.CheckReportStatusResponse;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 更新方法注释**
|
|||
|
|
|
|||
|
|
更新 `getBankStatement()` 方法的注释:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
/**
|
|||
|
|
* 获取银行流水(新版接口)
|
|||
|
|
* 注意:需要传入logId参数,参数名已从pageNum改为pageNow
|
|||
|
|
*
|
|||
|
|
* @param request 请求参数(groupId, logId, pageNow, pageSize)
|
|||
|
|
* @return 流水明细列表
|
|||
|
|
*/
|
|||
|
|
public GetBankStatementResponse getBankStatement(GetBankStatementRequest request) {
|
|||
|
|
String url = baseUrl + getBankStatementEndpoint;
|
|||
|
|
|
|||
|
|
Map<String, String> headers = new HashMap<>();
|
|||
|
|
headers.put(LsfxConstants.HEADER_CLIENT_ID, clientId);
|
|||
|
|
|
|||
|
|
return httpUtil.postJson(url, request, headers, GetBankStatementResponse.class);
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 4: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/client/LsfxAnalysisClient.java
|
|||
|
|
git commit -m "refactor(lsfx): Client删除接口5、6方法,更新接口7注释"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 8: 更新LsfxTestController测试控制器
|
|||
|
|
|
|||
|
|
**文件:**
|
|||
|
|
- 修改: `ccdi-lsfx/src/main/java/com/ruoyi/lsfx/controller/LsfxTestController.java`
|
|||
|
|
|
|||
|
|
**步骤 1: 删除接口5和接口6的测试方法**
|
|||
|
|
|
|||
|
|
删除以下两个方法:
|
|||
|
|
1. `generateReport()` 方法(约第697-703行)
|
|||
|
|
2. `checkReportStatus()` 方法(约第705-711行)
|
|||
|
|
|
|||
|
|
**步骤 2: 删除相关import**
|
|||
|
|
|
|||
|
|
确保删除:
|
|||
|
|
```java
|
|||
|
|
import com.ruoyi.lsfx.domain.request.GenerateReportRequest;
|
|||
|
|
import com.ruoyi.lsfx.domain.response.GenerateReportResponse;
|
|||
|
|
import com.ruoyi.lsfx.domain.response.CheckReportStatusResponse;
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 更新接口7的Swagger注释和参数验证**
|
|||
|
|
|
|||
|
|
更新 `getBankStatement()` 方法:
|
|||
|
|
|
|||
|
|
```java
|
|||
|
|
@Operation(summary = "获取银行流水列表(新版)",
|
|||
|
|
description = "分页获取指定文件的银行流水数据,需要提供logId参数")
|
|||
|
|
@PostMapping("/getBankStatement")
|
|||
|
|
public AjaxResult getBankStatement(@RequestBody GetBankStatementRequest request) {
|
|||
|
|
// 参数校验
|
|||
|
|
if (request.getGroupId() == null) {
|
|||
|
|
return AjaxResult.error("参数不完整:groupId为必填");
|
|||
|
|
}
|
|||
|
|
if (request.getLogId() == null) {
|
|||
|
|
return AjaxResult.error("参数不完整:logId为必填(文件ID)");
|
|||
|
|
}
|
|||
|
|
if (request.getPageNow() == null || request.getPageNow() < 1) {
|
|||
|
|
return AjaxResult.error("参数不完整:pageNow为必填且大于0");
|
|||
|
|
}
|
|||
|
|
if (request.getPageSize() == null || request.getPageSize() < 1) {
|
|||
|
|
return AjaxResult.error("参数不完整:pageSize为必填且大于0");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
GetBankStatementResponse response = lsfxAnalysisClient.getBankStatement(request);
|
|||
|
|
return AjaxResult.success(response);
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 4: 提交更改**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add ccdi-lsfx/src/main/java/com/ruoyi/lsfx/controller/LsfxTestController.java
|
|||
|
|
git commit -m "refactor(lsfx): Controller删除接口5、6测试接口,更新接口7参数验证"
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Task 9: 编译验证和测试
|
|||
|
|
|
|||
|
|
**步骤 1: 编译项目**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
mvn clean compile
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**预期输出:**
|
|||
|
|
```
|
|||
|
|
[INFO] BUILD SUCCESS
|
|||
|
|
[INFO] Total time: XX.XXX s
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**如果编译失败:**
|
|||
|
|
- 检查是否有残留的import语句引用已删除的类
|
|||
|
|
- 检查DTO类中的字段类型是否正确
|
|||
|
|
- 查看编译错误信息并修复
|
|||
|
|
|
|||
|
|
**步骤 2: 启动应用**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cd ruoyi-admin
|
|||
|
|
mvn spring-boot:run
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**预期输出:**
|
|||
|
|
```
|
|||
|
|
Application started successfully
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 3: 访问Swagger UI**
|
|||
|
|
|
|||
|
|
浏览器访问:`http://localhost:8080/swagger-ui/index.html`
|
|||
|
|
|
|||
|
|
**验证项:**
|
|||
|
|
1. ✅ 确认接口5(生成报告)和接口6(检查报告状态)已消失
|
|||
|
|
2. ✅ 确认接口7的路径显示为 `/lsfx/test/getBankStatement`
|
|||
|
|
3. ✅ 点击接口7,查看Schema,确认Request包含4个字段(groupId, logId, pageNow, pageSize)
|
|||
|
|
4. ✅ 查看Response Schema,确认包含完整的BankStatementItem字段
|
|||
|
|
|
|||
|
|
**步骤 4: 测试接口1(获取Token)**
|
|||
|
|
|
|||
|
|
使用Swagger或curl测试:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
curl -X POST http://localhost:8080/lsfx/test/getToken \
|
|||
|
|
-H "Content-Type: application/json" \
|
|||
|
|
-d '{
|
|||
|
|
"projectNo": "902000_'$(date +%s)'",
|
|||
|
|
"entityName": "测试项目",
|
|||
|
|
"userId": "902001",
|
|||
|
|
"userName": "902001",
|
|||
|
|
"orgCode": "902000",
|
|||
|
|
"departmentCode": "902000"
|
|||
|
|
}'
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**预期响应:**
|
|||
|
|
```json
|
|||
|
|
{
|
|||
|
|
"code": 200,
|
|||
|
|
"msg": "操作成功",
|
|||
|
|
"data": {
|
|||
|
|
"code": "200",
|
|||
|
|
"data": {
|
|||
|
|
"token": "eyJ0eXAi...",
|
|||
|
|
"projectId": 123,
|
|||
|
|
...
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 5: 查看git状态**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git status
|
|||
|
|
git log --oneline -5
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**预期看到5个提交:**
|
|||
|
|
```
|
|||
|
|
xxxxxxx refactor(lsfx): Controller删除接口5、6测试接口,更新接口7参数验证
|
|||
|
|
xxxxxxx refactor(lsfx): Client删除接口5、6方法,更新接口7注释
|
|||
|
|
xxxxxxx refactor(lsfx): 重构接口7 Request/Response,新路径、新参数、完整字段
|
|||
|
|
xxxxxxx refactor(lsfx): 重构接口4 Response,添加parsing字段和完整pendingList
|
|||
|
|
xxxxxxx refactor(lsfx): 重构接口3 Request/Response,修正参数名和字段结构
|
|||
|
|
...
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 6: 创建总结报告**
|
|||
|
|
|
|||
|
|
在 `doc/implementation/` 目录下创建实施报告:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cat > doc/implementation/lsfx-update-report-$(date +%Y%m%d).md << 'EOF'
|
|||
|
|
# 流水分析接口更新实施报告
|
|||
|
|
|
|||
|
|
## 实施日期
|
|||
|
|
$(date +%Y-%m-%d)
|
|||
|
|
|
|||
|
|
## 更新内容
|
|||
|
|
|
|||
|
|
### 删除的接口
|
|||
|
|
- 接口5:生成尽调报告(/watson/api/project/confirmStageUploadLogs)
|
|||
|
|
- 接口6:检查报告生成状态(/watson/api/project/upload/getallpendings)
|
|||
|
|
|
|||
|
|
### 重构的接口
|
|||
|
|
- 接口2:上传文件Response - 添加完整字段(accountsOfLog、uploadLogList)
|
|||
|
|
- 接口3:拉取行内流水 - 修正Request参数名,重构Response结构
|
|||
|
|
- 接口4:检查解析状态 - 添加parsing字段,完善pendingList结构
|
|||
|
|
- 接口7:获取流水 - 新路径、新参数(logId、pageNow)、完整40+字段
|
|||
|
|
|
|||
|
|
### 保留的接口
|
|||
|
|
- 接口1:获取Token - 无需修改
|
|||
|
|
|
|||
|
|
## 修改的文件统计
|
|||
|
|
- 配置文件:1个
|
|||
|
|
- 删除的DTO类:3个
|
|||
|
|
- 重构的DTO类:6个
|
|||
|
|
- 更新的Java类:2个
|
|||
|
|
- 总计:12个文件
|
|||
|
|
|
|||
|
|
## 测试结果
|
|||
|
|
- 编译状态:✅ 成功
|
|||
|
|
- 启动状态:✅ 成功
|
|||
|
|
- Swagger UI:✅ 接口正常显示
|
|||
|
|
- 接口1测试:✅ 返回正常
|
|||
|
|
|
|||
|
|
## 待办事项
|
|||
|
|
- [ ] 与前端联调测试新接口参数
|
|||
|
|
- [ ] 生产环境配置更新
|
|||
|
|
- [ ] 接口文档更新
|
|||
|
|
EOF
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**步骤 7: 最终提交**
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
git add doc/implementation/lsfx-update-report-*.md
|
|||
|
|
git commit -m "docs(lsfx): 添加接口更新实施报告"
|
|||
|
|
git log --oneline
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 验收标准
|
|||
|
|
|
|||
|
|
### 功能验收
|
|||
|
|
- ✅ 项目编译无错误
|
|||
|
|
- ✅ 应用启动成功
|
|||
|
|
- ✅ Swagger UI正常访问
|
|||
|
|
- ✅ 接口5、6已删除
|
|||
|
|
- ✅ 接口2、3、4、7的Response字段完整
|
|||
|
|
- ✅ 接口7使用新路径和新参数名
|
|||
|
|
|
|||
|
|
### 代码验收
|
|||
|
|
- ✅ 无残留的import语句
|
|||
|
|
- ✅ DTO类使用@Data注解
|
|||
|
|
- ✅ 字段类型正确(Integer、String、BigDecimal等)
|
|||
|
|
- ✅ 方法注释完整清晰
|
|||
|
|
|
|||
|
|
### 文档验收
|
|||
|
|
- ✅ 配置文件注释清晰
|
|||
|
|
- ✅ 实施报告完整
|
|||
|
|
- ✅ 提交信息规范
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 故障排查指南
|
|||
|
|
|
|||
|
|
### 问题1:编译报错找不到类
|
|||
|
|
**原因:** 残留的import语句
|
|||
|
|
**解决:** 搜索并删除所有对GenerateReportRequest/Response和CheckReportStatusResponse的引用
|
|||
|
|
|
|||
|
|
### 问题2:启动报错配置项不存在
|
|||
|
|
**原因:** Client中仍然注入已删除的配置项
|
|||
|
|
**解决:** 检查LsfxAnalysisClient.java,删除generate-report和check-report-status的@Value注入
|
|||
|
|
|
|||
|
|
### 问题3:Swagger UI不显示接口
|
|||
|
|
**原因:** Controller方法签名错误
|
|||
|
|
**解决:** 检查LsfxTestController.java,确保所有方法都有@Operation注解
|
|||
|
|
|
|||
|
|
### 问题4:接口调用返回字段为null
|
|||
|
|
**原因:** DTO字段名与API返回不匹配
|
|||
|
|
**解决:** 对比新文档响应示例,确保字段名完全一致(区分大小写)
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 参考资料
|
|||
|
|
|
|||
|
|
- 新版接口文档:`doc/对接流水分析/兰溪-流水分析对接-新版.md`
|
|||
|
|
- 设计文档:`docs/plans/2026-03-02-lsfx-integration-design.md`
|
|||
|
|
- 若依框架规范:`CLAUDE.md`
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
**计划完成日期:** 2026-03-02
|
|||
|
|
**预计实施时间:** 2-3小时
|
|||
|
|
**风险等级:** 中(涉及多个DTO重构)
|