8 Commits

Author SHA1 Message Date
wkc
a4f927fdcb Remove login title and obsolete AGENTS guide 2026-05-12 17:06:00 +08:00
wkc
a22c83ba7e 流程列表添加角色数据权限 2026-05-12 16:35:32 +08:00
wkc
9ed6fc2d38 替换登录页背景图 2026-05-12 16:33:12 +08:00
wkc
6ef3cfcaea 实现上虞利率定价字段调整 2026-05-11 18:02:04 +08:00
wkc
a50b25e4ec 新增上虞字段调整实施计划 2026-05-11 17:34:05 +08:00
wkc
947c955415 修正上虞字段调整设计范围 2026-05-11 17:13:33 +08:00
wkc
6c949fee40 新增上虞利率定价字段调整设计 2026-05-11 17:09:06 +08:00
wkc
366d8e499a 修复外部查询接口GET参数调用 2026-05-11 16:33:16 +08:00
38 changed files with 2234 additions and 121 deletions

View File

@@ -1,31 +0,0 @@
# AGENTS.md - AI Coding Assistant Guide
## GIT
- git提交时使用中文添加描述
- 无视`.DS_Store`
## AGENT
- 不开启subagent
## 文档
- 如果是前后端开发任务,根据设计文档产出实施计划时,输出两份执行文档,一份为后端的实施计划,一份为前端的实施计划
- 每一次改动都需要留下实施文档,记录修改的内容
- 每次写设计文档的时候,都要检查一下保存路径是否正确
## 测试
- 开发完成后必须执行与本次改动直接对应的验证步骤,完成验证后才能结束本次任务
- 如果是接口开发完成,先重启后端进程,确保最新代码已经生效,再调用接口进行测试
- 接口测试时必须覆盖多种情况,至少包含正常场景、必填/参数错误场景、分支场景;如接口逻辑包含状态、类型、金额、期限等关键条件,需要分别验证对应分支
- 每次调用外部接口进行测试或联调时,必须在后端日志中完整输出请求 URL、请求参数和返回参数
- 如果是前端页面开发完成,必须启动前端页面并调用浏览器检查功能是否正常,确认页面展示、交互流程、接口联动和关键提示信息符合预期
- 测试结束后,自动结束测试时开启的前后端进程
## 开发
- 在开发前端的时候不需要使用git worktree直接在当前分支进行开发
## 方案规范
- 当需要你给出方案时,必须符合以下规范
- 不允许给出兼容性或补丁性的方案
- 不允许过度设计,保持最短路径实现,且不能违反上一条要求
- 不允许自行给出我提供的需求以外的方案,例如一些兜底和降级方案,这可能导致业务逻辑偏移问题
- 必须确保方案的逻辑正确,必须经过全链路的逻辑验证

View File

@@ -0,0 +1,34 @@
# 上虞利率定价系统操作手册生成实施记录
## 基本信息
- 日期2026-05-09
- 任务:生成系统操作文档,覆盖主要业务流程、用户管理、部门管理,并在合适位置加入真实页面截图
- 产物:`doc/上虞利率定价系统操作手册-2026-05-09.docx`
## 实施内容
- 梳理前端路由、菜单 SQL、业务流程组件和系统管理页面确认操作手册覆盖范围。
- 临时启动前端开发服务,复用本机 63310 后端服务,通过真实浏览器获取页面截图。
- 截图覆盖登录页、流程列表、客户类型选择、客户号查询、新增个人定价流程、流程详情、用户管理、部门管理。
- 使用 `python-docx` 生成 Word 操作手册,内容包含:
- 文档说明与角色范围
- 登录与页面布局
- 利率定价主要业务流程
- 用户管理操作说明
- 部门管理操作说明
- 日常使用注意事项
## 验证情况
- 已确认前端服务可访问:`http://localhost:8080`
- 已通过 `/login/test` 获取测试登录令牌并进入真实页面截图。
- 已抽查关键截图显示正常,流程详情截图已改为从列表真实记录进入,避免使用无效流水号。
- 已生成 Word 文件:`doc/上虞利率定价系统操作手册-2026-05-09.docx`
- DOCX 渲染检查尝试使用文档技能提供的 `render_docx.py`,当前机器缺少 `soffice`,无法完成逐页 PNG 渲染;截图已内嵌在 Word 文档中。
- 已使用 macOS Quick Look 生成首屏缩略图进行抽查,封面、标题、表格和首张截图显示正常。
## 临时文件
- 截图目录、生成脚本、Playwright 临时依赖均位于 `output/` 下。
- 本次收尾时已清理 `output/`,避免误提交临时文件。

View File

@@ -0,0 +1,33 @@
# 2026-05-11 外部查询接口 GET 参数调用修复实施记录
## 实施内容
- 修复客户号查询客户内码的个人、企业两个外部接口调用方式。
- `LoanPricingCustomerMapService` 构建请求地址时先移除同名 `appCode``cust_id` 参数,再通过 GET query param 追加配置中的公共 `appCode` 和真实客户号。
- 修复历史贷款记录查询外部接口调用方式。
- `LoanRateHistoryService` 构建请求地址时先移除同名 `appCode``cust_isn` 参数,再通过 GET query param 追加配置中的公共 `appCode` 和真实客户内码。
- 调整 profile 外部地址配置。
- `application-pro.yml``application-dev.yml``application-uat.yml` 新增同一个 `loan-pricing-external.app-code` 配置项。
- 生产 profile 三条查询 URL 仅保留接口地址,不再在 URL 中写 `appCode` 或空业务参数。
- 补充服务层单元测试。
- 覆盖个人客户映射、企业客户映射、历史贷款记录三条接口最终均按 GET query param 生成公共 `appCode` 和各自业务参数。
- 测试文件位于 `*/src/test/`,按仓库 `.gitignore` 规则不纳入提交范围,仅用于本地验证。
## 涉及文件
- `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/LoanPricingCustomerMapService.java`
- `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/LoanRateHistoryService.java`
- `ruoyi-admin/src/main/resources/application-pro.yml`
- `ruoyi-admin/src/main/resources/application-dev.yml`
- `ruoyi-admin/src/main/resources/application-uat.yml`
- `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingCustomerMapServiceTest.java`
- `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanRateHistoryServiceTest.java`
## 验证记录
- 已执行:`mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingCustomerMapServiceTest,LoanRateHistoryServiceTest -Dsurefire.failIfNoSpecifiedTests=false test`
- 结果:通过,`Tests run: 9, Failures: 0, Errors: 0, Skipped: 0`
- 日志验证:
- 个人客户映射最终请求 URL 为 `http://mock/personal?appCode=abc&cust_id=P001`
- 企业客户映射最终请求 URL 为 `http://mock/corporate?appCode=abc&cust_id=C001`
- 历史贷款记录最终请求 URL 为 `http://mock/history?appCode=abc&cust_isn=81033011438`

View File

@@ -0,0 +1,19 @@
# 2026-05-11 上虞利率定价字段口径调整实施计划记录
## 修改内容
- 新增后端实施计划:`docs/superpowers/plans/2026-05-11-shangyu-pricing-field-adjustment-backend-plan.md`
- 新增前端实施计划:`docs/superpowers/plans/2026-05-11-shangyu-pricing-field-adjustment-frontend-plan.md`
- 后端计划覆盖创建 DTO、流程实体、模型入参、转换器、服务层校验、SQL schema 和后端测试。
- 前端计划覆盖个人/企业新增弹窗、业务种类选项、抵质押类型选项、`couponRate` 条件必填、静态断言、构建和 Playwright 真实页面验证。
## 范围说明
- 计划依据:`docs/superpowers/specs/2026-05-11-shangyu-pricing-field-adjustment-design.md`
- 对公 `businessType` 上传模型这一条已按用户确认从本次实施范围排除;计划只覆盖 `couponRate` 的模型入参新增。
- 本次仅产出实施计划,未进入业务代码实现。
## 待验证
- 计划需通过计划审查后再进入实施。
- 后续实现完成后需要补充 `doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md`,记录真实代码改动、测试命令和页面验证结果。

View File

@@ -0,0 +1,76 @@
# 上虞利率定价字段调整实施记录
## 基本信息
- 日期2026-05-11
- 范围:上虞利率定价个人/企业新增链路、服务端校验、模型入参、表结构脚本
- 目标:按已确认需求调整业务种类、抵质押类型、存单票面利率字段,以及对私新增入口字段剔除
## 修改内容
### 后端
- 个人新增 DTO
- 业务种类调整为 `新增/存量新增/存量转贷`
- 移除 `loanPurpose``bizProof` 新增入口字段。
- 新增 `couponRate`
- 企业新增 DTO
- 业务种类调整为 `新增/存量新增/存量转贷`
- 企业抵押类型调整为 `一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`
- 企业质押类型调整为 `存单质押/股权质押/其他质押`
- 新增 `couponRate`
- 流程实体和模型入参:
- `LoanPricingWorkflow` 新增 `couponRate`
- `ModelInvokeDTO` 新增 `couponRate`,未增加 `businessType` 模型入参。
- 转换器:
- 个人/企业新增 DTO 均映射 `couponRate`
- 个人新增 DTO 不再映射 `loanPurpose``bizProof`
- 服务校验:
- 业务种类仅允许 `新增/存量新增/存量转贷`
-`存量转贷` 要求历史贷款合同。
- 抵押/质押时要求选择抵质押类型。
- 对私/对公按客户类型和担保方式校验各自抵质押类型。
- `质押 + 存单质押` 时要求填写 `couponRate`
- SQL
- 新增 `sql/add_coupon_rate_20260511.sql`
- 同步更新 `loan_pricing_workflow` 建表脚本中的 `coupon_rate` 字段。
### 前端
- 个人新增弹窗:
- 业务种类调整为 `新增/存量新增/存量转贷`
- 移除 `贷款用途``是否有经营佐证`
- 抵押类型调整为 `一线/一类/二类/三类`
- 质押类型调整为 `存单质押/其他质押`
- `质押 + 存单质押` 时显示并必填 `存单票面利率`
- 企业新增弹窗:
- 业务种类调整为 `新增/存量新增/存量转贷`
- 抵押类型调整为 `一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`
- 质押类型调整为 `存单质押/股权质押/其他质押`
- `质押 + 存单质押` 时显示并必填 `存单票面利率`
- 共同逻辑:
-`存量转贷` 触发历史贷款合同查询。
- 非存单质押提交时清理 `couponRate`
## 验证结果
- 后端单元测试:
- `mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingModelServicePersonalParamsTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test`
- 结果通过23 个测试全部成功。
- 前端静态断言:
- `zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:personal-create-input-params && npm --prefix ruoyi-ui run test:corporate-create-input-params && npm --prefix ruoyi-ui run test:business-type-history-rate'`
- 结果:通过。
- 前端生产构建:
- `zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run build:prod'`
- 结果:构建通过,仅存在既有包体积 warning。
- 真实页面验证:
- 使用 Playwright 打开 `http://localhost:1024/index`
- 使用 `/login/test` 获取登录 token 后访问真实流程列表页面。
- 个人新增弹窗验证:已移除 `贷款用途/是否有经营佐证`;业务种类仅 `存量转贷` 触发历史利率逻辑;个人抵押/质押选项正确;`存单质押``couponRate` 显示并进入必填校验。
- 企业新增弹窗验证:抵押/质押选项正确;`存单质押``couponRate` 显示并进入必填校验;业务种类仅 `存量转贷` 触发历史利率逻辑。
- 验证后已关闭 Playwright 浏览器会话;本次未新启动前后端进程。
## 注意事项
- 控制台中的 `sockjs-node` 报错来自本地 dev-server HMR 连接内网地址失败,不影响本次页面功能验证。
- 表单校验 warning 来自验证时故意触发必填校验。

View File

@@ -0,0 +1,20 @@
# 登录页背景图替换实施记录
## 修改时间
2026-05-12
## 修改内容
- 将登录页背景资源 `ruoyi-ui/src/assets/images/login-background.jpg` 替换为上虞农商银行“心乐为新未来”宣传图。
- 保持登录页现有样式引用不变,继续由 `login.vue``.login` 背景图样式加载该资源。
## 涉及文件
- `ruoyi-ui/src/assets/images/login-background.jpg`
## 验证情况
- 已确认 `ruoyi-ui/src/assets/images/login-background.jpg` 与原始图片 SHA256 一致。
- 已使用 Node 14.21.3 执行 `npm --prefix ruoyi-ui run build:prod`,构建成功;仅存在项目原有包体积 warning。
- 已使用 browser-use 打开真实登录页 `http://localhost:9527/login`,确认新背景图已渲染,账号、密码和登录按钮显示正常。

View File

@@ -0,0 +1,18 @@
# 登录页标题文案移除实施记录
## 修改时间
2026-05-12
## 修改内容
- 移除登录框顶部标题展示,不再显示“上虞利率定价系统”。
## 涉及文件
- `ruoyi-ui/src/views/login.vue`
## 验证情况
- 已检查登录页模板,确认登录框内不再渲染标题节点。
- 已使用 browser-use 打开 `http://localhost:9527/login` 进行实际页面验证,确认页面跳转到登录页后不再出现“上虞利率定价系统”,账号和密码输入项仍正常显示。

View File

