客户类型字段更新
This commit is contained in:
@@ -9,6 +9,8 @@ import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
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.vo.LoanPricingWorkflowVO;
|
||||
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
|
||||
@@ -36,14 +38,25 @@ public class LoanPricingWorkflowController extends BaseController
|
||||
private ILoanPricingWorkflowService loanPricingWorkflowService;
|
||||
|
||||
/**
|
||||
* 发起利率定价流程
|
||||
* 发起个人客户利率定价流程
|
||||
*/
|
||||
@Operation(summary = "发起利率定价流程")
|
||||
@Log(title = "利率定价流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public AjaxResult create(@Validated @RequestBody LoanPricingWorkflow loanPricingWorkflow)
|
||||
@Operation(summary = "发起个人客户利率定价流程", description = "用于个人客户的利率定价流程发起")
|
||||
@Log(title = "个人客户利率定价流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create/personal")
|
||||
public AjaxResult createPersonal(@Validated @RequestBody PersonalLoanPricingCreateDTO dto) {
|
||||
LoanPricingWorkflow result = loanPricingWorkflowService.createPersonalLoanPricing(dto);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起企业客户利率定价流程
|
||||
*/
|
||||
@Operation(summary = "发起企业客户利率定价流程", description = "用于企业客户的利率定价流程发起")
|
||||
@Log(title = "企业客户利率定价流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create/corporate")
|
||||
public AjaxResult createCorporate(@Validated @RequestBody CorporateLoanPricingCreateDTO dto)
|
||||
{
|
||||
LoanPricingWorkflow result = loanPricingWorkflowService.createLoanPricing(loanPricingWorkflow);
|
||||
LoanPricingWorkflow result = loanPricingWorkflowService.createCorporateLoanPricing(dto);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.loanpricing.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 企业客户利率定价发起DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "企业客户利率定价发起请求")
|
||||
public class CorporateLoanPricingCreateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户内码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CORP001")
|
||||
@NotBlank(message = "客户内码不能为空")
|
||||
private String custIsn;
|
||||
|
||||
@Schema(description = "客户名称", example = "测试科技有限公司")
|
||||
private String custName;
|
||||
|
||||
@Schema(description = "证件类型", example = "统一社会信用代码")
|
||||
private String idType;
|
||||
|
||||
@Schema(description = "证件号码", example = "91110000100000000X")
|
||||
private String idNum;
|
||||
|
||||
@Schema(description = "担保方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "抵押", allowableValues = {"信用", "保证", "抵押", "质押"})
|
||||
@NotBlank(message = "担保方式不能为空")
|
||||
@Pattern(regexp = "^(信用|保证|抵押|质押)$", message = "担保方式必须是:信用、保证、抵押、质押之一")
|
||||
private String guarType;
|
||||
|
||||
@Schema(description = "申请金额(元)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000000")
|
||||
@NotBlank(message = "申请金额不能为空")
|
||||
private String applyAmt;
|
||||
|
||||
@Schema(description = "贷款期限", example = "36")
|
||||
private String loanTerm;
|
||||
|
||||
@Schema(description = "省农担担保贷款", example = "false")
|
||||
private String isAgriGuar;
|
||||
|
||||
@Schema(description = "绿色贷款", example = "true")
|
||||
private String isGreenLoan;
|
||||
|
||||
@Schema(description = "科技型企业", example = "true")
|
||||
private String isTechEnt;
|
||||
|
||||
@Schema(description = "贸易和建筑业企业标识", example = "false")
|
||||
private String isTradeConstruction;
|
||||
|
||||
@Schema(description = "抵质押类型", example = "一类")
|
||||
private String collType;
|
||||
|
||||
@Schema(description = "抵质押物是否三方所有", example = "false")
|
||||
private String collThirdParty;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.loanpricing.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 个人客户利率定价发起DTO
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "个人客户利率定价发起请求")
|
||||
public class PersonalLoanPricingCreateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "客户内码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CUST001")
|
||||
@NotBlank(message = "客户内码不能为空")
|
||||
private String custIsn;
|
||||
|
||||
@Schema(description = "客户名称", example = "张三")
|
||||
private String custName;
|
||||
|
||||
@Schema(description = "证件类型", example = "身份证")
|
||||
private String idType;
|
||||
|
||||
@Schema(description = "证件号码", example = "110101199001011234")
|
||||
private String idNum;
|
||||
|
||||
@Schema(description = "担保方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "信用", allowableValues = {"信用", "保证", "抵押", "质押"})
|
||||
@NotBlank(message = "担保方式不能为空")
|
||||
@Pattern(regexp = "^(信用|保证|抵押|质押)$", message = "担保方式必须是:信用、保证、抵押、质押之一")
|
||||
private String guarType;
|
||||
|
||||
@Schema(description = "申请金额(元)", requiredMode = Schema.RequiredMode.REQUIRED, example = "500000")
|
||||
@NotBlank(message = "申请金额不能为空")
|
||||
private String applyAmt;
|
||||
|
||||
@Schema(description = "是否有经营佐证", example = "true")
|
||||
private String bizProof;
|
||||
|
||||
@Schema(description = "循环功能", example = "false")
|
||||
private String loanLoop;
|
||||
|
||||
@Schema(description = "抵质押类型", example = "一类")
|
||||
private String collType;
|
||||
|
||||
@Schema(description = "抵质押物是否三方所有", example = "false")
|
||||
private String collThirdParty;
|
||||
}
|
||||
@@ -64,6 +64,11 @@ public class LoanPricingWorkflow implements Serializable
|
||||
@NotBlank(message = "申请金额不能为空")
|
||||
private String applyAmt;
|
||||
|
||||
/**
|
||||
* 贷款期限
|
||||
*/
|
||||
private String loanTerm;
|
||||
|
||||
/** 净身企业: true/false */
|
||||
private String isCleanEnt;
|
||||
|
||||
@@ -76,6 +81,21 @@ public class LoanPricingWorkflow implements Serializable
|
||||
/** 省农担担保贷款: true/false */
|
||||
private String isAgriGuar;
|
||||
|
||||
/**
|
||||
* 贸易和建筑业企业标识: true/false
|
||||
*/
|
||||
private String isTradeConstruction;
|
||||
|
||||
/**
|
||||
* 绿色贷款: true/false
|
||||
*/
|
||||
private String isGreenLoan;
|
||||
|
||||
/**
|
||||
* 科技型企业: true/false
|
||||
*/
|
||||
private String isTechEnt;
|
||||
|
||||
/** 是否纳税信用等级A级: true/false */
|
||||
private String isTaxA;
|
||||
|
||||
@@ -88,6 +108,9 @@ public class LoanPricingWorkflow implements Serializable
|
||||
/** 是否有经营佐证: true/false */
|
||||
private String bizProof;
|
||||
|
||||
/** 循环功能: true/false */
|
||||
private String loanLoop;
|
||||
|
||||
/** 抵质押类型: 一线/一类/二类 */
|
||||
private String collType;
|
||||
|
||||
@@ -95,7 +118,6 @@ public class LoanPricingWorkflow implements Serializable
|
||||
private String collThirdParty;
|
||||
|
||||
/** 贷款利率 */
|
||||
@NotBlank(message = "贷款利率不能为空")
|
||||
private String loanRate;
|
||||
|
||||
/**
|
||||
@@ -106,9 +128,14 @@ public class LoanPricingWorkflow implements Serializable
|
||||
/** 客户名称 */
|
||||
private String custName;
|
||||
|
||||
/** 证件类型 */
|
||||
/**
|
||||
* 证件类型
|
||||
*/
|
||||
private String idType;
|
||||
|
||||
/** 证件号码 */
|
||||
private String idNum;
|
||||
|
||||
/** 是否普惠小微借款人: true/false */
|
||||
private String isInclusiveFinance;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.ruoyi.loanpricing.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.vo.LoanPricingWorkflowVO;
|
||||
|
||||
@@ -16,12 +18,20 @@ import java.util.List;
|
||||
public interface ILoanPricingWorkflowService
|
||||
{
|
||||
/**
|
||||
* 发起利率定价流程
|
||||
* 发起个人客户利率定价流程
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @param dto 个人客户发起DTO
|
||||
* @return 结果
|
||||
*/
|
||||
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow);
|
||||
public LoanPricingWorkflow createPersonalLoanPricing(PersonalLoanPricingCreateDTO dto);
|
||||
|
||||
/**
|
||||
* 发起企业客户利率定价流程
|
||||
*
|
||||
* @param dto 企业客户发起DTO
|
||||
* @return 结果
|
||||
*/
|
||||
public LoanPricingWorkflow createCorporateLoanPricing(CorporateLoanPricingCreateDTO dto);
|
||||
|
||||
/**
|
||||
* 查询利率定价流程列表
|
||||
|
||||
@@ -3,6 +3,8 @@ 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.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;
|
||||
@@ -12,6 +14,7 @@ import com.ruoyi.loanpricing.mapper.ModelCorpOutputFieldsMapper;
|
||||
import com.ruoyi.loanpricing.mapper.ModelRetailOutputFieldsMapper;
|
||||
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
|
||||
import com.ruoyi.loanpricing.service.LoanPricingModelService;
|
||||
import com.ruoyi.loanpricing.util.LoanPricingConverter;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -50,7 +53,6 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
@@ -75,6 +77,32 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
|
||||
return loanPricingWorkflow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起个人客户利率定价流程
|
||||
*
|
||||
* @param dto 个人客户发起DTO
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public LoanPricingWorkflow createPersonalLoanPricing(PersonalLoanPricingCreateDTO dto) {
|
||||
LoanPricingWorkflow entity = LoanPricingConverter.toEntity(dto);
|
||||
return createLoanPricing(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起企业客户利率定价流程
|
||||
*
|
||||
* @param dto 企业客户发起DTO
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public LoanPricingWorkflow createCorporateLoanPricing(CorporateLoanPricingCreateDTO dto) {
|
||||
LoanPricingWorkflow entity = LoanPricingConverter.toEntity(dto);
|
||||
return createLoanPricing(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询利率定价流程列表
|
||||
*
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.loanpricing.util;
|
||||
|
||||
import com.ruoyi.loanpricing.domain.dto.CorporateLoanPricingCreateDTO;
|
||||
import com.ruoyi.loanpricing.domain.dto.PersonalLoanPricingCreateDTO;
|
||||
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
|
||||
|
||||
/**
|
||||
* 利率定价转换器
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
public class LoanPricingConverter {
|
||||
|
||||
/**
|
||||
* 个人客户DTO转Entity
|
||||
*
|
||||
* @param dto 个人客户发起DTO
|
||||
* @return 利率定价流程实体
|
||||
*/
|
||||
public static LoanPricingWorkflow toEntity(PersonalLoanPricingCreateDTO dto) {
|
||||
LoanPricingWorkflow entity = new LoanPricingWorkflow();
|
||||
// 映射共同字段
|
||||
entity.setCustIsn(dto.getCustIsn());
|
||||
entity.setCustType("个人");
|
||||
entity.setCustName(dto.getCustName());
|
||||
entity.setIdType(dto.getIdType());
|
||||
entity.setIdNum(dto.getIdNum());
|
||||
entity.setGuarType(dto.getGuarType());
|
||||
entity.setApplyAmt(dto.getApplyAmt());
|
||||
entity.setCollType(dto.getCollType());
|
||||
entity.setCollThirdParty(dto.getCollThirdParty());
|
||||
// 映射个人特有字段
|
||||
entity.setBizProof(dto.getBizProof());
|
||||
entity.setLoanLoop(dto.getLoanLoop());
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业客户DTO转Entity
|
||||
*
|
||||
* @param dto 企业客户发起DTO
|
||||
* @return 利率定价流程实体
|
||||
*/
|
||||
public static LoanPricingWorkflow toEntity(CorporateLoanPricingCreateDTO dto) {
|
||||
LoanPricingWorkflow entity = new LoanPricingWorkflow();
|
||||
// 映射共同字段
|
||||
entity.setCustIsn(dto.getCustIsn());
|
||||
entity.setCustType("企业");
|
||||
entity.setCustName(dto.getCustName());
|
||||
entity.setIdType(dto.getIdType());
|
||||
entity.setIdNum(dto.getIdNum());
|
||||
entity.setGuarType(dto.getGuarType());
|
||||
entity.setApplyAmt(dto.getApplyAmt());
|
||||
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.setLoanTerm(dto.getLoanTerm());
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user