Commit e12c0821 authored by 王向伟's avatar 王向伟

渠道配置兼容多项channelApplyInfoStrategy

parent a158c791
......@@ -4,6 +4,7 @@ import cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
......@@ -20,7 +21,7 @@ public class ChannelConfBaseModel {
private Integer fundId;
private Integer p2pFundId;
private ChannelApplyInfoStrategy channelApplyInfoStrategy;
private List<ChannelApplyInfoStrategy> channelApplyInfoStrategyList;
/**
* 对应productId
*/
......
......@@ -11,6 +11,7 @@ import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfOrderCallBack;
import cn.quantgroup.cashloanflowboss.spi.clf.model.KANoticeType;
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterService;
import cn.quantgroup.cashloanflowboss.utils.IgnorePropertiesUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -73,8 +74,8 @@ public class ChannelConfServiceImpl implements ChannelConfService {
channelConfVo = ChannelConfUtil.getChannelConfVoByClf(channelConfiguration, approve, orderStatus, repaymentPlan);
}
ChannelApplyInfoStrategy channelApplyInfoStrategyByChannelId = clfCenterService.findChannelApplyInfoStrategyByChannelId(channelId);
channelConfVo.getBasicInfo().setChannelApplyInfoStrategy(channelApplyInfoStrategyByChannelId);
List<ChannelApplyInfoStrategy> channelApplyInfoStrategyByChannelId = clfCenterService.findChannelApplyInfoStrategyByChannelId(channelId);
channelConfVo.getBasicInfo().setChannelApplyInfoStrategyList(channelApplyInfoStrategyByChannelId);
return channelConfVo;
}
......@@ -130,15 +131,13 @@ public class ChannelConfServiceImpl implements ChannelConfService {
//保存进件配置项
Long channelId = basicInfo.getChannelId();
ChannelApplyInfoStrategy channelApplyInfoStrategy = basicInfo.getChannelApplyInfoStrategy();
if (channelApplyInfoStrategy != null) {
ChannelApplyInfoStrategy strategy = clfCenterService.findChannelApplyInfoStrategyByChannelId(channelId);
if (strategy != null) {
channelApplyInfoStrategy.setId(strategy.getId());
List<ChannelApplyInfoStrategy> channelApplyInfoStrategyList = basicInfo.getChannelApplyInfoStrategyList();
if (CollectionUtils.isNotEmpty(channelApplyInfoStrategyList)) {
for (ChannelApplyInfoStrategy strategy : channelApplyInfoStrategyList) {
clfCenterService.saveChannelApplyInfoStrategy(strategy);
}
clfCenterService.saveChannelApplyInfoStrategy(channelApplyInfoStrategy);
}
}
return true;
}
......
......@@ -5,6 +5,8 @@ import cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author Wang Xiangwei
* @version 2020/2/25
......@@ -13,5 +15,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ChannelApplyInfoStrategyRepository extends JpaRepository<ChannelApplyInfoStrategy, Long> {
ChannelApplyInfoStrategy findByChannelId(Long channelId);
List<ChannelApplyInfoStrategy> findByChannelId(Long channelId);
}
......@@ -38,7 +38,7 @@ public interface CLFCenterService {
void reloadKAConfiguration();
ChannelApplyInfoStrategy findChannelApplyInfoStrategyByChannelId(Long channelId);
List<ChannelApplyInfoStrategy> findChannelApplyInfoStrategyByChannelId(Long channelId);
void saveChannelApplyInfoStrategy(ChannelApplyInfoStrategy channelApplyInfoStrategy);
......
......@@ -147,7 +147,7 @@ public class CLFCenterServiceImpl implements CLFCenterService {
}
@Override
public ChannelApplyInfoStrategy findChannelApplyInfoStrategyByChannelId(Long channelId) {
public List<ChannelApplyInfoStrategy> findChannelApplyInfoStrategyByChannelId(Long channelId) {
return channelApplyInfoStrategyRepository.findByChannelId(channelId);
}
......
......@@ -121,7 +121,7 @@ public class KoalaCenterService {
}
}
public String cancelPreAudit(Map<Object, Object> data) {
public String cancelPreLoanHasLoanId(Map<Object, Object> data) {
if (Application.isDebug()) {
String result = koalaCenter.cancelPreAudit(data);
log.info("koala 有loanId贷前关单 result={}",result);
......
......@@ -5,7 +5,6 @@ import cn.quantgroup.cashloanflowboss.api.channel.model.ChannelConfVo;
import cn.quantgroup.cashloanflowboss.api.channel.service.ChannelConfService;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ChannelApplyInfoStrategy;
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterService;
import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,9 +38,9 @@ public class ChannelApplyInfoStrategyTest extends CashLoanFlowBossApplicationTes
strategy.setMobile(true);
clfCenterService.saveChannelApplyInfoStrategy(strategy);
ChannelApplyInfoStrategy strategy1 = clfCenterService.findChannelApplyInfoStrategyByChannelId(12L);
// ChannelApplyInfoStrategy strategy1 = clfCenterService.findChannelApplyInfoStrategyByChannelId(12L);
strategy.setId(strategy1.getId());
// strategy.setId(strategy1.getId());
strategy.setChannelName("测试更新");
clfCenterService.saveChannelApplyInfoStrategy(strategy);
}
......@@ -50,13 +49,14 @@ public class ChannelApplyInfoStrategyTest extends CashLoanFlowBossApplicationTes
public void testGetChannelInfo(){
ChannelConfVo channelConf = channelConfService.getChannelConf(159881L);
ChannelApplyInfoStrategy channelApplyInfoStrategy = channelConf.getBasicInfo().getChannelApplyInfoStrategy();
//ChannelApplyInfoStrategy channelApplyInfoStrategy = channelConf.getBasicInfo().getChannelApplyInfoStrategyList();
channelApplyInfoStrategy.setChannelUserId(true);
//channelApplyInfoStrategy.setChannelUserId(true);
channelConfService.editChannelConfInfo(channelConf);
//数据恢复
channelApplyInfoStrategy.setChannelUserId(false);
//channelApplyInfoStrategy.setChannelUserId(false);
channelConfService.editChannelConfInfo(channelConf);
......
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