@@ -0,0 +1,57 @@
# 流程列表角色数据权限实施记录
## 修改日期
2026-05-12
## 需求范围
- 仅控制 `GET /loanPricing/workflow/list` 流程列表接口。
- 超级管理员 `user_id=1`、启用角色名为“管理员”或角色标识为 `headAdmin` 的用户可查看全部流程。
- 非管理员用户只能查看 `loan_pricing_workflow.create_by` 精确等于当前登录人 `昵称-柜员号` 的流程。
- 列表页“创建者”查询参数继续保留,但只按 `create_by` 中的柜员号部分进行模糊匹配。
## 修改内容
- `LoanPricingWorkflow` 增加非表字段 `dataScopeCreateBy`,专用于后端内部数据权限精确过滤。
- `LoanPricingWorkflowServiceImpl.selectLoanPricingPage` 增加流程列表数据权限裁剪:
- 管理员不写入 `dataScopeCreateBy`
- 非管理员写入 `dataScopeCreateBy = nickName + "-" + username`
- 前端传入 `createBy` 时仍保留原查询参数,但不能扩大非管理员可见范围。
- `LoanPricingWorkflowMapper.xml` 增加 `lpw.create_by = #{query.dataScopeCreateBy}` 精确权限条件。
- `LoanPricingWorkflowMapper.xml``createBy` 查询调整为 `SUBSTRING_INDEX(lpw.create_by, '-', -1) LIKE ...`,即只按柜员号模糊匹配。
- 补充 `LoanPricingWorkflowServiceImplTest``LoanPricingWorkflowMapperXmlTest`,覆盖管理员、业务管理员、客户经理、越权创建者查询参数和 XML 条件。
## 验证记录
- 单元测试通过:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingWorkflowMapperXmlTest -Dsurefire.failIfNoSpecifiedTests=false test
```
- 后端打包通过:
```bash
mvn -pl ruoyi-admin -am clean package -DskipTests
```
- API 验证通过:
- `admin/admin123` 查询流程列表返回全量数据,包含测试行和 `若依-admin` 历史行。
- `8929999/123456` 业务管理员查询流程列表返回全量数据。
- `8920001/123456` 客户经理查询流程列表只返回本人创建的测试行。
- 客户经理按 `createBy=8920001` 查询可返回本人测试行。
- 客户经理按昵称 `createBy=测试客户经理` 查询返回 0 条。
- 客户经理按其他柜员号 `createBy=admin` 查询返回 0 条。
- browser-use 真实页面验证通过:
- 管理员登录真实流程列表页,页面显示 `共 40 条`,可见本人测试行和 `若依-admin` 历史行。
- 客户经理登录真实流程列表页,页面只显示本人创建的测试行。
- 客户经理在“创建者”输入 `admin` 后页面显示暂无数据。
- 客户经理在“创建者”输入 `8920001` 后页面重新显示本人测试行。
## 验证数据与清理
- 因当前开发库创建流程接口依赖的模型输出表缺少 `coupon_rate` 字段,无法通过页面新增生成验证流程。
- 本次验证使用一条临时 SQL 测试数据:`serial_num = ROLE_SCOPE_20260512_001``create_by = 测试客户经理-8920001`
- 验证结束后已删除该临时数据,回查剩余数量为 0。

Binary file not shown.

View File

@@ -0,0 +1,647 @@
# Shangyu Pricing Field Adjustment Backend Implementation Plan
> **For agentic workers:** Follow this repository's `AGENTS.md`: do not invoke `using-superpowers` or subagents during implementation unless the user explicitly requests them. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Update the backend create-flow contract so `businessType`, `couponRate`, personal removed fields, and customer-type-specific collateral options match the approved Shangyu pricing spec.
**Architecture:** Keep the existing workflow creation API and entity flow. Add `couponRate` to the DTO/entity/model path, tighten service-layer validation in `LoanPricingWorkflowServiceImpl`, remove personal create dependencies on `loanPurpose` and `bizProof`, and update SQL schema files in place.
**Tech Stack:** Spring Boot, RuoYi, MyBatis Plus, Lombok, Jakarta Validation, JUnit 5, Mockito, MySQL SQL files.
---
## File Structure
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/PersonalLoanPricingCreateDTO.java`
- Change `businessType` values to `新增/存量新增/存量转贷`.
- Remove personal create DTO dependency on `loanPurpose` and `bizProof`.
- Add `couponRate`.
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/CorporateLoanPricingCreateDTO.java`
- Change `businessType` values to `新增/存量新增/存量转贷`.
- Expand `collType` values for corporate mortgage and pledge paths.
- Add `couponRate`.
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/entity/LoanPricingWorkflow.java`
- Update `businessType` comment and add persisted `couponRate`.
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/ModelInvokeDTO.java`
- Add `couponRate` only. Do not add `businessType`; the user excluded that model-input branch from this scope.
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java`
- Map `couponRate`.
- Stop mapping removed personal fields from the personal create DTO.
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java`
- Update business type validation.
- Add collateral-option validation by `custType + guarType`.
- Add required `couponRate` validation for `质押 + 存单质押`.
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImplTest.java`
- Add validation coverage and update existing create tests to set valid `businessType`.
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServicePersonalParamsTest.java`
- Remove old personal `loanPurpose` DTO expectations so Maven test compilation remains valid after DTO removal.
- Keep `loanTerm/loanLoop` model assertions.
- Create Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/util/LoanPricingConverterTest.java`
- Confirm personal removed fields no longer drive conversion and `couponRate` maps.
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServiceTest.java`
- Confirm `couponRate` is copied into `ModelInvokeDTO` via the model invocation path.
- Create: `sql/add_coupon_rate_20260511.sql`
- Migration for existing databases.
- Modify: `sql/loan_pricing_workflow.sql`
- Add `coupon_rate`.
- Modify: `sql/loan_pricing_schema_20260328.sql`
- Add `coupon_rate` to `loan_pricing_workflow`.
- Modify: `sql/loan_pricing_prod_init_20260331.sql`
- Add `coupon_rate` to production init schema.
## Task 1: Add Failing Backend Contract Tests
**Files:**
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImplTest.java`
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServicePersonalParamsTest.java`
- Create Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/util/LoanPricingConverterTest.java`
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServiceTest.java`
- [ ] **Step 1: Update existing create tests with valid business type**
In `LoanPricingWorkflowServiceImplTest`, every test that calls `createLoanPricing` must set:
```java
workflow.setBusinessType("新增");
```
For tests using mortgage or pledge, also set an allowed `collType` for the matching `custType`.
- [ ] **Step 2: Update old personal parameter tests**
In `LoanPricingModelServicePersonalParamsTest`, replace the old DTO field test:
Add the static import if it is not present:
```java
import static org.junit.jupiter.api.Assertions.assertNull;
```
```java
@Test
void shouldRemoveLoanPurposeAndKeepLoanTermInPersonalCreateDto() throws NoSuchFieldException {
assertThrows(NoSuchFieldException.class,
() -> PersonalLoanPricingCreateDTO.class.getDeclaredField("loanPurpose"));
assertNotNull(PersonalLoanPricingCreateDTO.class.getDeclaredField("loanTerm"));
}
```
Replace the old converter test that called `dto.setLoanPurpose(...)`:
```java
@Test
void shouldMapLoanTermWithoutLoanPurposeFromPersonalDto() {
PersonalLoanPricingCreateDTO dto = new PersonalLoanPricingCreateDTO();
dto.setCustIsn("CUST001");
dto.setCustName("张三");
dto.setGuarType("信用");
dto.setApplyAmt("100000");
dto.setBusinessType("新增");
dto.setLoanTerm("3");
LoanPricingWorkflow workflow = LoanPricingConverter.toEntity(dto);
assertNull(workflow.getLoanPurpose());
assertNull(workflow.getBizProof());
assertEquals("3", workflow.getLoanTerm());
}
```
In `shouldInvokePersonalModelWithExpectedParams`, remove:
```java
workflow.setLoanPurpose("business");
workflow.setBizProof("true");
```
and remove these argument matcher clauses:
```java
&& Objects.equals("business", dto.getLoanPurpose())
&& Objects.equals("1", dto.getBizProof())
```
Keep the existing `loanTerm`, `loanLoop`, `collThirdParty`, and `collType` assertions.
- [ ] **Step 3: Add failing business type and collateral validation tests**
Add tests like:
```java
@Test
void shouldRejectOldBusinessType() {
LoanPricingWorkflow workflow = validPersonalWorkflow();
workflow.setBusinessType("新客");
ServiceException ex = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("业务种类必须是:新增、存量新增、存量转贷之一", ex.getMessage());
}
@Test
void shouldRequireHistoryRateForStockTransfer() {
LoanPricingWorkflow workflow = validCorporateWorkflow();
workflow.setBusinessType("存量转贷");
workflow.setLoanRateHistory(null);
ServiceException ex = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("请选择历史贷款合同", ex.getMessage());
}
@Test
void shouldRequireCouponRateForCertificatePledge() {
LoanPricingWorkflow workflow = validPersonalWorkflow();
workflow.setGuarType("质押");
workflow.setCollType("存单质押");
workflow.setCouponRate(null);
ServiceException ex = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("存单票面利率不能为空", ex.getMessage());
}
```
Add helper methods:
```java
private LoanPricingWorkflow validPersonalWorkflow() {
LoanPricingWorkflow workflow = new LoanPricingWorkflow();
workflow.setCustType("个人");
workflow.setCustIsn("P001");
workflow.setCustName("张三");
workflow.setIdNum("330102199001011234");
workflow.setGuarType("信用");
workflow.setApplyAmt("100000");
workflow.setBusinessType("新增");
return workflow;
}
private LoanPricingWorkflow validCorporateWorkflow() {
LoanPricingWorkflow workflow = new LoanPricingWorkflow();
workflow.setCustType("企业");
workflow.setCustIsn("C001");
workflow.setCustName("测试企业");
workflow.setIdNum("91330100MA0000000X");
workflow.setGuarType("信用");
workflow.setApplyAmt("1000000");
workflow.setBusinessType("新增");
return workflow;
}
```
- [ ] **Step 4: Add failing allowed-option tests**
Add focused tests:
```java
@Test
void shouldAllowPersonalMortgageLineType() {
LoanPricingWorkflow workflow = validPersonalWorkflow();
workflow.setGuarType("抵押");
workflow.setCollType("一线");
when(sensitiveFieldCryptoService.encrypt(any())).thenAnswer(invocation -> invocation.getArgument(0));
loanPricingWorkflowService.createLoanPricing(workflow);
verify(loanPricingWorkflowMapper).insert(any());
}
@Test
void shouldRejectCorporateMortgageTypeForPersonalMortgage() {
LoanPricingWorkflow workflow = validPersonalWorkflow();
workflow.setGuarType("抵押");
workflow.setCollType("排污权抵押");
ServiceException ex = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("个人抵押抵质押类型必须是:一线、一类、二类、三类之一", ex.getMessage());
}
@Test
void shouldAllowCorporatePledgeEquityType() {
LoanPricingWorkflow workflow = validCorporateWorkflow();
workflow.setGuarType("质押");
workflow.setCollType("股权质押");
when(sensitiveFieldCryptoService.encrypt(any())).thenAnswer(invocation -> invocation.getArgument(0));
loanPricingWorkflowService.createLoanPricing(workflow);
verify(loanPricingWorkflowMapper).insert(any());
}
```
- [ ] **Step 5: Add failing converter test**
Create `LoanPricingConverterTest`:
```java
package com.ruoyi.loanpricing.util;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
import org.junit.jupiter.api.Test;
class LoanPricingConverterTest {
@Test
void shouldMapCouponRateForPersonalWorkflow() {
PersonalLoanPricingCreateDTO dto = new PersonalLoanPricingCreateDTO();
dto.setCustIsn("P001");
dto.setGuarType("质押");
dto.setApplyAmt("100000");
dto.setBusinessType("新增");
dto.setCouponRate("2.15");
LoanPricingWorkflow workflow = LoanPricingConverter.toEntity(dto);
assertEquals("2.15", workflow.getCouponRate());
assertNull(workflow.getLoanPurpose());
assertNull(workflow.getBizProof());
}
@Test
void shouldMapCouponRateForCorporateWorkflow() {
CorporateLoanPricingCreateDTO dto = new CorporateLoanPricingCreateDTO();
dto.setCustIsn("C001");
dto.setGuarType("质押");
dto.setApplyAmt("1000000");
dto.setBusinessType("新增");
dto.setCouponRate("2.35");
LoanPricingWorkflow workflow = LoanPricingConverter.toEntity(dto);
assertEquals("2.35", workflow.getCouponRate());
}
}
```
- [ ] **Step 6: Add failing model DTO test**
In `LoanPricingModelServiceTest`, add a test or extend the existing argument-captor test to assert:
```java
assertEquals("2.15", capturedModelInvokeDto.getCouponRate());
```
The workflow used by that test must set:
```java
loanPricingWorkflow.setCouponRate("2.15");
loanPricingWorkflow.setBusinessType("新增");
```
- [ ] **Step 7: Run backend tests and confirm failure**
Run:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingModelServicePersonalParamsTest,LoanPricingConverterTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
```
Expected: FAIL because `couponRate` and new validation are not implemented yet.
## Task 2: Implement DTO, Entity, Converter, and Model DTO Fields
**Files:**
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/PersonalLoanPricingCreateDTO.java`
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/CorporateLoanPricingCreateDTO.java`
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/entity/LoanPricingWorkflow.java`
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/ModelInvokeDTO.java`
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java`
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServicePersonalParamsTest.java`
- [ ] **Step 1: Update personal create DTO**
In `PersonalLoanPricingCreateDTO`:
- Remove the `loanPurpose` field and its validation annotations.
- Remove the `bizProof` field.
- Change `businessType` annotations to:
```java
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "新增", allowableValues = {"新增", "存量新增", "存量转贷"})
@NotBlank(message = "业务种类不能为空")
@Pattern(regexp = "^(新增|存量新增|存量转贷)$", message = "业务种类必须是:新增、存量新增、存量转贷之一")
private String businessType;
```
- Add:
```java
@Schema(description = "存单票面利率", example = "2.15")
private String couponRate;
```
- [ ] **Step 2: Update corporate create DTO**
In `CorporateLoanPricingCreateDTO`:
```java
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "新增", allowableValues = {"新增", "存量新增", "存量转贷"})
@NotBlank(message = "业务种类不能为空")
@Pattern(regexp = "^(新增|存量新增|存量转贷)$", message = "业务种类必须是:新增、存量新增、存量转贷之一")
private String businessType;
```
Change `collType` annotation to include the combined corporate option set:
```java
@Schema(description = "抵质押类型", example = "一类", allowableValues = {"一类", "二类", "三类", "四类", "排污权抵押", "设备等其他不动产抵押", "存单质押", "股权质押", "其他质押"})
@Pattern(regexp = "^(一类|二类|三类|四类|排污权抵押|设备等其他不动产抵押|存单质押|股权质押|其他质押)$", message = "抵质押类型不符合当前客户类型和担保方式")
private String collType;
```
Add:
```java
@Schema(description = "存单票面利率", example = "2.35")
private String couponRate;
```
- [ ] **Step 3: Update workflow entity**
In `LoanPricingWorkflow`:
```java
/** 业务种类: 新增/存量新增/存量转贷 */
private String businessType;
/** 存单票面利率 */
private String couponRate;
```
Keep `loanPurpose` and `bizProof` on the entity for historical rows and existing schema compatibility; they are no longer populated by personal create DTO conversion.
- [ ] **Step 4: Update model DTO**
In `ModelInvokeDTO`, add:
```java
/**
* 存单票面利率
*/
private String couponRate;
```
Do not add `businessType` in this task.
- [ ] **Step 5: Update converter**
In personal conversion, remove:
```java
entity.setLoanPurpose(dto.getLoanPurpose());
entity.setBizProof(dto.getBizProof());
```
Add for both personal and corporate conversion:
```java
entity.setCouponRate(dto.getCouponRate());
```
- [ ] **Step 6: Run targeted converter and model tests**
Run:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingModelServicePersonalParamsTest,LoanPricingConverterTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
```
Expected: personal parameter, converter, and model field tests PASS; service validation tests may still fail until Task 3.
- [ ] **Step 7: Commit field and converter changes**
```bash
git add ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/PersonalLoanPricingCreateDTO.java \
ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/CorporateLoanPricingCreateDTO.java \
ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/entity/LoanPricingWorkflow.java \
ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/domain/dto/ModelInvokeDTO.java \
ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java \
ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServicePersonalParamsTest.java \
ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/util/LoanPricingConverterTest.java \
ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/LoanPricingModelServiceTest.java
git commit -m "调整上虞利率定价后端字段"
```
## Task 3: Implement Service-Layer Validation
**Files:**
- Modify: `ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java`
- Modify Test: `ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImplTest.java`
- [ ] **Step 1: Replace business type validation**
Update `validateBusinessTypeAndHistoryRate`:
```java
private void validateBusinessTypeAndHistoryRate(LoanPricingWorkflow workflow) {
if (!StringUtils.hasText(workflow.getBusinessType())) {
throw new ServiceException("业务种类不能为空");
}
if (!isOneOf(workflow.getBusinessType(), "新增", "存量新增", "存量转贷")) {
throw new ServiceException("业务种类必须是:新增、存量新增、存量转贷之一");
}
if ("存量转贷".equals(workflow.getBusinessType())
&& !StringUtils.hasText(workflow.getLoanRateHistory())) {
throw new ServiceException("请选择历史贷款合同");
}
}
```
- [ ] **Step 2: Add collateral and coupon validators**
Add calls before insert:
```java
validateBusinessTypeAndHistoryRate(loanPricingWorkflow);
validateCollateralType(loanPricingWorkflow);
validateCouponRate(loanPricingWorkflow);
```
Add helper methods:
```java
private void validateCouponRate(LoanPricingWorkflow workflow) {
if ("质押".equals(workflow.getGuarType())
&& "存单质押".equals(workflow.getCollType())
&& !StringUtils.hasText(workflow.getCouponRate())) {
throw new ServiceException("存单票面利率不能为空");
}
}
private void validateCollateralType(LoanPricingWorkflow workflow) {
if (!"抵押".equals(workflow.getGuarType()) && !"质押".equals(workflow.getGuarType())) {
return;
}
if (!StringUtils.hasText(workflow.getCollType())) {
throw new ServiceException("请选择抵质押类型");
}
if ("个人".equals(workflow.getCustType()) && "抵押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "一线", "一类", "二类", "三类")) {
throw new ServiceException("个人抵押抵质押类型必须是:一线、一类、二类、三类之一");
}
if ("个人".equals(workflow.getCustType()) && "质押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "存单质押", "其他质押")) {
throw new ServiceException("个人质押抵质押类型必须是:存单质押、其他质押之一");
}
if ("企业".equals(workflow.getCustType()) && "抵押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "一类", "二类", "三类", "四类", "排污权抵押", "设备等其他不动产抵押")) {
throw new ServiceException("企业抵押抵质押类型必须是:一类、二类、三类、四类、排污权抵押、设备等其他不动产抵押之一");
}
if ("企业".equals(workflow.getCustType()) && "质押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "存单质押", "股权质押", "其他质押")) {
throw new ServiceException("企业质押抵质押类型必须是:存单质押、股权质押、其他质押之一");
}
}
private boolean isOneOf(String value, String... allowedValues) {
for (String allowedValue : allowedValues) {
if (allowedValue.equals(value)) {
return true;
}
}
return false;
}
```
- [ ] **Step 3: Run service tests**
Run:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false test
```
Expected: PASS.
- [ ] **Step 4: Run backend targeted suite**
Run:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingModelServicePersonalParamsTest,LoanPricingConverterTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
```
Expected: PASS.
- [ ] **Step 5: Commit validation changes**
```bash
git add ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java \
ruoyi-loan-pricing/src/test/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImplTest.java
git commit -m "增加上虞利率定价创建校验"
```
## Task 4: Update SQL Schema Files
**Files:**
- Create: `sql/add_coupon_rate_20260511.sql`
- Modify: `sql/loan_pricing_workflow.sql`
- Modify: `sql/loan_pricing_schema_20260328.sql`
- Modify: `sql/loan_pricing_prod_init_20260331.sql`
- [ ] **Step 1: Create migration SQL**
Create `sql/add_coupon_rate_20260511.sql`:
```sql
-- 上虞利率定价存单票面利率字段
ALTER TABLE `loan_pricing_workflow`
ADD COLUMN `coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率' AFTER `loan_rate_history`;
```
- [ ] **Step 2: Update standalone workflow schema**
In `sql/loan_pricing_workflow.sql`, add after `loan_rate_history`:
```sql
`coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率',
```
- [ ] **Step 3: Update bundled schema files**
Apply the same column to the `loan_pricing_workflow` table definitions in:
- `sql/loan_pricing_schema_20260328.sql`
- `sql/loan_pricing_prod_init_20260331.sql`
- [ ] **Step 4: Verify SQL references**
Run:
```bash
rg -n "coupon_rate|存单票面利率" sql
```
Expected: `coupon_rate` appears in the migration and all three schema/init files.
- [ ] **Step 5: Commit SQL changes**
```bash
git add sql/add_coupon_rate_20260511.sql \
sql/loan_pricing_workflow.sql \
sql/loan_pricing_schema_20260328.sql \
sql/loan_pricing_prod_init_20260331.sql
git commit -m "新增存单票面利率数据库字段"
```
## Task 5: Backend Verification and Record
**Files:**
- Create or Modify: `doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md`
- [ ] **Step 1: Run backend verification**
Run:
```bash
mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingModelServicePersonalParamsTest,LoanPricingConverterTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
```
Expected: PASS.
- [ ] **Step 2: Check staged-independent status**
Run:
```bash
git status --short
```
Expected: only intended backend and SQL files are modified or staged for this implementation slice. Existing unrelated files such as `AGENTS.md`, `.DS_Store`, and operation-manual docs must stay out of these commits.
- [ ] **Step 3: Update implementation record**
Add backend notes to `doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md`:
```markdown
## 后端实现
- 调整个人/企业创建 DTO 的业务种类口径为 `新增/存量新增/存量转贷`
- 新增 `couponRate` 存单票面利率字段,并贯通流程保存和模型入参。
- 取消对私创建链路对 `loanPurpose``bizProof` 的依赖。
- 增加服务层校验,覆盖业务种类、历史贷款利率、抵质押类型和存单票面利率。
- 新增 `coupon_rate` 数据库字段及 schema/init SQL。
## 后端验证
- `mvn -pl ruoyi-loan-pricing -am -Dtest=LoanPricingWorkflowServiceImplTest,LoanPricingModelServicePersonalParamsTest,LoanPricingConverterTest,LoanPricingModelServiceTest -Dsurefire.failIfNoSpecifiedTests=false test`
```
- [ ] **Step 4: Commit backend record**
```bash
git add doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md
git commit -m "记录上虞字段调整后端实现"
```

View File

@@ -0,0 +1,485 @@
# Shangyu Pricing Field Adjustment Frontend Implementation Plan
> **For agentic workers:** Follow this repository's `AGENTS.md`: do not invoke `using-superpowers` or subagents during implementation unless the user explicitly requests them. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Update the personal and corporate workflow create dialogs so the displayed fields, dynamic options, required `couponRate`, and submitted payload match the approved Shangyu pricing spec.
**Architecture:** Keep the existing Vue 2 create-dialog components and static Node assertion tests. Update each dialog in place, using computed properties for customer-type-specific collateral options and the `质押 + 存单质押` coupon-rate condition; verify with static tests, production build, and a real Playwright browser check.
**Tech Stack:** Vue 2, Element UI, RuoYi request wrapper, Node static tests, npm scripts, nvm-controlled frontend runtime, Playwright real browser verification.
---
## File Structure
- Modify: `ruoyi-ui/src/views/loanPricing/workflow/components/PersonalCreateDialog.vue`
- Change `businessType` options.
- Remove `loanPurpose` and `bizProof` UI, form fields, rules, reset values, and submit payload handling.
- Change personal `collateralTypeOptions`.
- Add `couponRate` conditional field and submit cleanup.
- Modify: `ruoyi-ui/src/views/loanPricing/workflow/components/CorporateCreateDialog.vue`
- Change `businessType` options.
- Change corporate `collateralTypeOptions`.
- Add `couponRate` conditional field and submit cleanup.
- Modify: `ruoyi-ui/tests/business-type-history-rate.test.js`
- Update business-type assertions from `新客` to `新增`.
- Add `couponRate` assertions.
- Modify: `ruoyi-ui/tests/personal-create-input-params.test.js`
- Assert personal removed fields are absent.
- Assert personal collateral options match the new spec.
- Modify: `ruoyi-ui/tests/corporate-create-input-params.test.js`
- Assert corporate collateral options match the new spec.
- Modify: `doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md`
- Add frontend implementation and Playwright verification notes after execution.
## Task 1: Update Frontend Static Assertions First
**Files:**
- Modify: `ruoyi-ui/tests/business-type-history-rate.test.js`
- Modify: `ruoyi-ui/tests/personal-create-input-params.test.js`
- Modify: `ruoyi-ui/tests/corporate-create-input-params.test.js`
- [ ] **Step 1: Update business-type assertions**
In `business-type-history-rate.test.js`, replace old assertions for `新客` with:
```js
;[
['个人新增弹窗', personalCreate],
['企业新增弹窗', corporateCreate]
].forEach(([name, source]) => {
assert(source.includes('label="业务种类"'), `${name} 缺少业务种类`)
assert(source.includes('value="新增"'), `${name} 缺少新增选项`)
assert(source.includes('value="存量新增"'), `${name} 缺少存量新增选项`)
assert(source.includes('value="存量转贷"'), `${name} 缺少存量转贷选项`)
assert(!source.includes('value="新客"'), `${name} 仍保留旧业务种类 新客`)
assert(source.includes("if (value === '存量转贷')"), `${name} 未保持仅存量转贷查询历史合同`)
})
```
- [ ] **Step 2: Add coupon-rate assertions**
In the same test file, add:
```js
;[
['个人新增弹窗', personalCreate],
['企业新增弹窗', corporateCreate]
].forEach(([name, source]) => {
assert(source.includes('label="存单票面利率"'), `${name} 缺少存单票面利率字段`)
assert(source.includes('prop="couponRate"'), `${name} 缺少 couponRate prop`)
assert(source.includes('isCertificatePledge'), `${name} 缺少存单质押条件计算`)
assert(source.includes("this.form.guarType === '质押'") && source.includes("this.form.collType === '存单质押'"), `${name} couponRate 条件不正确`)
assert(source.includes('delete data.couponRate'), `${name} 未在非适用条件删除 couponRate`)
assert(source.includes('存单票面利率不能为空'), `${name} 缺少 couponRate 必填提示`)
})
```
This shared `business-type-history-rate.test.js` is expected to remain failing until both personal and corporate dialogs are updated. Do not use it as a passing checkpoint after only the personal dialog is changed.
- [ ] **Step 3: Update personal-field assertions**
In `personal-create-input-params.test.js`, replace old required assertions for `loanPurpose` and `bizProof` with absence checks:
```js
assert(
!personalCreateDialog.includes('label="贷款用途"') &&
!personalCreateDialog.includes('prop="loanPurpose"') &&
!personalCreateDialog.includes('loanPurpose:'),
'个人新增弹窗不应继续保留贷款用途字段'
)
assert(
!personalCreateDialog.includes('label="是否有经营佐证"') &&
!personalCreateDialog.includes('prop="bizProof"') &&
!personalCreateDialog.includes('bizProof:'),
'个人新增弹窗不应继续保留是否有经营佐证字段'
)
```
Update personal collateral assertion:
```js
assert(
personalCreateDialog.includes("return ['一线', '一类', '二类', '三类']") &&
personalCreateDialog.includes("return ['存单质押', '其他质押']"),
'个人新增弹窗抵质押类型选项未按新口径动态切换'
)
```
- [ ] **Step 4: Update corporate collateral assertions**
In `corporate-create-input-params.test.js`, replace old collateral assertion with:
```js
assert(
corporateCreateDialog.includes("return ['一类', '二类', '三类', '四类', '排污权抵押', '设备等其他不动产抵押']") &&
corporateCreateDialog.includes("return ['存单质押', '股权质押', '其他质押']"),
'企业新增弹窗抵质押类型选项未按新口径动态切换'
)
```
- [ ] **Step 5: Run frontend static tests and confirm failure**
Run:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:business-type-history-rate && npm --prefix ruoyi-ui run test:personal-create-input-params && npm --prefix ruoyi-ui run test:corporate-create-input-params'
```
Expected: FAIL because the UI is not updated yet.
## Task 2: Update Personal Create Dialog
**Files:**
- Modify: `ruoyi-ui/src/views/loanPricing/workflow/components/PersonalCreateDialog.vue`
- [ ] **Step 1: Change business type options**
Replace the first option:
```vue
<el-option label="新增" value="新增"/>
<el-option label="存量新增" value="存量新增"/>
<el-option label="存量转贷" value="存量转贷"/>
```
- [ ] **Step 2: Remove personal fields from template**
Delete the `贷款用途` form item and its surrounding column. Delete the `是否有经营佐证` form item. Keep `借款期限(年)` and `循环功能`.
If a row becomes single-column, leave it as a normal `el-row` with one `el-col :span="12"`; do not restructure the whole dialog.
- [ ] **Step 3: Remove personal fields from data, rules, and submit payload**
Remove these from `form` initial state and `reset()`:
```js
loanPurpose: undefined,
bizProof: false,
```
Remove `loanPurpose` from `rules`.
Remove this submit conversion:
```js
bizProof: this.form.bizProof ? '1' : '0',
```
Keep:
```js
loanLoop: this.form.loanLoop ? '1' : '0'
```
- [ ] **Step 4: Update personal collateral options**
Change `collateralTypeOptions()` to:
```js
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一线', '一类', '二类', '三类']
}
if (this.form.guarType === '质押') {
return ['存单质押', '其他质押']
}
return []
}
```
- [ ] **Step 5: Add coupon-rate field**
Add under the collateral row:
```vue
<el-col :span="12" v-if="isCertificatePledge">
<el-form-item label="存单票面利率" prop="couponRate">
<el-input v-model="form.couponRate" placeholder="请输入存单票面利率"/>
</el-form-item>
</el-col>
```
If the row already has two columns, put this field in the same `抵质押信息` area and keep the existing `900px` dialog.
- [ ] **Step 6: Add computed condition and validator**
Add:
```js
isCertificatePledge() {
return this.form.guarType === '质押' && this.form.collType === '存单质押'
}
```
Add a validator in `data()`:
```js
const validateCouponRate = (rule, value, callback) => {
if (this.isCertificatePledge && !value) {
callback(new Error('存单票面利率不能为空'))
return
}
callback()
}
```
Add rule:
```js
couponRate: [
{validator: validateCouponRate, trigger: "blur"}
]
```
- [ ] **Step 7: Add coupon-rate state cleanup**
Add `couponRate: undefined` to `form` initial state and `reset()`.
Add watcher:
```js
'form.collType'() {
this.resetCouponRateIfNotCertificatePledge()
}
```
Add method:
```js
resetCouponRateIfNotCertificatePledge() {
if (!this.isCertificatePledge) {
this.form.couponRate = undefined
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['couponRate'])
}
})
}
}
```
Call it at the end of `resetCollateralFields()`.
- [ ] **Step 8: Add submit cleanup and front-end guard**
In `submitForm`, before `this.submitting = true`, add:
```js
if (this.isCertificatePledge && !this.form.couponRate) {
this.$modal.msgWarning("存单票面利率不能为空")
return
}
```
After collateral handling:
```js
if (!this.isCertificatePledge) {
delete data.couponRate
}
```
- [ ] **Step 9: Run personal static tests**
Run:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:personal-create-input-params'
```
Expected: PASS. The shared `test:business-type-history-rate` is intentionally not run here because it also asserts corporate changes that are implemented in Task 3.
- [ ] **Step 10: Commit personal frontend changes**
```bash
git add ruoyi-ui/src/views/loanPricing/workflow/components/PersonalCreateDialog.vue \
ruoyi-ui/tests/personal-create-input-params.test.js
git commit -m "调整上虞对私新增字段口径"
```
## Task 3: Update Corporate Create Dialog
**Files:**
- Modify: `ruoyi-ui/src/views/loanPricing/workflow/components/CorporateCreateDialog.vue`
- Modify: `ruoyi-ui/tests/corporate-create-input-params.test.js`
- Modify: `ruoyi-ui/tests/business-type-history-rate.test.js`
- [ ] **Step 1: Change business type options**
Use:
```vue
<el-option label="新增" value="新增"/>
<el-option label="存量新增" value="存量新增"/>
<el-option label="存量转贷" value="存量转贷"/>
```
- [ ] **Step 2: Update corporate collateral options**
Change `collateralTypeOptions()` to:
```js
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一类', '二类', '三类', '四类', '排污权抵押', '设备等其他不动产抵押']
}
if (this.form.guarType === '质押') {
return ['存单质押', '股权质押', '其他质押']
}
return []
}
```
- [ ] **Step 3: Add coupon-rate field and state**
Mirror the personal dialog implementation:
```vue
<el-col :span="12" v-if="isCertificatePledge">
<el-form-item label="存单票面利率" prop="couponRate">
<el-input v-model="form.couponRate" placeholder="请输入存单票面利率"/>
</el-form-item>
</el-col>
```
Add:
```js
couponRate: undefined
```
to initial `form` and `reset()`.
- [ ] **Step 4: Add computed condition, validator, watcher, and submit cleanup**
Use the same names as personal dialog:
```js
isCertificatePledge() {
return this.form.guarType === '质押' && this.form.collType === '存单质押'
}
```
Use the same `validateCouponRate`, `couponRate` rule, `form.collType` watcher, `resetCouponRateIfNotCertificatePledge`, front-end guard, and:
```js
if (!this.isCertificatePledge) {
delete data.couponRate
}
```
- [ ] **Step 5: Run corporate static tests**
Run:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:corporate-create-input-params && npm --prefix ruoyi-ui run test:business-type-history-rate'
```
Expected: PASS.
- [ ] **Step 6: Commit corporate frontend changes**
```bash
git add ruoyi-ui/src/views/loanPricing/workflow/components/CorporateCreateDialog.vue \
ruoyi-ui/tests/corporate-create-input-params.test.js \
ruoyi-ui/tests/business-type-history-rate.test.js
git commit -m "调整上虞对公新增字段口径"
```
## Task 4: Frontend Build and Real Page Verification
**Files:**
- Modify: `doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md`
- [ ] **Step 1: Run all related static tests**
Run:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run test:business-type-history-rate && npm --prefix ruoyi-ui run test:personal-create-input-params && npm --prefix ruoyi-ui run test:corporate-create-input-params'
```
Expected: PASS.
- [ ] **Step 2: Run production build**
Run:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run build:prod'
```
Expected: PASS and `ruoyi-ui/dist` generated.
- [ ] **Step 3: Start the local app stack**
Use the repository's existing startup scripts if available. If a frontend dev server is needed, run it with Node controlled by `nvm`:
```bash
zsh -lic 'nvm use 14.21.3 >/dev/null && npm --prefix ruoyi-ui run dev'
```
Record the PID and URL. If the backend also needs restart, use the existing repository backend restart script rather than inventing a new start path.
- [ ] **Step 4: Use Playwright on the real page**
Open the actual local workflow page, not a prototype. Verify:
- Personal create dialog:
- `业务种类` shows `新增/存量新增/存量转贷`.
- `新客` is absent.
- `贷款用途` is absent.
- `是否有经营佐证` is absent.
- `抵押` shows `一线/一类/二类/三类`.
- `质押 + 存单质押` shows `存单票面利率`.
- Leaving `存单票面利率` empty blocks submit.
- Corporate create dialog:
- `业务种类` shows `新增/存量新增/存量转贷`.
- `抵押` shows `一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`.
- `质押` shows `存单质押/股权质押/其他质押`.
- `质押 + 存单质押` shows `存单票面利率`.
- Leaving `存单票面利率` empty blocks submit.
- History-rate behavior:
- `存量转贷` triggers historical-contract query.
- `新增` and `存量新增` do not trigger historical-contract query.
- [ ] **Step 5: Stop test processes**
Stop any frontend/backend processes started in this task. Verify with:
```bash
ps -ef | rg 'vue-cli-service|ruoyi-admin|RuoYiApplication'
```
Expected: no leftover processes from this test run.
- [ ] **Step 6: Update implementation record**
Append:
```markdown
## 前端实现
- 调整个人/企业新增弹窗业务种类选项为 `新增/存量新增/存量转贷`
- 个人新增弹窗剔除 `loanPurpose``bizProof`
- 按客户类型和担保方式调整抵质押类型选项。
- 新增 `质押 + 存单质押` 下的 `couponRate` 存单票面利率字段、必填校验和提交清理。
## 前端验证
- `npm --prefix ruoyi-ui run test:business-type-history-rate`
- `npm --prefix ruoyi-ui run test:personal-create-input-params`
- `npm --prefix ruoyi-ui run test:corporate-create-input-params`
- `npm --prefix ruoyi-ui run build:prod`
- Playwright 真实页面验证:通过
```
- [ ] **Step 7: Commit frontend verification record**
```bash
git add doc/implementation-report-2026-05-11-shangyu-pricing-field-adjustment.md
git commit -m "记录上虞字段调整前端验证"
```

