Commit fd3bfc71 authored by liwenbin's avatar liwenbin

资方去重

parent 95a08bcd
......@@ -2,8 +2,10 @@ package com.quantgroup.asset.distribution.service.asset.impl;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
......@@ -233,6 +235,8 @@ public class AssetServiceImpl implements IAssetService{
}
QGPreconditions.checkArgument(config != null, QGExceptionType.NOT_FOUNT_CHANNEL_FUNDS_INFO, assetForm.getBizChannel());
JSONArray fundArray = new JSONArray();
// 资方去重, 可能存在多条件同一个资方
Set<String> fundSet = new HashSet<>();
List<ChannelFundConfig> fundConfigList = JSONArray.parseArray(config.getFunds(), ChannelFundConfig.class);
A : for (ChannelFundConfig channelFundConfig : fundConfigList) {
List<ChannelFundConfig.Limit> limits = channelFundConfig.getLimits();
......@@ -255,17 +259,21 @@ public class AssetServiceImpl implements IAssetService{
}
}
}
// 创建并增加资方配置
JSONObject fundInfoJSON = new JSONObject();
fundInfoJSON.put("fundId", channelFundConfig.getFundId());
fundInfoJSON.put("fundProductId", channelFundConfig.getFundProductId());
fundInfoJSON.put("priority", channelFundConfig.getPriority());
fundInfoJSON.put("feeType", channelFundConfig.getFeeType());
fundInfoJSON.put("rateType", channelFundConfig.getRateType());
fundInfoJSON.put("rate", channelFundConfig.getRate());
fundArray.add(fundInfoJSON);
log.info("资方模块用户命中资方条件, uuid : {}, assetNo : {}, bizNo : {}, bizChannel : {}, fundId : {}, fundProductId : {}",
assetForm.getUuid(), assetForm.getAssetNo(), assetForm.getBizNo(), assetForm.getBizChannel(), channelFundConfig.getFundId(), channelFundConfig.getFundProductId());
String key = channelFundConfig.getFundId() + "_" + channelFundConfig.getFundProductId() + "_" + channelFundConfig.getPriority();
if (!fundSet.contains(key)) {
// 创建并增加资方配置
JSONObject fundInfoJSON = new JSONObject();
fundInfoJSON.put("fundId", channelFundConfig.getFundId());
fundInfoJSON.put("fundProductId", channelFundConfig.getFundProductId());
fundInfoJSON.put("priority", channelFundConfig.getPriority());
fundInfoJSON.put("feeType", channelFundConfig.getFeeType());
fundInfoJSON.put("rateType", channelFundConfig.getRateType());
fundInfoJSON.put("rate", channelFundConfig.getRate());
fundArray.add(fundInfoJSON);
log.info("资方模块用户命中资方条件, uuid : {}, assetNo : {}, bizNo : {}, bizChannel : {}, fundId : {}, fundProductId : {}",
assetForm.getUuid(), assetForm.getAssetNo(), assetForm.getBizNo(), assetForm.getBizChannel(), channelFundConfig.getFundId(), channelFundConfig.getFundProductId());
fundSet.add(key);
}
}
// 如果审核拒绝,也没命中任何资方, 直接返回
......
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