Commit fd3bfc71 authored by liwenbin's avatar liwenbin

资方去重

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