Browse Source

add 迁移api

GITZYY 7 months ago
parent
commit
bcacae154f
33 changed files with 4053 additions and 1 deletions
  1. 1 1
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/DfrzwCreditService.java
  2. 129 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongChuangJinFuCreditService.java
  3. 138 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangDaChangShaCreditService.java
  4. 140 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangKeBuShuCreditService.java
  5. 139 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangKeV2CreditService.java
  6. 129 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongYiDaCreditService.java
  7. 84 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongkedaiCreditService.java
  8. 380 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongshengCreditService.java
  9. 146 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongxiziCreditService.java
  10. 89 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RunMeiXinYiRongCreditService.java
  11. 117 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RxkCreditService.java
  12. 157 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanDongBangBangDaiCreditService.java
  13. 125 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanXiHengShengDaiCreditService.java
  14. 121 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanXiMingDePuHuiCreditService.java
  15. 85 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShangHaiHanGeCreditService.java
  16. 83 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShangHaiJuHuiRongCreditService.java
  17. 97 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenLuoJinFuCreditService.java
  18. 110 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenYangHengXinCreditService.java
  19. 89 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenYangXinYiRongCreditService.java
  20. 167 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShiYueCreditService.java
  21. 94 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShuRongCreditService.java
  22. 152 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SiChuangRuiCreditService.java
  23. 170 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SouYuJinFuCreditService.java
  24. 99 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SuZhouJianYiRongCreditService.java
  25. 144 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SuzhouchangshuoCreditService.java
  26. 80 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TangShanRongYangCreditService.java
  27. 112 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TianJingJiaYiCreditService.java
  28. 76 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TianShuiShuYiRongCreditService.java
  29. 130 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TuoBaoRongCreditService.java
  30. 102 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WeiFangHuaShenCreditService.java
  31. 94 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WeiFangYouYiCreditService.java
  32. 161 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WenZhouGaoShenCreditService.java
  33. 113 0
      egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WenZhouYueShangXiangCreditService.java

File diff suppressed because it is too large
+ 1 - 1
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/DfrzwCreditService.java


+ 129 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongChuangJinFuCreditService.java