View File

@@ -0,0 +1,231 @@
# 上虞利率定价字段口径调整设计
## 背景
当前上虞利率定价新增流程已经具备个人、企业两个新增弹窗,并已有业务种类、历史贷款利率和历史贷款合同选择链路。本次需求是在现有链路上调整字段口径:
- 前端通用业务种类改为 `新增/存量新增/存量转贷`,仅 `存量转贷` 查询历史贷款合同。
- `质押 + 存单质押` 时新增 `couponRate` 存单票面利率,客户经理填写后上传。
- 上虞对私剔除 `loanPurpose` 贷款用途和 `bizProof` 是否有经营佐证。
- 上虞对私、对公按客户类型和担保方式分别调整 `collType` 可选值。
用户已确认本次按页面、创建接口、服务校验、流程保存、模型调用参数全链路同步调整。用户也确认 `couponRate``质押 + 存单质押` 时必须填写。对公 `businessType` 上传模型接口这一条用户已明确要求忽略,因此本设计不新增、不验证 `businessType` 模型入参链路;本次模型入参调整只覆盖 `couponRate`
## 范围
### 本次包含
- 调整个人和企业新增弹窗的 `businessType` 选项。
- 保持 `businessType=存量转贷` 才查询历史贷款合同。
- 新增 `couponRate` 条件展示、必填校验、提交和模型入参传递。
- 移除个人新增弹窗中的 `loanPurpose``bizProof`
- 后端取消个人创建 DTO 对 `loanPurpose``bizProof` 的必填依赖。
- 按个人/企业和抵押/质押分别校验 `collType` 可选值。
- 新增或更新数据库字段定义,使 `couponRate` 能保存到流程表。
- 更新直接相关的前端静态断言和后端单元测试。
### 本次不包含
- 不重做历史贷款合同查询接口。
- 不改历史贷款合同选择弹窗结构。
- 不新增字典配置或字段配置化能力。
- 不处理旧历史数据回填。
- 不新增或验证对公 `businessType` 上传模型逻辑;该条按用户确认忽略。
## 推荐方案
采用全链路最短路径同步方案。
页面负责字段展示、条件清空和提交前整理。后端负责创建 DTO 接收、统一业务校验、流程实体保存和模型入参传递。SQL 同步补充 `coupon_rate` 字段,保证新环境和已有环境都能落库。
不采用只改前端的方式,因为直接调用创建接口会绕过 `couponRate` 必填和 `collType` 口径校验。不采用配置化字段规则,因为本次口径明确,配置化会超出需求范围。
## 前端设计
### 通用业务种类
个人新增弹窗和企业新增弹窗的 `businessType` 选项统一为:
- `新增`
- `存量新增`
- `存量转贷`
交互规则:
- 选择 `存量转贷` 时,沿用现有客户内码查询历史贷款合同逻辑。
- 选择 `新增``存量新增` 时,清空历史合同选择和 `loanRateHistory`
-`存量转贷` 提交前不上传 `loanRateHistory`
### 存单票面利率
个人和企业新增弹窗都新增 `couponRate` 输入框,字段名称展示为 `存单票面利率`
展示和提交规则:
- 仅当 `guarType=质押``collType=存单质押` 时展示。
- 展示时必填。
- 切换担保方式或抵质押类型后,如果不再满足 `质押 + 存单质押`,清空 `couponRate`
- 不满足条件时提交前不上传 `couponRate`
### 上虞对私字段调整
个人新增弹窗移除:
- `贷款用途 loanPurpose`
- `是否有经营佐证 bizProof`
个人提交数据不再包含这两个字段。个人的 `loanLoop``collThirdParty` 等既有字段保持现有处理方式。
个人 `collType` 选项:
- `guarType=抵押``一线/一类/二类/三类`
- `guarType=质押``存单质押/其他质押`
### 上虞对公字段调整
企业 `collType` 选项:
- `guarType=抵押``一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`
- `guarType=质押``存单质押/股权质押/其他质押`
企业其他既有上传字段保持现状。
## 后端设计
### DTO 和实体
`PersonalLoanPricingCreateDTO`
- `businessType` 允许值改为 `新增/存量新增/存量转贷`
- 移除 `loanPurpose` 必填和枚举校验。
- 移除 `bizProof` 业务依赖。
- 新增 `couponRate`
`CorporateLoanPricingCreateDTO`
- `businessType` 允许值改为 `新增/存量新增/存量转贷`
- 新增 `couponRate`
- `collType` 允许值覆盖对公抵押和质押新口径。
`LoanPricingWorkflow`
- `businessType` 注释更新为 `新增/存量新增/存量转贷`
- 新增 `couponRate` 字段,对应数据库 `coupon_rate`
- 个人剔除字段不再作为本次创建链路必需字段。
`ModelInvokeDTO`
- 新增 `couponRate`,用于模型调用参数。
- 不新增或调整 `businessType` 模型入参;该条按用户确认不纳入本次范围。
`LoanPricingConverter`
- 个人和企业创建 DTO 都映射 `couponRate`
- 个人转换不再依赖 `loanPurpose``bizProof`
### 服务层校验
创建流程统一校验放在 `LoanPricingWorkflowServiceImpl`,确保绕过前端直接调用接口也会被拦截。
校验规则:
- `businessType` 必填,只允许 `新增/存量新增/存量转贷`
- `businessType=存量转贷` 时,`loanRateHistory` 必填。
- `guarType=质押``collType=存单质押` 时,`couponRate` 必填。
- `custType=个人``guarType=抵押` 时,`collType` 只允许 `一线/一类/二类/三类`
- `custType=个人``guarType=质押` 时,`collType` 只允许 `存单质押/其他质押`
- `custType=企业``guarType=抵押` 时,`collType` 只允许 `一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`
- `custType=企业``guarType=质押` 时,`collType` 只允许 `存单质押/股权质押/其他质押`
当担保方式不是抵押或质押时,不要求 `collType``couponRate`
## 数据库设计
流程表新增字段:
```sql
ALTER TABLE `loan_pricing_workflow`
ADD COLUMN `coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率' AFTER `loan_rate_history`;
```
需要同步更新:
- 当前迁移 SQL。
- `sql/loan_pricing_workflow.sql`
- `sql/loan_pricing_schema_20260328.sql`
- `sql/loan_pricing_prod_init_20260331.sql`
已有历史数据不回填,`coupon_rate` 允许为空。
## 数据流
1. 用户进入利率定价列表,选择新增。
2. 用户选择个人或企业客户,并通过客户号映射选择客户内码。
3. 打开对应新增弹窗。
4. 用户选择业务种类。
5. 若业务种类为 `存量转贷`,前端使用客户内码查询历史贷款合同并回填 `loanRateHistory`
6. 用户选择担保方式和抵质押类型。
7. 若选择 `质押 + 存单质押`,前端展示并要求填写 `couponRate`
8. 前端提交前清理不适用字段。
9. 后端创建接口接收 DTO。
10. 转换器映射为 `LoanPricingWorkflow`
11. 服务层做业务种类、历史利率、抵质押类型和 `couponRate` 校验。
12. 流程表保存。
13. 模型调用前复制流程字段到 `ModelInvokeDTO`,带出 `couponRate``businessType` 模型入参不在本次设计范围内。
## 错误处理
- 业务种类为空:提示 `请选择业务种类` 或后端返回 `业务种类不能为空`
- 业务种类为旧值或非法值:后端返回 `业务种类必须是:新增、存量新增、存量转贷之一`
- `存量转贷` 未选择历史贷款合同:提示或返回 `请选择历史贷款合同`
- `质押 + 存单质押` 未填写 `couponRate`:提示或返回 `存单票面利率不能为空`
- `collType` 不符合当前客户类型和担保方式:后端返回对应可选值错误。
## 测试设计
### 前端静态断言
更新或新增前端测试脚本,覆盖:
- 个人和企业新增弹窗都包含 `新增/存量新增/存量转贷`
- 个人和企业新增弹窗不再包含旧选项 `新客`
- 个人新增弹窗不再展示 `贷款用途``是否有经营佐证`
- 个人抵押选项为 `一线/一类/二类/三类`
- 个人质押选项包含 `存单质押/其他质押`
- 企业抵押选项为 `一类/二类/三类/四类/排污权抵押/设备等其他不动产抵押`
- 企业质押选项为 `存单质押/股权质押/其他质押`
- `couponRate` 仅在 `质押 + 存单质押` 条件下展示、必填、提交。
- 非适用条件提交前删除 `couponRate`
### 后端单元测试
更新 `LoanPricingWorkflowServiceImplTest` 或新增直接相关测试,覆盖:
- `businessType=新增` 通过。
- `businessType=新客` 拒绝。
- `businessType=存量转贷` 且缺少 `loanRateHistory` 拒绝。
- `guarType=质押``collType=存单质押` 且缺少 `couponRate` 拒绝。
- 个人抵押允许 `一线/一类/二类/三类`,拒绝对公专属抵押值。
- 企业抵押允许 `排污权抵押/设备等其他不动产抵押`
- 企业质押允许 `股权质押/其他质押`
### 实际页面验证
实现完成后按项目规则验证:
- 使用 `nvm` 控制前端 Node 版本。
- 启动前端页面并用 Playwright 打开真实页面,不使用 prototype。
- 验证个人新增弹窗字段移除、业务种类选项、抵押/质押选项和 `couponRate` 条件展示。
- 验证企业新增弹窗业务种类选项、抵押/质押选项和 `couponRate` 条件展示。
- 验证 `存量转贷` 仍会触发历史合同查询,`新增/存量新增` 不触发。
- 测试结束关闭本次启动的前后端进程。
## 验收标准
- 页面字段和选项与本设计一致。
- 创建接口不能接受旧业务种类 `新客`
- `质押 + 存单质押` 未填 `couponRate` 时前后端都不能提交成功。
- 不适用 `couponRate` 时不会上传该字段。
- `couponRate` 能保存到流程表并进入模型调用参数。
- 对私不再要求或上传 `loanPurpose``bizProof`
- 前端静态断言、后端单元测试和真实页面验证通过。

BIN
ruoyi-admin/.DS_Store vendored

Binary file not shown.

View File

@@ -82,6 +82,9 @@ model:
personal-url: http://localhost:63310/rate/pricing/mock/invokeModel/personal
corporate-url: http://localhost:63310/rate/pricing/mock/invokeModel/corporate
loan-pricing-external:
app-code: 1a89fa84abda480ba93ed73fd01ffd07
customer-map:
personal-url: http://localhost:63310/rate/pricing/mock/customer-map/personal
corporate-url: http://localhost:63310/rate/pricing/mock/customer-map/corporate

View File

@@ -82,12 +82,15 @@ model:
personal-url: http://64.202.32.40:8083/api/service/interface/invokeService/syllcs
corporate-url: http://64.202.32.40:8083/api/service/interface/invokeService/sydgllcs
loan-pricing-external:
app-code: 1a89fa84abda480ba93ed73fd01ffd07
customer-map:
personal-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ind_idmapno?appCode=1a89fa84abda480ba93ed73fd01ffd07&cust_id=
corporate-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ent_idmapno?appCode=1a89fa84abda480ba93ed73fd01ffd07&cust_id=
personal-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ind_idmapno
corporate-url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_lilvcesuan_ent_idmapno
loan-rate-history:
url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_loan_rate_history?appCode=1a89fa84abda480ba93ed73fd01ffd07
url: http://552f7aff0acd4c09ac3b83dbfee57fa0.apigateway.res.dc-pdt-zj96596.com/shangyu_loan_rate_history
security:
password-transfer:

View File

@@ -82,6 +82,9 @@ model:
personal-url: http://localhost:63310/rate/pricing/mock/invokeModel/personal
corporate-url: http://localhost:63310/rate/pricing/mock/invokeModel/corporate
loan-pricing-external:
app-code: 1a89fa84abda480ba93ed73fd01ffd07
customer-map:
personal-url: http://localhost:63310/rate/pricing/mock/customer-map/personal
corporate-url: http://localhost:63310/rate/pricing/mock/customer-map/corporate

View File

@@ -41,9 +41,9 @@ public class CorporateLoanPricingCreateDTO implements Serializable {
@NotBlank(message = "申请金额不能为空")
private String applyAmt;
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "存量转贷", allowableValues = {"", "存量新增", "存量转贷"})
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "存量转贷", allowableValues = {"", "存量新增", "存量转贷"})
@NotBlank(message = "业务种类不能为空")
@Pattern(regexp = "^(新|存量新增|存量转贷)$", message = "业务种类必须是:新、存量新增、存量转贷之一")
@Pattern(regexp = "^(新|存量新增|存量转贷)$", message = "业务种类必须是:新、存量新增、存量转贷之一")
private String businessType;
@Schema(description = "历史贷款利率", example = "3.65")
@@ -62,10 +62,13 @@ public class CorporateLoanPricingCreateDTO implements Serializable {
@Schema(description = "贸易和建筑业企业标识", example = "0")
private String isTradeBuildEnt;
@Schema(description = "抵质押类型", example = "一类", allowableValues = {"一类", "二类", "三类", "四类", "其他", "存单质押"})
@Pattern(regexp = "^(一类|二类|三类|四类|其他|存单质押)$", message = "抵质押类型必须是:一类、二类、三类、四类、其他、存单质押之一")
@Schema(description = "抵质押类型", example = "一类", allowableValues = {"一类", "二类", "三类", "四类", "排污权抵押", "设备等其他不动产抵押", "存单质押", "股权质押", "其他质押"})
@Pattern(regexp = "^(一类|二类|三类|四类|排污权抵押|设备等其他不动产抵押|存单质押|股权质押|其他质押)$", message = "抵质押类型必须是:一类、二类、三类、四类、排污权抵押、设备等其他不动产抵押、存单质押、股权质押、其他质押之一")
private String collType;
@Schema(description = "抵质押物是否三方所有", example = "0")
private String collThirdParty;
@Schema(description = "存单票面利率", example = "2.15")
private String couponRate;
}

View File

@@ -158,6 +158,11 @@ public class ModelInvokeDTO {
*/
private String loanRateHistory;
/**
* 存单票面利率
*/
private String couponRate;
// /**
// * 贷款利率(必填)
// */

View File

@@ -41,14 +41,9 @@ public class PersonalLoanPricingCreateDTO implements Serializable {
@NotBlank(message = "申请金额不能为空")
private String applyAmt;
@Schema(description = "贷款用途", requiredMode = Schema.RequiredMode.REQUIRED, example = "business", allowableValues = {"consumer", "business"})
@NotBlank(message = "贷款用途不能为空")
@Pattern(regexp = "^(consumer|business)$", message = "贷款用途必须是consumer、business之一")
private String loanPurpose;
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "存量转贷", allowableValues = {"新客", "存量新增", "存量转贷"})
@Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "存量转贷", allowableValues = {"新增", "存量新增", "存量转贷"})
@NotBlank(message = "业务种类不能为空")
@Pattern(regexp = "^(新|存量新增|存量转贷)$", message = "业务种类必须是:新、存量新增、存量转贷之一")
@Pattern(regexp = "^(新|存量新增|存量转贷)$", message = "业务种类必须是:新、存量新增、存量转贷之一")
private String businessType;
@Schema(description = "历史贷款利率", example = "3.65")
@@ -58,15 +53,15 @@ public class PersonalLoanPricingCreateDTO implements Serializable {
@NotBlank(message = "借款期限不能为空")
private String loanTerm;
@Schema(description = "是否有经营佐证", example = "1")
private String bizProof;
@Schema(description = "循环功能", example = "0")
private String loanLoop;
@Schema(description = "抵质押类型", example = "一类")
@Schema(description = "抵质押类型", example = "一类", allowableValues = {"一线", "一类", "二类", "三类", "存单质押", "其他质押"})
private String collType;
@Schema(description = "抵质押物是否三方所有", example = "0")
private String collThirdParty;
@Schema(description = "存单票面利率", example = "2.15")
private String couponRate;
}

View File

@@ -103,12 +103,15 @@ public class LoanPricingWorkflow implements Serializable
/** 贷款用途: consumer-消费/business-经营 */
private String loanPurpose;
/** 业务种类: 新/存量新增/存量转贷 */
/** 业务种类: 新/存量新增/存量转贷 */
private String businessType;
/** 历史贷款利率 */
private String loanRateHistory;
/** 存单票面利率 */
private String couponRate;
/** 是否有经营佐证: true/false */
private String bizProof;
@@ -147,6 +150,10 @@ public class LoanPricingWorkflow implements Serializable
@TableField(fill = FieldFill.INSERT)
private String createBy;
/** 列表数据权限创建者过滤条件 */
@TableField(exist = false)
private String dataScopeCreateBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT)

View File

@@ -6,7 +6,9 @@ import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.loanpricing.domain.vo.CustomerMapRecordVO;
import java.net.URI;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@@ -30,6 +32,9 @@ public class LoanPricingCustomerMapService
@Value("${customer-map.corporate-url}")
private String corporateUrl;
@Value("${loan-pricing-external.app-code:}")
private String appCode;
public LoanPricingCustomerMapService()
{
this(new RestTemplate());
@@ -41,10 +46,16 @@ public class LoanPricingCustomerMapService
}
LoanPricingCustomerMapService(RestTemplate restTemplate, String personalUrl, String corporateUrl)
{
this(restTemplate, personalUrl, corporateUrl, null);
}
LoanPricingCustomerMapService(RestTemplate restTemplate, String personalUrl, String corporateUrl, String appCode)
{
this.restTemplate = restTemplate;
this.personalUrl = personalUrl;
this.corporateUrl = corporateUrl;
this.appCode = appCode;
}
public List<CustomerMapRecordVO> queryPersonal(String custId)
@@ -64,15 +75,12 @@ public class LoanPricingCustomerMapService
{
throw new ServiceException("客户号不能为空");
}
URI uri = UriComponentsBuilder.fromHttpUrl(url)
.queryParam("cust_id", normalizedCustId)
.build()
.encode()
.toUri();
URI uri = buildGetParamUri(url, "cust_id", normalizedCustId);
Map<String, String> requestParams = buildRequestParamLog("cust_id", normalizedCustId);
CustomerMapResponse response = restTemplate.getForObject(uri, CustomerMapResponse.class);
log.info("后端外部接口调用完成\n请求URL{}\n请求参数\n{}\n返回参数\n{}",
uri,
HttpUtils.formatLogValue(Collections.singletonMap("cust_id", normalizedCustId)),
HttpUtils.formatLogValue(requestParams),
HttpUtils.formatLogValue(response));
if (response == null)
{
@@ -85,6 +93,34 @@ public class LoanPricingCustomerMapService
return response.getData() == null ? Collections.emptyList() : response.getData();
}
private URI buildGetParamUri(String url, String paramName, String paramValue)
{
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url)
.replaceQueryParam("appCode")
.replaceQueryParam(paramName);
String normalizedAppCode = StringUtils.trimWhitespace(appCode);
if (StringUtils.hasText(normalizedAppCode))
{
builder.queryParam("appCode", normalizedAppCode);
}
return builder.queryParam(paramName, paramValue)
.build()
.encode()
.toUri();
}
private Map<String, String> buildRequestParamLog(String paramName, String paramValue)
{
Map<String, String> requestParams = new LinkedHashMap<>();
String normalizedAppCode = StringUtils.trimWhitespace(appCode);
if (StringUtils.hasText(normalizedAppCode))
{
requestParams.put("appCode", normalizedAppCode);
}
requestParams.put(paramName, paramValue);
return requestParams;
}
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
static class CustomerMapResponse

View File

@@ -6,7 +6,9 @@ import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.loanpricing.domain.vo.HistoryLoanContractVO;
import java.net.URI;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@@ -24,6 +26,9 @@ public class LoanRateHistoryService
@Value("${loan-rate-history.url}")
private String historyUrl;
@Value("${loan-pricing-external.app-code:}")
private String appCode;
public LoanRateHistoryService()
{
this(new RestTemplate());
@@ -35,9 +40,15 @@ public class LoanRateHistoryService
}
LoanRateHistoryService(RestTemplate restTemplate, String historyUrl)
{
this(restTemplate, historyUrl, null);
}
LoanRateHistoryService(RestTemplate restTemplate, String historyUrl, String appCode)
{
this.restTemplate = restTemplate;
this.historyUrl = historyUrl;
this.appCode = appCode;
}
public List<HistoryLoanContractVO> query(String custIsn)
@@ -47,15 +58,12 @@ public class LoanRateHistoryService
{
throw new ServiceException("客户内码不能为空");
}
URI uri = UriComponentsBuilder.fromHttpUrl(historyUrl)
.queryParam("cust_isn", normalizedCustIsn)
.build()
.encode()
.toUri();
URI uri = buildGetParamUri(historyUrl, "cust_isn", normalizedCustIsn);
Map<String, String> requestParams = buildRequestParamLog("cust_isn", normalizedCustIsn);
HistoryLoanContractResponse response = restTemplate.getForObject(uri, HistoryLoanContractResponse.class);
log.info("后端外部接口调用完成\n请求URL{}\n请求参数\n{}\n返回参数\n{}",
uri,
HttpUtils.formatLogValue(Collections.singletonMap("cust_isn", normalizedCustIsn)),
HttpUtils.formatLogValue(requestParams),
HttpUtils.formatLogValue(response));
if (response == null)
{
@@ -68,6 +76,34 @@ public class LoanRateHistoryService
return response.getData() == null ? Collections.emptyList() : response.getData();
}
private URI buildGetParamUri(String url, String paramName, String paramValue)
{
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url)
.replaceQueryParam("appCode")
.replaceQueryParam(paramName);
String normalizedAppCode = StringUtils.trimWhitespace(appCode);
if (StringUtils.hasText(normalizedAppCode))
{
builder.queryParam("appCode", normalizedAppCode);
}
return builder.queryParam(paramName, paramValue)
.build()
.encode()
.toUri();
}
private Map<String, String> buildRequestParamLog(String paramName, String paramValue)
{
Map<String, String> requestParams = new LinkedHashMap<>();
String normalizedAppCode = StringUtils.trimWhitespace(appCode);
if (StringUtils.hasText(normalizedAppCode))
{
requestParams.put("appCode", normalizedAppCode);
}
requestParams.put(paramName, paramValue);
return requestParams;
}
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
static class HistoryLoanContractResponse

View File

@@ -3,7 +3,12 @@ package com.ruoyi.loanpricing.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
@@ -38,6 +43,10 @@ import java.util.Objects;
@Service
public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowService
{
private static final String WORKFLOW_ADMIN_ROLE_NAME = "管理员";
private static final String WORKFLOW_ADMIN_ROLE_KEY = "headAdmin";
@Resource
private LoanPricingWorkflowMapper loanPricingWorkflowMapper;
@@ -67,6 +76,7 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow)
{
validateBusinessTypeAndHistoryRate(loanPricingWorkflow);
validateCollateralTypeAndCouponRate(loanPricingWorkflow);
// 自动生成业务方流水号(时间戳)
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
@@ -95,10 +105,10 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
if (!StringUtils.hasText(workflow.getBusinessType())) {
throw new ServiceException("业务种类不能为空");
}
if (!"".equals(workflow.getBusinessType())
if (!"".equals(workflow.getBusinessType())
&& !"存量新增".equals(workflow.getBusinessType())
&& !"存量转贷".equals(workflow.getBusinessType())) {
throw new ServiceException("业务种类必须是:新、存量新增、存量转贷之一");
throw new ServiceException("业务种类必须是:新、存量新增、存量转贷之一");
}
if ("存量转贷".equals(workflow.getBusinessType())
&& !StringUtils.hasText(workflow.getLoanRateHistory())) {
@@ -106,6 +116,57 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
}
}
private void validateCollateralTypeAndCouponRate(LoanPricingWorkflow workflow) {
if (!"抵押".equals(workflow.getGuarType()) && !"质押".equals(workflow.getGuarType())) {
return;
}
if (!StringUtils.hasText(workflow.getCollType())) {
throw new ServiceException("请选择抵质押类型");
}
if ("个人".equals(workflow.getCustType())) {
validatePersonalCollateralType(workflow);
}
if ("企业".equals(workflow.getCustType())) {
validateCorporateCollateralType(workflow);
}
if ("质押".equals(workflow.getGuarType())
&& "存单质押".equals(workflow.getCollType())
&& !StringUtils.hasText(workflow.getCouponRate())) {
throw new ServiceException("存单票面利率不能为空");
}
}
private void validatePersonalCollateralType(LoanPricingWorkflow workflow) {
if ("抵押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "一线", "一类", "二类", "三类")) {
throw new ServiceException("个人抵押抵质押类型必须是:一线、一类、二类、三类之一");
}
if ("质押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "存单质押", "其他质押")) {
throw new ServiceException("个人质押抵质押类型必须是:存单质押、其他质押之一");
}
}
private void validateCorporateCollateralType(LoanPricingWorkflow workflow) {
if ("抵押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "一类", "二类", "三类", "四类", "排污权抵押", "设备等其他不动产抵押")) {
throw new ServiceException("企业抵押抵质押类型必须是:一类、二类、三类、四类、排污权抵押、设备等其他不动产抵押之一");
}
if ("质押".equals(workflow.getGuarType())
&& !isOneOf(workflow.getCollType(), "存单质押", "股权质押", "其他质押")) {
throw new ServiceException("企业质押抵质押类型必须是:存单质押、股权质押、其他质押之一");
}
}
private boolean isOneOf(String value, String... allowedValues) {
for (String allowedValue : allowedValues) {
if (allowedValue.equals(value)) {
return true;
}
}
return false;
}
/**
* 发起个人客户利率定价流程
*
@@ -157,7 +218,8 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
@Override
public IPage<LoanPricingWorkflowListVO> selectLoanPricingPage(Page<LoanPricingWorkflowListVO> page, LoanPricingWorkflow loanPricingWorkflow)
{
IPage<LoanPricingWorkflowListVO> pageResult = loanPricingWorkflowMapper.selectWorkflowPageWithRates(page, loanPricingWorkflow);
LoanPricingWorkflow scopedQuery = applyWorkflowListDataScope(loanPricingWorkflow);
IPage<LoanPricingWorkflowListVO> pageResult = loanPricingWorkflowMapper.selectWorkflowPageWithRates(page, scopedQuery);
pageResult.getRecords().forEach(row -> row.setCustName(
loanPricingSensitiveDisplayService.maskCustName(
sensitiveFieldCryptoService.decrypt(row.getCustName()))));
@@ -240,6 +302,41 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
return wrapper;
}
private LoanPricingWorkflow applyWorkflowListDataScope(LoanPricingWorkflow query)
{
LoanPricingWorkflow scopedQuery = query == null ? new LoanPricingWorkflow() : query;
LoginUser loginUser = SecurityUtils.getLoginUser();
if (!canViewAllWorkflows(loginUser))
{
scopedQuery.setDataScopeCreateBy(buildCurrentCreateBy(loginUser));
}
return scopedQuery;
}
private boolean canViewAllWorkflows(LoginUser loginUser)
{
SysUser user = loginUser.getUser();
if (user.isAdmin())
{
return true;
}
List<SysRole> roles = user.getRoles();
if (roles == null)
{
return false;
}
return roles.stream().anyMatch(role -> role != null
&& UserConstants.ROLE_NORMAL.equals(role.getStatus())
&& (WORKFLOW_ADMIN_ROLE_NAME.equals(role.getRoleName())
|| WORKFLOW_ADMIN_ROLE_KEY.equals(role.getRoleKey())));
}
private String buildCurrentCreateBy(LoginUser loginUser)
{
SysUser user = loginUser.getUser();
return user.getNickName() + "-" + loginUser.getUsername();
}
private void maskModelRetailOutputBasicInfo(ModelRetailOutputFields modelRetailOutputFields)
{
modelRetailOutputFields.setCustName(

View File

@@ -28,14 +28,13 @@ public class LoanPricingConverter {
entity.setIdNum(dto.getIdNum());
entity.setGuarType(dto.getGuarType());
entity.setApplyAmt(dto.getApplyAmt());
entity.setLoanPurpose(dto.getLoanPurpose());
entity.setBusinessType(dto.getBusinessType());
entity.setLoanRateHistory(dto.getLoanRateHistory());
entity.setCouponRate(dto.getCouponRate());
entity.setLoanTerm(dto.getLoanTerm());
entity.setCollType(dto.getCollType());
entity.setCollThirdParty(dto.getCollThirdParty());
// 映射个人特有字段
entity.setBizProof(dto.getBizProof());
entity.setLoanLoop(dto.getLoanLoop());
return entity;
}
@@ -58,6 +57,7 @@ public class LoanPricingConverter {
entity.setApplyAmt(dto.getApplyAmt());
entity.setBusinessType(dto.getBusinessType());
entity.setLoanRateHistory(dto.getLoanRateHistory());
entity.setCouponRate(dto.getCouponRate());
entity.setRepayMethod(dto.getRepayMethod());
entity.setCollType(dto.getCollType());
entity.setCollThirdParty(dto.getCollThirdParty());

View File

@@ -23,8 +23,11 @@
LEFT JOIN model_retail_output_fields mr ON lpw.model_output_id = mr.id
LEFT JOIN model_corp_output_fields mc ON lpw.model_output_id = mc.id
<where>
<if test="query != null and query.dataScopeCreateBy != null and query.dataScopeCreateBy != ''">
AND lpw.create_by = #{query.dataScopeCreateBy}
</if>
<if test="query != null and query.createBy != null and query.createBy != ''">
AND lpw.create_by LIKE CONCAT('%', #{query.createBy}, '%')
AND SUBSTRING_INDEX(lpw.create_by, '-', -1) LIKE CONCAT('%', #{query.createBy}, '%')
</if>
<if test="query != null and query.custIsn != null and query.custIsn != ''">
AND lpw.cust_isn LIKE CONCAT('%', #{query.custIsn}, '%')

View File

@@ -18,5 +18,7 @@ class LoanPricingWorkflowMapperXmlTest
assertTrue(xml.contains("WHEN lpw.cust_type = '个人' THEN mr.final_calculate_rate"));
assertTrue(xml.contains("WHEN lpw.cust_type = '企业' THEN mc.calculate_rate"));
assertTrue(xml.contains("lpw.create_by = #{query.dataScopeCreateBy}"));
assertTrue(xml.contains("SUBSTRING_INDEX(lpw.create_by, '-', -1) LIKE CONCAT('%', #{query.createBy}, '%')"));
}
}

View File

@@ -18,6 +18,7 @@ import java.util.Objects;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
@@ -46,24 +47,28 @@ class LoanPricingModelServicePersonalParamsTest {
private LoanPricingModelService loanPricingModelService;
@Test
void shouldContainLoanPurposeAndLoanTermInPersonalCreateDto() throws NoSuchFieldException {
assertNotNull(PersonalLoanPricingCreateDTO.class.getDeclaredField("loanPurpose"));
void shouldRemoveLoanPurposeAndKeepLoanTermInPersonalCreateDto() throws NoSuchFieldException {
assertThrows(NoSuchFieldException.class,
() -> PersonalLoanPricingCreateDTO.class.getDeclaredField("loanPurpose"));
assertThrows(NoSuchFieldException.class,
() -> PersonalLoanPricingCreateDTO.class.getDeclaredField("bizProof"));
assertNotNull(PersonalLoanPricingCreateDTO.class.getDeclaredField("loanTerm"));
}
@Test
void shouldMapLoanPurposeAndLoanTermFromPersonalDto() {
void shouldNotMapLoanPurposeAndBizProofFromPersonalDto() {
PersonalLoanPricingCreateDTO dto = new PersonalLoanPricingCreateDTO();
dto.setCustIsn("CUST001");
dto.setCustName("张三");
dto.setGuarType("信用");
dto.setApplyAmt("100000");
dto.setLoanPurpose("business");
dto.setBusinessType("新增");
dto.setLoanTerm("3");
LoanPricingWorkflow workflow = LoanPricingConverter.toEntity(dto);
assertEquals("business", workflow.getLoanPurpose());
assertNull(workflow.getLoanPurpose());
assertNull(workflow.getBizProof());
assertEquals("3", workflow.getLoanTerm());
}
@@ -87,9 +92,7 @@ class LoanPricingModelServicePersonalParamsTest {
workflow.setIdNum("cipher-id");
workflow.setGuarType("信用");
workflow.setApplyAmt("100000");
workflow.setLoanPurpose("business");
workflow.setLoanTerm("3");
workflow.setBizProof("true");
workflow.setLoanLoop("false");
workflow.setCollThirdParty("true");
workflow.setCollType("一类");
@@ -115,9 +118,7 @@ class LoanPricingModelServicePersonalParamsTest {
&& Objects.equals("110101199001011234", dto.getIdNum())
&& Objects.equals("信用", dto.getGuarType())
&& Objects.equals("100000", dto.getApplyAmt())
&& Objects.equals("business", dto.getLoanPurpose())
&& Objects.equals("3", dto.getLoanTerm())
&& Objects.equals("1", dto.getBizProof())
&& Objects.equals("0", dto.getLoanLoop())
&& Objects.equals("1", dto.getCollThirdParty())
&& Objects.equals("一类", dto.getCollType())));

View File

@@ -29,6 +29,7 @@ class LoanPricingModelServiceTest
assertEquals("张三", context.modelService.personalRequest.getCustName());
assertEquals("110101199001011234", context.modelService.personalRequest.getIdNum());
assertEquals("2.15", context.modelService.personalRequest.getCouponRate());
assertEquals(1, context.modelService.personalCalls.get());
assertEquals(0, context.modelService.corporateCalls.get());
assertEquals(1, context.retailInsertCount.get());
@@ -59,6 +60,7 @@ class LoanPricingModelServiceTest
workflow.setIsGreenLoan("true");
workflow.setIsTradeBuildEnt("false");
workflow.setCollThirdParty("true");
workflow.setCouponRate("2.35");
TestContext context = createContext(workflow);
context.service.invokeModelAsync(3L);
@@ -68,6 +70,7 @@ class LoanPricingModelServiceTest
assertEquals("1", request.getIsGreenLoan());
assertEquals("0", request.getIsTradeBuildEnt());
assertEquals("1", request.getCollThirdParty());
assertEquals("2.35", request.getCouponRate());
assertEquals(0, context.modelService.personalCalls.get());
assertEquals(1, context.modelService.corporateCalls.get());
assertEquals(0, context.retailInsertCount.get());
@@ -81,6 +84,7 @@ class LoanPricingModelServiceTest
workflow.setCustType("个人");
workflow.setCustName("cipher-name");
workflow.setIdNum("cipher-id");
workflow.setCouponRate("2.15");
return workflow;
}

View File

@@ -1,6 +1,8 @@
package com.ruoyi.loanpricing.service.impl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
@@ -12,6 +14,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO;
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
import com.ruoyi.loanpricing.domain.entity.ModelCorpOutputFields;
import com.ruoyi.loanpricing.domain.entity.ModelRetailOutputFields;
@@ -24,12 +33,16 @@ import com.ruoyi.loanpricing.service.LoanPricingSensitiveDisplayService;
import com.ruoyi.loanpricing.service.LoanPricingModelService;
import com.ruoyi.loanpricing.service.SensitiveFieldCryptoService;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import java.util.Collections;
import java.util.Objects;
@@ -58,6 +71,18 @@ class LoanPricingWorkflowServiceImplTest
@InjectMocks
private LoanPricingWorkflowServiceImpl loanPricingWorkflowService;
@BeforeEach
void setUpLoginUser()
{
setLoginUser(1L, "admin", "若依", role(1L, "超级管理员", "admin"));
}
@AfterEach
void clearLoginUser()
{
SecurityContextHolder.clearContext();
}
@Test
void shouldEncryptCustNameAndIdNumBeforeInsert()
{
@@ -65,6 +90,7 @@ class LoanPricingWorkflowServiceImplTest
workflow.setCustName("张三");
workflow.setIdNum("110101199001011234");
workflow.setCustIsn("CUST001");
workflow.setBusinessType("新增");
when(sensitiveFieldCryptoService.encrypt("张三")).thenReturn("cipher-name");
when(sensitiveFieldCryptoService.encrypt("110101199001011234")).thenReturn("cipher-id");
@@ -111,6 +137,64 @@ class LoanPricingWorkflowServiceImplTest
assertEquals("张*", result.getRecords().get(0).getCustName());
}
@Test
void shouldNotSetDataScopeCreateByForSuperAdminWhenReturningPagedWorkflowList()
{
when(loanPricingWorkflowMapper.selectWorkflowPageWithRates(any(), any())).thenReturn(emptyPageResult());
loanPricingWorkflowService.selectLoanPricingPage(new Page<>(1, 10), new LoanPricingWorkflow());
ArgumentCaptor<LoanPricingWorkflow> queryCaptor = ArgumentCaptor.forClass(LoanPricingWorkflow.class);
verify(loanPricingWorkflowMapper).selectWorkflowPageWithRates(any(), queryCaptor.capture());
assertNull(queryCaptor.getValue().getDataScopeCreateBy());
}
@Test
void shouldNotSetDataScopeCreateByForBusinessAdminWhenReturningPagedWorkflowList()
{
setLoginUser(100L, "8929999", "测试管理员", role(100L, "管理员", "headAdmin"));
when(loanPricingWorkflowMapper.selectWorkflowPageWithRates(any(), any())).thenReturn(emptyPageResult());
loanPricingWorkflowService.selectLoanPricingPage(new Page<>(1, 10), new LoanPricingWorkflow());
ArgumentCaptor<LoanPricingWorkflow> queryCaptor = ArgumentCaptor.forClass(LoanPricingWorkflow.class);
verify(loanPricingWorkflowMapper).selectWorkflowPageWithRates(any(), queryCaptor.capture());
assertNull(queryCaptor.getValue().getDataScopeCreateBy());
}
@Test
void shouldSetCurrentCreateByForCustomerManagerWhenReturningPagedWorkflowList()
{
setLoginUser(101L, "8920001", "测试客户经理", role(101L, "客户经理", "common"));
when(loanPricingWorkflowMapper.selectWorkflowPageWithRates(any(), any())).thenReturn(emptyPageResult());
loanPricingWorkflowService.selectLoanPricingPage(new Page<>(1, 10), new LoanPricingWorkflow());
ArgumentCaptor<LoanPricingWorkflow> queryCaptor = ArgumentCaptor.forClass(LoanPricingWorkflow.class);
verify(loanPricingWorkflowMapper).selectWorkflowPageWithRates(any(), queryCaptor.capture());
assertEquals("测试客户经理-8920001", queryCaptor.getValue().getDataScopeCreateBy());
}
@Test
void shouldKeepCustomerManagerWithinOwnDataScopeWhenCreateByQueryIsProvided()
{
setLoginUser(101L, "8920001", "测试客户经理", role(101L, "客户经理", "common"));
LoanPricingWorkflow query = new LoanPricingWorkflow();
query.setCreateBy("若依-admin");
when(loanPricingWorkflowMapper.selectWorkflowPageWithRates(any(), any())).thenReturn(emptyPageResult());
loanPricingWorkflowService.selectLoanPricingPage(new Page<>(1, 10), query);
ArgumentCaptor<LoanPricingWorkflow> queryCaptor = ArgumentCaptor.forClass(LoanPricingWorkflow.class);
verify(loanPricingWorkflowMapper).selectWorkflowPageWithRates(any(), queryCaptor.capture());
assertEquals("若依-admin", queryCaptor.getValue().getCreateBy());
assertEquals("测试客户经理-8920001", queryCaptor.getValue().getDataScopeCreateBy());
}
@Test
void shouldUseCustIsnInsteadOfCustNameAsQueryCondition()
{
@@ -133,6 +217,134 @@ class LoanPricingWorkflowServiceImplTest
assertTrue(!sqlSegment.contains("cust_name"), sqlSegment);
}
@Test
void shouldRejectOldBusinessType()
{
LoanPricingWorkflow workflow = validWorkflow();
workflow.setBusinessType("新客");
ServiceException exception = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("业务种类必须是:新增、存量新增、存量转贷之一", exception.getMessage());
}
@Test
void shouldRequireHistoryRateForStockTransfer()
{
LoanPricingWorkflow workflow = validWorkflow();
workflow.setBusinessType("存量转贷");
ServiceException exception = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("请选择历史贷款合同", exception.getMessage());
}
@Test
void shouldRequireCouponRateForCertificatePledge()
{
LoanPricingWorkflow workflow = validWorkflow();
workflow.setCustType("企业");
workflow.setGuarType("质押");
workflow.setCollType("存单质押");
ServiceException exception = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(workflow));
assertEquals("存单票面利率不能为空", exception.getMessage());
}
@Test
void shouldAllowPersonalMortgageOneLineAndRejectOldOther()
{
LoanPricingWorkflow allowedWorkflow = validWorkflow();
allowedWorkflow.setCustType("个人");
allowedWorkflow.setGuarType("抵押");
allowedWorkflow.setCollType("一线");
loanPricingWorkflowService.createLoanPricing(allowedWorkflow);
LoanPricingWorkflow rejectedWorkflow = validWorkflow();
rejectedWorkflow.setCustType("个人");
rejectedWorkflow.setGuarType("抵押");
rejectedWorkflow.setCollType("其他");
ServiceException exception = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(rejectedWorkflow));
assertEquals("个人抵押抵质押类型必须是:一线、一类、二类、三类之一", exception.getMessage());
}
@Test
void shouldAllowCorporateMortgagePollutionRightAndPledgeEquity()
{
LoanPricingWorkflow mortgageWorkflow = validWorkflow();
mortgageWorkflow.setCustType("企业");
mortgageWorkflow.setGuarType("抵押");
mortgageWorkflow.setCollType("排污权抵押");
loanPricingWorkflowService.createLoanPricing(mortgageWorkflow);
LoanPricingWorkflow pledgeWorkflow = validWorkflow();
pledgeWorkflow.setCustType("企业");
pledgeWorkflow.setGuarType("质押");
pledgeWorkflow.setCollType("股权质押");
loanPricingWorkflowService.createLoanPricing(pledgeWorkflow);
LoanPricingWorkflow rejectedWorkflow = validWorkflow();
rejectedWorkflow.setCustType("企业");
rejectedWorkflow.setGuarType("质押");
rejectedWorkflow.setCollType("其他");
ServiceException exception = assertThrows(ServiceException.class,
() -> loanPricingWorkflowService.createLoanPricing(rejectedWorkflow));
assertEquals("企业质押抵质押类型必须是:存单质押、股权质押、其他质押之一", exception.getMessage());
}
@Test
void shouldCreatePersonalWorkflowWithCouponRateAndWithoutRemovedFields()
{
PersonalLoanPricingCreateDTO dto = new PersonalLoanPricingCreateDTO();
dto.setCustIsn("CUST001");
dto.setGuarType("质押");
dto.setApplyAmt("100000");
dto.setBusinessType("新增");
dto.setLoanTerm("3");
dto.setCollType("存单质押");
dto.setCouponRate("2.15");
loanPricingWorkflowService.createPersonalLoanPricing(dto);
verify(loanPricingWorkflowMapper).insert(argThat((LoanPricingWorkflow entity) ->
Objects.equals("个人", entity.getCustType())
&& Objects.equals("2.15", entity.getCouponRate())
&& Objects.isNull(entity.getLoanPurpose())
&& Objects.isNull(entity.getBizProof())));
}
@Test
void shouldCreateCorporateWorkflowWithCouponRateAndBusinessType()
{
CorporateLoanPricingCreateDTO dto = new CorporateLoanPricingCreateDTO();
dto.setCustIsn("CORP001");
dto.setGuarType("质押");
dto.setApplyAmt("1000000");
dto.setBusinessType("新增");
dto.setLoanTerm("3");
dto.setCollType("存单质押");
dto.setCouponRate("2.35");
loanPricingWorkflowService.createCorporateLoanPricing(dto);
verify(loanPricingWorkflowMapper).insert(argThat((LoanPricingWorkflow entity) ->
Objects.equals("企业", entity.getCustType())
&& Objects.equals("新增", entity.getBusinessType())
&& Objects.equals("2.35", entity.getCouponRate())));
}
@Test
void shouldUseRetailModelOutputFinalCalculateRateForWorkflowDetail()
{
@@ -255,4 +467,44 @@ class LoanPricingWorkflowServiceImplTest
assertEquals("测试****公司", result.getModelCorpOutputFields().getCustName());
assertEquals("91*************00X", result.getModelCorpOutputFields().getIdNum());
}
private LoanPricingWorkflow validWorkflow()
{
LoanPricingWorkflow workflow = new LoanPricingWorkflow();
workflow.setCustIsn("CUST001");
workflow.setCustType("个人");
workflow.setGuarType("信用");
workflow.setApplyAmt("100000");
workflow.setBusinessType("新增");
return workflow;
}
private Page<LoanPricingWorkflowListVO> emptyPageResult()
{
Page<LoanPricingWorkflowListVO> pageResult = new Page<>(1, 10);
pageResult.setRecords(Collections.emptyList());
return pageResult;
}
private void setLoginUser(Long userId, String username, String nickName, SysRole... roles)
{
SysUser user = new SysUser();
user.setUserId(userId);
user.setUserName(username);
user.setNickName(nickName);
user.setRoles(java.util.Arrays.asList(roles));
LoginUser loginUser = new LoginUser(userId, 100L, user, Collections.emptySet());
UsernamePasswordAuthenticationToken authentication =
new UsernamePasswordAuthenticationToken(loginUser, null, Collections.emptyList());
SecurityContextHolder.getContext().setAuthentication(authentication);
}
private SysRole role(Long roleId, String roleName, String roleKey)
{
SysRole role = new SysRole(roleId);
role.setRoleName(roleName);
role.setRoleKey(roleKey);
role.setStatus(UserConstants.ROLE_NORMAL);
return role;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -64,7 +64,7 @@
<el-col :span="12">
<el-form-item label="业务种类" prop="businessType">
<el-select v-model="form.businessType" placeholder="请选择业务种类" style="width: 100%" @change="handleBusinessTypeChange">
<el-option label="新" value="新"/>
<el-option label="新" value="新"/>
<el-option label="存量新增" value="存量新增"/>
<el-option label="存量转贷" value="存量转贷"/>
</el-select>
@@ -107,6 +107,11 @@
<el-switch v-model="form.collThirdParty"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="isCertificatePledge">
<el-form-item label="存单票面利率" prop="couponRate">
<el-input v-model="form.couponRate" placeholder="请输入存单票面利率"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<history-contract-selector
@@ -158,6 +163,14 @@ export default {
}
}
const validateCouponRate = (rule, value, callback) => {
if (this.isCertificatePledge && !value) {
callback(new Error('存单票面利率不能为空'))
return
}
callback()
}
// 贷款期限验证
const validateLoanTerm = (rule, value, callback) => {
if (!value && value !== 0) {
@@ -196,7 +209,8 @@ export default {
isGreenLoan: false,
isTradeBuildEnt: false,
collType: undefined,
collThirdParty: false
collThirdParty: false,
couponRate: undefined
},
rules: {
custIsn: [
@@ -230,6 +244,9 @@ export default {
],
collType: [
{required: true, message: "请选择抵质押类型", trigger: "change"}
],
couponRate: [
{validator: validateCouponRate, trigger: "blur"}
]
}
}
@@ -249,12 +266,15 @@ export default {
isStockTransfer() {
return this.form.businessType === '存量转贷'
},
isCertificatePledge() {
return this.form.guarType === '质押' && this.form.collType === '存单质押'
},
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一类', '二类', '三类', '四类', '其他']
return ['一类', '二类', '三类', '四类', '排污权抵押', '设备等其他不动产抵押']
}
if (this.form.guarType === '质押') {
return ['存单质押', '其他']
return ['存单质押', '股权质押', '其他质押']
}
return []
}
@@ -269,6 +289,9 @@ export default {
if (val !== oldVal) {
this.resetCollateralFields()
}
},
'form.collType'() {
this.resetCouponRateIfNotCertificatePledge()
}
},
methods: {
@@ -289,7 +312,8 @@ export default {
isGreenLoan: false,
isTradeBuildEnt: false,
collType: undefined,
collThirdParty: false
collThirdParty: false,
couponRate: undefined
}
this.submitting = false
this.showHistorySelector = false
@@ -315,12 +339,23 @@ export default {
resetCollateralFields() {
this.form.collType = undefined
this.form.collThirdParty = false
this.resetCouponRateIfNotCertificatePledge()
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['collType', 'collThirdParty'])
this.$refs.form.clearValidate(['collType', 'collThirdParty', 'couponRate'])
}
})
},
resetCouponRateIfNotCertificatePledge() {
if (!this.isCertificatePledge) {
this.form.couponRate = undefined
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['couponRate'])
}
})
}
},
handleBusinessTypeChange(value) {
this.clearHistoryContract()
if (value === '存量转贷') {
@@ -370,6 +405,10 @@ export default {
this.$modal.msgWarning("请选择历史贷款合同")
return
}
if (this.isCertificatePledge && !this.form.couponRate) {
this.$modal.msgWarning("存单票面利率不能为空")
return
}
this.submitting = true
// 转换开关值为字符串
const data = {
@@ -386,6 +425,9 @@ export default {
if (!this.isStockTransfer) {
delete data.loanRateHistory
}
if (!this.isCertificatePledge) {
delete data.couponRate
}
createCorporateWorkflow(data).then(response => {
this.$modal.msgSuccess("新增成功")

View File

@@ -52,14 +52,6 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="贷款用途" prop="loanPurpose">
<el-select v-model="form.loanPurpose" placeholder="请选择贷款用途" style="width: 100%">
<el-option label="消费" value="consumer"/>
<el-option label="经营" value="business"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="借款期限(年)" prop="loanTerm">
<el-select v-model="form.loanTerm" placeholder="请选择借款期限" style="width: 100%">
@@ -72,7 +64,7 @@
<el-col :span="12">
<el-form-item label="业务种类" prop="businessType">
<el-select v-model="form.businessType" placeholder="请选择业务种类" style="width: 100%" @change="handleBusinessTypeChange">
<el-option label="新" value="新"/>
<el-option label="新" value="新"/>
<el-option label="存量新增" value="存量新增"/>
<el-option label="存量转贷" value="存量转贷"/>
</el-select>
@@ -85,11 +77,6 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否有经营佐证" prop="bizProof">
<el-switch v-model="form.bizProof"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="循环功能" prop="loanLoop">
<el-switch v-model="form.loanLoop"/>
@@ -112,6 +99,11 @@
<el-switch v-model="form.collThirdParty"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="isCertificatePledge">
<el-form-item label="存单票面利率" prop="couponRate">
<el-input v-model="form.couponRate" placeholder="请输入存单票面利率"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<history-contract-selector
@@ -163,6 +155,14 @@ export default {
}
}
const validateCouponRate = (rule, value, callback) => {
if (this.isCertificatePledge && !value) {
callback(new Error('存单票面利率不能为空'))
return
}
callback()
}
return {
loanTermOptions: [
'1', '2', '3', '4', '5', '6'
@@ -181,14 +181,13 @@ export default {
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanPurpose: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
bizProof: false,
loanLoop: false,
collType: undefined,
collThirdParty: false
collThirdParty: false,
couponRate: undefined
},
rules: {
custIsn: [
@@ -211,9 +210,6 @@ export default {
applyAmt: [
{required: true, validator: validateApplyAmt, trigger: "blur"}
],
loanPurpose: [
{required: true, message: "请选择贷款用途", trigger: "change"}
],
loanTerm: [
{required: true, message: "请选择借款期限", trigger: "change"}
],
@@ -222,6 +218,12 @@ export default {
],
loanRateHistory: [
{required: true, message: "请选择历史贷款合同", trigger: "change"}
],
collType: [
{required: true, message: "请选择抵质押类型", trigger: "change"}
],
couponRate: [
{validator: validateCouponRate, trigger: "blur"}
]
}
}
@@ -241,12 +243,15 @@ export default {
isStockTransfer() {
return this.form.businessType === '存量转贷'
},
isCertificatePledge() {
return this.form.guarType === '质押' && this.form.collType === '存单质押'
},
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一类', '二类', '三类', '四类', '其他']
return ['一线', '一类', '二类', '三类']
}
if (this.form.guarType === '质押') {
return ['存单质押', '其他']
return ['存单质押', '其他质押']
}
return []
}
@@ -261,6 +266,9 @@ export default {
if (val !== oldVal) {
this.resetCollateralFields()
}
},
'form.collType'() {
this.resetCouponRateIfNotCertificatePledge()
}
},
methods: {
@@ -275,14 +283,13 @@ export default {
idNum: this.customerMap ? (this.customerMap.cust_id || '').substring(3) : undefined,
guarType: undefined,
applyAmt: undefined,
loanPurpose: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
bizProof: false,
loanLoop: false,
collType: undefined,
collThirdParty: false
collThirdParty: false,
couponRate: undefined
}
this.submitting = false
this.showHistorySelector = false
@@ -308,12 +315,23 @@ export default {
resetCollateralFields() {
this.form.collType = undefined
this.form.collThirdParty = false
this.resetCouponRateIfNotCertificatePledge()
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['collType', 'collThirdParty'])
this.$refs.form.clearValidate(['collType', 'collThirdParty', 'couponRate'])
}
})
},
resetCouponRateIfNotCertificatePledge() {
if (!this.isCertificatePledge) {
this.form.couponRate = undefined
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['couponRate'])
}
})
}
},
handleBusinessTypeChange(value) {
this.clearHistoryContract()
if (value === '存量转贷') {
@@ -363,11 +381,14 @@ export default {
this.$modal.msgWarning("请选择历史贷款合同")
return
}
if (this.isCertificatePledge && !this.form.couponRate) {
this.$modal.msgWarning("存单票面利率不能为空")
return
}
this.submitting = true
// 转换开关值为字符串
const data = {
...this.form,
bizProof: this.form.bizProof ? '1' : '0',
loanLoop: this.form.loanLoop ? '1' : '0'
}
if (this.isCollateralGuarantee) {
@@ -379,6 +400,9 @@ export default {
if (!this.isStockTransfer) {
delete data.loanRateHistory
}
if (!this.isCertificatePledge) {
delete data.couponRate
}
createPersonalWorkflow(data).then(response => {
this.$modal.msgSuccess("新增成功")

View File

@@ -1,7 +1,6 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">{{title}}</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"

View File

@@ -10,8 +10,10 @@ const personalCreateDialog = read('src/views/loanPricing/workflow/components/Per
const personalDetail = read('src/views/loanPricing/workflow/components/PersonalWorkflowDetail.vue')
assert(
personalCreateDialog.includes('label="贷款用途"') && personalCreateDialog.includes('prop="loanPurpose"'),
'个人新增弹窗缺少贷款用途字段'
!personalCreateDialog.includes('label="贷款用途"') &&
!personalCreateDialog.includes('prop="loanPurpose"') &&
!personalCreateDialog.includes('loanPurpose:'),
'个人新增弹窗不应继续保留贷款用途字段'
)
assert(
@@ -20,8 +22,8 @@ assert(
)
assert(
personalCreateDialog.includes("value=\"consumer\"") && personalCreateDialog.includes("value=\"business\""),
'个人新增弹窗缺少贷款用途选项'
!personalCreateDialog.includes("value=\"consumer\"") && !personalCreateDialog.includes("value=\"business\""),
'个人新增弹窗不应继续保留贷款用途选项'
)
assert(
@@ -41,19 +43,20 @@ assert(
assert(
personalCreateDialog.includes('collateralTypeOptions') &&
personalCreateDialog.includes("return ['一类', '二类', '三类', '四类', '其他']") &&
personalCreateDialog.includes("return ['存单质押', '其他']") &&
!personalCreateDialog.includes('label="一线"'),
personalCreateDialog.includes("return ['一线', '一类', '二类', '三类']") &&
personalCreateDialog.includes("return ['存单质押', '其他质押']"),
'个人新增弹窗抵质押类型选项未按担保方式动态切换'
)
assert(
!personalCreateDialog.includes('{required: true, message: "请选择抵质押类型", trigger: "change"}'),
'个人新增弹窗仍将抵质押类型为必填'
personalCreateDialog.includes('{required: true, message: "请选择抵质押类型", trigger: "change"}'),
'个人新增弹窗抵质押类型为必填'
)
assert(
personalCreateDialog.includes("bizProof: this.form.bizProof ? '1' : '0'") &&
!personalCreateDialog.includes('label="是否有经营佐证"') &&
!personalCreateDialog.includes('prop="bizProof"') &&
!personalCreateDialog.includes('bizProof:') &&
personalCreateDialog.includes("loanLoop: this.form.loanLoop ? '1' : '0'") &&
personalCreateDialog.includes("data.collThirdParty = this.form.collThirdParty ? '1' : '0'") &&
personalCreateDialog.includes('delete data.collType') &&

View File

@@ -0,0 +1,3 @@
-- 上虞利率定价存单票面利率字段
ALTER TABLE `loan_pricing_workflow`
ADD COLUMN `coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率' AFTER `loan_rate_history`;

