Commit 8d5408be authored by liwenbin's avatar liwenbin

资方配置增加

parent 0b6adc13
package com.quantgroup.asset.distribution.service.funding.impl; 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.AuditTargetEnum;
import com.quantgroup.asset.distribution.enums.funding.AuditTypeEnum; import com.quantgroup.asset.distribution.enums.funding.AuditTypeEnum;
import com.quantgroup.asset.distribution.enums.response.FundModuleResponse; import com.quantgroup.asset.distribution.enums.response.FundModuleResponse;
import com.quantgroup.asset.distribution.exception.QGException; import com.quantgroup.asset.distribution.exception.QGException;
import com.quantgroup.asset.distribution.exception.QGExceptionType; 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.model.response.GlobalResponse;
import com.quantgroup.asset.distribution.service.approval.IApprovalLogService; import com.quantgroup.asset.distribution.service.approval.IApprovalLogService;
import com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigNewService; import com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigNewService;
...@@ -229,7 +232,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha ...@@ -229,7 +232,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
private FundModuleChannelFundConfigNew createdNewChannelFundConfigNew(String bizChannel, String funds, String remarks) { private FundModuleChannelFundConfigNew createdNewChannelFundConfigNew(String bizChannel, String funds, String remarks) {
FundModuleChannelFundConfigNew config = new FundModuleChannelFundConfigNew(); FundModuleChannelFundConfigNew config = new FundModuleChannelFundConfigNew();
config.setBizChannel(bizChannel); config.setBizChannel(bizChannel);
config.setFunds(funds); config.setFunds(supplementDefaultFundsInfo(funds));
config.setRemarks(remarks); config.setRemarks(remarks);
config.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds)); config.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds));
config.setFundLimitTranslate(ChannelFundConfigUtil.getFundLimitTranslate(funds)); config.setFundLimitTranslate(ChannelFundConfigUtil.getFundLimitTranslate(funds));
...@@ -237,6 +240,27 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha ...@@ -237,6 +240,27 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
return fundModuleChannelFundConfigNewRepository.save(config); 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 * @param bizChannel
......
...@@ -150,7 +150,7 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne ...@@ -150,7 +150,7 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne
private FundModuleChannelFundConfig createdNewChannelFundConfig(String bizChannel, String funds, String remarks) { private FundModuleChannelFundConfig createdNewChannelFundConfig(String bizChannel, String funds, String remarks) {
FundModuleChannelFundConfig fundModuleChannelFundConfig = new FundModuleChannelFundConfig(); FundModuleChannelFundConfig fundModuleChannelFundConfig = new FundModuleChannelFundConfig();
fundModuleChannelFundConfig.setBizChannel(bizChannel); fundModuleChannelFundConfig.setBizChannel(bizChannel);
fundModuleChannelFundConfig.setFunds(funds); fundModuleChannelFundConfig.setFunds(supplementDefaultFundsInfo(funds));
fundModuleChannelFundConfig.setRemarks(remarks); fundModuleChannelFundConfig.setRemarks(remarks);
fundModuleChannelFundConfig.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds)); fundModuleChannelFundConfig.setFundIds(ChannelFundConfigUtil.getAllFundIds(funds));
// 默认测试 // 默认测试
...@@ -159,6 +159,27 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne ...@@ -159,6 +159,27 @@ public class FundModuleChannelFundConfigServiceImpl implements IFundModuleChanne
return fundModuleChannelFundConfigRepository.save(fundModuleChannelFundConfig); 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);
}
/** /**
* 创建渠道资方配置审批记录 * 创建渠道资方配置审批记录
* @param bizChannel * @param bizChannel
......
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