Commit 8adf88c5 authored by data-爬虫-任锋's avatar data-爬虫-任锋

助贷资金配置加载模块开发

parent ab2d3239
package com.quantgroup.asset.distribution.constant;
/**
* Created by renfeng on 2019/7/22.
*/
public class CommonStants {
}
package com.quantgroup.asset.distribution.constant;
import com.google.common.collect.Lists;
import com.quantgroup.asset.distribution.service.jpa.entity.AidLoanFundConfig;
import java.util.List;
/**
* Created by renfeng on 2019/7/22.
*/
public class FundingConstants {
/**
* 助贷资金池
*/
public final static List<AidLoanFundConfig> AID_LOAN_FUND_CONFIG_LIST = Lists.newArrayList();
}
package com.quantgroup.asset.distribution.constant;
/**
* Created by renfeng on 2019/7/22.
*/
public class RedisKeyConstants {
}
package com.quantgroup.asset.distribution.service.funding;
import com.quantgroup.asset.distribution.service.jpa.entity.AidLoanFundConfig;
import java.util.List;
/**
* Created by renfeng on 2019/7/22.
*/
public interface IAidLoanFundConfigService {
/**
* 查询全部可用助贷资金
* @return
*/
List<AidLoanFundConfig> findAll();
/**
* 根据id查询助贷资金
* @param id
* @return
*/
AidLoanFundConfig findById(Long id);
/**
* 根据编号查询助贷资金
* @param fundNo
* @return
*/
AidLoanFundConfig findByFundNo(String fundNo);
}
......@@ -20,5 +20,6 @@ public class AidFundRouteRecordServiceImpl implements IAidFundRouteRecordService
@Override
public void fundingResultNotity(String bizNo, FundingResult fundingResult) {
}
}
......@@ -21,6 +21,14 @@ public class AidFundRouteServiceImpl implements IAidFundRouteService {
*/
@Override
public GlobalResponse aidFundRoute(AssetForm assetForm) {
return null;
//
return GlobalResponse.success();
}
}
package com.quantgroup.asset.distribution.service.funding.impl;
import com.quantgroup.asset.distribution.service.funding.IAidLoanFundConfigService;
import com.quantgroup.asset.distribution.service.jpa.entity.AidLoanFundConfig;
import com.quantgroup.asset.distribution.service.jpa.repository.IAidLoanFundConfigRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import static com.quantgroup.asset.distribution.constant.FundingConstants.AID_LOAN_FUND_CONFIG_LIST;
/**
* Created by renfeng on 2019/7/22.
*/
@Service
@Slf4j
public class AidLoanFundConfigServiceImpl implements IAidLoanFundConfigService {
@Autowired
private IAidLoanFundConfigRepository iAidLoanFundConfigRepository;
/**
* 查询全部可用助贷资金
*
* @return
*/
@Override
public List<AidLoanFundConfig> findAll() {
if(AID_LOAN_FUND_CONFIG_LIST.size()<1) {
List<AidLoanFundConfig> aidLoanFundConfigs = iAidLoanFundConfigRepository.findByEnableTrue();
if (CollectionUtils.isEmpty(aidLoanFundConfigs))
AID_LOAN_FUND_CONFIG_LIST.addAll(aidLoanFundConfigs);
}
return AID_LOAN_FUND_CONFIG_LIST;
}
/**
* 根据id查询助贷资金
*
* @param id
* @return
*/
@Override
public AidLoanFundConfig findById(Long id) {
return iAidLoanFundConfigRepository.findOne(id);
}
/**
* 根据编号查询助贷资金
*
* @param fundNo
* @return
*/
@Override
public AidLoanFundConfig findByFundNo(String fundNo) {
return iAidLoanFundConfigRepository.findByFundNo(fundNo);
}
}
......@@ -3,9 +3,19 @@ package com.quantgroup.asset.distribution.service.jpa.repository;
import com.quantgroup.asset.distribution.service.jpa.entity.AidLoanFundConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* Created by renfeng on 2019/7/17.
*/
public interface IAidLoanFundConfigRepository extends JpaRepository<AidLoanFundConfig, Long>{
List<AidLoanFundConfig> findByEnableTrue();
AidLoanFundConfig findByFundNo(String fundNo);
}
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