@@ -0,0 +1,129 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.util.Base64Utils;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESedeKeySpec;
+import javax.crypto.spec.IvParameterSpec;
+import java.security.Key;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 06 24 15 25
+ **/
+@Slf4j
+@Service
+public class RongChuangJinFuCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.RongChuangJinFu;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String mobile;// 手机号MD5
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongChuangJinFuCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融创金服对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMobile(phoneMd5);
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RongChuangJinFuCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("融创金服准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongChuangJinFuCreditService response userId:{}, result:{}",phoneMd5, response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code").equals("0")&&jsonObject.getBoolean("data")) {
+                return DataVo.success(0, "融创金服撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "融创金服撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("融创金服撞库失败", e);
+            return DataVo.fail(1, "融创金服撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+    public static String encode(String plainText, String secretKey, String iv) {
+        String result = null;
+        try {
+            DESedeKeySpec deSedeKeySpec = new DESedeKeySpec(secretKey.getBytes());
+            SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("desede");
+            Key desKey = secretKeyFactory.generateSecret(deSedeKeySpec);
+            Cipher cipher = Cipher.getInstance("desede/CBC/PKCS5Padding");
+            IvParameterSpec ips = new IvParameterSpec(iv.getBytes());
+            cipher.init(Cipher.ENCRYPT_MODE, desKey, ips);
+            byte[] encryptData = cipher.doFinal(plainText.getBytes("UTF-8"));
+            result = Base64Utils.encodeToString(encryptData);
+        } catch (Exception e) {
+            log.error("DesCbcUtil encode error : {}", e);
+        }
+        return result;
+    }
+
+    /**
+     * 3DES解密
+     *
+     * @param encryptText 加密文本
+     * @return 解密后明文,失败返回null
+     */
+    public static String decode(String encryptText, String secretKey, String iv) {
+        String result = null;
+        try {
+            DESedeKeySpec spec = new DESedeKeySpec(secretKey.getBytes());
+            SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("desede");
+            Key desKey = secretKeyFactory.generateSecret(spec);
+            Cipher cipher = Cipher.getInstance("desede/CBC/PKCS5Padding");
+            IvParameterSpec ips = new IvParameterSpec(iv.getBytes());
+            cipher.init(Cipher.DECRYPT_MODE, desKey, ips);
+            byte[] decryptData = cipher.doFinal(Base64Utils.decodeFromString(encryptText));
+            result = new String(decryptData, "UTF-8");
+        } catch (Exception e) {
+            log.error("DesCbcUtil decode error : {}", e.getMessage());
+        }
+        return result;
+    }
+
+
+}

+ 138 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangDaChangShaCreditService.java

@@ -0,0 +1,138 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 11 03 17 31
+ **/
+@Slf4j
+@Service
+public class RongXiangDaChangShaCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.RongXiangDaChangSha;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String phoneMd5;//md5 的手机号
+        private String accessKey;//渠道访问密钥
+        private String sourceCode;//渠道标识
+    }
+
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *  {
+     * 	"checkUrl": "http://test-gw.xxb888.com/xxb-filter/api/filter/md5",
+     * 	"applyUrl": "http://test-gw.xxb888.com/xxb/api/source/clue_data/consumer",
+     * 	"accesskey": "3465D5B2-1D08-4875-B7E7-E1DAA9385530",
+     * 	"sourcecode": "10986",
+     * 	"key": "BFXC7JM1OG35XDVR",
+     * 	"iv": "67P0VGV0AXUM9NH5"
+     * }
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongXiangDaChangShaCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融享达长沙对接参数:{}", JSONObject.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? convertMD5ToUpperCase(Md5Util.encoderByMd5(userInfo.getUserMobile())) : convertMD5ToUpperCase(userInfo.getPhoneMd5());
+            checkInfo.setPhoneMd5(phoneMd5);
+            checkInfo.setAccessKey(config.getString("accesskey"));
+            checkInfo.setSourceCode(config.getString("sourcecode"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RongXiangDaChangShaCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("融享达长沙准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongXiangDaChangShaCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 1 && jsonObject.getJSONObject("data")!=null && jsonObject.getJSONObject("data").getBoolean("phoneMd5Exist").equals(false)) {
+                return DataVo.success(0, "融享达长沙撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "融享达长沙撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("融享达长沙撞库失败", e);
+            return DataVo.fail(1, "融享达长沙撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+    public static String convertMD5ToUpperCase(String md5Hash) {
+        if (md5Hash == null || md5Hash.length() == 0) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < md5Hash.length(); i++) {
+            char c = md5Hash.charAt(i);
+            if (Character.isLowerCase(c)) {
+                sb.append(Character.toUpperCase(c));
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+    public static String encrypt(String plainText, String key, String iv) throws Exception {
+        // 将 key 转换为 SecretKey 对象
+        SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+        // 将 IV 字符串转换为字节数组
+        byte[] ivBytes = iv.getBytes(StandardCharsets.UTF_8);
+        // 生成 IV
+        // 创建 Cipher 对象
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
+        // 加密明文
+        byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+        // 将加密后的字节转换为 Base64 编码
+        return Base64.getEncoder().encodeToString(encryptedBytes);
+    }
+
+}

+ 140 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangKeBuShuCreditService.java

@@ -0,0 +1,140 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 07 01 14 26
+ **/
+@Slf4j
+@Service
+public class RongXiangKeBuShuCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.RongXiangKeBuShu;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String phoneMd5;//md5 的手机号
+        private String sourceCode;//渠道标识
+    }
+
+
+
+
+    /**
+     * 助贷对接撞库模板1,标准流程,post请求,application/json,参数直接传对象
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *  {
+     * 	"checkUrl": "http://test-gw.xxb888.com/xxb-filter/api/filter/md5",
+     * 	"applyUrl": "http://test-gw.xxb888.com/xxb/api/source/clue_data/consumer",
+     * 	"accesskey": "3465D5B2-1D08-4875-B7E7-E1DAA9385530",
+     * 	"sourcecode": "10986",
+     * 	"key": "BFXC7JM1OG35XDVR",
+     * 	"iv": "67P0VGV0AXUM9NH5"
+     * }
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongXiangKeBuShuCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融享客部署模式对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? convertMD5ToUpperCase(Md5Util.encoderByMd5(userInfo.getUserMobile())) : convertMD5ToUpperCase(userInfo.getPhoneMd5());
+            checkInfo.setPhoneMd5(phoneMd5);
+            checkInfo.setSourceCode(config.getString("sourcecode"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RongXiangKeBuShuCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("融享客部署模式准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongXiangKeBuShuCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 1 && jsonObject.getJSONObject("data")!=null && jsonObject.getJSONObject("data").getBoolean("phoneMd5Exist").equals(false)) {
+                return DataVo.success(0, "融享客部署模式撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "融享客部署模式撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("融享客部署模式撞库失败", e);
+            return DataVo.fail(1, "融享客部署模式撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+    public static String convertMD5ToUpperCase(String md5Hash) {
+        if (md5Hash == null || md5Hash.length() == 0) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < md5Hash.length(); i++) {
+            char c = md5Hash.charAt(i);
+            if (Character.isLowerCase(c)) {
+                sb.append(Character.toUpperCase(c));
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+    public static String encrypt(String plainText, String key, String iv) throws Exception {
+        // 将 key 转换为 SecretKey 对象
+        SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+        // 将 IV 字符串转换为字节数组
+        byte[] ivBytes = iv.getBytes(StandardCharsets.UTF_8);
+        // 生成 IV
+        // 创建 Cipher 对象
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
+        // 加密明文
+        byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+        // 将加密后的字节转换为 Base64 编码
+        return Base64.getEncoder().encodeToString(encryptedBytes);
+    }
+}

+ 139 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongXiangKeV2CreditService.java

@@ -0,0 +1,139 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 03 19 15 54
+ **/
+@Slf4j
+@Component
+public class RongXiangKeV2CreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.RongXiangKeV2;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String phoneMd5;//md5 的手机号
+        private String accessKey;//渠道访问密钥
+        private String sourceCode;//渠道标识
+    }
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *  {
+     * 	"checkUrl": "http://test-gw.xxb888.com/xxb-filter/api/filter/md5",
+     * 	"applyUrl": "http://test-gw.xxb888.com/xxb/api/source/clue_data/consumer",
+     * 	"accesskey": "3465D5B2-1D08-4875-B7E7-E1DAA9385530",
+     * 	"sourcecode": "10986",
+     * 	"key": "BFXC7JM1OG35XDVR",
+     * 	"iv": "67P0VGV0AXUM9NH5"
+     * }
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongXiangKeV2CreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融享客V2对接参数:{}", JSONObject.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? convertMD5ToUpperCase(Md5Util.encoderByMd5(userInfo.getUserMobile())) : convertMD5ToUpperCase(userInfo.getPhoneMd5());
+            checkInfo.setPhoneMd5(phoneMd5);
+            checkInfo.setAccessKey(config.getString("accesskey"));
+            checkInfo.setSourceCode(config.getString("sourcecode"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RongXiangKeV2CreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("融享客V2准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongXiangKeV2CreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 1 && jsonObject.getJSONObject("data")!=null && jsonObject.getJSONObject("data").getBoolean("phoneMd5Exist").equals(false)) {
+                return DataVo.success(0, "融享客V2撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "融享客V2撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("融享客V2撞库失败", e);
+            return DataVo.fail(1, "融享客V2撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+    public static String convertMD5ToUpperCase(String md5Hash) {
+        if (md5Hash == null || md5Hash.length() == 0) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < md5Hash.length(); i++) {
+            char c = md5Hash.charAt(i);
+            if (Character.isLowerCase(c)) {
+                sb.append(Character.toUpperCase(c));
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+    public static String encrypt(String plainText, String key, String iv) throws Exception {
+        // 将 key 转换为 SecretKey 对象
+        SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+        // 将 IV 字符串转换为字节数组
+        byte[] ivBytes = iv.getBytes(StandardCharsets.UTF_8);
+        // 生成 IV
+        // 创建 Cipher 对象
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
+        // 加密明文
+        byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+        // 将加密后的字节转换为 Base64 编码
+        return Base64.getEncoder().encodeToString(encryptedBytes);
+    }
+
+}
+

+ 129 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongYiDaCreditService.java

@@ -0,0 +1,129 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.DateUtil;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.Date;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 06 18 11 35
+ **/
+@Slf4j
+@Service
+public class RongYiDaCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.RongYiDa;
+    }
+
+    //撞库
+    @Data
+    private static class CheckInfo {
+        private String phoneNo;//md5 的手机号
+
+    }
+
+    @Data
+    private static class RquestParam {
+        private String data;
+        private String merchantNo;
+        private String timestamp;
+        private String reqId;
+
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongYiDaCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融易达对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setPhoneNo(phoneMd5);
+            RquestParam requestParam=new RquestParam();
+            requestParam.setTimestamp(DateUtil.getFormatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
+            requestParam.setData(encrypt( config.getString("key"),config.getString("iv"),JSON.toJSONString(checkInfo)));
+            requestParam.setReqId(config.getString("reqId"));
+            requestParam.setMerchantNo(config.getString("merchantNo"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RongYiDaCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, phoneMd5);
+            String response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, requestParam, String.class);
+            } catch (Exception e) {
+                log.error("融易达准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongYiDaCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("dealStatus").equals("0000")) {
+                return DataVo.success(0, "融易达撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "融易达撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("融易达撞库失败", e);
+            return DataVo.fail(1, "融易达撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+    public static String encrypt(String key, String initVector, String value) throws Exception {
+        IvParameterSpec iv = new IvParameterSpec(initVector.getBytes(StandardCharsets.UTF_8));
+        SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
+
+        byte[] encrypted = cipher.doFinal(value.getBytes());
+        return Base64.getEncoder().encodeToString(encrypted);
+    }
+
+    public static String decrypt(String key, String initVector, String encrypted) throws Exception {
+        IvParameterSpec iv = new IvParameterSpec(initVector.getBytes(StandardCharsets.UTF_8));
+        SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+        cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+
+        byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));
+
+        return new String(original);
+    }
+}

+ 84 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongkedaiCreditService.java

@@ -0,0 +1,84 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+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.http.*;
+import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import javax.annotation.Resource;
+
+
+/**
+ * 融客贷API接单
+ */
+@Service
+@Slf4j
+public class RongkedaiCreditService implements LoanDockingApi {
+
+    private final String qualityCheckPath = "/admin/pushApi/check_mobile";
+    private final String applyPath = "/admin/pushApi/import_tttg";
+
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.Rongkedai;
+    }
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *  {"url":"http://47.106.81.101:8811"}
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongkedaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+//            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融客贷对接参数:{}", JSONObject.toJSONString(config));
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+            MultiValueMap<String, String> params= new LinkedMultiValueMap<String, String>();
+            params.add("mobile", userInfo.getPhoneMd5());
+            String url = config.getString("url") + qualityCheckPath;
+            log.info("credit qualityCheck RongkedaiCreditService request userId:{}, url:{}, params:{}",userInfo.getUserId(), url, JSON.toJSONString(params));
+            ResponseEntity<String> response = null;
+            try{
+                HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
+                response = httpRestTemplate.restTemplate().postForEntity(url, requestEntity, String.class);
+            }catch (Exception e){
+                log.error("融客贷准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongkedaiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null || response.getStatusCode()!= HttpStatus.OK) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            return JSON.parseObject(response.getBody()).getInteger("code") ==0 ? DataVo.success(0, "融客贷撞库成功", product.getPlanId())
+                    : DataVo.fail("撞库失败", product.getPlanId());
+
+        } catch (Exception e) {
+            log.error("融客贷撞库失败", e);
+            return DataVo.fail(1, "融客贷撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+}

+ 380 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongshengCreditService.java

@@ -0,0 +1,380 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.RedisUtil;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @Descrption
+ * @Author: chend
+ * @Date: 2023/2/8
+ * @Version V1.0
+ **/
+@Service
+@Slf4j
+public class RongshengCreditService implements LoanDockingApi {
+
+    private final static String checkPath = "ad/h5/tripartite/v1/cs2";
+    private final static String applyPath = "ad/h5/tripartite/v1/ps";
+
+    private final static String RedisKey = "Rongsheng:api:%s";
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Resource
+    private RedisUtil redisUtil;
+
+    @Data
+    private static class CheckInfo {
+        private String channelCode;
+        private String bizData;
+        private String miAesKey;
+    }
+
+    @Data
+    private static class Result {
+        private Integer code;
+        private String msg;
+        private JSONObject data;
+        private Long timestamp;
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongshengCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+//            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("荣晟对接参数:{}", JSON.toJSONString(config));
+            String md5Phone = userInfo.getPhoneMd5();
+            String aesKey = AesUtil.getKey();
+            String miAesKey = RsaUtil.encryptByPublicKey(aesKey, config.getString("publicKey"));
+            String bizData = AesUtil.encrypt(md5Phone, aesKey);
+
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setBizData(bizData);
+            checkInfo.setMiAesKey(miAesKey);
+            checkInfo.setChannelCode(config.getString("channelSource"));
+            String url = config.getString("url") + checkPath;
+            log.info("credit qualityCheck RongshengCreditService request md5Phone:{}, url:{}, CheckInfo:{}", md5Phone, url, checkInfo);
+            Result response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, Result.class);
+            } catch (Exception e) {
+                log.error("荣晟准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RongshengCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+
+            if (0 == response.getCode()
+                    && StringUtils.isNotBlank(response.getData().getString("applyId"))
+                    && StringUtils.isNotBlank(response.getData().getString("key"))) {
+                String applyId = response.getData().getString("applyId");
+                String key = response.getData().getString("key");
+                String userRedisKey = String.format(RedisKey, md5Phone);
+                redisUtil.set(userRedisKey, applyId + "_" + key, 300, TimeUnit.SECONDS);
+                return DataVo.success(0, "荣晟撞库成功", product.getPlanId());
+            }
+
+            return DataVo.fail(response.getMsg(), product.getPlanId());
+
+        } catch (Exception e) {
+            log.error("荣晟撞库失败", e);
+            return DataVo.fail(1, "荣晟撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.RongSheng;
+    }
+
+    public static class AesUtil {
+
+        /**
+         * 加密
+         *
+         * @param sSrc 加密数据
+         * @param sKey aeskey
+         * @return : java.lang.String
+         * @date : 2021/3/30
+         */
+        public static String encrypt(String sSrc, String sKey) throws Exception {
+            if (sKey == null) {
+                return null;
+            }
+            // 判断 Key 是否为 16 位
+            if (sKey.length() != 16) {
+                return null;
+            }
+
+            byte[] raw = sKey.getBytes("utf-8");
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+            // "算法/模式/补码方式"
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+            byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+            // 此处使用 BASE64 做转码功 能,同时能起到 2 次加密的作用。
+            return new Base64().encodeToString(encrypted);
+        }
+
+        /**
+         * 解密
+         *
+         * @param sSrc 加密数据
+         * @param sKey aeskey
+         * @return : java.lang.String
+         * @date : 2021/3/30
+         */
+        public static String decrypt(String sSrc, String sKey) throws Exception {
+            try {
+                // 判断 Key 是否正确
+                if (sKey == null) {
+                    return null;
+                }
+                // 判断 Key 是否为 16 位
+                if (sKey.length() != 16) {
+                    return null;
+                }
+                byte[] raw = sKey.getBytes("utf-8");
+                SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+                Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+                cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+                // 先用 base64 解密
+                byte[] encrypted1 = new Base64().decode(sSrc);
+                try {
+                    byte[] original = cipher.doFinal(encrypted1);
+                    return new String(original, "utf-8");
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    return null;
+                }
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                return null;
+            }
+        }
+
+        /**
+         * 获取key
+         */
+        public static String getKey() {
+            StringBuilder uid = new StringBuilder();
+            //产生16位的强随机数
+            Random rd = new SecureRandom();
+            for (int i = 0; i < 16; i++) {
+                //产生0-2的3位随机数
+                int type = rd.nextInt(3);
+                switch (type) {
+                    case 0:
+                        //0-9的随机数
+                        uid.append(rd.nextInt(10));
+                        break;
+                    case 1:
+                        //ASCII在65-90之间为大写,获取大写随机
+                        uid.append((char) (rd.nextInt(25) + 65));
+                        break;
+                    case 2:
+                        //ASCII在97-122之间为小写,获取小写随机
+                        uid.append((char) (rd.nextInt(25) + 97));
+                        break;
+                    default:
+                        break;
+                }
+            }
+            return uid.toString();
+        }
+    }
+
+
+    public static class RsaUtil {
+
+        private static final String KEY_ALGORITHM = "RSA";
+        public static final String DEFAULT_ALGORITHM = "MD5withRSA";
+        private static final String DEFAULT_ENCODING = "UTF-8";
+
+        public static String sign(String privateKey, String dataSrc) {
+            return sign(privateKey, dataSrc, DEFAULT_ALGORITHM);
+        }
+
+        /**
+         * 签名
+         *
+         * @param privateKey:私钥
+         * @param dataSrc:源
+         * @param algorithm:签名算法
+         * @return 签名
+         */
+        public static String sign(
+                String privateKey,
+                String dataSrc,
+                String algorithm
+        ) {
+            try {
+                PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(
+                        Base64.decodeBase64(privateKey)
+                );
+                KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+                PrivateKey myPrivateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
+                Signature signature = Signature.getInstance(algorithm);
+                signature.initSign(myPrivateKey);
+                signature.update(dataSrc.getBytes(DEFAULT_ENCODING));
+                byte[] signed = signature.sign();
+                return Base64.encodeBase64String(signed);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            return null;
+        }
+
+        /**
+         * 签名验证
+         *
+         * @param publicKey:公钥
+         * @param dataSrc:源
+         * @param sign:签名结果串
+         * @return 验签结果
+         */
+        public static boolean checkSign(
+                String publicKey,
+                String dataSrc,
+                String sign
+        ) throws Exception {
+            X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(
+                    Base64.decodeBase64(publicKey)
+            );
+            KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+            PublicKey myPublicKey = keyFactory.generatePublic(x509EncodedKeySpec);
+            byte[] signed = Base64.decodeBase64(sign);
+            Signature signature = Signature.getInstance(
+                    DEFAULT_ALGORITHM
+            );
+            signature.initVerify(myPublicKey);
+            signature.update(dataSrc.getBytes(DEFAULT_ENCODING));
+            return signature.verify(signed);
+        }
+
+        private static PublicKey getPublicKey(String idRsaPub) throws NoSuchAlgorithmException, InvalidKeySpecException {
+            X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(
+                    Base64.decodeBase64(idRsaPub)
+            );
+            KeyFactory keyFactory;
+            keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+            return keyFactory.generatePublic(x509EncodedKeySpec);
+        }
+
+        private static PrivateKey getPrivateKey(String idRsa) throws NoSuchAlgorithmException, InvalidKeySpecException {
+            PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(
+                    Base64.decodeBase64(idRsa)
+            );
+            KeyFactory keyFactory1;
+            keyFactory1 = KeyFactory.getInstance(KEY_ALGORITHM);
+            return keyFactory1.generatePrivate(pkcs8EncodedKeySpec);
+        }
+
+        private static byte[] decryptByPrivateKey(byte[] encryptedData, String idRsa)
+                throws Exception {
+            Cipher cipher = Cipher.getInstance(KEY_ALGORITHM);
+            cipher.init(2, getPrivateKey(idRsa));
+            int inputLen = encryptedData.length;
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            int offSet = 0;
+
+            for (int i = 0; inputLen - offSet > 0; offSet = i * 256) {
+                byte[] cache;
+                if (inputLen - offSet > 256) {
+                    cache = cipher.doFinal(encryptedData, offSet, 256);
+                } else {
+                    cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
+                }
+
+                out.write(cache, 0, cache.length);
+                ++i;
+            }
+
+            byte[] decryptedData = out.toByteArray();
+            out.close();
+            return decryptedData;
+        }
+
+        public static String decryptByPrivateKey(String data, String idRsa) throws Exception {
+            byte[] encryptedData = Base64.decodeBase64(data);
+            byte[] result = decryptByPrivateKey(encryptedData, idRsa);
+            if (result == null) {
+                return null;
+            }
+            return new String(result, StandardCharsets.UTF_8);
+        }
+
+        public static String encryptByPublicKey(String data, String idRsaPub) throws Exception {
+            byte[] encryptedData = data.getBytes(StandardCharsets.UTF_8);
+            byte[] result = encryptByPublicKey(encryptedData, idRsaPub);
+            if (result == null) {
+                return null;
+            }
+            return Base64.encodeBase64String(result);
+        }
+
+        private static byte[] encryptByPublicKey(byte[] data, String idRsaPub)
+                throws Exception {
+            PublicKey publicKey = getPublicKey(idRsaPub);
+            Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
+            cipher.init(1, publicKey);
+            int inputLen = data.length;
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            int offSet = 0;
+
+            for (int i = 0; inputLen - offSet > 0; offSet = i * 244) {
+                byte[] cache;
+                if (inputLen - offSet > 244) {
+                    cache = cipher.doFinal(data, offSet, 244);
+                } else {
+                    cache = cipher.doFinal(data, offSet, inputLen - offSet);
+                }
+
+                out.write(cache, 0, cache.length);
+                ++i;
+            }
+            byte[] encryptedData = out.toByteArray();
+            out.close();
+            return encryptedData;
+        }
+    }
+
+
+}

+ 146 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RongxiziCreditService.java

@@ -0,0 +1,146 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+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.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Hex;
+import org.springframework.http.*;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import javax.annotation.Resource;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+
+/**
+ * 荣西子API接单
+ */
+@Service
+@Slf4j
+public class RongxiziCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    private final String qualityCheckPath = "https://admin.qxd-wh.com/home/Api/checkTel";
+
+    private final String applyPath = "http://47.111.167.41:8009/customer/import";
+
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.Rongxizi;
+    }
+
+
+    @Data
+    private static class ResultHt{
+        private String code;
+        private String msg;
+    }
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     * {"token":"UWDSdzJHCq3KnrLwuBaPBBGX8Hs0oEY3","vender_name":"birong","appid":"20076","appkey":"05xduuQdn6r46giJji91aXDlzEeOT5Be"}
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RongxiziCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+//            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("荣西子对接参数:{}", JSONObject.toJSONString(config));
+            String url = qualityCheckPath;
+            log.info("credit qualityCheck RongxiziCreditService request userId:{}, url:{}",userInfo.getUserId(), url);
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+            Map map = new HashMap();
+            map.put("token",config.getString("token"));
+            map.put("tel",userInfo.getPhoneMd5());
+            HttpEntity<String> requestBody = new HttpEntity<String>(JSONObject.toJSONString(map), headers);
+            String res = null;
+            try{
+                ResponseEntity<String> responseEntity = httpRestTemplate.restTemplate().postForEntity(url, requestBody, String.class);
+                res = responseEntity.getBody();
+            }catch (Exception e){
+                log.error("荣西子准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            if (res == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject result = JSONObject.parseObject(res);
+            log.info("credit qualityCheck RongxiziCreditService response userId:{}, result:{}",userInfo.getUserId(), JSONObject.toJSONString(result));
+            if (result.getInteger("code") == 200) {
+                if (result.getJSONObject("data").getInteger("state") == 0 ) {
+                    return DataVo.success(0, "荣西子撞库成功", product.getPlanId());
+                }
+            }
+            return DataVo.fail(1, result.getString("message"), product.getPlanId());
+
+        } catch (Exception e) {
+            log.error("荣西子撞库失败", e);
+            return DataVo.fail(1, "荣西子撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+    private static String buildPreSign(Map map){
+
+        //将参数转换为map
+
+        Set<String> keys = map.keySet();
+        List<String> list = new ArrayList<>();
+        for (String key : keys) {
+            if(!StringUtils.isEmpty(map.get(key))){
+                list.add(key);
+            }
+        }
+        //排序key
+        Collections.sort(list);
+        //遍历封装排序后key的list,拼接字符串
+        StringBuilder sb = new StringBuilder("");
+        for (int i=0;i<list.size();i++) {
+            if (i==0){
+                sb.append(list.get(i)).append("=").append(map.get(list.get(i)));
+            }else {
+                sb.append("&");
+                sb.append(list.get(i)).append("=").append(map.get(list.get(i)));
+            }
+
+        }
+        return sb.toString();
+    }
+
+    private static String sha1(String text){
+
+        // 获取指定摘要算法的messageDigest对象
+        MessageDigest messageDigest = null; // 此处的sha代表sha1
+        try {
+            messageDigest = MessageDigest.getInstance("SHA");
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+
+        // 调用digest方法,进行加密操作
+        byte[] cipherBytes = messageDigest.digest(text.getBytes());
+
+        return Hex.encodeHexString(cipherBytes);
+    }
+}

+ 89 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RunMeiXinYiRongCreditService.java

@@ -0,0 +1,89 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 10 12 10 44
+ * 润美API
+ **/
+@Slf4j
+@Service
+public class RunMeiXinYiRongCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.RunMei;
+    }
+    @Data
+    private static class CheckInfo{
+        private String channelcode;//渠道号
+        private String phone_md5;//手 机 号 md5 小 写
+        private String city;//申请人所在城市,如上海市
+        private String sign;//键按照升序组合,加上秘钥(URSolKiBSlcxUuAVtbEO)md5
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit RunMeiXinYiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("润美对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setPhone_md5(phoneMd5);
+            checkInfo.setCity(userInfo.getCityAllName());
+            checkInfo.setChannelcode(config.getString("channelCode"));
+            String sign="channelcode="+config.getString("channelCode")+"&city="+userInfo.getCityAllName()+"&phone_md5="+phoneMd5+config.getString("appKey");
+
+            checkInfo.setSign(Md5Util.encoderByMd5(sign));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck RunMeiXinYiRongCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("润美准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RunMeiXinYiRongCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 200) {
+                return DataVo.success(0, "润美撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "润美撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("润美撞库失败", e);
+            return DataVo.fail(1, "润美撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+}

+ 117 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/RxkCreditService.java

@@ -0,0 +1,117 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+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.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Objects;
+
+/**
+ * @Descrption
+ * @Author: chend
+ * @Date: 2023/4/17
+ * @Version V1.0
+ **/
+@Slf4j
+@Service
+public class RxkCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    private final static String CHECK_URL="/xxb-filter/api/filter/md5";
+    private final static String REGISTER_URL="/xxb/api/source/clue_data/consumer";
+
+
+    private final static String CHECK_URL_PRIVATE="/youka/api/user_filter/md5";
+    private final static String REGISTER_URL_PRIVATE="/youka/api/clue_data/accept";
+
+
+    @Data
+    private static class CheckInfo {
+        private String sourceCode;
+
+        private String accessKey;
+
+        private String phoneMd5;
+    }
+
+    @Data
+    private static class Result {
+        private Integer code;
+        private String msg;
+        private JSONObject data;
+        private boolean success;
+    }
+
+    @Data
+    private static class ResultRegister {
+        private String code;
+        private String msg;
+        private String data;
+        private boolean success;
+    }
+
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        log.info("credit RxkCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+        try {
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("融享客对接参数:{}", JSON.toJSONString(config));
+
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setPhoneMd5(userInfo.getPhoneMd5());
+            checkInfo.setSourceCode(config.getString("sourceCode"));
+            checkInfo.setAccessKey(config.getString("accessKey"));
+            String url;
+            if(null !=config.get("private") && config.getBoolean("private")){
+                url = config.getString("domain")+CHECK_URL_PRIVATE;
+            }else {
+                url = config.getString("domain")+CHECK_URL;
+            }
+            log.info("credit qualityCheck RxkCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
+            Result response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, Result.class);
+            } catch (Exception e) {
+                log.error("融享客准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck RxkCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            return
+                    Objects.equals(1, response.getCode())
+                            && Objects.equals(true, response.isSuccess())
+                            && Objects.equals(false, response.getData().getBoolean("phoneMd5Exist")) ?
+                            DataVo.success(0, "融享客撞库成功", product.getPlanId())
+                            : DataVo.fail("融享客-"+product.getPlanName()+"撞库失败", product.getPlanId());
+
+        } catch (Exception e) {
+            log.error("融享客撞库失败", e);
+            return DataVo.fail(1, "融享客撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.CRM_RXK;
+    }
+
+}

+ 157 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanDongBangBangDaiCreditService.java

@@ -0,0 +1,157 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.util.HashMap;
+import java.util.Map;
+/**
+ * @Author Liu Tao
+ * @Date 2023 09 18 13 40
+ **/
+@Slf4j
+@Service
+public class ShanDongBangBangDaiCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShanDongBangBangDai;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String mobile_md5;//md5 的手机号
+    }
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShanDongBangBangDaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("山东帮帮代对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMobile_md5(phoneMd5);
+            String checkUrl = config.getString("checkUrl");
+            String url=checkUrl+"?company="+config.getString("checkCompany")+"&mobile_md5="+checkInfo.getMobile_md5();
+            log.info("credit qualityCheck ShanDongBangBangDaiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().getForObject(url, String.class);
+            }catch (Exception e){
+                log.error("山东帮帮代准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShanDongBangBangDaiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "山东帮帮代撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "山东帮帮代撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("山东帮帮代撞库失败", e);
+            return DataVo.fail(1, "山东帮帮代撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+    public static class AESUtil {
+
+        // mode_key:Cipher
+        private static final Map<String, Cipher> CIPHERMAP_MAP = new HashMap<String, Cipher>();
+
+        // constants
+        private static final String DEFAULT_CHARSET = "utf-8";
+        private static final String ALGORITHM_NAME = "AES";
+        private static final String ALGORITHM_STR = ALGORITHM_NAME + "/CBC/PKCS5Padding";
+        private static final String IV = "0000000000000000";
+
+        /**
+         * get cipher
+         *
+         * @param mode
+         * @param key
+         * @param charset
+         * @return
+         * @throws Exception
+         */
+        private static Cipher getCipher(int mode, String key, String charset) throws Exception {
+            Cipher cipher = CIPHERMAP_MAP.get(mode + "_" + key);
+            if (cipher != null) {
+                return cipher;
+            }
+
+            // secretKeySpec
+            SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(charset), ALGORITHM_NAME);
+            // ivParameterSpec
+            IvParameterSpec ivParameterSpec = new IvParameterSpec(IV.getBytes(charset));
+            // cipher
+            cipher = Cipher.getInstance(ALGORITHM_STR);
+            cipher.init(mode, secretKeySpec, ivParameterSpec);
+            // return
+            CIPHERMAP_MAP.put(mode + "_" + key, cipher);
+            return cipher;
+        }
+
+        public static String encrypt(String a, String key, String charset) throws Exception {
+            Cipher cipher = getCipher(Cipher.ENCRYPT_MODE, key, charset);
+            byte[] resultByte = cipher.doFinal(a.getBytes(charset));
+            return base64BytesToString(resultByte, charset);
+        }
+
+        public static String encrypt(String a, String key) throws Exception {
+            return encrypt(a, key, DEFAULT_CHARSET);
+        }
+
+        public static String decrypt(String a, String key, String charset) throws Exception {
+            Cipher cipher = getCipher(Cipher.DECRYPT_MODE, key, charset);
+            byte[] inputByte = base64stringToBytes(a, charset);
+            byte[] resultByte = cipher.doFinal(inputByte);
+            return new String(resultByte, charset);
+        }
+
+        public static String decrypt(String a, String key) throws Exception {
+            return decrypt(a, key, DEFAULT_CHARSET);
+        }
+
+        private static String base64BytesToString(byte[] bytes, String charset) throws Exception {
+            return new String(Base64.encodeBase64(bytes), charset);
+        }
+
+        private static byte[] base64stringToBytes(String string, String charset) throws Exception {
+            return Base64.decodeBase64(string.getBytes(charset));
+        }
+
+
+    }
+}

+ 125 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanXiHengShengDaiCreditService.java

@@ -0,0 +1,125 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Service;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 11 01 17 49
+ **/
+@Slf4j
+@Service
+public class ShanXiHengShengDaiCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShanXiHengSheng;
+    }
+    @Data
+    private static class CheckInfo{
+        private String md5mobile;//md5 的手机号
+        private String brand;//品牌对应数字(比如 6)
+    }
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+    {
+    "checkUrl": "https://www2.zhudaicms.com/sem/check_canindb.html",
+    "applyUrl": "https://www2.zhudaicms.com/sem/loan_do_aes_cbc_new.html",
+    "source": "hsjf-hryk",
+    "brand": "609",
+    "publickey": "zhudai#aes#cbc#1",
+    "iv": "2022042215123456"
+    }
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShanXiHengShengDaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("山西恒昇对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMd5mobile(phoneMd5);
+            checkInfo.setBrand(config.getString("brand"));
+            String url = config.getString("checkUrl");
+            MultiValueMap<String, String> params= new LinkedMultiValueMap<String, String>();
+            params.add("md5mobile", phoneMd5);
+            params.add("brand", config.getString("brand"));
+            log.info("credit qualityCheck ShanXiHengShengDaiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                HttpHeaders headers = new HttpHeaders();
+                headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+                HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
+                response = httpRestTemplate.restTemplate().postForEntity(url, requestEntity, String.class).getBody();
+            }catch (Exception e){
+                log.error("山西恒昇准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShanXiHengShengDaiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            if (response.equals("1")) {
+                return DataVo.success(0, "山西恒昇撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "山西恒昇撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("山西恒昇撞库失败", e);
+            return DataVo.fail(1, "山西恒昇撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+    public static String encrypt(String plainText, String key, String iv) throws Exception {
+        // 将 key 转换为 SecretKey 对象
+        SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+        // 将 IV 字符串转换为字节数组
+        byte[] ivBytes = iv.getBytes(StandardCharsets.UTF_8);
+        // 生成 IV
+        // 创建 Cipher 对象
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(ivBytes));
+        // 加密明文
+        byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+        // 将加密后的字节转换为 Base64 编码
+        return Base64.getEncoder().encodeToString(encryptedBytes);
+    }
+}

+ 121 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShanXiMingDePuHuiCreditService.java

@@ -0,0 +1,121 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 07 22 14 13
+ **/
+@Service
+@Slf4j
+public class ShanXiMingDePuHuiCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShanXiMingDePuHui;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String tel;// 明文电话号码Md5加密值(小写),用于判断是否重复
+    }
+
+
+
+    @Data
+    private static class RequestData {
+
+        private String data;
+        private String source;
+        private String sourceName;
+    }
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShanXiMingDePuHuiCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("陕西明德普惠对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            String url = config.getString("checkUrl");
+
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setTel(phoneMd5);
+
+            log.info("credit qualityCheck ShanXiMingDePuHuiCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, String.class);
+            } catch (Exception e) {
+                log.error("陕西明德普惠准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShanXiMingDePuHuiCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code").equals(200) && jsonObject.getBoolean("isSuccess")) {
+                return DataVo.success(0, "陕西明德普惠撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "陕西明德普惠撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("陕西明德普惠撞库失败", e);
+            return DataVo.fail(1, "陕西明德普惠撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+    /**
+     * AES 加密
+     *
+     * @param str 待加密内容
+     * @param key 加密key
+     * @return 加密内容
+     */
+    public static String encryptAES(String str, String key) {
+        try {
+            byte[] raw = key.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec secretKeySpec = new SecretKeySpec(raw, "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
+            byte[] encrypted = cipher.doFinal(str.getBytes(StandardCharsets.UTF_8));
+            return Base64.encodeBase64String(encrypted);
+        } catch (Exception e) {
+            log.error("AES 加密异常", e);
+            throw new RuntimeException(e);
+        }
+    }
+
+
+}

+ 85 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShangHaiHanGeCreditService.java

@@ -0,0 +1,85 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 06 05 14 46
+ **/
+@Slf4j
+@Component
+public class ShangHaiHanGeCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShangHaiHanGe;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String MobilePhone;// 手机号(32位MD5加密字符串)
+    }
+
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("上海晗各对接参数:{}", JSONObject.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            String url = config.getString("checkUrl");
+            log.info("上海晗各开始撞库,请求地址:{},md5:{}", url, phoneMd5);
+            MultiValueMap<String, String> params= new LinkedMultiValueMap<String, String>();
+            params.add("MobilePhone", phoneMd5);
+            String response = null;
+            try{
+                HttpHeaders headers = new HttpHeaders();
+                headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+                HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
+                response = httpRestTemplate.restTemplate().postForEntity(url, requestEntity, String.class).getBody();
+            } catch (Exception e) {
+                log.error("上海晗各准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("上海晗各撞库响应:{},md5:{}", response, phoneMd5);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            if (jsonObject.getString("Ret").equals("0")&&jsonObject.getString("Code").equals("100")) {
+                return DataVo.success(0, "上海晗各撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "上海晗各撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            return DataVo.fail(1, "上海晗各撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+}

+ 83 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShangHaiJuHuiRongCreditService.java

@@ -0,0 +1,83 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+/**
+ * @Author Liu Tao
+ * @Date 2024 04 01 16 08
+ **/
+@Slf4j
+@Service
+public class ShangHaiJuHuiRongCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShangHaiJuHuiRongCreditService;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String mobile;//md5 的手机号
+        private String ditchCode;//渠道编码
+        private String city; //城市
+    }
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShangHaiJuHuiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("上海聚汇融对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMobile(phoneMd5);
+            checkInfo.setCity(userInfo.getCityAllName());
+            checkInfo.setDitchCode(config.getString("ditchCode"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck ShangHaiJuHuiRongCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("上海聚汇融准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShangHaiJuHuiRongCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code").equals("200")) {
+                return DataVo.success(0, "上海聚汇融撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "上海聚汇融撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("上海聚汇融撞库失败", e);
+            return DataVo.fail(1, "上海聚汇融撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+}
+

+ 97 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenLuoJinFuCreditService.java

@@ -0,0 +1,97 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 07 17 15 21
+ **/
+@Slf4j
+@Component
+public class ShenLuoJinFuCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShenLuoJinFu;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String account_key;//account_key值需接口方提供
+        private String tel_m;//手机号(MD5加密的32位小写)
+        private String city;//城市,例如(上海或上海市)
+        private String repeat_system;//指定系统撞库(需接口方提供)
+    }
+
+
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("盛略金服对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            Map<String, String> requestData = new HashMap<>();
+            requestData.put("tel_m", phoneMd5);
+            requestData.put("account_key", config.getString("account_key"));
+            requestData.put("city",userInfo.getCityAllName());
+            if (config.getString("repeat_system")!=null){
+                requestData.put("repeat_system", config.getString("repeat_system"));
+            }
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck ShenLuoJinFuCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            JSONObject response = null;
+            try{
+                Map<String, String> head = new HashMap<>();
+                head.put("Content-Type", "application/x-www-form-urlencoded");
+                HttpResponse httpResponse = httpRestTemplate.restTemplate().postForObject(url, null, null, head, null, requestData);
+                String responseStr = EntityUtils.toString(httpResponse.getEntity());
+                response = JSONObject.parseObject(responseStr);
+            }catch (Exception e){
+                log.error("盛略金服准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShenLuoJinFuCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (response.getInteger("code")==1) {
+                return DataVo.success(0, "盛略金服撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "盛略金服撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("盛略金服撞库失败", e);
+            return DataVo.fail(1, "盛略金服撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+}

+ 110 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenYangHengXinCreditService.java

@@ -0,0 +1,110 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.util.*;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 04 29 10 55
+ **/
+@Slf4j
+@Service
+public class ShenYangHengXinCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShenYangHengXin;
+    }
+    @Data
+    private static class CheckInfo{
+        private String mobile;// 手机号md5
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShenYangHengXinCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("沈阳恒信对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            Map<String, String> requestData = new HashMap<>();
+            requestData.put("mobile", phoneMd5);
+            String url = config.getString("checkUrl");
+            JSONObject jsonObject = new JSONObject();
+            log.info("credit qualityCheck ShenYangHengXinCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
+            Map<String, String> header = new HashMap<>();
+            header.put("Content-Type", "application/x-www-form-urlencoded");
+            String res = "";
+            try{
+                HttpResponse response = httpRestTemplate.restTemplate().postForObject(url, null, null, header, null, requestData);
+                res = EntityUtils.toString(response.getEntity());
+                jsonObject = JSON.parseObject(res);
+            }catch (Exception e){
+                log.error("沈阳恒信准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShenYangHengXinCreditService response userId:{}, result:{}",userInfo.getUserId(), jsonObject);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code").equals("0")) {
+                return DataVo.success(0, "沈阳恒信撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "沈阳恒信撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            return DataVo.fail(1, "沈阳恒信撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+    /**
+     * 加密
+     * @param sSrc 需要加密的字符串
+     * @param sKey 此处使用AES-128-ECB加密模式,key需要为16位。
+     * @return
+     * @throws Exception
+     */
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+
+        // 判断Key是否为16位
+        if (sKey.length() != 16) {
+            System.out.print("Key长度不是16位");
+            return null;
+        }
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+        return new Base64().encodeToString(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+    }
+}

+ 89 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShenYangXinYiRongCreditService.java

@@ -0,0 +1,89 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 10 10 15 09
+ * 沈阳信易融APi
+ **/
+
+@Slf4j
+@Service
+public class ShenYangXinYiRongCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShenYangXinYiRong;
+    }
+
+
+    @Data
+    private static class CheckInfo{
+        private String mobile_md5;//md5 的手机号
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShenYangXinYiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("沈阳信易融对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMobile_md5(phoneMd5);
+            String checkUrl = config.getString("checkUrl");
+            String url=checkUrl+"?company="+config.getInteger("checkCompany")+"&mobile_md5="+checkInfo.getMobile_md5();
+            log.info("credit qualityCheck ShenYangXinYiRongCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("沈阳信易融准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShenYangXinYiRongCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "沈阳信易融撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "沈阳信易融撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("沈阳信易融撞库失败", e);
+            return DataVo.fail(1, "沈阳信易融撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+}

+ 167 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShiYueCreditService.java

@@ -0,0 +1,167 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.AsyncResult;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+import java.util.concurrent.Future;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 03 12 14 03
+ **/
+@Slf4j
+@Service
+public class ShiYueCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ShiYue;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private Integer app_id;//渠道编码
+        private String timestamp;//时间戳
+        private String sign;//签名
+        private String mobile;//md5加密后的手机号,32位小写
+    }
+    /*
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShiYueCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("司跃对接参数:{}", JSON.toJSONString(config));
+
+            Map<String, String> map = new HashMap<>();
+            map.put("app_id",config.getString("app_id"));
+            map.put("mobile",(userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5()));
+            map.put("timestamp",System.currentTimeMillis()/1000+"");
+            String sign = makeSign(map, config.getString("token"));
+            map.put("sign",sign);
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck ShiYueCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, map);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,map, String.class);
+            }catch (Exception e){
+                log.error("司跃准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShiYueCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code") .equals("20000")) {
+                return DataVo.success(0, "司跃撞库成功", product.getPlanId());
+            } else {
+                return  DataVo.fail(1, "司跃撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("司跃撞库失败", e);
+            return DataVo.fail(1, "司跃撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+
+    public static String makeSign(Map<String, String> args, String token) {
+        if (args == null || token == null) {
+            return "";
+        }
+
+        Map<String, String> sortedArgs = new TreeMap<>(args);
+
+        StringBuilder signStr = new StringBuilder();
+        for (Map.Entry<String, String> entry : sortedArgs.entrySet()) {
+            String key = entry.getKey();
+            String value = entry.getValue();
+            if (value != null && !value.isEmpty()) {
+                signStr.append(key).append(value);
+            }
+        }
+
+        System.out.println(signStr.toString());
+
+        return md5(md5(signStr.toString()) + token).toUpperCase();
+    }
+
+    private static String md5(String str) {
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            md.update(str.getBytes());
+            byte[] digest = md.digest();
+
+            StringBuilder sb = new StringBuilder();
+            for (byte b : digest) {
+                sb.append(String.format("%02x", b & 0xff));
+            }
+
+            return sb.toString();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+
+    // 加密
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+        if (sKey == null) {
+            System.out.print("Key为空null");
+            return null;
+        }
+        // 判断Key是否为16位
+        if (sKey.length() != 16) {
+            System.out.print("Key长度不是16位");
+            return null;
+        }
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+        return Base64.getEncoder().encodeToString(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+    }
+
+
+}

+ 94 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/ShuRongCreditService.java

@@ -0,0 +1,94 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 06 06 17 11
+ **/
+@Slf4j
+@Service
+public class ShuRongCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.ShuRong;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String mobile;//手机号, MD5加密(32位小写)
+        private String city;//城市:例如:北京
+        private String source;//固定值,具体需要和对接人确定
+    }
+
+
+    @Data
+    private static class ApplyInfoRequst {
+       private String is_jm;
+       private String source;
+       private String data;
+    }
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit ShuRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("速融对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMobile(phoneMd5);
+            checkInfo.setSource(config.getString("source"));
+            checkInfo.setCity(userInfo.getCityAllName());
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck ShuRongCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("速融准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck ShuRongCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code").equals("100")) {
+                return DataVo.success(0, "速融撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "速融撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("速融撞库失败", e);
+            return DataVo.fail(1, "速融撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+}

+ 152 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SiChuangRuiCreditService.java

@@ -0,0 +1,152 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 09 07 15 26
+ **/
+@Slf4j
+@Service
+public class SiChuangRuiCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.SiChuangRui;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String phone;//md5 的手机号
+    }
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *  {
+     * 	"checkUrl": "http://47.242.43.151/Home/EncryptApi/checkRegister",
+     * 	"applyUrl": "http://47.242.43.151/Home/EncryptApi/reg",
+     * 	"source": "HuiRongYK",
+     * 	"channel": "BiRong",
+     * 	"publicKey": "hxW7zT4BI9siImpE"
+     * }
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit SiChuangRuiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("思创瑞对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setPhone(phoneMd5);
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck SiChuangRuiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("思创瑞准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck SiChuangRuiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 200 && jsonObject.getJSONObject("data")!=null && jsonObject.getJSONObject("data").getInteger("isRegistered")==0) {
+                return DataVo.success(0, "思创瑞撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "思创瑞撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("思创瑞撞库失败", e);
+            return DataVo.fail(1, "思创瑞撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+    private static class ApiAesUtil {
+        public static String encrypt(String sSrc, String sKey) throws Exception {
+            if (sKey == null) {
+                System.out.print("Key为空null");
+                return null;
+            }
+            if (sKey.length() != 16) {
+                System.out.print("Key长度不是16位");
+                return null;
+            }
+            byte[] raw = sKey.getBytes("utf-8");
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+            byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+            return Base64.encodeBase64String(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+        }
+
+        public static String Decrypt(String sSrc, String sKey) throws Exception {
+            try {
+                if (sKey == null) {
+                    System.out.print("Key为空null");
+                    return null;
+                }
+                if (sKey.length() != 16) {
+                    System.out.print("Key长度不是16位");
+                    return null;
+                }
+                byte[] raw = sKey.getBytes("utf-8");
+                SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+                Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+                cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+                byte[] encrypted1 = Base64.decodeBase64(sSrc);//先用base64解密
+                try {
+                    byte[] original = cipher.doFinal(encrypted1);
+                    String originalString = new String(original,"utf-8");
+                    return originalString;
+                } catch (Exception e) {
+                    System.out.println(e.toString());
+                    return null;
+                }
+            } catch (Exception ex) {
+                System.out.println(ex.toString());
+                return null;
+            }
+        }
+
+    }
+
+}

+ 170 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SouYuJinFuCreditService.java

@@ -0,0 +1,170 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.DESKeySpec;
+import javax.crypto.spec.IvParameterSpec;
+import java.security.Key;
+import java.util.Base64;
+/**
+ * @Author Liu Tao
+ * @Date 2024 03 20 13 50
+ **/
+@Slf4j
+@Service
+public class SouYuJinFuCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.SouYuJinFu;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String phone;//手机号码md5(32位,字母小写)
+    }
+
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit SouYuJinFuCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("授渔金服对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setPhone((userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5()));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck SouYuJinFuCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try {
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            } catch (Exception e) {
+                log.error("授渔金服准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck SouYuJinFuCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            log.info("credit qualityCheck SouYuJinFuCreditService response userId:{}, jsonObject:{}", userInfo.getUserId(), jsonObject);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("businessCode").equals("200")) {
+                return DataVo.success(0, "授渔金服撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "授渔金服撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("授渔金服撞库失败", e);
+            return DataVo.fail(1, "授渔金服撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+    public static class DESUtil {
+
+        private static final Logger log = LoggerFactory.getLogger(DESUtil.class);
+
+        /**
+         * 偏移变量,固定占8位字节
+         */
+        private final static String IV_PARAMETER = "12345678";
+
+        private static final String ALGORITHM = "DES";
+
+        private static final String CIPHER_ALGORITHM = "DES/CBC/PKCS5Padding";
+
+        private static final String CHARSET = "utf-8";
+
+        /**
+         * 解密
+         * @param key 密钥
+         * @param data 密文
+         * @return  解密后的内容
+         */
+        public static String decrypt(String key, String data) {
+            if(StringUtils.isBlank(key))
+                throw new RuntimeException("缺少key");
+            if(StringUtils.isBlank(data))
+                throw new RuntimeException("加密对象空的");
+            try {
+                Key secretKey = generateKey(key);
+                Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
+                IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
+                cipher.init(Cipher.DECRYPT_MODE, secretKey,iv);
+                return new String(cipher.doFinal(Base64.getDecoder().decode(data.getBytes(CHARSET))), CHARSET);
+            } catch (Exception e) {
+                log.error("key-{},data-{},DES解密异常:{}-{}",key,data,e.getMessage(),e);
+                return null;
+            }
+        }
+
+
+        /**
+         * 加密
+         * @param key 密钥
+         * @param data 待加密的内容
+         * @return 密文
+         */
+        public static String encrypt(String key, String data) {
+            if (key== null || key.length() < 8) {
+                throw new RuntimeException("加密失败,key不能小于8位");
+            }
+            if (data == null)
+                return null;
+            try {
+                Key secretKey = generateKey(key);
+                Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
+                IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
+                cipher.init(Cipher.ENCRYPT_MODE, secretKey,iv);
+                byte[] bytes = cipher.doFinal(data.getBytes(CHARSET));
+                //JDK1.8及以上可直接使用Base64,JDK1.7及以下可以使用BASE64Encoder
+                //Android平台可以使用android.util.Base64
+                return new String(Base64.getEncoder().encode(bytes));
+            } catch (Exception e) {
+                log.error("key-{},data-{},DES加密异常:{}-{}",key,data,e.getMessage(),e);
+                return null;
+            }
+        }
+
+        /**
+         * 生成key
+         *
+         * @param password
+         * @return
+         * @throws Exception
+         */
+        private static Key generateKey(String password) throws Exception {
+            DESKeySpec dks = new DESKeySpec(password.getBytes(CHARSET));
+            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM);
+            return keyFactory.generateSecret(dks);
+        }
+    }
+}

+ 99 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SuZhouJianYiRongCreditService.java

@@ -0,0 +1,99 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author zjc
+ * @Date 2024 07 09 16 36
+ **/
+@Slf4j
+@Service
+public class SuZhouJianYiRongCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.SuZhouJianYiRong;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private String md5_mobile;//md5加密后的手机号,32位小写
+    }
+
+
+    @Data
+    private static class RquestParam {
+        private String source;//渠道来源
+        private String file_id;//
+        private String data;//	AES加密 (AES/ECB/PKCS5Padding)
+        private String sign;
+        private String timestamp;
+
+
+    }
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit SuZhouJianYiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("苏州简易融对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMd5_mobile(phoneMd5);
+
+
+            String url = config.getString("checkUrl");
+
+            log.info("credit qualityCheck SuZhouJianYiRongCreditService request userId:{}, url:{}, checkInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("苏州简易融准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck SuZhouJianYiRongCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") ==0 ) {
+                return DataVo.success(0, "苏州简易融撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "苏州简易融撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("苏州简易融撞库失败", e);
+            return DataVo.fail(1, "苏州简易融撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+
+}

+ 144 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/SuzhouchangshuoCreditService.java

@@ -0,0 +1,144 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @Author Tianli
+ * @Date 2023 11 08.
+ * 苏州昌硕API接单
+ **/
+@Service
+@Slf4j
+public class SuzhouchangshuoCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.Suzhouchangshuo;
+    }
+
+    @Data
+    public static class CheckData{
+        private String tel;
+    }
+
+    /*@Data
+    private static class CheckInfo{
+        private String phoneMd5;
+
+        private String sign;
+
+        private String areaName;
+
+
+    }*/
+    @Data
+    private static class ResultHt{
+        private String code;
+        private String msg;
+    }
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit SuzhouchangshuoCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("苏州昌硕对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            /*checkInfo.setPhoneMd5(phoneMd5);
+            AreaCity cityInfoByCode = cityService.getCityInfoByCode(userInfo.getCityCode());
+            checkInfo.setAreaName(cityInfoByCode.getCityName());
+//实体类转为JSONObject
+            JSONObject jsons = JSONObject.parseObject(JSON.toJSONString(checkInfo));
+            jsons.remove("sign");
+            String sign = getSign(jsons,config.getString("signKey"));
+            checkInfo.setSign(MSDSUtils.MD5.EncoderByMd5(sign));
+            CheckData checkData = new CheckData();
+            checkData.setParams(AESencrypt(JSONObject.toJSONString(checkInfo),config.getString("encKey")));
+            checkData.setMerNo(config.getString("merNo"));*/
+            CheckData checkData = new CheckData();
+            checkData.setTel(phoneMd5);
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck SuzhouchangshuoCreditService request userId:{}, url:{}, checkData:{}",userInfo.getUserId(), url, checkData);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkData, String.class);
+            }catch (Exception e){
+                log.error("苏州昌硕准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck SuzhouchangshuoCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "苏州昌硕撞库成功", product.getPlanId());
+            }else if (jsonObject.getInteger("code") == 1) {
+                return DataVo.fail(1, "苏州昌硕撞库失败,该数据对方已存在", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "苏州昌硕撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("苏州昌硕撞库失败", e);
+            return DataVo.fail(1, "苏州昌硕撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+
+        // 判断Key是否为16位
+        if (sKey.length() != 16) {
+            System.out.print("Key长度不是16位");
+            return null;
+        }
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+        return new Base64().encodeToString(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+    }
+
+
+
+
+
+
+}

+ 80 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TangShanRongYangCreditService.java

@@ -0,0 +1,80 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+/**
+ * @Author Liu Tao
+ * @Date 2024 07 22 14 13
+ **/
+@Service
+@Slf4j
+public class TangShanRongYangCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.ThangSanRongYang;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String md5_phone;// Md5(mobile)
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit TangShanRongYangCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("唐山融扬对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            String url = config.getString("checkUrl");
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMd5_phone(phoneMd5);
+            log.info("credit qualityCheck TangShanRongYangCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, String.class);
+            } catch (Exception e) {
+                log.error("唐山融扬准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck TangShanRongYangCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("resStatus").equals("1")) {
+                return DataVo.success(0, "唐山融扬撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "唐山融扬撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("唐山融扬撞库失败", e);
+            return DataVo.fail(1, "唐山融扬撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+}

+ 112 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TianJingJiaYiCreditService.java

@@ -0,0 +1,112 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 11 22 17 52
+ **/
+@Slf4j
+@Service
+public class TianJingJiaYiCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.TianJingJiaYi;
+    }
+    @Data
+    private static class CheckInfo{
+        private Integer channel_code;//渠道编码,由系统负责人提供
+        private String channel_secret_key;//渠道密钥,由系统负责人提供
+        private String md5_phone;//手机号码MD5值(32位小写)
+    }
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit TianJingJiaYiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("天津佳亿对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMd5_phone(phoneMd5);//md5
+            checkInfo.setChannel_code(config.getInteger("channelCode"));//渠道编码
+            checkInfo.setChannel_secret_key(config.getString("channelSecretKey"));//渠道密钥
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck TianJingJiaYiCreditService request userId:{}, url:{}, checkInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("天津佳亿准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck TianJingJiaYiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getString("code").equals("0")) {
+                return DataVo.success(0, "天津佳亿撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "天津佳亿撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("天津佳亿撞库失败", e);
+            return DataVo.fail(1, "天津佳亿撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+
+        // 判断Key是否为16位
+        if (sKey.length() != 16) {
+            System.out.print("Key长度不是16位");
+            return null;
+        }
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+        return new Base64().encodeToString(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+    }
+}

+ 76 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TianShuiShuYiRongCreditService.java

@@ -0,0 +1,76 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 12 13 16 07
+ **/
+@Slf4j
+@Service
+public class TianShuiShuYiRongCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.TianShuiShuYiRong;
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit TianShuiShuYiRongCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("天水速易融对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            String checkUrl = config.getString("checkUrl");
+            String company = config.getString("company");
+            String url = checkUrl + "?company=" + company + "&mobile_md5=" + phoneMd5;
+            log.info("credit qualityCheck TianShuiShuYiRongCreditService request userId:{}, url:{}, phoneMd5:{}", userInfo.getUserId(), url, phoneMd5);
+            String response = null;
+            try {
+                response = httpRestTemplate.restTemplate().getForObject(url, String.class);
+            } catch (Exception e) {
+                log.error("天水速易融准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck TianShuiShuYiRongCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "天水速易融撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "天水速易融撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("天水速易融撞库失败", e);
+            return DataVo.fail(1, "天水速易融撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+
+}

+ 130 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/TuoBaoRongCreditService.java

@@ -0,0 +1,130 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+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.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.util.Objects;
+
+/**
+ * @Descrption
+ * @Author: chend
+ * @Date: 2023/2/16
+ * @Version V1.0
+ **/
+@Service
+@Slf4j
+public class TuoBaoRongCreditService implements LoanDockingApi {
+
+    private static final String checkPath = "api/check";
+    private static final String applyPath = "api/apply";
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+
+    @Data
+    private static class CheckInfo {
+        private String trafficsources;
+        private String md5_mobile;
+    }
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.TuoBaoRong;
+    }
+
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit TuoBaoRongCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+//            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("拓宝荣对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMd5_mobile(userInfo.getPhoneMd5());
+            checkInfo.setTrafficsources(config.getString("channelSource"));
+
+            JSONObject param = new JSONObject() {{
+                put("data", encrypt(JSON.toJSONString(checkInfo), config.getString("secret")));
+            }};
+
+            String url = config.getString("url") + checkPath;
+            log.info("credit qualityCheck TuoBaoRongCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
+            JSONObject response = null;
+            try {
+                response = httpRestTemplate.restTemplate().postForObject(url, param, JSONObject.class);
+            } catch (Exception e) {
+                log.error("拓宝荣准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck TuoBaoRongCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            return Objects.equals("200", response.getString("code")) ? DataVo.success(0, "拓宝荣撞库成功", product.getPlanId())
+                    : DataVo.fail(response.getString("msg"), product.getPlanId());
+
+        } catch (Exception e) {
+            log.error("拓宝荣撞库失败", e);
+            return DataVo.fail(1, "拓宝荣撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+        if (sKey == null) {
+            return null;
+        }
+        // 判断 Key 是否为 16 位
+        if (sKey.length() != 16) {
+            return null;
+        }
+
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        // "算法/模式/补码方式"
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+        return bytesToHexString(encrypted);
+    }
+
+
+    public static String bytesToHexString(byte[] src) {
+        StringBuilder stringBuilder = new StringBuilder("");
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        for (int i = 0; i < src.length; i++) {
+            int v = src[i] & 0xFF;
+            String hv = Integer.toHexString(v);
+            if (hv.length() < 2) {
+                stringBuilder.append(0);
+            }
+            stringBuilder.append(hv);
+        }
+        return stringBuilder.toString();
+    }
+
+}

+ 102 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WeiFangHuaShenCreditService.java

@@ -0,0 +1,102 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 07 03 16 14
+ **/
+@Slf4j
+@Service
+public class WeiFangHuaShenCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.WeiFangHuaShenCreditService;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private Integer channel_code;//渠道编码,由负责人提供
+        private String md5_phone;//md5加密后的手机号,32位小写
+    }
+
+
+
+    /**
+     * 助贷对接模板2,撞库,需要form表单提交
+     * @param userInfo
+     * @param product
+     * @return
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit WeiFangHuaShenCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("潍坊华盛对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            checkInfo.setMd5_phone(phoneMd5);
+            checkInfo.setChannel_code(config.getInteger("channel_code"));
+
+            Map<String, String> requestData = new HashMap<>();
+            requestData.put("channel_code", String.valueOf(checkInfo.getChannel_code()));
+            requestData.put("md5_phone", String.valueOf(checkInfo.getMd5_phone()));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck WeiFangHuaShenCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            JSONObject response = null;
+            try{
+                Map<String, String> head = new HashMap<>();
+                head.put("Content-Type", "application/x-www-form-urlencoded");
+                HttpResponse httpResponse = httpRestTemplate.restTemplate().postForObject(url, null, null, head, null, requestData);
+                String responseStr = EntityUtils.toString(httpResponse.getEntity());
+                response = JSONObject.parseObject(responseStr);
+            }catch (Exception e){
+                log.error("潍坊华盛准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck WeiFangHuaShenCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (response.getInteger("code")==0) {
+                return DataVo.success(0, "潍坊华盛撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "潍坊华盛撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("潍坊华盛撞库失败", e);
+            return DataVo.fail(1, "潍坊华盛撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+}

+ 94 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WeiFangYouYiCreditService.java

@@ -0,0 +1,94 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 09 21 11 46
+ * 潍坊优易API
+ **/
+@Slf4j
+@Service
+public class WeiFangYouYiCreditService implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.WFangYy;
+    }
+
+    @Data
+    private static class CheckInfo{
+        private Integer channel_code;//渠道编码
+        private String channel_secret_key;//渠道密钥
+        private String md5_phone;//md5加密后的手机号,32位小写
+    }
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     *
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit WeiFangYouYiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("潍坊优易对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setMd5_phone(Md5Util.encoderByMd5(userInfo.getUserMobile()));
+            checkInfo.setChannel_code(Integer.valueOf(config.getString("channel_code")));
+            checkInfo.setChannel_secret_key(config.getString("channel_secret_key"));
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck WeiFangYouYiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            }catch (Exception e){
+                log.error("潍坊优易准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck WeiFangYouYiCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "潍坊优易撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "潍坊优易撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("潍坊优易撞库失败", e);
+            return DataVo.fail(1, "潍坊优易撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+}

+ 161 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WenZhouGaoShenCreditService.java

@@ -0,0 +1,161 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 12 22 09 42
+ **/
+@Slf4j
+@Service
+public class WenZhouGaoShenCreditService implements LoanDockingApi {
+
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums getType() {
+        return ServerCodeEnums.WenZhouGaoShen;
+    }
+
+    @Data
+    private static class CheckInfo {
+        private String appKey;//appKey
+        private String phone;//手机
+        private String isMask;//是否加密,默认0 不加密;1加密
+        private String Sign;//
+    }
+
+
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit WenZhouGaoShenCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("温州高升对接参数:{}", JSON.toJSONString(config));
+            CheckInfo checkInfo = new CheckInfo();
+            checkInfo.setPhone((userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5()));
+            checkInfo.setIsMask("1");
+            checkInfo.setAppKey(config.getString("appKey"));
+            String sign="appKey="+config.getString("appKey")+"&phone="+checkInfo.getPhone()+config.getString("appSecret");
+            log.info("温州高升对接sign:{}", JSON.toJSONString(sign));
+            checkInfo.setSign(Md5Util.encoderByMd5(sign).toUpperCase());
+            String url = config.getString("post")+config.getString("tenantCode")+"/"+config.getString("check");
+            log.info("credit qualityCheck WenZhouGaoShenCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
+            String response = null;
+            try {
+                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            } catch (Exception e) {
+                log.error("温州高升准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck WenZhouGaoShenCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            log.info("credit qualityCheck WenZhouGaoShenCreditService response userId:{}, jsonObject:{}", userInfo.getUserId(), jsonObject);
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("errCode") == 0 && jsonObject.getString("data").equals("true")) {
+                return DataVo.success(0, "温州高升撞库成功", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "温州高升撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("温州高升撞库失败", e);
+            return DataVo.fail(1, "温州高升撞库失败,请联系系统管理员", product.getPlanId());
+        }
+    }
+
+
+
+    public static String encrypt(String str, String key) {
+        try {
+            byte[] raw = key.getBytes(StandardCharsets.UTF_8);
+            SecretKeySpec secretKeySpec = new SecretKeySpec(raw, "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
+            byte[] encrypted = cipher.doFinal(str.getBytes(StandardCharsets.UTF_8));
+            return HEX(encrypted);
+        } catch (Exception e) {
+            log.error("AES 加密异常", e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static String HEX(byte[] bytes) {
+        StringBuilder hexString = new StringBuilder();
+        for (byte b : bytes) {
+            String hex = Integer.toHexString(0xff & b);
+            if (hex.length() == 1) {
+                hexString.append('0');
+            }
+            hexString.append(hex);
+        }
+        return hexString.toString();
+    }
+
+    /**
+     * 计算签名
+     *
+     * @param params
+     * @return
+     */
+    public static String getSign(JSONObject params, String key) {
+        String sortStr = getFormatParams(params);
+        System.out.println("sortStr = " + sortStr);
+        //第二步:将tradeKey拼接在1中排序后的字符串后面得到待签名字符串。
+        sortStr += "&"+ key;
+        System.out.println("sortStr = " + sortStr);
+        //sortStr += "key=BF1BDE5A649724056F904A9335B1C1C9";
+        //第三步:使用md5算法加密待加密字符串并转为大写即为sign
+//        String sign = DigestUtils.md5DigestAsHex(sortStr.getBytes()).toUpperCase();
+//        System.out.println("sign = " + sign);
+        return sortStr;
+    }
+
+    /**
+     * 字典排序
+     * 获得参数格式化字符串
+     * 参数名按字典排序,小写在后面
+     */
+    private static String getFormatParams(Map<String, Object> params) {
+        List<Map.Entry<String, Object>> infoIds = new ArrayList<Map.Entry<String, Object>>(params.entrySet());
+        Collections.sort(infoIds, new Comparator<Map.Entry<String, Object>>() {
+            public int compare(Map.Entry<String, Object> arg0, Map.Entry<String, Object> arg1) {
+                return (arg0.getKey()).compareTo(arg1.getKey());
+            }
+        });
+        String ret = "";
+        for (Map.Entry<String, Object> entry : infoIds) {
+            ret += entry.getValue();
+            ret += "&";
+        }
+        ret = ret.substring(0, ret.length() - 1);
+        return ret;
+    }
+
+}

+ 113 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/threedocking/impl/WenZhouYueShangXiangCreditService.java

@@ -0,0 +1,113 @@
+package com.hrsk.cloud.eg.app.threedocking.impl;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
+import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
+import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
+import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
+import com.hrsk.cloud.eg.vo.response.DataVo;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * @Author Liu Tao
+ * @Date 2023 12 14 11 48
+ **/
+@Slf4j
+@Component
+public class WenZhouYueShangXiangCreditService  implements LoanDockingApi {
+    @Resource
+    private ProductBusinessApiInfoService apiInfoService;
+
+    @Resource
+    private RetryRestTemplate httpRestTemplate;
+    @Override
+    public ServerCodeEnums  getType() {
+        return ServerCodeEnums.WenZhouYueShangXiang;
+    }
+
+    @Data
+    public static class CheckData{
+        private String tel;
+    }
+
+
+    /**
+     * 撞库 实现单个用户撞库
+     *
+     * @param userInfo
+     * @param product
+     * @return
+     */
+    @Override
+    public DataVo qualityCheck(UserInBaseInfoDto userInfo, PlanDto product) {
+        try {
+            log.info("credit WenZhouYueShangXiangCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
+            ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
+            String configJson = apiInfo.getThreeSystemConfig();
+            JSONObject config = JSONObject.parseObject(configJson);
+            log.info("温州悦尚祥对接参数:{}", JSON.toJSONString(config));
+            String phoneMd5 = userInfo.getPhoneMd5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getPhoneMd5();
+            CheckData checkData = new CheckData();
+            checkData.setTel(phoneMd5);
+            String url = config.getString("checkUrl");
+            log.info("credit qualityCheck WenZhouYueShangXiangCreditService request userId:{}, url:{}, checkData:{}",userInfo.getUserId(), url, checkData);
+            String response = null;
+            try{
+                response =httpRestTemplate.restTemplate().postForObject(url,checkData, String.class);
+            }catch (Exception e){
+                log.error("温州悦尚祥准入异常,异常信息:{}", e.getMessage(), e);
+            }
+            log.info("credit qualityCheck WenZhouYueShangXiangCreditService response userId:{}, result:{}",userInfo.getUserId(), response);
+            if (response == null) {
+                return DataVo.timeout(product.getPlanId(),product.getPlanName());
+            }
+            JSONObject jsonObject=JSONObject.parseObject(response);
+
+            if (jsonObject == null) {
+                return DataVo.timeout(product.getPlanId(), product.getPlanName());
+            }
+            if (jsonObject.getInteger("code") == 0) {
+                return DataVo.success(0, "温州悦尚祥撞库成功", product.getPlanId());
+            }else if (jsonObject.getInteger("code") == 1) {
+                return DataVo.fail(1, "温州悦尚祥撞库失败,该数据对方已存在", product.getPlanId());
+            } else {
+                return DataVo.fail(1, "温州悦尚祥撞库失败,请联系系统管理员", product.getPlanId());
+            }
+        } catch (Exception e) {
+            log.error("温州悦尚祥撞库失败", e);
+            return DataVo.fail(1, "温州悦尚祥撞库失败,请联系系统管理员", product.getPlanId());
+        }
+
+    }
+
+    public static String encrypt(String sSrc, String sKey) throws Exception {
+
+        // 判断Key是否为16位
+        if (sKey.length() != 16) {
+            System.out.print("Key长度不是16位");
+            return null;
+        }
+        byte[] raw = sKey.getBytes("utf-8");
+        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");//"算法/模式/补码方式"
+        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
+        byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
+
+        return new Base64().encodeToString(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+    }
+
+
+
+}

Some files were not shown because too many files changed in this diff