实现上虞利率定价字段调整

This commit is contained in:
wkc
2026-05-11 18:02:04 +08:00
parent a50b25e4ec
commit 6ef3cfcaea
17 changed files with 430 additions and 72 deletions

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;

View File

@@ -67,6 +67,7 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow)
{
validateBusinessTypeAndHistoryRate(loanPricingWorkflow);
validateCollateralTypeAndCouponRate(loanPricingWorkflow);
// 自动生成业务方流水号(时间戳)
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
@@ -95,10 +96,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 +107,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;
}
/**
* 发起个人客户利率定价流程
*

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());