View File

@@ -765,6 +765,7 @@ CREATE TABLE `loan_pricing_workflow` (
`loan_purpose` varchar(20) DEFAULT NULL COMMENT '贷款用途: consumer-消费/business-经营',
`business_type` varchar(20) DEFAULT NULL COMMENT '业务种类',
`loan_rate_history` varchar(100) DEFAULT NULL COMMENT '历史贷款利率',
`coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率',
`biz_proof` varchar(10) DEFAULT NULL COMMENT '是否有经营佐证: true/false',
`loan_loop` varchar(10) DEFAULT NULL COMMENT '循环功能: true/false贷款合同是否开通循环功能',
`coll_type` varchar(20) DEFAULT NULL COMMENT '抵质押类型: 一类/二类/三类/四类',

View File

@@ -347,6 +347,7 @@ CREATE TABLE `loan_pricing_workflow` (
`loan_purpose` varchar(20) DEFAULT NULL COMMENT '贷款用途: consumer-消费/business-经营',
`business_type` varchar(20) DEFAULT NULL COMMENT '业务种类',
`loan_rate_history` varchar(100) DEFAULT NULL COMMENT '历史贷款利率',
`coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率',
`biz_proof` varchar(10) DEFAULT NULL COMMENT '是否有经营佐证: true/false',
`loan_loop` varchar(10) DEFAULT NULL COMMENT '循环功能: true/false贷款合同是否开通循环功能',
`coll_type` varchar(20) DEFAULT NULL COMMENT '抵质押类型: 一类/二类/三类/四类',

View File

@@ -28,6 +28,7 @@ CREATE TABLE `loan_pricing_workflow` (
`loan_purpose` varchar(20) DEFAULT NULL COMMENT '贷款用途: consumer-消费/business-经营',
`business_type` varchar(20) DEFAULT NULL COMMENT '业务种类',
`loan_rate_history` varchar(100) DEFAULT NULL COMMENT '历史贷款利率',
`coupon_rate` varchar(100) DEFAULT NULL COMMENT '存单票面利率',
`biz_proof` varchar(10) DEFAULT NULL COMMENT '是否有经营佐证: true/false',
`loan_loop` varchar(10) DEFAULT NULL COMMENT '循环功能: true/false贷款合同是否开通循环功能',
`coll_type` varchar(20) DEFAULT NULL COMMENT '抵质押类型: 一类/二类/三类/四类',