| | |
| | | import com.nova.sankuai.domain.api.rongbei.ApplyData; // 申请数据类 |
| | | import com.nova.sankuai.domain.api.rongbei.RbResponse; // 响应结果类 |
| | | import com.nova.sankuai.domain.api.yinsheng.SerialGenerator; |
| | | import com.nova.sankuai.domain.dto.rongbei.ApplyDto; // 申请DTO |
| | | import com.nova.sankuai.domain.dto.rongbei.ContactListDto; // 联系人列表DTO |
| | | import com.nova.sankuai.domain.dto.rongbei.ProfileDictDto; |
| | | import com.nova.sankuai.domain.dto.rongbei.RongBeBasicDto; // 融贝基础DTO |
| | | import com.nova.sankuai.domain.dto.rongbei.*; |
| | | import com.nova.sankuai.domain.entity.*; |
| | | import com.nova.sankuai.infra.utils.ConstantsUtil; |
| | | import com.nova.sankuai.infra.utils.eshidai.EsdUtil; |
| | |
| | | |
| | | /** |
| | | * 设置公共的查询条件 |
| | | * |
| | | * @return LambdaQueryWrapper<CapitalInfo> |
| | | */ |
| | | private LambdaQueryWrapper<CapitalInfo> getWrapper(){ |
| | |
| | | |
| | | /** |
| | | * 获取要推送的半流程资方 |
| | | * |
| | | * @return 资金信息列表 |
| | | */ |
| | | private List<CapitalInfo> getCapitalInfoList() { |
| | |
| | | |
| | | /** |
| | | * 获取要推送的非半流程资方 |
| | | * |
| | | * @return 资金信息列表 |
| | | */ |
| | | private List<CapitalInfo> getNotHalfCapitalInfoList() { |
| | |
| | | |
| | | /** |
| | | * 获取要推送的非半流程资金类型线上资方 |
| | | * |
| | | * @return 资金信息列表 |
| | | */ |
| | | private List<CapitalInfo> getNotHalfFundTypeCapitalInfoList() { |
| | |
| | | wrapper.orderByAsc(CapitalInfo::getSeq); // 按序号升序排列 |
| | | return capitalInfoService.list(wrapper); // 返回匹配的资金信息列表 |
| | | } |
| | | |
| | | /** |
| | | * 根据资金名获取配置 |
| | | * |
| | | * @param capitalName 资金名 |
| | | * @return 配置映射 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据方法名返回相应的数据 |
| | | * |
| | | * @param action 方法名 |
| | | * @return 配置映射 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 接收我来贷请求的数据并中转给下游资方 |
| | | * |
| | | * @param body 请求体 |
| | | * @param action 方法名 |
| | | * @return RbResponse |
| | |
| | | wrapper.eq(CustomerApplyOrder::getCapitalId, capitalInfo.getId()); |
| | | customerApplyOrder = customerApplyOrderService.getOne(wrapper); |
| | | if (Objects.isNull(customerApplyOrder)) { |
| | | wrapper.eq(CustomerApplyOrder::getCapitalId, capitalInfo.getId()); |
| | | customerApplyOrder = customerApplyOrderService.getOne(wrapper); |
| | | if (Objects.isNull(customerApplyOrder)) { |
| | | boolean halfFlag = false; |
| | | ApplyData applyData = new ApplyData(); |
| | | applyData.setStatus(1); |
| | | applyData.setPartner_flow_id(""); |
| | | //调用对应资方的推送机制 |
| | | if (capitalInfo.getId() == 25L) { //e时贷 |
| | | halfFlag = esdUtil.wldPushToEsd(customer, logNumber); |
| | | if (halfFlag) { |
| | | applyData.setStatus(0); |
| | | applyData.setPartner_flow_id(SerialGenerator.getOrder()); |
| | | } |
| | | |
| | | } else if (capitalInfo.getId() == 12L) { //慧借钱包 |
| | | halfFlag = hjqbUtil.wldPushToHjqb(customer, logNumber); |
| | | |
| | | if (halfFlag) { |
| | | applyData.setStatus(0); |
| | | applyData.setPartner_flow_id(SerialGenerator.getOrder()); |
| | | } |
| | | } else if (capitalInfo.getId() == 41L) { //好汇推 |
| | | halfFlag = hhtUtil.wldPushToHht(customer, logNumber); |
| | | if (halfFlag) { |
| | | applyData.setStatus(0); |
| | | applyData.setPartner_flow_id(SerialGenerator.getOrder()); |
| | | } |
| | | |
| | | } else if (capitalInfo.getId() == 36L) { //随易花 |
| | | halfFlag = syhUtil.wldPushToSyh(customer, logNumber); |
| | | if (halfFlag) { |
| | | applyData.setStatus(0); |
| | | applyData.setPartner_flow_id(SerialGenerator.getOrder()); |
| | | } |
| | | } |
| | | |
| | | if (halfFlag) { |
| | | |
| | | // 进件成功后,调用接受订单状态接口推送数据给我来贷 |
| | | OrderStatusByWld(chnOrderId, applyData.getPartner_flow_id()); |
| | | |
| | |
| | | customerApplyOrderService.save(customerApplyOrder); |
| | | } |
| | | } |
| | | } |
| | | // 遍历非半流程资金方式线上贷款信息列表 |
| | | List<CapitalInfo> notHalfFundTypeCapitalInfoList = getNotHalfFundTypeCapitalInfoList(); |
| | | log.info("日志编号:{},定时器自动进件, 非半流程资金方式线上贷款信息列表:【{}】", logNumber, lst); // 非半流程资金方式线上贷款信息列表 |
| | | Customer customer = new Customer(); |
| | | for (CapitalInfo capitalInfo : notHalfFundTypeCapitalInfoList) { |
| | | // 先判断有没有推过,如果有则不再推送 |
| | | wrapper.eq(CustomerApplyOrder::getCapitalId, capitalInfo.getId()); |
| | | customerApplyOrder = customerApplyOrderService.getOne(wrapper); |
| | | if (Objects.isNull(customerApplyOrder)) { |
| | | boolean halfFlag = false; |
| | | boolean halfFundTypeFlag = false; |
| | | ApplyData applyData = new ApplyData(); |
| | | applyData.setStatus(1); |
| | | applyData.setPartner_flow_id(""); |
| | | //调用对应资方的推送机制 |
| | | if (capitalInfo.getId() == 25L) { //e时贷 |
| | | halfFlag = esdUtil.wldPushToEsd(customer, logNumber); |
| | | |
| | | } else if (capitalInfo.getId() == 12L) { //慧借钱包 |
| | | halfFlag = hjqbUtil.wldPushToHjqb(customer, logNumber); |
| | | |
| | | } else if (capitalInfo.getId() == 41L) { //好汇推 |
| | | halfFlag = hhtUtil.wldPushToHht(customer, logNumber); |
| | | |
| | | } else if (capitalInfo.getId() == 36L) { //随易花 |
| | | halfFlag = syhUtil.wldPushToSyh(customer, logNumber); |
| | | if (capitalInfo.getId() == 4L) { //青花优品 |
| | | applyDto = JSON.parseObject(decryptStr, ApplyDto.class); |
| | | customer.setCreditNo(ConstantsUtil.getCreditNo()); |
| | | halfFundTypeFlag = qingHuaYouPinUtil.wldPushToQHYP(capitalInfo, applyDto, customer, logNumber); |
| | | if (halfFundTypeFlag) { |
| | | applyData.setStatus(0); |
| | | applyData.setPartner_flow_id(customer.getCreditNo()); |
| | | } |
| | | |
| | | if (halfFlag) { |
| | | } |
| | | if (halfFundTypeFlag) { |
| | | |
| | | // 进件成功后,调用接受订单状态接口推送数据给我来贷 |
| | | OrderStatusByWld(chnOrderId, applyData.getPartner_flow_id()); |
| | |
| | | // 调用接受授信结果接口推送授信结果给我来贷 |
| | | autoPushCreditResult(chnOrderId, applyData.getPartner_flow_id()); |
| | | } |
| | | |
| | | // 保存进件记录 |
| | | customerApplyOrder = getCustomerApplyOrder(chnOrderId, applyData, capitalInfo, "28", decryptStr); |
| | | customerApplyOrderService.save(customerApplyOrder); |
| | |
| | | |
| | | /** |
| | | * 保存我来贷推送的数据记录 |
| | | * |
| | | * @param customerWldPushRecord 要保存的数据 |
| | | */ |
| | | private void savePushData(CustomerWldPushRecord customerWldPushRecord) { |
| | |
| | | |
| | | /** |
| | | * 保存数据 |
| | | * |
| | | * @param applyDto 数据对象 |
| | | */ |
| | | private Customer saveData(ApplyDto applyDto) { |
| | |
| | | if (!Objects.isNull(applyDto.getLive_info().getLive_data())) { |
| | | // 活体分类 |
| | | customerZcy.setVerifySimilarity(applyDto.getLive_info().getLive_data().getFace_score()); |
| | | } |
| | | customerZcy.setVerifySimilarityName(applyDto.getLive_info().getService_provider()); |
| | | customerZcy.setFacePhotoPath(applyDto.getLive_info().getBest_face_image()); |
| | | } |
| | | |
| | | |
| | | //设备信息 |
| | | customerZcy.setOs(applyDto.getDevice_info().getOs()); |
| | | customerZcy.setClientIp(applyDto.getDevice_info().getIp()); |
| | | String gps = applyDto.getDevice_info().getGps(); |
| | | DeviceInfoDto deviceInfo = applyDto.getDevice_info(); |
| | | if (!Objects.isNull(deviceInfo)) { |
| | | customerZcy.setOs(deviceInfo.getOs()); |
| | | customerZcy.setClientIp(deviceInfo.getIp()); |
| | | String gps = deviceInfo.getGps(); |
| | | if (StringUtils.isNotEmpty(gps)) { |
| | | String[] gpsArray = gps.split(","); |
| | | if (gpsArray.length == 2) { |
| | |
| | | customerZcy.setLat(gpsArray[1]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 标记为我来数科的数据 |
| | | customerZcy.setMark(2); |
| | | customerZcyService.save(customerZcy); |
| | |
| | | |
| | | /** |
| | | * 从我来贷请求查询接受订单状态接口 |
| | | * |
| | | * @param body 请求体 |
| | | * @return RbResponse |
| | | */ |
| | |
| | | log.error("日志编号:{} 【我来贷】接受授信结果接口请求失败,参数:{}-{},错误原因:{}", logNumber, chnOrderId, partnerFlowId, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 从我来贷请求接受授信结果接口 |
| | | * |
| | | * @return RbResponse |
| | | */ |
| | | public RbResponse creditResultByWld(RongBeBasicDto body) { |
| | |
| | | |
| | | /** |
| | | * 从我来贷请求接受还款计划接口 |
| | | * |
| | | * @param body 请求体 |
| | | * @return RbResponse |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 加密 |
| | | * |
| | | * @param oriData 要加密的内容串 |
| | | * @return String |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 生成签名(融呗私钥加密) |
| | | * |
| | | * @param fullData 用于签名的对象 |
| | | * @param publicKey 公钥 |
| | | * @return String |
| | |
| | | |
| | | /** |
| | | * 解密(公钥解密) |
| | | * |
| | | * @param fullData 要解密的内容 |
| | | * @param publicKey 公钥 |
| | | * @return String |
| | |
| | | |
| | | /** |
| | | * 提供我来贷进件发送短信 |
| | | * |
| | | * @param phone |
| | | */ |
| | | public void smsNotify(String phone) { |