From b8b8d21b09fb16ca551e1abd8989aaf173219bc0 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Thu, 30 Apr 2026 09:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=B9=B6=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=A7=8D=E7=B1=BB=E5=8E=86=E5=8F=B2=E5=88=A9?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LoanPricingWorkflowServiceImpl.java | 18 ++++++++++++++++++ .../loanpricing/util/LoanPricingConverter.java | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java b/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java index 2a145da..046c90f 100644 --- a/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java +++ b/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/service/impl/LoanPricingWorkflowServiceImpl.java @@ -3,6 +3,7 @@ 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.exception.ServiceException; import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO; import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO; import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow; @@ -65,6 +66,8 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi @Transactional(rollbackFor = Exception.class) public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow) { + validateBusinessTypeAndHistoryRate(loanPricingWorkflow); + // 自动生成业务方流水号(时间戳) SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); String serialNum = sdf.format(new Date()); @@ -88,6 +91,21 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi return loanPricingWorkflow; } + private void validateBusinessTypeAndHistoryRate(LoanPricingWorkflow workflow) { + if (!StringUtils.hasText(workflow.getBusinessType())) { + throw new ServiceException("业务种类不能为空"); + } + if (!"新客".equals(workflow.getBusinessType()) + && !"存量新增".equals(workflow.getBusinessType()) + && !"存量转贷".equals(workflow.getBusinessType())) { + throw new ServiceException("业务种类必须是:新客、存量新增、存量转贷之一"); + } + if ("存量转贷".equals(workflow.getBusinessType()) + && !StringUtils.hasText(workflow.getLoanRateHistory())) { + throw new ServiceException("请选择历史贷款合同"); + } + } + /** * 发起个人客户利率定价流程 * diff --git a/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java b/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java index e463dc6..9ac0fa1 100644 --- a/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java +++ b/ruoyi-loan-pricing/src/main/java/com/ruoyi/loanpricing/util/LoanPricingConverter.java @@ -29,6 +29,8 @@ public class LoanPricingConverter { entity.setGuarType(dto.getGuarType()); entity.setApplyAmt(dto.getApplyAmt()); entity.setLoanPurpose(dto.getLoanPurpose()); + entity.setBusinessType(dto.getBusinessType()); + entity.setLoanRateHistory(dto.getLoanRateHistory()); entity.setLoanTerm(dto.getLoanTerm()); entity.setCollType(dto.getCollType()); entity.setCollThirdParty(dto.getCollThirdParty()); @@ -54,6 +56,8 @@ public class LoanPricingConverter { entity.setIdNum(dto.getIdNum()); entity.setGuarType(dto.getGuarType()); entity.setApplyAmt(dto.getApplyAmt()); + entity.setBusinessType(dto.getBusinessType()); + entity.setLoanRateHistory(dto.getLoanRateHistory()); entity.setRepayMethod(dto.getRepayMethod()); entity.setCollType(dto.getCollType()); entity.setCollThirdParty(dto.getCollThirdParty());