增删改查完成
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
package com.ruoyi.loanpricing.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
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.LoanPricingWorkflow;
|
||||
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 利率定价流程Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
@Tag(name = "利率定价流程管理")
|
||||
@RestController
|
||||
@RequestMapping("/loanPricing/workflow")
|
||||
public class LoanPricingWorkflowController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ILoanPricingWorkflowService loanPricingWorkflowService;
|
||||
|
||||
/**
|
||||
* 发起利率定价流程
|
||||
*/
|
||||
@Operation(summary = "发起利率定价流程")
|
||||
@Log(title = "利率定价流程", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public AjaxResult create(@Validated @RequestBody LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
// 设置创建者
|
||||
loanPricingWorkflow.setCreateBy(SecurityUtils.getUsername());
|
||||
loanPricingWorkflow.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
||||
LoanPricingWorkflow result = loanPricingWorkflowService.createLoanPricing(loanPricingWorkflow);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询利率定价流程列表
|
||||
*/
|
||||
@Operation(summary = "查询利率定价流程列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Page<LoanPricingWorkflow> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
|
||||
IPage<LoanPricingWorkflow> result = loanPricingWorkflowService.selectLoanPricingPage(page, loanPricingWorkflow);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(200);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(result.getRecords());
|
||||
rspData.setTotal(result.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询利率定价流程详情
|
||||
*/
|
||||
@Operation(summary = "查询利率定价流程详情")
|
||||
@GetMapping("/{serialNum}")
|
||||
public AjaxResult getInfo(
|
||||
@Parameter(description = "业务方流水号")
|
||||
@PathVariable("serialNum") String serialNum)
|
||||
{
|
||||
LoanPricingWorkflow workflow = loanPricingWorkflowService.selectLoanPricingBySerialNum(serialNum);
|
||||
if (workflow == null)
|
||||
{
|
||||
return error("记录不存在");
|
||||
}
|
||||
return success(workflow);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.ruoyi.loanpricing.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 利率定价流程对象 loan_pricing_workflow
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
@Data
|
||||
@TableName("loan_pricing_workflow")
|
||||
public class LoanPricingWorkflow implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 业务方流水号 */
|
||||
private String serialNum;
|
||||
|
||||
/** 机构编码 */
|
||||
private String orgCode;
|
||||
|
||||
/** 运行模式: 1-同步 */
|
||||
private String runType;
|
||||
|
||||
/** 客户内码 */
|
||||
@NotBlank(message = "客户内码不能为空")
|
||||
private String custIsn;
|
||||
|
||||
/** 客户类型: 个人/企业 */
|
||||
@NotBlank(message = "客户类型不能为空")
|
||||
private String custType;
|
||||
|
||||
/** 担保方式: 信用/保证/抵押/质押 */
|
||||
@NotBlank(message = "担保方式不能为空")
|
||||
private String guarType;
|
||||
|
||||
/** 中间业务_个人_快捷支付: true/false */
|
||||
private String midPerQuickPay;
|
||||
|
||||
/** 中间业务_个人_电费代扣: true/false */
|
||||
private String midPerEleDdc;
|
||||
|
||||
/** 中间业务_企业_电费代扣: true/false */
|
||||
private String midEntEleDdc;
|
||||
|
||||
/** 中间业务_企业_水费代扣: true/false */
|
||||
private String midEntWaterDdc;
|
||||
|
||||
/** 申请金额(元) */
|
||||
@NotBlank(message = "申请金额不能为空")
|
||||
private String applyAmt;
|
||||
|
||||
/** 净身企业: true/false */
|
||||
private String isCleanEnt;
|
||||
|
||||
/** 开立基本结算账户: true/false */
|
||||
private String hasSettleAcct;
|
||||
|
||||
/** 制造业企业: true/false */
|
||||
private String isManufacturing;
|
||||
|
||||
/** 省农担担保贷款: true/false */
|
||||
private String isAgriGuar;
|
||||
|
||||
/** 是否纳税信用等级A级: true/false */
|
||||
private String isTaxA;
|
||||
|
||||
/** 是否县级及以上农业龙头企业: true/false */
|
||||
private String isAgriLeading;
|
||||
|
||||
/** 贷款用途: consumer-消费/business-经营 */
|
||||
private String loanPurpose;
|
||||
|
||||
/** 是否有经营佐证: true/false */
|
||||
private String bizProof;
|
||||
|
||||
/** 抵质押类型: 一线/一类/二类 */
|
||||
private String collType;
|
||||
|
||||
/** 抵质押物是否三方所有: true/false */
|
||||
private String collThirdParty;
|
||||
|
||||
/** 贷款利率 */
|
||||
@NotBlank(message = "贷款利率不能为空")
|
||||
private String loanRate;
|
||||
|
||||
/** 客户名称 */
|
||||
private String custName;
|
||||
|
||||
/** 证件类型 */
|
||||
private String idType;
|
||||
|
||||
/** 是否普惠小微借款人: true/false */
|
||||
private String isInclusiveFinance;
|
||||
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.loanpricing.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.loanpricing.domain.LoanPricingWorkflow;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 利率定价流程Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
public interface LoanPricingWorkflowMapper extends BaseMapper<LoanPricingWorkflow>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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.LoanPricingWorkflow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 利率定价流程Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
public interface ILoanPricingWorkflowService
|
||||
{
|
||||
/**
|
||||
* 发起利率定价流程
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 结果
|
||||
*/
|
||||
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow);
|
||||
|
||||
/**
|
||||
* 查询利率定价流程列表
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 利率定价流程集合
|
||||
*/
|
||||
public List<LoanPricingWorkflow> selectLoanPricingList(LoanPricingWorkflow loanPricingWorkflow);
|
||||
|
||||
/**
|
||||
* 分页查询利率定价流程列表
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 分页结果
|
||||
*/
|
||||
public IPage<LoanPricingWorkflow> selectLoanPricingPage(Page<LoanPricingWorkflow> page, LoanPricingWorkflow loanPricingWorkflow);
|
||||
|
||||
/**
|
||||
* 查询利率定价流程详情
|
||||
*
|
||||
* @param serialNum 业务方流水号
|
||||
* @return 利率定价流程
|
||||
*/
|
||||
public LoanPricingWorkflow selectLoanPricingBySerialNum(String serialNum);
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
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.LoanPricingWorkflow;
|
||||
import com.ruoyi.loanpricing.mapper.LoanPricingWorkflowMapper;
|
||||
import com.ruoyi.loanpricing.service.ILoanPricingWorkflowService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 利率定价流程Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-19
|
||||
*/
|
||||
@Service
|
||||
public class LoanPricingWorkflowServiceImpl implements ILoanPricingWorkflowService
|
||||
{
|
||||
@Autowired
|
||||
private LoanPricingWorkflowMapper loanPricingWorkflowMapper;
|
||||
|
||||
/**
|
||||
* 发起利率定价流程
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public LoanPricingWorkflow createLoanPricing(LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
// 自动生成业务方流水号(时间戳)
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String serialNum = sdf.format(new Date());
|
||||
loanPricingWorkflow.setSerialNum(serialNum);
|
||||
|
||||
// 设置默认值
|
||||
if (!StringUtils.hasText(loanPricingWorkflow.getOrgCode()))
|
||||
{
|
||||
loanPricingWorkflow.setOrgCode("931000");
|
||||
}
|
||||
if (!StringUtils.hasText(loanPricingWorkflow.getRunType()))
|
||||
{
|
||||
loanPricingWorkflow.setRunType("1");
|
||||
}
|
||||
|
||||
// 设置创建时间和更新时间
|
||||
Date now = new Date();
|
||||
loanPricingWorkflow.setCreateTime(now);
|
||||
loanPricingWorkflow.setUpdateTime(now);
|
||||
|
||||
loanPricingWorkflowMapper.insert(loanPricingWorkflow);
|
||||
return loanPricingWorkflow;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询利率定价流程列表
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 利率定价流程
|
||||
*/
|
||||
@Override
|
||||
public List<LoanPricingWorkflow> selectLoanPricingList(LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
LambdaQueryWrapper<LoanPricingWorkflow> wrapper = buildQueryWrapper(loanPricingWorkflow);
|
||||
// 按更新时间倒序
|
||||
wrapper.orderByDesc(LoanPricingWorkflow::getUpdateTime);
|
||||
return loanPricingWorkflowMapper.selectList(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询利率定价流程列表
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return 利率定价流程
|
||||
*/
|
||||
@Override
|
||||
public IPage<LoanPricingWorkflow> selectLoanPricingPage(Page<LoanPricingWorkflow> page, LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
LambdaQueryWrapper<LoanPricingWorkflow> wrapper = buildQueryWrapper(loanPricingWorkflow);
|
||||
// 按更新时间倒序
|
||||
wrapper.orderByDesc(LoanPricingWorkflow::getUpdateTime);
|
||||
return loanPricingWorkflowMapper.selectPage(page, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询利率定价流程详情
|
||||
*
|
||||
* @param serialNum 业务方流水号
|
||||
* @return 利率定价流程
|
||||
*/
|
||||
@Override
|
||||
public LoanPricingWorkflow selectLoanPricingBySerialNum(String serialNum)
|
||||
{
|
||||
LambdaQueryWrapper<LoanPricingWorkflow> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LoanPricingWorkflow::getSerialNum, serialNum);
|
||||
return loanPricingWorkflowMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
*
|
||||
* @param loanPricingWorkflow 利率定价流程信息
|
||||
* @return LambdaQueryWrapper
|
||||
*/
|
||||
private LambdaQueryWrapper<LoanPricingWorkflow> buildQueryWrapper(LoanPricingWorkflow loanPricingWorkflow)
|
||||
{
|
||||
LambdaQueryWrapper<LoanPricingWorkflow> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 按创建者筛选
|
||||
if (StringUtils.hasText(loanPricingWorkflow.getCreateBy()))
|
||||
{
|
||||
wrapper.eq(LoanPricingWorkflow::getCreateBy, loanPricingWorkflow.getCreateBy());
|
||||
}
|
||||
|
||||
// 按客户名称模糊查询
|
||||
if (StringUtils.hasText(loanPricingWorkflow.getCustName()))
|
||||
{
|
||||
wrapper.like(LoanPricingWorkflow::getCustName, loanPricingWorkflow.getCustName());
|
||||
}
|
||||
|
||||
// 按机构号筛选
|
||||
if (StringUtils.hasText(loanPricingWorkflow.getOrgCode()))
|
||||
{
|
||||
wrapper.eq(LoanPricingWorkflow::getOrgCode, loanPricingWorkflow.getOrgCode());
|
||||
}
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user