|
@@ -0,0 +1,135 @@
|
|
|
|
+package com.hrsk.cloud.eg.app.business;
|
|
|
|
+
|
|
|
|
+import com.hrsk.cloud.eg.app.constant.JoinMethodEnums;
|
|
|
|
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
|
|
|
|
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
|
|
|
|
+import com.hrsk.cloud.eg.app.threedocking.impl.*;
|
|
|
|
+import com.hrsk.cloud.eg.dto.data.CheckIntoParamDto;
|
|
|
|
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
|
|
|
|
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
|
|
|
|
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
|
|
|
|
+import com.hrsk.cloud.eg.vo.response.DataVo;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @author zhangyy
|
|
|
|
+ * @version 1.0
|
|
|
|
+ * @description: ApiRouteService
|
|
|
|
+ * @date 2024/9/13 09:29
|
|
|
|
+ */
|
|
|
|
+@Slf4j
|
|
|
|
+@Service
|
|
|
|
+public class ApiRouteService {
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProductBusinessApiInfoService apiInfoService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ApiBizHandler apiBizHandler;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private QingyuCreditService qingyuCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private XinluCreditService xinluCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private OpenApiCreditService openApiCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private QingyuV2CreditService qingyuV2CreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private XiangKeDaCreditService xiangKeDaCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private RxkCreditService rxkCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private OpenApiAesCreditService openApiAesCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private HuirongCrmCreditService huirongCrmCreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private JinDieV2CreditService jinDieV2CreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private JinDieV3CreditService jinDieV3CreditService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private QingyuV3CreditService qingyuV3CreditService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * API 路由
|
|
|
|
+ *
|
|
|
|
+ * @param xdProduct
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public LoanDockingApi apiRouter(PlanDto xdProduct) {
|
|
|
|
+ if (null == xdProduct.getApiId()) return null;
|
|
|
|
+ ProductBusinessApiInfoDo apiInfo = apiInfoService.getApiInfoByRedis(xdProduct.getApiId());
|
|
|
|
+ LoanDockingApi apiService = null;
|
|
|
|
+ JoinMethodEnums method = JoinMethodEnums.getByCode(apiInfo.getJoinMethod());
|
|
|
|
+
|
|
|
|
+ if (null == method) return null;
|
|
|
|
+ switch (method) {
|
|
|
|
+ case CRM_QY:
|
|
|
|
+ apiService = qingyuCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_XL:
|
|
|
|
+ apiService = xinluCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case OPEN_API:
|
|
|
|
+ apiService = openApiCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_QY_V2:
|
|
|
|
+ apiService = qingyuV2CreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_XKD:
|
|
|
|
+ apiService = xiangKeDaCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_RXK:
|
|
|
|
+ apiService = rxkCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case HUIRONG_CRM:
|
|
|
|
+ apiService = huirongCrmCreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_EC:
|
|
|
|
+ break;
|
|
|
|
+ case CRM_JD:
|
|
|
|
+ apiService = jinDieV2CreditService;
|
|
|
|
+ break;
|
|
|
|
+ case CRM_JDV3:
|
|
|
|
+ apiService = jinDieV3CreditService;
|
|
|
|
+ break;
|
|
|
|
+ case BUSI_API:
|
|
|
|
+ apiService = apiBizHandler.getBizHandler(ServerCodeEnums.map.get(apiInfo.getJointType()));
|
|
|
|
+ break;
|
|
|
|
+ case CRM_QY_V3:
|
|
|
|
+ apiService = qingyuV3CreditService;
|
|
|
|
+ break;
|
|
|
|
+ case OPEN_API_AES:
|
|
|
|
+ apiService = openApiAesCreditService;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ log.error("不支持的对接方式:productId={}", xdProduct.getPlanId());
|
|
|
|
+ }
|
|
|
|
+ return apiService;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @description: 助贷撞库api
|
|
|
|
+ * @param:
|
|
|
|
+ * @return:
|
|
|
|
+ * @author zhangyy
|
|
|
|
+ * @date: 2024/9/13 09:59
|
|
|
|
+ */
|
|
|
|
+ public DataVo loanCheckInto(CheckIntoParamDto checkIntoParamDto){
|
|
|
|
+ LoanDockingApi loanDockingApi = apiRouter(checkIntoParamDto.getPlan());
|
|
|
|
+ return loanDockingApi.qualityCheck(checkIntoParamDto.getUser(),checkIntoParamDto.getPlan());
|
|
|
|
+ }
|
|
|
|
+}
|