Commit 0285b473 authored by shangying's avatar shangying

如果phone在detail表中已经存在,则idNo去user_detail表中的身份证号

parent 2bb581e0
......@@ -10,6 +10,8 @@ import cn.quantgroup.cashloanflowboss.core.base.Result;
import cn.quantgroup.cashloanflowboss.core.dictionary.ApplicationStatus;
import cn.quantgroup.cashloanflowboss.spi.clf.entity.ClfChannelConfiguration;
import cn.quantgroup.cashloanflowboss.spi.clf.service.CLFCenterServiceImpl;
import cn.quantgroup.cashloanflowboss.spi.user.entity.UserDetail;
import cn.quantgroup.cashloanflowboss.spi.user.repository.UserDetailRepository;
import cn.quantgroup.cashloanflowboss.utils.AESUtil;
import cn.quantgroup.cashloanflowboss.utils.ChineseIDCardNumberGenerator;
import cn.quantgroup.cashloanflowboss.utils.GetEncryptContentAndMd5;
......@@ -25,6 +27,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* Created by shang on 2019/12/4.
......@@ -41,7 +44,8 @@ public class ApplyLoanServiceImpl implements ApplyLoanService {
private OneClickDataRespository oneClickDataRespository;
@Autowired
private CLFCenterServiceImpl clfCenterService;
@Autowired
private UserDetailRepository userDetailRepository;
@Autowired
private PhoneInfoService phoneInfoService;
......@@ -60,7 +64,12 @@ public class ApplyLoanServiceImpl implements ApplyLoanService {
clfChannelConfiguration=clfCenterService.findChannelConfigurationByChannelId(Long.parseLong(oneClickModel.getChannel().trim()));
md5Keywy=clfChannelConfiguration.getMd5Key();
aesKeywy=clfChannelConfiguration.getAesKey();
result=apply(oneClickModel,md5Keywy,aesKeywy);
result=apply(oneClickModel, md5Keywy, aesKeywy);
UserDetail userDetail= userDetailRepository.findByphoneNo(oneClickModel.getPhone());
if(Objects.nonNull(userDetail)){
idNo=userDetail.getId_no();
}
log.info("查看当前的phone是否已经在user_detail表中有,则使用现有的身份证号={}",userDetail);
String getDecryption = AESUtil.decryptAfterBase64Decode(result.get("context").toString(), aesKeywy);
log.info("解密的getDecryption的结果={}" , getDecryption);
JSONObject getDecryptionResult = (JSONObject) JSONObject.parse(getDecryption);
......
package cn.quantgroup.cashloanflowboss.spi.user.repository;
import cn.quantgroup.cashloanflowboss.api.oneclickdata.entity.OneClickData;
import cn.quantgroup.cashloanflowboss.spi.user.entity.UserDetail;
import cn.quantgroup.cashloanflowboss.spi.user.source.XyqbUserDataSource;
import org.springframework.data.jpa.repository.JpaRepository;
......@@ -16,4 +17,9 @@ public interface UserDetailRepository extends JpaRepository<UserDetail,Long>{
@Modifying
@Query(value = "delete from user_detail where user_id = ?1", nativeQuery = true)
int deleteByUserId(Long userId);
// 通过phone查找usesr_detail
@Query(value = "select * from user_detail where phone_no= ?1 order by id desc limit 1", nativeQuery = true)
UserDetail findByphoneNo(String phoneNo);
}
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