添加执行利率接口

This commit is contained in:
wkc
2026-01-22 15:04:40 +08:00
parent 50178923f8
commit c102714f92
13 changed files with 586 additions and 3 deletions

View File

@@ -9,7 +9,6 @@ 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.common.utils.SecurityUtils;
import com.ruoyi.loanpricing.domain.entity.LoanPricingWorkflow;
import com.ruoyi.loanpricing.domain.vo.LoanPricingWorkflowVO;
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
@@ -20,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 利率定价流程Controller
*
@@ -80,4 +81,19 @@ public class LoanPricingWorkflowController extends BaseController
}
return success(workflow);
}
/**
* 设定执行利率
*/
@Operation(summary = "设定执行利率")
@Log(title = "利率定价流程", businessType = BusinessType.UPDATE)
@PutMapping("/{serialNum}/executeRate")
public AjaxResult setExecuteRate(
@Parameter(description = "业务方流水号")
@PathVariable("serialNum") String serialNum,
@RequestBody Map<String, String> request) {
String executeRate = request.get("executeRate");
boolean success = loanPricingWorkflowService.setExecuteRate(serialNum, executeRate);
return success ? success() : error("设定失败");
}
}

View File

@@ -3,7 +3,6 @@ package com.ruoyi.loanpricing.domain.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serializable;
@@ -99,6 +98,11 @@ public class LoanPricingWorkflow implements Serializable
@NotBlank(message = "贷款利率不能为空")
private String loanRate;
/**
* 执行利率(%)
*/
private String executeRate;
/** 客户名称 */
private String custName;

View File

@@ -47,4 +47,13 @@ public interface ILoanPricingWorkflowService
* @return 利率定价流程
*/
public LoanPricingWorkflowVO selectLoanPricingBySerialNum(String serialNum);
/**
* 设定执行利率
*
* @param serialNum 业务方流水号
* @param executeRate 执行利率
* @return 是否成功
*/
public boolean setExecuteRate(String serialNum, String executeRate);
}

View File

@@ -167,4 +167,27 @@ public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowServi
return wrapper;
}
/**
* 设定执行利率
*
* @param serialNum 业务方流水号
* @param executeRate 执行利率
* @return 是否成功
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean setExecuteRate(String serialNum, String executeRate) {
LambdaQueryWrapper<LoanPricingWorkflow> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LoanPricingWorkflow::getSerialNum, serialNum);
LoanPricingWorkflow workflow = loanPricingWorkflowMapper.selectOne(wrapper);
if (workflow == null) {
return false;
}
workflow.setExecuteRate(executeRate);
int result = loanPricingWorkflowMapper.updateById(workflow);
return result > 0;
}
}