Commit fa07e22d authored by 鹿朋's avatar 鹿朋

审批添加fundProductId字段

parent 041f9514
...@@ -29,6 +29,7 @@ import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneService; ...@@ -29,6 +29,7 @@ import cn.quantgroup.cashloanflowboss.spi.jolyne.JolyneService;
import cn.quantgroup.cashloanflowboss.spi.opapi.OPCenter; import cn.quantgroup.cashloanflowboss.spi.opapi.OPCenter;
import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService; import cn.quantgroup.cashloanflowboss.spi.user.service.XyqbUserService;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.Contract;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FinanceProduct;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.LoanApplicationHistory;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaProduct; import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.QuotaProduct;
import cn.quantgroup.cashloanflowboss.spi.xyqb.repository.CancelPreLoanRepository; import cn.quantgroup.cashloanflowboss.spi.xyqb.repository.CancelPreLoanRepository;
...@@ -212,9 +213,11 @@ public class OrderServiceImpl implements OrderService{ ...@@ -212,9 +213,11 @@ public class OrderServiceImpl implements OrderService{
return new Tuple(false, "审批失败,boss渠道配置为空"); return new Tuple(false, "审批失败,boss渠道配置为空");
} }
Integer fundId = ChannelConfUtil.getFundIdByType(approveVo.getFundType(), channelConf); Integer fundId = ChannelConfUtil.getFundIdByType(approveVo.getFundType(), channelConf);
FinanceProduct financeProduct = xyqbCenterService.getByFundCorpId(Long.valueOf(fundId));
log.info("approveOpt审批,fundProductId={}", financeProduct.getId());
// 资方 及 期数额度规则 // 资方 及 期数额度规则
String fundFormat = String.format(OrderUtil.financeProductsFormat, approveVo.getAmount(), approveVo.getAmount(), String fundFormat = String.format(OrderUtil.financeProductsFormat, approveVo.getAmount(), approveVo.getAmount(),
approveVo.getPeriod(), fundId); approveVo.getPeriod(), fundId, financeProduct.getId());
saveOrUpdateOrderApprove(approveVo, orderMapping, fundId); saveOrUpdateOrderApprove(approveVo, orderMapping, fundId);
ClfChannelConfiguration clfChannelConfiguration = clfCenterService.findChannelConfigurationByChannelId(orderMapping.getRegisteredFrom()); ClfChannelConfiguration clfChannelConfiguration = clfCenterService.findChannelConfigurationByChannelId(orderMapping.getRegisteredFrom());
if (clfChannelConfiguration == null) { if (clfChannelConfiguration == null) {
......
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
*/ */
public class OrderUtil { public class OrderUtil {
// public static final String financeProductsFormat = "[{\"min\":%s,\"max\":%s,\"terms\":[{\"term\":%s,\"fundInfo\":[{\"fundId\":%s,\"rate\":\"0\",\"rateType\":1,\"priority\":\"1\",\"feeType\":\"1\"}]}]}]"; // public static final String financeProductsFormat = "[{\"min\":%s,\"max\":%s,\"terms\":[{\"term\":%s,\"fundInfo\":[{\"fundId\":%s,\"rate\":\"0\",\"rateType\":1,\"priority\":\"1\",\"feeType\":\"1\"}]}]}]";
public static final String financeProductsFormat = "[{\"min\":%s,\"max\":%s,\"terms\":[{\"term\":%s,\"fundInfo\":[{\"fundId\":%s,\"rate\":\"0\",\"rateType\":1,\"priority\":\"1\",\"feeType\":\"1\",\"fundProductId\":1050}]}]}]"; public static final String financeProductsFormat = "[{\"min\":%s,\"max\":%s,\"terms\":[{\"term\":%s,\"fundInfo\":[{\"fundId\":%s,\"rate\":\"0\",\"rateType\":1,\"priority\":\"1\",\"feeType\":\"1\",\"fundProductId\":%s}]}]}]";
/** /**
* *
* @param kaNoticeType * @param kaNoticeType
......
package cn.quantgroup.cashloanflowboss.spi.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* 金融产品
*
* @author lupeng
* @since 2020/04/23
*/
@Entity
@Data
@Table(name = "finance_product")
public class FinanceProduct implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 主键id
*/
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 资方id
*/
@Column(name = "fund_corp_id")
private Long fundCorpId;
/**
* 月利率
*/
@Column(name = "monthly_interest_rate")
private BigDecimal monthlyInterestRate;
/**
* 还款类型:1:等额本金:0:等额本息
*/
@Column(name = "repayment_type")
private Integer repaymentType;
/**
* 计息规则
*/
@Column(name = "repayment_rule")
private String repaymentRule;
/**
* 数据有效性标志位
*/
@Column(name = "is_active")
private Integer isActive;
/**
* 描述
*/
@Column(name = "remark")
private String remark;
/**
* 创建时间
*/
@Column(name = "created_at")
private Timestamp createdAt;
/**
* 更新时间
*/
@Column(name = "updated_at")
private Timestamp updatedAt;
/**
* {1:"0.0001",2:"0.00012",0:"0.00011"}0表示任何其他期
*/
@Column(name = "service_fee_config")
private String serviceFeeConfig;
/**
* 展示日利率
*/
@Column(name = "show_day_interest")
private BigDecimal showDayInterest;
/**
* 展示月利率
*/
@Column(name = "show_month_interest")
private BigDecimal showMonthInterest;
/**
* 展示年利率
*/
@Column(name = "show_year_interest")
private BigDecimal showYearInterest;
}
package cn.quantgroup.cashloanflowboss.spi.xyqb.repository;
import cn.quantgroup.cashloanflowboss.spi.xyqb.entity.FinanceProduct;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
/**
* @author lupeng
* @since 2020/04/23
*/
public interface FinanceProductRepository extends JpaRepository<FinanceProduct, Long> {
@Query(value = "select * from finance_product where fund_corp_id = ?1 and is_active = 1 limit 1", nativeQuery = true)
FinanceProduct findByFundCorpId(Long fundCorpId);
}
...@@ -53,4 +53,12 @@ public interface XYQBCenterService { ...@@ -53,4 +53,12 @@ public interface XYQBCenterService {
Tuple<Boolean,String> cleanUserActiveOrder(Long userId); Tuple<Boolean,String> cleanUserActiveOrder(Long userId);
ServiceResult<RepaymentPlansResultModel> findRepaymentPlan(Long loanId); ServiceResult<RepaymentPlansResultModel> findRepaymentPlan(Long loanId);
/**
* 查询金融产品通过资方id
* @param fundCorpId
* @return
*/
FinanceProduct getByFundCorpId(Long fundCorpId);
} }
...@@ -52,6 +52,8 @@ public class XYQBCenterServiceImpl implements XYQBCenterService { ...@@ -52,6 +52,8 @@ public class XYQBCenterServiceImpl implements XYQBCenterService {
private LoanApplicationHistoryRepository loanApplicationHistoryRepository; private LoanApplicationHistoryRepository loanApplicationHistoryRepository;
@Autowired @Autowired
private QuotaProductRepository quotaProductRepository; private QuotaProductRepository quotaProductRepository;
@Autowired
private FinanceProductRepository financeProductRepository;
@Autowired @Autowired
private JolyneService jolyneService; private JolyneService jolyneService;
...@@ -272,4 +274,9 @@ public class XYQBCenterServiceImpl implements XYQBCenterService { ...@@ -272,4 +274,9 @@ public class XYQBCenterServiceImpl implements XYQBCenterService {
log.info("查询还款计划,请求参数 paramMap={}", paramMap); log.info("查询还款计划,请求参数 paramMap={}", paramMap);
return xyqbCenter.getXyqbRepaymentPlans(paramMap); return xyqbCenter.getXyqbRepaymentPlans(paramMap);
} }
@Override
public FinanceProduct getByFundCorpId(Long fundCorpId) {
return financeProductRepository.findByFundCorpId(fundCorpId);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment