调整流程详情与对公新增弹窗展示并补充测试
This commit is contained in:
@@ -41,24 +41,26 @@ public class CorporateLoanPricingCreateDTO implements Serializable {
|
||||
@NotBlank(message = "申请金额不能为空")
|
||||
private String applyAmt;
|
||||
|
||||
@Schema(description = "贷款期限", example = "36")
|
||||
@Schema(description = "还款方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "分期", allowableValues = {"分期", "不分期"})
|
||||
@NotBlank(message = "还款方式不能为空")
|
||||
@Pattern(regexp = "^(分期|不分期)$", message = "还款方式必须是:分期、不分期之一")
|
||||
private String repayMethod;
|
||||
|
||||
@Schema(description = "借款期限(年)", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
||||
@NotBlank(message = "贷款期限不能为空")
|
||||
private String loanTerm;
|
||||
|
||||
@Schema(description = "省农担担保贷款", example = "false")
|
||||
private String isAgriGuar;
|
||||
|
||||
@Schema(description = "绿色贷款", example = "true")
|
||||
@Schema(description = "绿色贷款", example = "0")
|
||||
private String isGreenLoan;
|
||||
|
||||
@Schema(description = "科技型企业", example = "true")
|
||||
private String isTechEnt;
|
||||
@Schema(description = "贸易和建筑业企业标识", example = "0")
|
||||
private String isTradeBuildEnt;
|
||||
|
||||
@Schema(description = "贸易和建筑业企业标识", example = "false")
|
||||
private String isTradeConstruction;
|
||||
|
||||
@Schema(description = "抵质押类型", example = "一类")
|
||||
@Schema(description = "抵质押类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "一类", allowableValues = {"一类", "二类", "三类", "四类"})
|
||||
@NotBlank(message = "抵质押类型不能为空")
|
||||
@Pattern(regexp = "^(一类|二类|三类|四类)$", message = "抵质押类型必须是:一类、二类、三类、四类之一")
|
||||
private String collType;
|
||||
|
||||
@Schema(description = "抵质押物是否三方所有", example = "false")
|
||||
@Schema(description = "抵质押物是否三方所有", example = "0")
|
||||
private String collThirdParty;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,12 @@ public class ModelInvokeDTO {
|
||||
*/
|
||||
private String loanTerm;
|
||||
|
||||
/**
|
||||
* 还款方式(非必填)
|
||||
* 可选值:分期/不分期
|
||||
*/
|
||||
private String repayMethod;
|
||||
|
||||
/**
|
||||
* 净身企业(非必填)
|
||||
* 可选值:true/false
|
||||
@@ -98,10 +104,10 @@ public class ModelInvokeDTO {
|
||||
private String isManufacturing;
|
||||
|
||||
/**
|
||||
* 省农担担保贷款(非必填)
|
||||
* 可选值:true/false
|
||||
* 绿色贷款(非必填)
|
||||
* 可选值:0/1
|
||||
*/
|
||||
private String isAgriGuar;
|
||||
private String isGreenLoan;
|
||||
|
||||
/**
|
||||
* 是否纳税信用等级A级(非必填)
|
||||
@@ -137,7 +143,7 @@ public class ModelInvokeDTO {
|
||||
|
||||
/**
|
||||
* 抵质押类型(非必填)
|
||||
* 可选值:一类/二类/三类
|
||||
* 可选值:一类/二类/三类/四类
|
||||
*/
|
||||
private String collType;
|
||||
|
||||
@@ -167,4 +173,10 @@ public class ModelInvokeDTO {
|
||||
*/
|
||||
private String idNum;
|
||||
|
||||
/**
|
||||
* 贸易和建筑业企业(非必填)
|
||||
* 可选值:0/1
|
||||
*/
|
||||
private String isTradeBuildEnt;
|
||||
|
||||
}
|
||||
|
||||
@@ -69,6 +69,11 @@ public class LoanPricingWorkflow implements Serializable
|
||||
*/
|
||||
private String loanTerm;
|
||||
|
||||
/**
|
||||
* 还款方式: 分期/不分期
|
||||
*/
|
||||
private String repayMethod;
|
||||
|
||||
/** 净身企业: true/false */
|
||||
private String isCleanEnt;
|
||||
|
||||
@@ -78,24 +83,17 @@ public class LoanPricingWorkflow implements Serializable
|
||||
/** 制造业企业: true/false */
|
||||
private String isManufacturing;
|
||||
|
||||
/** 省农担担保贷款: true/false */
|
||||
private String isAgriGuar;
|
||||
|
||||
/**
|
||||
* 贸易和建筑业企业标识: true/false
|
||||
*/
|
||||
private String isTradeConstruction;
|
||||
@TableField("is_trade_construction")
|
||||
private String isTradeBuildEnt;
|
||||
|
||||
/**
|
||||
* 绿色贷款: true/false
|
||||
*/
|
||||
private String isGreenLoan;
|
||||
|
||||
/**
|
||||
* 科技型企业: true/false
|
||||
*/
|
||||
private String isTechEnt;
|
||||
|
||||
/** 是否纳税信用等级A级: true/false */
|
||||
private String isTaxA;
|
||||
|
||||
@@ -111,7 +109,7 @@ public class LoanPricingWorkflow implements Serializable
|
||||
/** 循环功能: true/false */
|
||||
private String loanLoop;
|
||||
|
||||
/** 抵质押类型: 一线/一类/二类 */
|
||||
/** 抵质押类型: 一类/二类/三类/四类 */
|
||||
private String collType;
|
||||
|
||||
/** 抵质押物是否三方所有: true/false */
|
||||
|
||||
@@ -31,6 +31,8 @@ public class ModelCorpOutputFields {
|
||||
private String idType;
|
||||
// 证件号码
|
||||
private String idNum;
|
||||
// 还款方式
|
||||
private String repayMethod;
|
||||
// 基准利率
|
||||
private String baseLoanRate;
|
||||
// 我行首贷客户
|
||||
@@ -65,8 +67,6 @@ public class ModelCorpOutputFields {
|
||||
private String midEntEleDdc;
|
||||
// 中间业务_企业_水费代扣
|
||||
private String midEntWaterDdc;
|
||||
// 中间业务_企业_税务代扣
|
||||
private String midEntTax;
|
||||
// BP_中间业务
|
||||
private String bpMid;
|
||||
// 代发工资户数
|
||||
@@ -79,12 +79,12 @@ public class ModelCorpOutputFields {
|
||||
private String isCleanEnt;
|
||||
// 开立基本结算账户
|
||||
private String hasSettleAcct;
|
||||
// 省农担担保贷款
|
||||
private String isAgriGuar;
|
||||
// 绿色贷款
|
||||
private String isGreenLoan;
|
||||
// 科技型企业
|
||||
private String isTechEnt;
|
||||
// 贸易和建筑业企业
|
||||
private String isTradeBuildEnt;
|
||||
// BP_企业客户类别
|
||||
private String bpEntType;
|
||||
// TOTAL_BP_关联度
|
||||
@@ -109,8 +109,6 @@ public class ModelCorpOutputFields {
|
||||
private String prinOverdue;
|
||||
// 利息逾期
|
||||
private String interestOverdue;
|
||||
// 信用卡逾期
|
||||
private String cardOverdue;
|
||||
// BP_灰名单与逾期
|
||||
private String bpGreyOverdue;
|
||||
// TOTAL_BP_风险度
|
||||
@@ -119,6 +117,16 @@ public class ModelCorpOutputFields {
|
||||
private String totalBp;
|
||||
// 测算利率
|
||||
private String calculateRate;
|
||||
// 历史利率
|
||||
private String loanRateHistory;
|
||||
// 产品最低利率下限
|
||||
private String minRateProduct;
|
||||
// 平滑幅度
|
||||
private String smoothRange;
|
||||
// 最终测算利率
|
||||
private String finalCalculateRate;
|
||||
// 参考利率
|
||||
private String referenceRate;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@@ -64,6 +64,10 @@ public class LoanPricingModelService {
|
||||
{
|
||||
normalizePersonalModelInvokeDTO(modelInvokeDTO);
|
||||
}
|
||||
if ("企业".equals(loanPricingWorkflow.getCustType()))
|
||||
{
|
||||
normalizeCorporateModelInvokeDTO(modelInvokeDTO);
|
||||
}
|
||||
JSONObject response = modelService.invokeModel(modelInvokeDTO);
|
||||
if (loanPricingWorkflow.getCustType().equals("个人")){
|
||||
// 个人模型
|
||||
@@ -95,6 +99,13 @@ public class LoanPricingModelService {
|
||||
modelInvokeDTO.setCollThirdParty(toZeroOne(modelInvokeDTO.getCollThirdParty()));
|
||||
}
|
||||
|
||||
private void normalizeCorporateModelInvokeDTO(ModelInvokeDTO modelInvokeDTO)
|
||||
{
|
||||
modelInvokeDTO.setCollThirdParty(toZeroOne(modelInvokeDTO.getCollThirdParty()));
|
||||
modelInvokeDTO.setIsGreenLoan(toZeroOne(modelInvokeDTO.getIsGreenLoan()));
|
||||
modelInvokeDTO.setIsTradeBuildEnt(toZeroOne(modelInvokeDTO.getIsTradeBuildEnt()));
|
||||
}
|
||||
|
||||
private String toZeroOne(String value)
|
||||
{
|
||||
if ("true".equals(value) || "1".equals(value))
|
||||
|
||||
@@ -181,7 +181,7 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
|
||||
if (Objects.nonNull(modelCorpOutputFields))
|
||||
{
|
||||
maskModelCorpOutputBasicInfo(modelCorpOutputFields);
|
||||
loanPricingWorkflow.setLoanRate(modelCorpOutputFields.getCalculateRate());
|
||||
loanPricingWorkflow.setLoanRate(modelCorpOutputFields.getFinalCalculateRate());
|
||||
}
|
||||
loanPricingWorkflowVO.setModelCorpOutputFields(modelCorpOutputFields);
|
||||
}
|
||||
|
||||
@@ -54,13 +54,11 @@ public class LoanPricingConverter {
|
||||
entity.setIdNum(dto.getIdNum());
|
||||
entity.setGuarType(dto.getGuarType());
|
||||
entity.setApplyAmt(dto.getApplyAmt());
|
||||
entity.setRepayMethod(dto.getRepayMethod());
|
||||
entity.setCollType(dto.getCollType());
|
||||
entity.setCollThirdParty(dto.getCollThirdParty());
|
||||
// 映射企业特有字段
|
||||
entity.setIsAgriGuar(dto.getIsAgriGuar());
|
||||
entity.setIsGreenLoan(dto.getIsGreenLoan());
|
||||
entity.setIsTechEnt(dto.getIsTechEnt());
|
||||
entity.setIsTradeConstruction(dto.getIsTradeConstruction());
|
||||
entity.setIsTradeBuildEnt(dto.getIsTradeBuildEnt());
|
||||
entity.setLoanTerm(dto.getLoanTerm());
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -3,66 +3,70 @@
|
||||
"cost": 2267,
|
||||
"tokenId": "17364055486305E7F4722M8IPFWNL8TOBEB",
|
||||
"mappingOutputFields": {
|
||||
"custIsn": "CUST20260121001",
|
||||
"custType": "企业客户",
|
||||
"guarType": "抵押担保",
|
||||
"custName": "北京智联科技有限公司",
|
||||
"idType": "营业执照",
|
||||
"idNum": "91110108MA00XXXXXX",
|
||||
"baseLoanRate": "3.45",
|
||||
"isFirstLoan": "N",
|
||||
"faithDay": "730",
|
||||
"bpFirstLoan": "0",
|
||||
"bpAgeLoan": "5.2",
|
||||
"totalBpLoyalty": "8.5",
|
||||
"balanceAvg": "5000000.00",
|
||||
"loanAvg": "3000000.00",
|
||||
"derivationRate": "1.8",
|
||||
"totalBpContribution": "12.3",
|
||||
"midEntConnect": "100000.00",
|
||||
"midEntEffect": "50000.00",
|
||||
"midEntInter": "80000.00",
|
||||
"midEntAccept": "200000.00",
|
||||
"midEntDiscount": "150000.00",
|
||||
"midEntEleDdc": "30000.00",
|
||||
"midEntWaterDdc": "10000.00",
|
||||
"midEntTax": "40000.00",
|
||||
"bpMid": "6.8",
|
||||
"payroll": "200",
|
||||
"invLoanAmount": "2500000.00",
|
||||
"bpPayroll": "4.1",
|
||||
"isCleanEnt": "Y",
|
||||
"hasSettleAcct": "Y",
|
||||
"isAgriGuar": "N",
|
||||
"isGreenLoan": "Y",
|
||||
"isTechEnt": "Y",
|
||||
"bpEntType": "7.5",
|
||||
"totoalBpRelevance": "9.2",
|
||||
"loanTerm": "36",
|
||||
"bpLoanTerm": "3.3",
|
||||
"applyAmt": "5000000.00",
|
||||
"bpLoanAmount": "5.8",
|
||||
"collType": "房产抵押",
|
||||
"collThirdParty": "N",
|
||||
"bpCollateral": "4.5",
|
||||
"greyCust": "N",
|
||||
"prinOverdue": "N",
|
||||
"interestOverdue": "N",
|
||||
"cardOverdue": "N",
|
||||
"bpGreyOverdue": "0",
|
||||
"totoalBpRisk": "1.2",
|
||||
"totalBp": "48.2",
|
||||
"calculateRate": "3.932"
|
||||
"custIsn": "CUST20260121001",
|
||||
"custType": "企业",
|
||||
"guarType": "抵押",
|
||||
"custName": "北京智联科技有限公司",
|
||||
"idType": "统一社会信用代码",
|
||||
"idNum": "91110108MA00XXXXXX",
|
||||
"repayMethod": "分期",
|
||||
"loanTerm": "3",
|
||||
"isFirstLoan": "0",
|
||||
"faithDay": "730",
|
||||
"bpFirstLoan": "0",
|
||||
"bpAgeLoan": "5.2",
|
||||
"totalBpLoyalty": "8.5",
|
||||
"balanceAvg": "5000000.00",
|
||||
"loanAvg": "3000000.00",
|
||||
"derivationRate": "1.8",
|
||||
"totalBpContribution": "12.3",
|
||||
"midEntConnect": "1",
|
||||
"midEntEffect": "1",
|
||||
"midEntInter": "1",
|
||||
"midEntAccept": "1",
|
||||
"midEntDiscount": "1",
|
||||
"midEntEleDdc": "1",
|
||||
"midEntWaterDdc": "1",
|
||||
"bpMid": "6.8",
|
||||
"payroll": "200",
|
||||
"invLoanAmount": "2500000.00",
|
||||
"bpPayroll": "4.1",
|
||||
"isCleanEnt": "1",
|
||||
"hasSettleAcct": "1",
|
||||
"isTradeBuildEnt": "0",
|
||||
"isGreenLoan": "1",
|
||||
"isTechEnt": "1",
|
||||
"bpEntType": "7.5",
|
||||
"totoalBpRelevance": "9.2",
|
||||
"bpLoanTerm": "3.3",
|
||||
"applyAmt": "5000000.00",
|
||||
"bpLoanAmount": "5.8",
|
||||
"collType": "一类",
|
||||
"collThirdParty": "0",
|
||||
"bpCollateral": "4.5",
|
||||
"greyCust": "0",
|
||||
"prinOverdue": "0",
|
||||
"interestOverdue": "0",
|
||||
"bpGreyOverdue": "0",
|
||||
"totoalBpRisk": "1.2",
|
||||
"totalBp": "48.2",
|
||||
"baseLoanRate": "3.45",
|
||||
"calculateRate": "3.932",
|
||||
"loanRateHistory": "4.20",
|
||||
"minRateProduct": "3.10",
|
||||
"smoothRange": "-0.20",
|
||||
"finalCalculateRate": "3.732",
|
||||
"referenceRate": "3.432"
|
||||
},
|
||||
"extensionMap": {},
|
||||
"reasonMessage": "Running successfully",
|
||||
"bizTime": 1736405548630,
|
||||
"outputFields": {},
|
||||
"workflowCode": "TBKH",
|
||||
"orgCode": "802000",
|
||||
"orgCode": "892000",
|
||||
"bizId": "2025010914345",
|
||||
"reasonCode": 200,
|
||||
"workflowVersion": 14,
|
||||
"callTime": 1736405548630,
|
||||
"status": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,4 +87,34 @@ class LoanPricingModelServiceTest
|
||||
!Objects.equals("张三", entity.getCustName())
|
||||
&& !Objects.equals("110101199001011234", entity.getIdNum())));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldNormalizeCorporateUploadParamsBeforeInvokeModel()
|
||||
{
|
||||
LoanPricingWorkflow workflow = new LoanPricingWorkflow();
|
||||
workflow.setId(3L);
|
||||
workflow.setCustType("企业");
|
||||
workflow.setCustName("cipher-name");
|
||||
workflow.setIdNum("cipher-id");
|
||||
workflow.setRepayMethod("分期");
|
||||
workflow.setIsGreenLoan("true");
|
||||
workflow.setIsTradeBuildEnt("false");
|
||||
workflow.setCollThirdParty("true");
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("calculateRate", "4.15");
|
||||
|
||||
when(loanPricingWorkflowMapper.selectById(3L)).thenReturn(workflow);
|
||||
when(sensitiveFieldCryptoService.decrypt("cipher-name")).thenReturn("测试公司");
|
||||
when(sensitiveFieldCryptoService.decrypt("cipher-id")).thenReturn("91330000123456789X");
|
||||
when(modelService.invokeModel(any())).thenReturn(response);
|
||||
|
||||
loanPricingModelService.invokeModelAsync(3L);
|
||||
|
||||
verify(modelService).invokeModel(argThat((ModelInvokeDTO dto) ->
|
||||
Objects.equals("分期", dto.getRepayMethod())
|
||||
&& Objects.equals("1", dto.getIsGreenLoan())
|
||||
&& Objects.equals("0", dto.getIsTradeBuildEnt())
|
||||
&& Objects.equals("1", dto.getCollThirdParty())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,14 +216,16 @@ class LoanPricingWorkflowServiceImplTest
|
||||
|
||||
ModelCorpOutputFields corpOutputFields = new ModelCorpOutputFields();
|
||||
corpOutputFields.setCalculateRate("3.932");
|
||||
corpOutputFields.setFinalCalculateRate("3.652");
|
||||
|
||||
when(loanPricingWorkflowMapper.selectOne(any())).thenReturn(workflow);
|
||||
when(modelCorpOutputFieldsMapper.selectById(22L)).thenReturn(corpOutputFields);
|
||||
|
||||
LoanPricingWorkflowVO result = loanPricingWorkflowService.selectLoanPricingBySerialNum("C20260328001");
|
||||
|
||||
assertEquals("3.932", result.getLoanPricingWorkflow().getLoanRate());
|
||||
assertEquals("3.652", result.getLoanPricingWorkflow().getLoanRate());
|
||||
assertEquals("3.932", result.getModelCorpOutputFields().getCalculateRate());
|
||||
assertEquals("3.652", result.getModelCorpOutputFields().getFinalCalculateRate());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user