Commit 2a70e4d0 authored by 郑建's avatar 郑建

Merge branch '6.7-2' into 'master'

资方配置增加

See merge request !10
parents 0b6adc13 8d5408be
package com.quantgroup.asset.distribution.service.funding.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.quantgroup.asset.distribution.enums.funding.AuditTargetEnum;
import com.quantgroup.asset.distribution.enums.funding.AuditTypeEnum;
import com.quantgroup.asset.distribution.enums.response.FundModuleResponse;
import com.quantgroup.asset.distribution.exception.QGException;
import com.quantgroup.asset.distribution.exception.QGExceptionType;
import com.quantgroup.asset.distribution.model.entity.fund.ChannelFundConfigNew;
import com.quantgroup.asset.distribution.model.response.GlobalResponse;
import com.quantgroup.asset.distribution.service.approval.IApprovalLogService;
import com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigNewService;
......@@ -229,7 +232,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
private FundModuleChannelFundConfigNew createdNewChannelFundConfigNew(String bizChannel, String funds, String remarks) {
FundModuleChannelFundConfigNew config = new FundModuleChannelFundConfigNew();
config.setBizChannel(bizChannel);
config.setFunds(funds);
config.setFunds(supplementDefaultFundsInfo(funds));
config.setRemarks(remarks);
config.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds));
config.setFundLimitTranslate(ChannelFundConfigUtil.getFundLimitTranslate(funds));
......@@ -237,6 +240,27 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
return fundModuleChannelFundConfigNewRepository.save(config);
}
/**
*
* @param funds
* @return
*/
private String supplementDefaultFundsInfo(String funds) {
List<ChannelFundConfigNew> channelFundConfigNewList = JSONArray.parseArray(funds, ChannelFundConfigNew.class);
channelFundConfigNewList.forEach(channelFundConfigNew -> {
if (channelFundConfigNew.getFeeType() == null) {
channelFundConfigNew.setFeeType(1);
}
if (channelFundConfigNew.getRateType() == null) {
channelFundConfigNew.setRateType(1);
}
if (StringUtils.isEmpty(channelFundConfigNew.getRate())) {
channelFundConfigNew.setRate("0");
}
});
return JSON.toJSONString(channelFundConfigNewList);
}
/**
* 创建渠道资方配置审批记录
* @param bizChannel
......
......@@ -150,7 +150,7 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne
private FundModuleChannelFundConfig createdNewChannelFundConfig(String bizChannel, String funds, String remarks) {
FundModuleChannelFundConfig fundModuleChannelFundConfig = new FundModuleChannelFundConfig();
fundModuleChannelFundConfig.setBizChannel(bizChannel);
fundModuleChannelFundConfig.setFunds(funds);
fundModuleChannelFundConfig.setFunds(supplementDefaultFundsInfo(funds));
fundModuleChannelFundConfig.setRemarks(remarks);
fundModuleChannelFundConfig.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds));
// 默认测试
......@@ -158,6 +158,27 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne
fundModuleChannelFundConfig.setEnable(false);
return fundModuleChannelFundConfigRepository.save(fundModuleChannelFundConfig);
}
/**
* 默认补充资金方相关信息
* @param funds
* @return
*/
private String supplementDefaultFundsInfo(String funds) {
List<ChannelFundConfig> channelFundConfigList = JSONArray.parseArray(funds, ChannelFundConfig.class);
for (ChannelFundConfig channelFundConfig : channelFundConfigList) {
if (channelFundConfig.getFeeType() == null) {
channelFundConfig.setFeeType(1);
}
if (channelFundConfig.getRateType() == null) {
channelFundConfig.setRateType(1);
}
if (StringUtils.isEmpty(channelFundConfig.getRate())) {
channelFundConfig.setRate("0");
}
}
return JSON.toJSONString(channelFundConfigList);
}
/**
* 创建渠道资方配置审批记录
......
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