liutao 1 deň pred
rodič
commit
994c56849f
70 zmenil súbory, kde vykonal 1896 pridanie a 399 odobranie
  1. 2 13
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/BaiYiJinFuCreditService.java
  2. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/CangZhouSuYiRonogCreditService.java
  3. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/CheYouRongCreditService.java
  4. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChengDuYiHeShengCreditService.java
  5. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChengHongHuiCreditService.java
  6. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChongQinDongRunCreditService.java
  7. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChongQingRuiShangXinCreditService.java
  8. 8 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChuanjinCreditService.java
  9. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeLuoXuanAesCreditService.java
  10. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeLuoXuanCreditService.java
  11. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeZhouXinYiRongCreditService.java
  12. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeZhouXinYiRongV2CreditService.java
  13. 29 34
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DfrzwCreditService.java
  14. 8 15
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FangxinwangiCreditService.java
  15. 26 14
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuChengCreditService.java
  16. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuZhouBeiJiuCreditService.java
  17. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuZhouBeiYinJinRongCreditService.java
  18. 15 6
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GexinjinfuCreditService.java
  19. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuanZhouPuHuiCreditService.java
  20. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangDongHaoEnCreditService.java
  21. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangDongHongZhanCreditService.java
  22. 1 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangZhouHuaXinCreditService.java
  23. 9 13
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HamiguaCreditService.java
  24. 13 7
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HaohanwuyinCreditService.java
  25. 11 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HeFeiShenDaiCreditService.java
  26. 11 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HeZeRongXinCreditService.java
  27. 3 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HengYangJiuZhenCreditService.java
  28. 17 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HengaiCreditService.java
  29. 10 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HongShengJinFuCreditService.java
  30. 17 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HongXinPuHuiCreditService.java
  31. 11 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuNanDiShuiYanCreditService.java
  32. 16 6
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuirongCrmCreditService.java
  33. 9 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuixinCreditService.java
  34. 17 10
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuizhongCreditService.java
  35. 22 16
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JianZhanCreditService.java
  36. 16 11
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JiechengCreditService.java
  37. 11 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JilingHuiRongCreditService.java
  38. 15 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV2CreditService.java
  39. 14 10
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV3CreditService.java
  40. 12 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV4CreditService.java
  41. 11 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinZhuLiCreditService.java
  42. 13 13
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JindieCreditService.java
  43. 11 1
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JiuXinKeCreditService.java
  44. 11 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiYiRongCreditService.java
  45. 17 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiCreditService.java
  46. 17 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiFourToOneCreditService.java
  47. 17 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiNightCreditService.java
  48. 16 11
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiV2CreditService.java
  49. 23 14
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KunMingXiaoSongShuCreditService.java
  50. 11 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LeXiangRongCreditService.java
  51. 17 8
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LianKeYunKongCreditService.java
  52. 12 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LiaoChengXinYiDaiCreditService.java
  53. 15 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/MoGuTouCreditService.java
  54. 23 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NanTongXingChengCreditService.java
  55. 13 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NiYouKeCreditService.java
  56. 12 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NingBoTianChengCreditService.java
  57. 21 13
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/OpenApiAesCreditService.java
  58. 18 10
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/OpenApiCreditService.java
  59. 16 12
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PingDingShanCreditService.java
  60. 16 15
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PingXunCreditService.java
  61. 8 3
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PubNoCheckCreditService.java
  62. 16 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingDaoAoSengCreditService.java
  63. 15 4
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingDaoAoSengV2CreditService.java
  64. 17 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuCreditService.java
  65. 19 6
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuV2CreditService.java
  66. 18 5
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuV3CreditService.java
  67. 273 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/Base64Utils.java
  68. 51 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/HeadsUtil.java
  69. 658 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/RSAUtils.java
  70. 173 0
      egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/SnowflakeIdWorker.java

+ 2 - 13
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/BaiYiJinFuCreditService.java

@@ -17,6 +17,7 @@ import com.hrsk.cloud.eg.domain.api.channel.guide.common.ValueObjectTypeEnum;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
@@ -128,19 +129,7 @@ public class BaiYiJinFuCreditService implements LoanDockingApi {
 //                Map<String, String> head = new HashMap<>();
 //                head.put("Content-Type", "application/json");
 //                head.put("Authorization", "Bearer "+token);
-                List<KeyValueObject> headers = Lists.newArrayList();
-                KeyValueObject head=new KeyValueObject();
-                head.setType(ValueObjectTypeEnum.BASIC.getType());
-                head.setKey("Content-Type");
-                head.setValue("application/json");
-                KeyValueObject head2=new KeyValueObject();
-                head2.setType(ValueObjectTypeEnum.BASIC.getType());
-                head2.setKey("Authorization");
-                head2.setValue("Bearer "+token);
-                log.info("token{},值:{}",token,"Bearer "+token);
-                headers.add(head2);
-                headers.add(head);
-                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(s,"post",url,headers));
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(s,"post",url, HeadsUtil.getJsonHeaders("Authorization","Bearer "+token)));
                 response2 =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("佰亿金服准入异常,异常信息:{}", e.getMessage(), e);

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/CangZhouSuYiRonogCreditService.java

@@ -62,6 +62,7 @@ public class CangZhouSuYiRonogCreditService implements LoanDockingApi {
 
     }
 
+        @Override
         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit CangZhouSuYiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/CheYouRongCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChengDuYiHeShengCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChengHongHuiCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChongQinDongRunCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChongQingRuiShangXinCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 8 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChuanjinCreditService.java

@@ -12,6 +12,7 @@ import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
@@ -75,21 +76,23 @@ public class ChuanjinCreditService implements LoanDockingApi {
             JSONObject config = JSONObject.parseObject(requestConfig.toString());
             log.info("川金对接参数:{}", JSON.toJSONString(config));
             String url = config.getString("url") + qualityCheckPath;
-            ResResult response = null;
+            HttpApiResponse response = null;
             try {
 
                 url = url + "?phone_encrypt=" + userInfo.getUserMobileMD5() + "&company_id=" + config.getString("channelSource");
                 log.info("credit qualityCheck ChuanjinCreditService request userId:{}, url:{}", userInfo.getUserId(), url);
-                response = httpRestTemplate.restTemplate().postForObject(url, null, ResResult.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(null,"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("川金准入异常,异常信息:{}", e.getMessage(), e);
             }
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
             log.info("credit qualityCheck ChuanjinCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
-            if (response == null) {
+            if (jsonObject == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            return Objects.equals(0, response.getData()) ? DataVo.success(0, "川金撞库成功", product.getPlanId())
-                    : DataVo.fail(1, response.getMsg(), product.getPlanId());
+            return Objects.equals(0, jsonObject.getString("data")) ? DataVo.success(0, "川金撞库成功", product.getPlanId())
+                    : DataVo.fail(1, jsonObject.getString("msg"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("川金撞库失败", e);

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeLuoXuanAesCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeLuoXuanCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeZhouXinYiRongCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DeZhouXinYiRongV2CreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 29 - 34
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/DfrzwCreditService.java

@@ -2,32 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.DateUtil;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
-import com.hrsk.cloud.eg.infrastructure.utils.DateUtil;
-import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.util.EntityUtils;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
 import java.util.Date;
-import java.util.HashMap;
 
 
 /**
@@ -67,11 +59,11 @@ public class DfrzwCreditService implements LoanDockingApi {
         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
 
         String cellPhoneNumber = userInfo.getUserMobileMD5().toLowerCase();
-        Boolean isNotBlack = preFilter(cellPhoneNumber);
-        if(!isNotBlack){
-            log.info("东方融资网准入失败,用户手机号在黑名单中:{}",cellPhoneNumber);
-            return DataVo.fail(1, "东方融资网准入失败,用户手机号在黑名单中", product.getPlanId());
-        }
+//        Boolean isNotBlack = preFilter(cellPhoneNumber);
+//        if(!isNotBlack){
+//            log.info("东方融资网准入失败,用户手机号在黑名单中:{}",cellPhoneNumber);
+//            return DataVo.fail(1, "东方融资网准入失败,用户手机号在黑名单中", product.getPlanId());
+//        }
 
 
         Object deserialize = HessianUtils.deserialize(configInfo.getRequestConfig());
@@ -85,11 +77,14 @@ public class DfrzwCreditService implements LoanDockingApi {
         body.put("Signature", Md5Util.encoderByMd5(cellPhoneNumber + timeStampStr + secret).toLowerCase());
         body.put("UtmSource", data.getString("channelCode"));
         String msg = "";
+        HttpApiResponse response = null;
         try {
             log.info("credit qualityCheck DfrzwCreditService userId:{},url={}, request:{}", userInfo.getUserId(), url, body.toJSONString());
-            String response = httpRestTemplate.restTemplate().postForObject(url + ISREGISTERED, body.toJSONString(), String.class);
+            HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(body.toJSONString(),"post",url + ISREGISTERED));
+            response =httpClientFunc.apply(request);
             log.info("credit qualityCheck DfrzwCreditService userId:{}, response:{}", userInfo.getUserId(), response);
-            if (!StringUtils.isBlank(response)) {
+
+            if (!StringUtils.isBlank((CharSequence) response)) {
                   JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
                 if (jsonObject.getIntValue("Code") == 0) {
                     Boolean isRegistered = jsonObject.getBoolean("IsRegistered");
@@ -114,22 +109,22 @@ public class DfrzwCreditService implements LoanDockingApi {
      * @param
      * @return
      */
-    public Boolean preFilter(String phoneMd5){
-        //todo
-        String url ="";
-//        String url = filterUrl + phoneMd5;
-        try {
-            HttpResponse httpResponse = httpRestTemplate.restTemplate().getForObject(url, null, null, new HashMap<>(), new HashMap<>());
-            String responseStr = EntityUtils.toString(httpResponse.getEntity());
-            JSONObject response = JSONObject.parseObject(responseStr, JSONObject.class);
-            Integer code = response.getInteger("code");
-            if(code != 200){
-                return false;
-            }
-        } catch (Exception e) {
-            log.info("东方融资网接口访问异常:{}",phoneMd5);
-        }
-        return true;
-    }
+//    public Boolean preFilter(String phoneMd5){
+//        //todo
+//        String url ="";
+////        String url = filterUrl + phoneMd5;
+//        try {
+//            HttpResponse httpResponse = httpRestTemplate.restTemplate().getForObject(url, null, null, new HashMap<>(), new HashMap<>());
+//            String responseStr = EntityUtils.toString(httpResponse.getEntity());
+//            JSONObject response = JSONObject.parseObject(responseStr, JSONObject.class);
+//            Integer code = response.getInteger("code");
+//            if(code != 200){
+//                return false;
+//            }
+//        } catch (Exception e) {
+//            log.info("东方融资网接口访问异常:{}",phoneMd5);
+//        }
+//        return true;
+//    }
 
 }

+ 8 - 15
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FangxinwangiCreditService.java

@@ -3,26 +3,21 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
 import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 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.HashMap;
-import java.util.Map;
 import java.util.Objects;
 
 /**
@@ -90,13 +85,10 @@ public class FangxinwangiCreditService implements LoanDockingApi {
             checkInfo.setPhone(userInfo.getUserMobile() != null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getUserMobileMD5());
             String requestBody = JSON.toJSONString(checkInfo);
             log.info("credit qualityCheck FangxinwangCreditService request userId:{},requestBody:{}",userInfo.getUserId(), url,requestBody);
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                Map<String, String> head = new HashMap<>();
-                head.put("Content-Type", "application/json");
-                HttpResponse httpResponse = httpRestTemplate.restTemplate().postForObject(url, null, null, head, null, requestBody);
-                String responseStr = EntityUtils.toString(httpResponse.getEntity());
-                response = JSONObject.parseObject(responseStr,ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(requestBody,"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("放心网准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -104,8 +96,9 @@ public class FangxinwangiCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals(0, response.getCode()) ? DataVo.success(0, "放心网撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals(0,jsonObject.getString("code")) ? DataVo.success(0, "放心网撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("msg"), product.getPlanId());
         } catch (Exception e) {
             log.error("放心网撞库失败", e);
             return DataVo.fail(1, "放心网撞库失败,请联系系统管理员", product.getPlanId());

+ 26 - 14
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuChengCreditService.java

@@ -3,29 +3,29 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
 import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.KeyValueObject;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.ValueObjectTypeEnum;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 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.HashMap;
-import java.util.Map;
+import java.util.List;
 
 /**
  * @Author Liu Tao
@@ -76,14 +76,25 @@ public class FuChengCreditService implements LoanDockingApi {
             }};
             String url = config.getString("checkUrl");
             log.info("credit qualityCheck FuChengCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
-            JSONObject response = null;
+            HttpApiResponse response = null;
             try{
-                Map<String, String> head = new HashMap<>();
-                head.put("Content-Type", "application/json");
-                head.put("channelSign", config.getString("channelSign"));
-                HttpResponse httpResponse = httpRestTemplate.restTemplate().postForObject(url, null, null, head, null, json.toJSONString());
-                String responseStr = EntityUtils.toString(httpResponse.getEntity());
-                response = JSONObject.parseObject(responseStr);
+//                Map<String, String> head = new HashMap<>();
+//                head.put("Content-Type", "application/json");
+//                head.put("channelSign", config.getString("channelSign"));
+                List<KeyValueObject> headers = Lists.newArrayList();
+                KeyValueObject head=new KeyValueObject();
+                head.setType(ValueObjectTypeEnum.BASIC.getType());
+                head.setKey("Content-Type");
+                head.setValue("application/json");
+                KeyValueObject head2=new KeyValueObject();
+                head2.setType(ValueObjectTypeEnum.BASIC.getType());
+                head2.setKey("channelSign");
+                head2.setValue(config.getString("channelSign"));
+                headers.add(head2);
+                headers.add(head);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(json.toJSONString(),"post",url,headers));
+                response =httpClientFunc.apply(request);
+
             }catch (Exception e){
                 log.error("福程准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -91,7 +102,8 @@ public class FuChengCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (response.getString("code").equals("200")) {
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject.getString("code").equals("200")) {
                 return DataVo.success(0, "福程撞库成功", product.getPlanId());
             } else {
                 return DataVo.fail(1, "福程撞库失败,请联系系统管理员", product.getPlanId());

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuZhouBeiJiuCreditService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/FuZhouBeiYinJinRongCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 15 - 6
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GexinjinfuCreditService.java

@@ -3,6 +3,8 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
@@ -10,8 +12,12 @@ import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.KeyValueObject;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.ValueObjectTypeEnum;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
@@ -20,6 +26,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
@@ -84,11 +91,12 @@ public class GexinjinfuCreditService implements LoanDockingApi {
             String md5 = userInfo.getUserMobileMD5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getUserMobileMD5();
             String url = gexinjinfuJointDTO.getString("url") + qualityCheckPath  + "?mobnum_md5=" +  md5;
             log.info("credit qualityCheck GexinjinfuCreditService request userId:{}, url:{}, checkData:{}",userInfo.getUserId(), url);
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                Map<String, String> head = new HashMap<>();
-                head.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
-                 response = httpRestTemplate.restTemplate().getForObject(url, ResultHt.class,head);
+//                Map<String, String> head = new HashMap<>();
+//                head.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(null,"post",url, HeadsUtil.getFromHeaders(null,null)));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("格鑫金服准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -96,8 +104,9 @@ public class GexinjinfuCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals(200, response.getStatus()) ? DataVo.success(0, "格鑫金服撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals(200, jsonObject.getString("status")) ? DataVo.success(0, "格鑫金服撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("msg"), product.getPlanId());
         } catch (Exception e) {
             log.error("格鑫金服撞库失败", e);
             return DataVo.fail(1, "格鑫金服撞库失败,请联系系统管理员", product.getPlanId());

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuanZhouPuHuiCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangDongHaoEnCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangDongHongZhanCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 1 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/GuangZhouHuaXinCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;

+ 9 - 13
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HamiguaCreditService.java

@@ -3,26 +3,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
 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.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -91,14 +87,13 @@ public class HamiguaCreditService implements LoanDockingApi {
 //            checkInfo.setData(checkData);
             String url = hamiguaJointDTO.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck HamiguaCreditService request userId:{}, url:{}, checkData:{}",userInfo.getUserId(), url, checkData);
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
                 Map<String, String> head = new HashMap<>();
                 head.put("Content-Type", "application/json");
                 head.put("secret", hamiguaJointDTO.getString("clientSecret"));
-                HttpResponse httpResponse = httpRestTemplate.restTemplate().postForObject(url, null, null, head, null, JSON.toJSONString(checkData));
-                String responseStr = EntityUtils.toString(httpResponse.getEntity());
-                response = JSONObject.parseObject(responseStr,ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(JSON.toJSONString(checkData),"post",url, HeadsUtil.getJsonHeaders("secret",hamiguaJointDTO.getString("clientSecret"))));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("哈密瓜准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -106,8 +101,9 @@ public class HamiguaCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals(10, response.getCode()) ? DataVo.success(0, "哈密瓜撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMessage(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals(10, jsonObject.getString("code")) ? DataVo.success(0, "哈密瓜撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("message"), product.getPlanId());
         } catch (Exception e) {
             log.error("哈密瓜撞库失败", e);
             return DataVo.fail(1, "哈密瓜撞库失败,请联系系统管理员", product.getPlanId());

+ 13 - 7
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HaohanwuyinCreditService.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
@@ -11,7 +12,9 @@ import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
@@ -89,12 +92,14 @@ public class HaohanwuyinCreditService implements LoanDockingApi {
             checkData.put("md5_phone", phoneMd5);
             String url = HaohanwuyinJointDTO.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck HaohanwuyinCreditService request userId:{}, url:{}, checkData:{}",userInfo.getUserId(), url, checkData);
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                Map<String, String> head = new HashMap<>();
-                head.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
-                String httpResponse = httpRestTemplate.restTemplate().postForObject(url,  head,String.class, checkData);
-                response = JSONObject.parseObject(httpResponse,ResultHt.class);
+//                Map<String, String> head = new HashMap<>();
+//                head.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+//                String httpResponse = httpRestTemplate.restTemplate().postForObject(url,  head,String.class, checkData);
+//                response = JSONObject.parseObject(httpResponse,ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkData),"post",url, HeadsUtil.getFromHeaders(null,null)));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("灏瀚无崟准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -102,8 +107,9 @@ public class HaohanwuyinCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals(0, response.getCode()) ? DataVo.success(0, "灏瀚无崟撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals(0, jsonObject.getString("code")) ? DataVo.success(0, "灏瀚无崟撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("msg"), product.getPlanId());
         } catch (Exception e) {
             log.error("灏瀚无崟撞库失败", e);
             return DataVo.fail(1, "灏瀚无崟撞库失败,请联系系统管理员", product.getPlanId());

+ 11 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HeFeiShenDaiCreditService.java

@@ -1,6 +1,9 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
+import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
@@ -8,6 +11,9 @@ import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
 import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
@@ -51,19 +57,20 @@ public class HeFeiShenDaiCreditService implements LoanDockingApi {
     }
 
 
-    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfoDo) {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
             log.info("credit HeFeiShenDaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-            byte[] requestConfig = configInfoDo.getRequestConfig();
+            byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
             log.info("合肥盛代对接参数:{}", JSONObject.toJSONString(config));
             String Phone_md5=(userInfo.getUserMobileMD5() == null ? Md5Util.encoderByMd5(userInfo.getUserMobile()) : userInfo.getUserMobileMD5());
             String url = config.getString("checkUrl")+Phone_md5;
             log.info("credit qualityCheck HeFeiShenDaiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, Phone_md5);
-            String response = null;
+            HttpApiResponse response = null;
             try{
-                response =httpRestTemplate.restTemplate().getForObject(url, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(null,"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("合肥盛代准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 11 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HeZeRongXinCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -47,7 +57,7 @@ public class HeZeRongXinCreditService implements LoanDockingApi {
         private Integer credit;//是否有信用卡 (  1:有  0:无 )
     }
 
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HeZeRongXinCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 3 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HengYangJiuZhenCreditService.java

@@ -2,12 +2,15 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.clinet.vo.DataVo;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
 import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import com.hrsk.cloud.eg.domain.common.HessianUtils;

+ 17 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HengaiCreditService.java

@@ -2,16 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.core.env.Environment;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -89,7 +95,7 @@ public class HengaiCreditService implements LoanDockingApi {
     }
 
 
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HengaiCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
@@ -115,12 +121,10 @@ public class HengaiCreditService implements LoanDockingApi {
                 url = config.getString("url") + qualityCheckPathTest;
             }
             log.info("credit qualityCheck HengaiCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            ResultHa response = null;
+            HttpApiResponse response = null;
             try {
-                HttpHeaders headers = new HttpHeaders();
-                headers.setContentType(MediaType.valueOf("application/json;UTF-8"));
-                HttpEntity<CheckInfo> entity = new HttpEntity(checkInfo, headers);
-                response = httpRestTemplate.restTemplate().postForObject(url, entity, ResultHa.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(JSON.toJSONString(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("恒爱准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -128,8 +132,9 @@ public class HengaiCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            return 0 == response.getErrcode() ? DataVo.success(0, "恒爱撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return 0 == jsonObject.getInteger("errcode") ? DataVo.success(0, "恒爱撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("msg"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("恒爱撞库失败", e);

+ 10 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HongShengJinFuCreditService.java

@@ -1,10 +1,19 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpEntity;
@@ -59,7 +68,7 @@ public class HongShengJinFuCreditService implements LoanDockingApi {
         private String remark;
     }
 
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
 
             byte[] requestConfig = configInfo.getRequestConfig();

+ 17 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HongXinPuHuiCreditService.java

@@ -1,17 +1,24 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 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.HashMap;
 import java.util.Map;
 
@@ -60,7 +67,7 @@ public class HongXinPuHuiCreditService implements LoanDockingApi {
         private Integer is_encrypt;//是否加密(1:是 0:否)
     }
 
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HongXinPuHuiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 
@@ -80,13 +87,10 @@ public class HongXinPuHuiCreditService implements LoanDockingApi {
             requestData.put("is_encrypt", String.valueOf(checkInfo.getIs_encrypt()));
             String url = config.getString("checkUrl");
             log.info("credit qualityCheck HongXinPuHuiCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
-            JSONObject response = null;
+            HttpApiResponse 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);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(requestData),"post",url, HeadsUtil.getFromHeaders(null,null)));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("弘鑫普惠准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -94,7 +98,8 @@ public class HongXinPuHuiCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (response.getInteger("code")==0) {
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject.getInteger("code")==0) {
                 return DataVo.success(0, "弘鑫普惠撞库成功", product.getPlanId());
             } else {
                 return DataVo.fail(1, "弘鑫普惠撞库失败,请联系系统管理员", product.getPlanId());

+ 11 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuNanDiShuiYanCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
@@ -49,7 +59,7 @@ public class HuNanDiShuiYanCreditService implements LoanDockingApi {
         private Integer note; //备注可为空(其他信息可传这
     }
 
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HuNanDiShuiYanCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 16 - 6
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuirongCrmCreditService.java

@@ -2,10 +2,19 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -49,12 +58,13 @@ public class HuirongCrmCreditService implements LoanDockingApi {
      *
      * @return {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
-    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfoCmd) {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HuirongCrmCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
-            String config = HessianUtils.deserialize(configInfoCmd.getRequestConfig()).toString();
-            JSONObject huirongJointDTO = JSON.parseObject(config);
-            String url = huirongJointDTO.getString("checkUrl");
+            byte[] requestConfig = configInfo.getRequestConfig();
+            Object deserialize = HessianUtils.deserialize(requestConfig);
+            JSONObject config = JSONObject.parseObject(deserialize.toString());
+            String url = config.getString("checkUrl");
             CheckData checkData = new CheckData();
             if(StringUtils.isNotBlank(userInfo.getUserMobile())){
                 checkData.setAttackPhone(Md5Util.encoderByMd5(userInfo.getUserMobile()));
@@ -62,8 +72,8 @@ public class HuirongCrmCreditService implements LoanDockingApi {
                 checkData.setAttackPhone(userInfo.getUserMobileMD5());
             }
 
-            checkData.setSecretKey(huirongJointDTO.getString("secretKey"));
-            checkData.setChanelCode(huirongJointDTO.getString("channelCode"));
+            checkData.setSecretKey(config.getString("secretKey"));
+            checkData.setChanelCode(config.getString("channelCode"));
             checkData.setMerchantNo(product.getBid());
             String requestJson = JSON.toJSONString(checkData);
             log.info("credit qualityCheck HuirongCrmCreditService request userId:{}, url:{},requestParam:{}", userInfo.getUserId(), url, requestJson);

+ 9 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuixinCreditService.java

@@ -1,10 +1,18 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
+import com.hrsk.cloud.eg.client.vo.DataVo;
 import com.hrsk.cloud.eg.clinet.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
 import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
 import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
@@ -82,7 +90,7 @@ public class HuixinCreditService implements LoanDockingApi {
      * @param product
      * @return {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HuixinCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());

+ 17 - 10
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/HuizhongCreditService.java

@@ -2,19 +2,23 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 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.*;
 import javax.crypto.spec.DESedeKeySpec;
 import javax.crypto.spec.IvParameterSpec;
@@ -84,7 +88,8 @@ public class HuizhongCreditService implements LoanDockingApi {
      * @return
      *  {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+    @Override
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit HuizhongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
@@ -98,9 +103,10 @@ public class HuizhongCreditService implements LoanDockingApi {
             checkInfo.setChannelSource(config.getString("channelSource"));
             String url = config.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck HuizhongCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("惠众准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -108,8 +114,9 @@ public class HuizhongCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals("0000", response.getCode()) ? DataVo.success(0, "惠众撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals("0000", jsonObject.getString("code")) ? DataVo.success(0, "惠众撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("msg"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("惠众撞库失败", e);

+ 22 - 16
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JianZhanCreditService.java

@@ -2,17 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 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.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.HashMap;
@@ -83,12 +90,11 @@ public class JianZhanCreditService implements LoanDockingApi {
     }
 
     @Override
-    public DataVo qualityCheck(UserBaseInfoCmd user, PlanCmd product, EgLoanApiConfigInfoCmd configInfoCmd) {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
-            log.info("credit JianZhanCreditService qualityCheck begin...userId:{}", user.getUserMobileMD5());
+            log.info("credit JianZhanCreditService qualityCheck begin...userId:{}", userInfo.getUserMobileMD5());
 
-            byte[] requestConfig =
-            configInfoCmd.getRequestConfig();
+            byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
             log.info("建站100对接参数:{}", JSON.toJSONString(config));
@@ -99,7 +105,7 @@ public class JianZhanCreditService implements LoanDockingApi {
             String formattedDateTime = now.format(formatter);
             CheckInfo checkInfo = new CheckInfo();
             checkInfo.setAct(config.getString("checkAct"));
-            checkInfo.setC_phone(user.getUserMobileMD5());
+            checkInfo.setC_phone(userInfo.getUserMobileMD5());
             checkInfo.setAid(config.getString("aid"));
             checkInfo.setNoncestr(formattedDateTime);
             checkInfo.setTimestamp(formattedDateTime);
@@ -114,22 +120,22 @@ public class JianZhanCreditService implements LoanDockingApi {
             requestData.put("signature",checkInfo.getSignature());
 
             String url = config.getString("url");
-            log.info("credit qualityCheck JianZhanCreditService request userId:{}, url:{}, CheckInfo:{}", requestData, url, user.getUserMobileMD5());
+            log.info("credit qualityCheck JianZhanCreditService request userId:{}, url:{}, CheckInfo:{}", requestData, url, userInfo.getUserMobileMD5());
             Map<String, String> header = new HashMap<>();
             header.put("Content-Type", "application/x-www-form-urlencoded");
             String res = "";
-            JSONObject jsonObject = new JSONObject();
+            HttpApiResponse response = null;
             try{
-                HttpResponse response = httpRestTemplate.restTemplate().postForObject(url, null, null, header, null, requestData);
-                res = EntityUtils.toString(response.getEntity());
-                jsonObject = JSON.parseObject(res);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(requestData),"post",url, HeadsUtil.getFromHeaders(null,null)));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("建站100准入异常,异常信息:{}", e.getMessage(), e);
             }
-            log.info("credit qualityCheck JianZhanCreditService response userId:{}, result:{}",user.getUserMobileMD5(), jsonObject);
-            if (jsonObject == null) {
+            if (response == null) {
                  return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            log.info("credit qualityCheck JianZhanCreditService response userId:{}, result:{}",userInfo.getUserMobileMD5(), jsonObject);
             if (jsonObject.getString("status").equals("0")) {
                 return DataVo.success(0, "建站100撞库成功", product.getPlanId());
             } else {

+ 16 - 11
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JiechengCreditService.java

@@ -2,19 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-
 /**
  * 捷诚API接单
  */
@@ -39,7 +42,7 @@ public class JiechengCreditService implements LoanDockingApi {
      *  {"key":"5lvNIA1Kmchq2gu3C9P5g+rttvQXq3lh","url":"http://www.cs.ahaiyu.com"}
      */
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JiechengCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
@@ -52,9 +55,10 @@ public class JiechengCreditService implements LoanDockingApi {
             checkInfo.setPhoneMd5(userInfo.getUserMobileMD5());
             String url = config.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck JiechengCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
-            ResultJc response = null;
+            HttpApiResponse response = null;
             try{
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, ResultJc.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("捷诚准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -62,8 +66,9 @@ public class JiechengCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return response.getCode() == 200 && response.getData().equals("1") ? DataVo.success(0, "捷诚撞库成功", product.getPlanId())
-                    : DataVo.fail("捷诚撞库失败:" + response.getMessage(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return jsonObject.getInteger("code") == 200 && response.getData().equals("1") ? DataVo.success(0, "捷诚撞库成功", product.getPlanId())
+                    : DataVo.fail("捷诚撞库失败:" + jsonObject.getInteger("message"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("捷诚撞库失败", e);

+ 11 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JilingHuiRongCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -43,7 +53,7 @@ public class JilingHuiRongCreditService implements LoanDockingApi {
      *
      */
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JilingHuiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 15 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV2CreditService.java

@@ -3,10 +3,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -46,7 +56,7 @@ public class JinDieV2CreditService implements LoanDockingApi {
      * @return {"url":"http://apitest.shlyxxjs.com","key":"fluxZhudai*_key","tenantId":"1405729496904110081","trafficPlatformId":"13872425018351111"}
      */
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
             log.info("credit JindieV2CreditService qualityCheck begin...userId:{},productId={}", userInfo.getUserId(), product.getPlanId());
 
@@ -63,9 +73,10 @@ public class JinDieV2CreditService implements LoanDockingApi {
             }};
             String url = config.getString("CheckUrl");
             log.info("credit qualityCheck JindieV2CreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, jsonObject);
-            String response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, jsonObject, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(jsonObject),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("【{}】-锦蝶V2.0准入异常,异常信息:{}", product.getPlanName(), e.getMessage(), e);
             }
@@ -73,7 +84,7 @@ public class JinDieV2CreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            JSONObject res = JSONObject.parseObject(response);
+            JSONObject res=JSONObject.parseObject(response.getData().toString());
             if (res.getInteger("result") == 400) {
                 return DataVo.success(0, "【" + product.getPlanName() + "】-锦蝶V2.0撞库成功", product.getPlanId());
             } else {

+ 14 - 10
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV3CreditService.java

@@ -2,20 +2,23 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
-
 /**
  * @Author Liu Tao
  * @Date 2023 12 01 16 54
@@ -53,7 +56,7 @@ public class JinDieV3CreditService implements LoanDockingApi {
      * @return {"url":"http://apitest.shlyxxjs.com","key":"fluxZhudai*_key","tenantId":"1405729496904110081","trafficPlatformId":"13872425018351111"}
      */
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
             log.info("credit JinDieV3CreditService qualityCheck begin...userId:{},productId={}", userInfo.getUserId(), product.getPlanId());
             String configJson = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
@@ -69,9 +72,10 @@ public class JinDieV3CreditService implements LoanDockingApi {
             }};
             String url = config.getString("CheckUrl");
             log.info("credit qualityCheck JinDieV3CreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, jsonObject);
-            String response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, jsonObject, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(jsonObject),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("【{}】-锦蝶V3.0准入异常,异常信息:{}", product.getPlanName(), e.getMessage(), e);
             }
@@ -79,7 +83,7 @@ public class JinDieV3CreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            JSONObject res = JSONObject.parseObject(response);
+            JSONObject res=JSONObject.parseObject(response.getData().toString());
             if (res.getInteger("result") == 400) {
                 return DataVo.success(0, "【" + product.getPlanName() + "】-锦蝶V3.0撞库成功", product.getPlanId());
             } else {

+ 12 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinDieV4CreditService.java

@@ -1,10 +1,21 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
+import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -34,7 +45,7 @@ public class JinDieV4CreditService implements LoanDockingApi {
     }
 
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JinDieV4CreditService qualityCheck begin...userId:{}", userInfo.getUserId());
 

+ 11 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JinZhuLiCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -66,7 +76,7 @@ public class JinZhuLiCreditService  implements LoanDockingApi {
     }
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JinZhuLiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 13 - 13
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JindieCreditService.java

@@ -2,20 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-
 /**
  * 锦蝶API接单
  */
@@ -39,11 +41,11 @@ public class JindieCreditService implements LoanDockingApi {
      * @return {"url":"https://jyw.jinchen.cc","Appid":"zZyeD3+kkEQVRWno","Appkey":"y52RC3muwUdtOhWe1Z0qo8FlFA","Channel":"网络渠道","ChannelInfo":"融5"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JindieCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -66,7 +68,8 @@ public class JindieCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (JSON.parseObject(response).getInteger("result") == 400 ) {
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject.getInteger("result") == 400 ) {
                 return DataVo.success(0, "锦蝶撞库成功", product.getPlanId());
             } else {
                 return DataVo.fail("锦蝶撞库失败", product.getPlanId());
@@ -80,13 +83,10 @@ public class JindieCreditService implements LoanDockingApi {
 
     @Data
     private static class CheckInfo {
-        @JsonProperty(value ="Appid")
         private String Appid;
 
-        @JsonProperty(value ="Appkey")
         private String Appkey;
 
-        @JsonProperty(value ="Userphone")
         private String Userphone;
     }
 

+ 11 - 1
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/JiuXinKeCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -43,7 +53,7 @@ public class JiuXinKeCreditService implements LoanDockingApi {
      * @return
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit JiuXinKeCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 11 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiYiRongCreditService.java

@@ -3,16 +3,23 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-
 /**
  * @Author Liu Tao
  * @Date 2023 08 31 10 54k
@@ -45,7 +52,7 @@ public class KuaiYiRongCreditService implements LoanDockingApi {
      *  {"channel_code":"34","checkUrl":"http://120.46.41.14:8888/api/customer/collisionLibrary","channel_secret_key":"HrYk20230829KYR6"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KuaiYiRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 17 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiCreditService.java

@@ -2,18 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -57,11 +61,11 @@ public class KuaiyidaiCreditService implements LoanDockingApi {
      *  {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KuaiyidaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
-           
+
             String configJson = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
             JSONObject kuaiyidaiJointDTO = JSONObject.parseObject(configJson);
             log.info("快易贷对接参数:{}", JSON.toJSONString(kuaiyidaiJointDTO));
@@ -74,10 +78,10 @@ public class KuaiyidaiCreditService implements LoanDockingApi {
 
             String url = kuaiyidaiJointDTO.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck KuaiyidaiCreditService request userId:{}, url:{}, data:{}",userInfo.getUserId(), url, JSON.toJSONString(paramMap));
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                JSONObject resJson = httpRestTemplate.restTemplate().postForEntity(url,paramMap,JSONObject.class).getBody();
-                response = JSON.parseObject(resJson.toJSONString(), ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(paramMap),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("快易贷准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -85,8 +89,9 @@ public class KuaiyidaiCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals("200", response.getStatus()) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMes(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals("200", jsonObject.getString("status")) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("mes"), product.getPlanId());
         } catch (Exception e) {
             log.error("快易贷撞库失败", e);
             return DataVo.fail(1, "快易贷撞库失败,请联系系统管理员", product.getPlanId());

+ 17 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiFourToOneCreditService.java

@@ -2,18 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -52,10 +56,10 @@ public class KuaiyidaiFourToOneCreditService implements LoanDockingApi {
      *  {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KuaiyidaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-           
+
             String configJson = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
             JSONObject kuaiyidaiJointDTO = JSON.parseObject(configJson);
             log.info("快易贷对接参数:{}", JSON.toJSONString(kuaiyidaiJointDTO));
@@ -69,10 +73,10 @@ public class KuaiyidaiFourToOneCreditService implements LoanDockingApi {
 
             String url = kuaiyidaiJointDTO.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck KuaiyidaiCreditService request userId:{}, url:{}, data:{}",userInfo.getUserId(), url, JSON.toJSONString(paramMap));
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                JSONObject resJson = httpRestTemplate.restTemplate().postForEntity(url,paramMap,JSONObject.class).getBody();
-                response = JSON.parseObject(resJson.toJSONString(), ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(paramMap),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("快易贷准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -80,8 +84,9 @@ public class KuaiyidaiFourToOneCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals("200", response.getStatus()) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMes(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals("200", jsonObject.getString("status")) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("mes"), product.getPlanId());
         } catch (Exception e) {
             log.error("快易贷撞库失败", e);
             return DataVo.fail(1, "快易贷撞库失败,请联系系统管理员", product.getPlanId());

+ 17 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiNightCreditService.java

@@ -2,20 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -57,10 +61,10 @@ public class KuaiyidaiNightCreditService implements LoanDockingApi {
      *  {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KuaiyidaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-           
+
             String configJson = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
             JSONObject kuaiyidaiJointDTO = JSON.parseObject(configJson);
             log.info("快易贷对接参数:{}", JSON.toJSONString(kuaiyidaiJointDTO));
@@ -74,10 +78,10 @@ public class KuaiyidaiNightCreditService implements LoanDockingApi {
 
             String url = kuaiyidaiJointDTO.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck KuaiyidaiCreditService request userId:{}, url:{}, data:{}",userInfo.getUserId(), url, JSON.toJSONString(paramMap));
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                JSONObject resJson = httpRestTemplate.restTemplate().postForEntity(url,paramMap,JSONObject.class).getBody() ;
-                response = JSON.parseObject(resJson.toJSONString(), ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(paramMap),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("快易贷准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -85,8 +89,9 @@ public class KuaiyidaiNightCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals("200", response.getStatus()) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMes(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals("200",jsonObject.getString("status")) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("mes"), product.getPlanId());
         } catch (Exception e) {
             log.error("快易贷撞库失败", e);
             return DataVo.fail(1, "快易贷撞库失败,请联系系统管理员", product.getPlanId());

+ 16 - 11
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KuaiyidaiV2CreditService.java

@@ -2,18 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -64,7 +68,7 @@ public class KuaiyidaiV2CreditService implements LoanDockingApi {
      *  {"channelSource":"birong","url":"http://apitest.shlyxxjs.com","key":"mgjr@3des123#dhjr9763089"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KuaiyidaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 
@@ -80,10 +84,10 @@ public class KuaiyidaiV2CreditService implements LoanDockingApi {
 
             String url = kuaiyidaiJointDTO.getString("url");
             log.info("credit qualityCheck KuaiyidaiCreditService request userId:{}, url:{}, data:{}",userInfo.getUserId(), url, JSON.toJSONString(paramMap));
-            ResultHt response = null;
+            HttpApiResponse response = null;
             try{
-                JSONObject resJson = httpRestTemplate.restTemplate().postForEntity(url,paramMap,JSONObject.class).getBody();
-                response = JSON.parseObject(resJson.toJSONString(), ResultHt.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(paramMap),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("快易贷准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -91,8 +95,9 @@ public class KuaiyidaiV2CreditService implements LoanDockingApi {
             if (response == null) {
                 return  DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            return Objects.equals("200", response.getStatus()) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMes(), product.getPlanId());
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            return Objects.equals("200",jsonObject.getString("status")) ? DataVo.success(0, "快易贷撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject.getString("mes"), product.getPlanId());
         } catch (Exception e) {
             log.error("快易贷撞库失败", e);
             return DataVo.fail(1, "快易贷撞库失败,请联系系统管理员", product.getPlanId());

+ 23 - 14
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/KunMingXiaoSongShuCreditService.java

@@ -2,18 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * @Author Liu Tao
  * @Date 2023 10 20 10 46
@@ -43,7 +49,7 @@ public class KunMingXiaoSongShuCreditService implements LoanDockingApi {
      * @return
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit KunMingXiaoSongShuCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 
@@ -56,14 +62,16 @@ public class KunMingXiaoSongShuCreditService implements LoanDockingApi {
             checkInfo.setMd5CusPhone(phoneMd5);
             String url = config.getString("checkUrl")+"/"+checkInfo.getMd5CusPhone();
             log.info("credit qualityCheck KunMingXiaoSongShuCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
-            JSONObject response = null;
+            HttpApiResponse response = null;
             try{
-                Map<String, String> head = new HashMap<>();
-                head.put("Content-Type", "application/json; charset=utf-8");
-                head.put("access-control-allow-origin","*");
-                String httpResponse =  httpRestTemplate.restTemplate().getForObject(url, String.class,  head);
-                log.info("昆明小松鼠撞库响应数据:{}", httpResponse);
-                response = JSON.parseObject(httpResponse);
+//                Map<String, String> head = new HashMap<>();
+//                head.put("Content-Type", "application/json; charset=utf-8");
+//                head.put("access-control-allow-origin","*");
+//                String httpResponse =  httpRestTemplate.restTemplate().getForObject(url, String.class,  head);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(null,"post",url, HeadsUtil.getJsonHeaders("access-control-allow-origin","*")));
+                response =httpClientFunc.apply(request);
+                log.info("昆明小松鼠撞库响应数据:{}", response);
+//                response = JSON.parseObject(httpResponse);
             }catch (Exception e){
                 log.error("昆明小松鼠代准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -71,7 +79,8 @@ public class KunMingXiaoSongShuCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(),product.getPlanName());
             }
-            if (response.getInteger("Code") == 1  && response.getString("Data").equals("false")) {
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject.getInteger("Code") == 1  && jsonObject.getString("Data").equals("false")) {
                 return DataVo.success(0, "昆明小松鼠代撞库成功", product.getPlanId());
             } else {
                 return DataVo.fail(1, "昆明小松鼠代撞库失败,请联系系统管理员", product.getPlanId());

+ 11 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LeXiangRongCreditService.java

@@ -2,15 +2,22 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
 /**
  * @Author Liu Tao
  * @Date 2024 07 18 14 51
@@ -34,7 +41,7 @@ public class LeXiangRongCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit LeXiangRongCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 17 - 8
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LianKeYunKongCreditService.java

@@ -2,17 +2,25 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
-import com.hrsk.cloud.eg.infrastructure.utils.RSAUtils;
-import com.hrsk.cloud.eg.infrastructure.utils.SnowflakeIdWorker;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
+import com.hrsk.cloud.eg.domain.common.RSAUtils;
+import com.hrsk.cloud.eg.domain.common.SnowflakeIdWorker;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.security.interfaces.RSAPublicKey;
 import java.time.Instant;
@@ -66,10 +74,10 @@ public class LianKeYunKongCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit LianKeYunKongCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -93,9 +101,10 @@ public class LianKeYunKongCreditService implements LoanDockingApi {
             requestParam.setConfigName(config.getString("configNameCheck"));
             String url = config.getString("checkUrl");
             log.info("credit qualityCheck LianKeYunKongCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, phoneMd5);
-            String response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, requestParam, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(requestParam),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("链客云控准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 12 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/LiaoChengXinYiDaiCreditService.java

@@ -2,16 +2,23 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-
 /**
  * @Author Liu Tao
  * @Date 2023 08 22 09 57
@@ -49,11 +56,11 @@ public class LiaoChengXinYiDaiCreditService implements LoanDockingApi {
      *  {"source":"xy_dxhb","checkUrl":"http://api-crm.krdcrm.cn:8181/home/encryptCheckCustomer","publicKey":"hxW7zT4BI9siImpE"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit LiaoChengXinYiDaiCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());

+ 15 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/MoGuTouCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -40,10 +50,10 @@ public class MoGuTouCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit SouYuJinFuCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -60,9 +70,10 @@ public class MoGuTouCreditService implements LoanDockingApi {
             String url = config.getString("checkUrl");
 
             log.info("credit qualityCheck MoGuTouCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            String response = null;
+            HttpApiResponse response = null;
             try {
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("蘑菇投准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 23 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NanTongXingChengCreditService.java

@@ -2,17 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
-import com.hrsk.cloud.eg.infrastructure.utils.RSAUtils;
-import com.hrsk.cloud.eg.infrastructure.utils.RedisUtil;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
+import com.hrsk.cloud.eg.domain.common.RSAUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.security.interfaces.RSAPublicKey;
 import java.util.concurrent.TimeUnit;
 
@@ -25,8 +32,6 @@ import java.util.concurrent.TimeUnit;
 public class NanTongXingChengCreditService implements LoanDockingApi {
 
 
-    @Resource
-    private RedisUtil redisUtil;
 
 
     @Override
@@ -49,10 +54,10 @@ public class NanTongXingChengCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit NanTongXingChengCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -70,9 +75,10 @@ public class NanTongXingChengCreditService implements LoanDockingApi {
             request.setData(data);
             String url = config.getString("checkUrl");
             log.info("credit qualityCheck NanTongXingChengCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, phoneMd5);
-            String response = null;
+            HttpApiResponse response = null;
             try{
-                response =httpRestTemplate.restTemplate().postForObject(url,request, String.class);
+                HttpApiRequest request2=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(request),"post",url));
+                response =httpClientFunc.apply(request2);
             }catch (Exception e){
                 log.error("南通星辰准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -85,8 +91,13 @@ public class NanTongXingChengCreditService implements LoanDockingApi {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
             if (jsonObject.getString("result").equals("true")) {
-                redisUtil.set(String.format("zudai:token:%s:%s", "nantong", phoneMd5), jsonObject.getString("token"),1, TimeUnit.DAYS);
-                return DataVo.success(0, "南通星辰撞库成功", product.getPlanId());
+                RedisSetDto redisSetDto=new RedisSetDto();
+                redisSetDto.setKey(String.format("zudai:token:%s:%s", "nantong", phoneMd5));
+                redisSetDto.setValue(jsonObject.getString("token"));
+                redisSetDto.setTime(1);
+                redisSetDto.setTimeUnit(TimeUnit.DAYS);
+                redisSetFunction.apply(redisSetDto);
+               return DataVo.success(0, "南通星辰撞库成功", product.getPlanId());
             } else {
                 return DataVo.fail(1, "南通星辰撞库失败,请联系系统管理员", product.getPlanId());
             }

+ 13 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NiYouKeCreditService.java

@@ -1,16 +1,24 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
+import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
-
 /**
  * @Author Liu Tao
  * @Date 2024 06 06 13 43
@@ -21,7 +29,7 @@ public class NiYouKeCreditService implements LoanDockingApi {
 
 
     @Override
-    public ServerCodeEnums  getType() {
+    public ServerCodeEnums getType() {
         return ServerCodeEnums.NiYouKe;
     }
     @Data
@@ -33,7 +41,7 @@ public class NiYouKeCreditService implements LoanDockingApi {
     }
 
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit NiYouKeCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
 

+ 12 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/NingBoTianChengCreditService.java

@@ -2,16 +2,23 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
-
 /**
  * @Author Liu Tao
  * @Date 2023 10 23 16 56
@@ -50,10 +57,10 @@ public class NingBoTianChengCreditService implements LoanDockingApi {
      *
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit NingBoTianChengCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());

+ 21 - 13
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/OpenApiAesCreditService.java

@@ -1,18 +1,22 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.Objects;
 
 /**
@@ -46,7 +50,7 @@ public class OpenApiAesCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         log.info("credit OpenApiAesCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
         try {
             byte[] requestConfig = configInfo.getRequestConfig();
@@ -59,19 +63,23 @@ public class OpenApiAesCreditService implements LoanDockingApi {
             checkInfo.setPhoneMd5(userInfo.getUserMobileMD5());
             checkInfo.setCity(userInfo.getCompanyCity());
             log.info("credit qualityCheck OpenApiAesCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            Result response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, Result.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
-                log.error("OpenAPI准入异常,异常信息:{}", e.getMessage(), e);
+                log.error("OpenAPIAES准入异常,异常信息:{}", e.getMessage(), e);
             }
-            log.info("credit qualityCheck OpenApiAesCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
+            log.info("credit qualityCheck OpenApiAESCreditService response userId:{}, result:{}", userInfo.getUserId(), response);
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            return Objects.equals(0, response.getCode()) && Objects.equals(0, response.getData().getInteger("status")) ?
-                   DataVo.success(0, "OpenAPI撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+            JSONObject jsonObject2=JSONObject.parseObject(response.getData().toString());
+            String data = jsonObject2.getString("data");
+            JSONObject jsonObject1 = JSONObject.parseObject(data);
+            return Objects.equals(0, jsonObject2.getInteger("code")) && Objects.equals(0, jsonObject1.getInteger("status")) ?
+                    DataVo.success(0, "OpenAPIAES撞库成功", product.getPlanId())
+                    : DataVo.fail(jsonObject2.getString("msg"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("OpenAPI撞库失败", e);

+ 18 - 10
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/OpenApiCreditService.java

@@ -1,19 +1,23 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.Objects;
 
 /**
@@ -50,7 +54,7 @@ public class OpenApiCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         log.info("credit OpenApiCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
         try {
             String config = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
@@ -63,9 +67,10 @@ public class OpenApiCreditService implements LoanDockingApi {
             checkInfo.setCity(userInfo.getCompanyCity());
             String url = jsonObject.getString("openapiCheckUrl");
             log.info("credit qualityCheck OpenApiCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            Result response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, Result.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("OpenAPI准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -73,9 +78,12 @@ public class OpenApiCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            return Objects.equals(0, response.getCode()) && Objects.equals(0, response.getData().getInteger("status")) ?
+            JSONObject jsonObject2=JSONObject.parseObject(response.getData().toString());
+            String data = jsonObject2.getString("data");
+            JSONObject jsonObject1 = JSONObject.parseObject(data);
+            return Objects.equals(0, jsonObject2.getInteger("code")) && Objects.equals(0, jsonObject1.getInteger("status")) ?
                     DataVo.success(0, "OpenAPI撞库成功", product.getPlanId())
-                    : DataVo.fail(response.getMsg(), product.getPlanId());
+                    : DataVo.fail(jsonObject2.getString("msg"), product.getPlanId());
 
         } catch (Exception e) {
             log.error("OpenAPI撞库失败", e);

+ 16 - 12
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PingDingShanCreditService.java

@@ -2,20 +2,26 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 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;
 import javax.crypto.Cipher;
 import javax.crypto.spec.SecretKeySpec;
 import java.time.Instant;
@@ -45,10 +51,10 @@ public class PingDingShanCreditService implements LoanDockingApi {
     }
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit PingDingShanCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -73,12 +79,10 @@ public class PingDingShanCreditService implements LoanDockingApi {
             params.add("serialNo", checkInfo.getSerialNo());
             params.add("requestData", checkInfo.getRequestData());
             log.info("credit qualityCheck PingDingShanCreditService request userId:{}, url:{}, checkInfo:{}",userInfo.getUserId(), url, checkInfo);
-            String response = null;
+            HttpApiResponse 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();
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(params),"post",url, HeadsUtil.getFromHeaders(null,null)));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("平顶山准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 16 - 15
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PingXunCreditService.java

@@ -2,21 +2,24 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-
-import com.hrsk.cloud.eg.infrastructure.utils.StringDecodeUtils;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
 import javax.crypto.Cipher;
 import javax.crypto.spec.SecretKeySpec;
 import java.nio.charset.StandardCharsets;
@@ -62,11 +65,11 @@ public class PingXunCreditService implements LoanDockingApi {
 
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit PingXunCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
 //            XdProductJointConfig xdProductJointConfig = xdProductJointConfigMapper.selectById(product.getJointType());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -97,12 +100,10 @@ public class PingXunCreditService implements LoanDockingApi {
             String url = config.getString("url") + checkPath;
             log.info("credit qualityCheck PingXunCreditService request userId:{}, url:{}, reqData:{}", userInfo.getUserId(), url, reqData);
 
-            ResponseEntity<String> response = null;
+            HttpApiResponse response = null;
             try {
-                HttpHeaders headers = new HttpHeaders();
-                headers.setContentType(MediaType.valueOf("application/json;UTF-8"));
-                HttpEntity<ReqData> entity = new HttpEntity(reqData, headers);
-                response = httpRestTemplate.restTemplate().postForEntity(url, entity, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(reqData),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("平讯准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -112,7 +113,7 @@ public class PingXunCreditService implements LoanDockingApi {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
 
-            JSONObject jsonObject = JSONObject.parseObject(StringDecodeUtils.decodeUnicode(response.getBody()));
+            JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
             if (200 == jsonObject.getInteger("status") && 1 == jsonObject.getJSONObject("data").getInteger("code")) {
                 return DataVo.success(0, "平讯撞库成功", product.getPlanId());
             }

+ 8 - 3
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/PubNoCheckCreditService.java

@@ -1,10 +1,15 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
@@ -32,7 +37,7 @@ public class PubNoCheckCreditService implements LoanDockingApi {
      * @return
      */
     @Override
-    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfoCmd) {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         log.info("虚假的助贷撞库请求参数 userInfo:{}  product:{}", userInfo, product);
         String productName = "";
         if (null != product && StringUtils.isNotBlank(product.getPlanName())){

+ 16 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingDaoAoSengCreditService.java

@@ -1,9 +1,19 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -29,10 +39,10 @@ public class QingDaoAoSengCreditService implements LoanDockingApi {
     }
 
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
 //            log.info("credit YunHaiLianDongCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -43,9 +53,10 @@ public class QingDaoAoSengCreditService implements LoanDockingApi {
             String url = config.getString("checkUrl");
 
 //            log.info("credit qualityCheck YunHaiLianDongCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            String response = null;
-            try {
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            HttpApiResponse response = null;
+            try{
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("青岛奥森准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 15 - 4
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingDaoAoSengV2CreditService.java

@@ -1,9 +1,19 @@
 package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -31,10 +41,10 @@ public class QingDaoAoSengV2CreditService implements LoanDockingApi {
 
 
     @Override
-        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction)  {
+        public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
 //            log.info("credit YunHaiLianDongCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -44,9 +54,10 @@ public class QingDaoAoSengV2CreditService implements LoanDockingApi {
 
             String url = config.getString("checkUrl");
 //            log.info("credit qualityCheck YunHaiLianDongCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            String response = null;
+            HttpApiResponse response = null;
             try {
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("青岛奥森V2准入异常,异常信息:{}", e.getMessage(), e);
             }

+ 17 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuCreditService.java

@@ -2,10 +2,20 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
@@ -43,7 +53,7 @@ public class QingyuCreditService implements LoanDockingApi {
      * @return {"url":"http://apitest.shlyxxjs.com","key":"fluxZhudai*_key","tenantId":"1405729496904110081","trafficPlatformId":"13872425018351111"}
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
             log.info("credit QingyuCreditService qualityCheck begin...userId:{},productId={}", userInfo.getUserId(), product.getPlanId());
             String configJson = HessianUtils.deserialize(configInfo.getRequestConfig()).toString();
@@ -66,9 +76,10 @@ public class QingyuCreditService implements LoanDockingApi {
             checkInfo.setSign(getSign(checkInfo.getData(), checkInfo.getTrafficPlatformId(), config.getString("key")));
             String url = config.getString("url") + qualityCheckPath;
             log.info("credit qualityCheck QingyuCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            ResultYq response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, ResultYq.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("【{}】-庆鱼准入异常,异常信息:{}", product.getPlanName(), e.getMessage(), e);
             }
@@ -76,10 +87,11 @@ public class QingyuCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (response.getCode() == 200 && response.getSuccess() == true && response.getData().get(0).getCustomers().get(0).getStatus() == 0) {
+            JSONObject jsonObject1=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject1.getInteger("code") == 200 && jsonObject1.getBoolean("success") && jsonObject1.getJSONArray("data").size() == 0) {
                 return DataVo.success(0, "【" + product.getPlanName() + "】-庆鱼撞库成功", product.getPlanId());
             } else {
-                return DataVo.fail(response.getMsg(), product.getPlanId());
+                return DataVo.fail(jsonObject1.getString("msg"), product.getPlanId());
             }
         } catch (Exception e) {
             log.error("【{}】-庆鱼撞库失败", product.getPlanName(), e);

+ 19 - 6
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuV2CreditService.java

@@ -3,10 +3,21 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cglib.beans.BeanMap;
@@ -45,10 +56,10 @@ public class QingyuV2CreditService implements LoanDockingApi {
      * @return {"url":"http://apitest.shlyxxjs.com","key":"fluxZhudai*_key","tenantId":"1405729496904110081","trafficPlatformId":"13872425018351111"}
      */
     @Override
-    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfoCmd) {
+    public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction)  {
         try {
             log.info("credit QingyuV2CreditService qualityCheck begin...userId:{},productId={}", userInfo.getUserId(), product.getPlanId());
-            byte[] requestConfig = configInfoCmd.getRequestConfig();
+            byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
             log.info("庆鱼V2.0对接参数:{}", JSON.toJSONString(config));
@@ -71,9 +82,10 @@ public class QingyuV2CreditService implements LoanDockingApi {
             }
 
             log.info("credit qualityCheck QingyuV2CreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
-            CheckInfoResp response = null;
+            HttpApiResponse response = null;
             try {
-                response = httpRestTemplate.restTemplate().postForObject(url, checkInfo, CheckInfoResp.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("【{}】-庆鱼V2.0准入异常,异常信息:{}", product.getPlanName(), e.getMessage(), e);
             }
@@ -81,10 +93,11 @@ public class QingyuV2CreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (response.getCode() == 200 && response.getSuccess() == true && response.getData().size() == 0) {
+            JSONObject jsonObject1=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject1.getInteger("code") == 200 && jsonObject1.getBoolean("success") && jsonObject1.getJSONArray("data").size() == 0) {
                 return DataVo.success(0, "【" + product.getPlanName() + "】-庆鱼V2.0撞库成功", product.getPlanId());
             } else {
-                return DataVo.fail(response.getMsg(), product.getPlanId());
+                return DataVo.fail(jsonObject1.getString("msg"), product.getPlanId());
             }
         } catch (Exception e) {
             log.error("【{}】-庆鱼V2.0撞库失败", product.getPlanName(), e);

+ 18 - 5
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/QingyuV3CreditService.java

@@ -3,10 +3,21 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
 import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
 
+import com.hrsk.cloud.eg.client.vo.DataVo;
+import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
+import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.HeadsUtil;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
+import com.hrsk.cloud.eg.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.cglib.beans.BeanMap;
@@ -42,7 +53,7 @@ public class QingyuV3CreditService implements LoanDockingApi {
      * }
      */
     @Override
-         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction) {
+         public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc, Function<String,Object> redisGetFunction, Function<RedisSetDto,Boolean> redisSetFunction) {
         try {
             log.info("credit QingyuV3CreditService qualityCheck begin...userId:{},productId={}", userInfo.getUserId(), product.getPlanName());
             byte[] requestConfig = configInfo.getRequestConfig();
@@ -62,9 +73,10 @@ public class QingyuV3CreditService implements LoanDockingApi {
             String checkUrl = config.getString("checkUrl");
 
             log.info("credit qualityCheck QingyuV3CreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), checkUrl, checkInfo);
-            CheckInfoResp response = null;
+            HttpApiResponse response = null;
             try {
-                response =httpRestTemplate.restTemplate().postForObject(checkUrl, checkInfo, CheckInfoResp.class);
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(String.valueOf(checkInfo),"post",checkUrl));
+                response =httpClientFunc.apply(request);
             } catch (Exception e) {
                 log.error("【{}】-庆鱼V3.0准入异常,异常信息:{}", product.getPlanName(), e.getMessage(), e);
             }
@@ -72,10 +84,11 @@ public class QingyuV3CreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getPlanId(), product.getPlanName());
             }
-            if (response.getCode() == 200 && response.getSuccess() == true && response.getData().size()  == 0) {
+            JSONObject jsonObject1=JSONObject.parseObject(response.getData().toString());
+            if (jsonObject1.getInteger("code") == 200 && jsonObject1.getBoolean("success") && jsonObject1.getJSONArray("data").size() == 0) {
                 return DataVo.success(0, "【" + product.getPlanName() + "】-庆鱼V3.0撞库成功", product.getPlanId());
             } else {
-                return DataVo.fail(response.getMsg(), product.getPlanId());
+                return DataVo.fail(jsonObject1.getString("msg"), product.getPlanId());
             }
         } catch (Exception e) {
             log.error("【{}】-庆鱼V3.0撞库失败", product.getPlanName(), e);

+ 273 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/Base64Utils.java

@@ -0,0 +1,273 @@
+package com.hrsk.cloud.eg.domain.common;
+
+public class Base64Utils {
+
+	static private final int     BASELENGTH           = 128;
+    static private final int     LOOKUPLENGTH         = 64;
+    static private final int     TWENTYFOURBITGROUP   = 24;
+    static private final int     EIGHTBIT             = 8;
+    static private final int     SIXTEENBIT           = 16;
+    static private final int     FOURBYTE             = 4;
+    static private final int     SIGN                 = -128;
+    static private final char    PAD                  = '=';
+    static private final boolean fDebug               = false;
+    static final private byte[]  base64Alphabet       = new byte[BASELENGTH];
+    static final private char[]  lookUpBase64Alphabet = new char[LOOKUPLENGTH];
+
+    static {
+        for (int i = 0; i < BASELENGTH; ++i) {
+            base64Alphabet[i] = -1;
+        }
+        for (int i = 'Z'; i >= 'A'; i--) {
+            base64Alphabet[i] = (byte) (i - 'A');
+        }
+        for (int i = 'z'; i >= 'a'; i--) {
+            base64Alphabet[i] = (byte) (i - 'a' + 26);
+        }
+
+        for (int i = '9'; i >= '0'; i--) {
+            base64Alphabet[i] = (byte) (i - '0' + 52);
+        }
+
+        base64Alphabet['+'] = 62;
+        base64Alphabet['/'] = 63;
+
+        for (int i = 0; i <= 25; i++) {
+            lookUpBase64Alphabet[i] = (char) ('A' + i);
+        }
+
+        for (int i = 26, j = 0; i <= 51; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('a' + j);
+        }
+
+        for (int i = 52, j = 0; i <= 61; i++, j++) {
+            lookUpBase64Alphabet[i] = (char) ('0' + j);
+        }
+        lookUpBase64Alphabet[62] = (char) '+';
+        lookUpBase64Alphabet[63] = (char) '/';
+
+    }
+
+    private static boolean isWhiteSpace(char octect) {
+        return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
+    }
+
+    private static boolean isPad(char octect) {
+        return (octect == PAD);
+    }
+
+    private static boolean isData(char octect) {
+        return (octect < BASELENGTH && base64Alphabet[octect] != -1);
+    }
+
+    /**
+     * Encodes hex octects into Base64
+     *
+     * @param binaryData Array containing binaryData
+     * @return Encoded Base64 array
+     */
+    public static String encode(byte[] binaryData) {
+
+        if (binaryData == null) {
+            return null;
+        }
+
+        int lengthDataBits = binaryData.length * EIGHTBIT;
+        if (lengthDataBits == 0) {
+            return "";
+        }
+
+        int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
+        int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
+        int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
+        char encodedData[] = null;
+
+        encodedData = new char[numberQuartet * 4];
+
+        byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
+
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        if (fDebug) {
+            System.out.println("number of triplets = " + numberTriplets);
+        }
+
+        for (int i = 0; i < numberTriplets; i++) {
+            b1 = binaryData[dataIndex++];
+            b2 = binaryData[dataIndex++];
+            b3 = binaryData[dataIndex++];
+
+            if (fDebug) {
+                System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
+            }
+
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+            byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
+
+            if (fDebug) {
+                System.out.println("val2 = " + val2);
+                System.out.println("k4   = " + (k << 4));
+                System.out.println("vak  = " + (val2 | (k << 4)));
+            }
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
+        }
+
+        // form integral number of 6-bit groups
+        if (fewerThan24bits == EIGHTBIT) {
+            b1 = binaryData[dataIndex];
+            k = (byte) (b1 & 0x03);
+            if (fDebug) {
+                System.out.println("b1=" + b1);
+                System.out.println("b1<<2 = " + (b1 >> 2));
+            }
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
+            encodedData[encodedIndex++] = PAD;
+            encodedData[encodedIndex++] = PAD;
+        } else if (fewerThan24bits == SIXTEENBIT) {
+            b1 = binaryData[dataIndex];
+            b2 = binaryData[dataIndex + 1];
+            l = (byte) (b2 & 0x0f);
+            k = (byte) (b1 & 0x03);
+
+            byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+            byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+            encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
+            encodedData[encodedIndex++] = PAD;
+        }
+
+        return new String(encodedData);
+    }
+
+    /**
+     * Decodes Base64 data into octects
+     *
+     * @param encoded string containing Base64 data
+     * @return Array containind decoded data.
+     */
+    public static byte[] decode(String encoded) {
+
+        if (encoded == null) {
+            return null;
+        }
+
+        char[] base64Data = encoded.toCharArray();
+        // remove white spaces
+        int len = removeWhiteSpace(base64Data);
+
+        if (len % FOURBYTE != 0) {
+            return null;//should be divisible by four
+        }
+
+        int numberQuadruple = (len / FOURBYTE);
+
+        if (numberQuadruple == 0) {
+            return new byte[0];
+        }
+
+        byte decodedData[] = null;
+        byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+        char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
+
+        int i = 0;
+        int encodedIndex = 0;
+        int dataIndex = 0;
+        decodedData = new byte[(numberQuadruple) * 3];
+
+        for (; i < numberQuadruple - 1; i++) {
+
+            if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
+                || !isData((d3 = base64Data[dataIndex++]))
+                || !isData((d4 = base64Data[dataIndex++]))) {
+                return null;
+            }//if found "no data" just return null
+
+            b1 = base64Alphabet[d1];
+            b2 = base64Alphabet[d2];
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+        }
+
+        if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
+            return null;//if found "no data" just return null
+        }
+
+        b1 = base64Alphabet[d1];
+        b2 = base64Alphabet[d2];
+
+        d3 = base64Data[dataIndex++];
+        d4 = base64Data[dataIndex++];
+        if (!isData((d3)) || !isData((d4))) {//Check if they are PAD characters
+            if (isPad(d3) && isPad(d4)) {
+                if ((b2 & 0xf) != 0)//last 4 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 1];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
+                return tmp;
+            } else if (!isPad(d3) && isPad(d4)) {
+                b3 = base64Alphabet[d3];
+                if ((b3 & 0x3) != 0)//last 2 bits should be zero
+                {
+                    return null;
+                }
+                byte[] tmp = new byte[i * 3 + 2];
+                System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+                tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+                tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+                return tmp;
+            } else {
+                return null;
+            }
+        } else { //No PAD e.g 3cQl
+            b3 = base64Alphabet[d3];
+            b4 = base64Alphabet[d4];
+            decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+            decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+            decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+
+        }
+
+        return decodedData;
+    }
+
+    /**
+     * remove WhiteSpace from MIME containing encoded Base64 data.
+     *
+     * @param data  the byte array of base64 data (with WS)
+     * @return      the new length
+     */
+    private static int removeWhiteSpace(char[] data) {
+        if (data == null) {
+            return 0;
+        }
+
+        // count characters that's not whitespace
+        int newSize = 0;
+        int len = data.length;
+        for (int i = 0; i < len; i++) {
+            if (!isWhiteSpace(data[i])) {
+                data[newSize++] = data[i];
+            }
+        }
+        return newSize;
+    }
+}

+ 51 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/HeadsUtil.java

@@ -0,0 +1,51 @@
+package com.hrsk.cloud.eg.domain.common;
+
+import com.google.common.collect.Lists;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.KeyValueObject;
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.ValueObjectTypeEnum;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
+
+/**
+ * @Author Liu Tao
+ * @Date 2024 11 21 15 18
+ **/
+public class HeadsUtil {
+
+    public static List<KeyValueObject> getJsonHeaders(String key,String value) {
+        List<KeyValueObject> headers = Lists.newArrayList();
+
+        KeyValueObject head = new KeyValueObject();
+        head.setType(ValueObjectTypeEnum.BASIC.getType());
+        head.setKey("Content-Type");
+        head.setValue("application/json");
+        headers.add(head);
+        if (StringUtils.isNotBlank(key)&&StringUtils.isNotBlank(value)){
+            KeyValueObject head2 = new KeyValueObject();
+            head2.setType(ValueObjectTypeEnum.BASIC.getType());
+            head2.setKey("Content-Type");
+            head2.setValue("application/json");
+            headers.add(head2);
+        }
+        return headers;
+    }
+
+    public static List<KeyValueObject> getFromHeaders(String key,String value) {
+        List<KeyValueObject> headers = Lists.newArrayList();
+
+        KeyValueObject head = new KeyValueObject();
+        head.setType(ValueObjectTypeEnum.BASIC.getType());
+        head.setKey("Content-Type");
+        head.setValue("application/x-www-form-urlencoded; charset=UTF-8");
+        headers.add(head);
+        if (StringUtils.isNotBlank(key)&&StringUtils.isNotBlank(value)){
+            KeyValueObject head2 = new KeyValueObject();
+            head2.setType(ValueObjectTypeEnum.BASIC.getType());
+            head2.setKey("Content-Type");
+            head2.setValue("application/json");
+            headers.add(head2);
+        }
+        return headers;
+    }
+}

+ 658 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/RSAUtils.java

@@ -0,0 +1,658 @@
+package com.hrsk.cloud.eg.domain.common;
+
+import org.apache.commons.codec.binary.Base64;
+import sun.misc.BASE64Decoder;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import java.io.*;
+import java.security.*;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+
+
+public class RSAUtils {
+    /**
+     * 字节数据转字符串专用集合
+     */
+    private static final char[] HEX_CHAR = { '0', '1', '2', '3', '4', '5', '6',
+            '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+
+    public static final String RSA_ALGORITHM = "RSA";
+    /**
+     * 加密的公钥 私钥 返回对应字符串
+     * @return
+     */
+    public static String genKeyPair( ) {
+
+        KeyPairGenerator keyPairGen = null;
+        try {
+            keyPairGen = KeyPairGenerator.getInstance("RSA");
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        // 初始化密钥对生成器,密钥大小为96-1024位
+        keyPairGen.initialize(1024,new SecureRandom());
+        // 生成一个密钥对,保存在keyPair中
+        KeyPair keyPair = keyPairGen.generateKeyPair();
+        // 得到私钥
+        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
+        // 得到公钥
+        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
+
+            // 得到公钥字符串
+            String publicKeyString = Base64Utils.encode(publicKey.getEncoded());
+            // 得到私钥字符串
+            String privateKeyString = Base64Utils.encode(privateKey.getEncoded());
+       return publicKeyString+","+privateKeyString;
+    }
+
+    /**
+     * 随机生成密钥对
+     */
+    public static void genKeyPair(String filePath) {
+        // KeyPairGenerator类用于生成公钥和私钥对,基于RSA算法生成对象
+        KeyPairGenerator keyPairGen = null;
+        try {
+            keyPairGen = KeyPairGenerator.getInstance("RSA");
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        // 初始化密钥对生成器,密钥大小为96-1024位
+        keyPairGen.initialize(1024,new SecureRandom());
+        // 生成一个密钥对,保存在keyPair中
+        KeyPair keyPair = keyPairGen.generateKeyPair();
+        // 得到私钥
+        RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
+        // 得到公钥
+        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
+        try {
+            // 得到公钥字符串
+            String publicKeyString = Base64Utils.encode(publicKey.getEncoded());
+            // 得到私钥字符串
+            String privateKeyString = Base64Utils.encode(privateKey.getEncoded());
+            // 将密钥对写入到文件
+            FileWriter pubfw = new FileWriter(filePath + "/publicKey.key");
+            FileWriter prifw = new FileWriter(filePath + "/privateKey.key");
+            BufferedWriter pubbw = new BufferedWriter(pubfw);
+            BufferedWriter pribw = new BufferedWriter(prifw);
+            pubbw.write(publicKeyString);
+            pribw.write(privateKeyString);
+            pubbw.flush();
+            pubbw.close();
+            pubfw.close();
+            pribw.flush();
+            pribw.close();
+            prifw.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 从文件中输入流中加载公钥
+     *
+     * @param in
+     *            公钥输入流
+     * @throws Exception
+     *             加载公钥时产生的异常
+     */
+    public static String loadPublicKeyByFile(String path) throws Exception {
+        try {
+            BufferedReader br = new BufferedReader(new FileReader(path));
+            String readLine = null;
+            StringBuilder sb = new StringBuilder();
+            while ((readLine = br.readLine()) != null) {
+                sb.append(readLine);
+            }
+            br.close();
+            return sb.toString();
+        } catch (IOException e) {
+            throw new Exception("公钥数据流读取错误");
+        } catch (NullPointerException e) {
+            throw new Exception("公钥输入流为空");
+        }
+    }
+
+    /**
+     * 从字符串中加载公钥
+     *
+     * @param publicKeyStr
+     *            公钥数据字符串
+     * @throws Exception
+     *             加载公钥时产生的异常
+     */
+    public static RSAPublicKey loadPublicKeyByStr(String publicKeyStr)
+            throws Exception {
+        try {
+            byte[] buffer = Base64Utils.decode(publicKeyStr);
+            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(buffer);
+            return (RSAPublicKey) keyFactory.generatePublic(keySpec);
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此算法");
+        } catch (InvalidKeySpecException e) {
+            throw new Exception("公钥非法");
+        } catch (NullPointerException e) {
+            throw new Exception("公钥数据为空");
+        }
+    }
+
+    /**
+     * 从文件中加载私钥
+     *
+     *            私钥文件名
+     * @return 是否成功
+     * @throws Exception
+     */
+    public static String loadPrivateKeyByFile(String path) throws Exception {
+        try {
+            BufferedReader br = new BufferedReader(new FileReader(path));
+            String readLine = null;
+            StringBuilder sb = new StringBuilder();
+            while ((readLine = br.readLine()) != null) {
+                sb.append(readLine);
+            }
+            br.close();
+            return sb.toString();
+        } catch (IOException e) {
+            throw new Exception("私钥数据读取错误");
+        } catch (NullPointerException e) {
+            throw new Exception("私钥输入流为空");
+        }
+    }
+
+    public static RSAPrivateKey loadPrivateKeyByStr(String privateKeyStr)
+            throws Exception {
+    	try {
+            BASE64Decoder base64Decoder = new BASE64Decoder();
+            byte[] buffer = base64Decoder.decodeBuffer(privateKeyStr);
+            PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(buffer);
+            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+            return (RSAPrivateKey) keyFactory
+                    .generatePrivate(keySpec);
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此算法");
+        } catch (InvalidKeySpecException e) {
+            throw new Exception("私钥非法");
+        } catch (IOException e) {
+            throw new Exception("私钥数据内容读取错误");
+        } catch (NullPointerException e) {
+            throw new Exception("私钥数据为空");
+        }
+    }
+
+    /**
+     * 得到公钥
+     *
+     * @param publicKey 密钥字符串(经过base64编码)
+     * @throws Exception
+     */
+    public static RSAPublicKey getPublicKey(String publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
+        //通过X509编码的Key指令获得公钥对象
+        KeyFactory keyFactory = KeyFactory.getInstance(RSA_ALGORITHM);
+        X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(Base64.decodeBase64(publicKey));
+        RSAPublicKey key = (RSAPublicKey) keyFactory.generatePublic(x509KeySpec);
+        return key;
+    }
+
+    /*
+     * 得到私钥
+     * @param privateKey 密钥字符串(经过base64编码)
+     * @throws Exception
+     */
+    public static RSAPrivateKey getPrivateKey(String privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException {
+        //通过PKCS#8编码的Key指令获得私钥对象
+        KeyFactory keyFactory = KeyFactory.getInstance(RSA_ALGORITHM);
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey));
+        RSAPrivateKey key = (RSAPrivateKey) keyFactory.generatePrivate(pkcs8KeySpec);
+        return key;
+    }
+
+
+
+    /**
+     * 公钥加密
+     * @param data
+     * @param publicKey
+     * @return
+     */
+    public static String publicEncrypt(String data, RSAPublicKey publicKey) {
+        try {
+            Cipher cipher = Cipher.getInstance("RSA");
+            cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+            return Base64.encodeBase64URLSafeString(rsaSplitCodec(cipher, Cipher.ENCRYPT_MODE, data.getBytes("UTF-8"), publicKey.getModulus().bitLength()));
+        } catch (Exception e) {
+            throw new RuntimeException("加密字符串[" + data + "]时遇到异常", e);
+        }
+    }
+
+
+    public static String publicEncryptUnsafe(String data, RSAPublicKey publicKey) {
+        try {
+            Cipher cipher = Cipher.getInstance("RSA");
+            cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+            return Base64.encodeBase64String(rsaSplitCodec(cipher, Cipher.ENCRYPT_MODE, data.getBytes("UTF-8"), publicKey.getModulus().bitLength()));
+        } catch (Exception e) {
+            throw new RuntimeException("加密字符串[" + data + "]时遇到异常", e);
+        }
+    }
+
+    /**
+     * 私钥解密
+     * @param data
+     * @param privateKey
+     * @return
+     */
+
+    public static String privateDecrypt(String data, RSAPrivateKey privateKey) {
+        try {
+            Cipher cipher = Cipher.getInstance("RSA");
+            cipher.init(Cipher.DECRYPT_MODE, privateKey);
+            return new String(rsaSplitCodec(cipher, Cipher.DECRYPT_MODE, Base64.decodeBase64(data), privateKey.getModulus().bitLength()), "UTF-8");
+        } catch (Exception e) {
+            throw new RuntimeException("解密字符串[" + data + "]时遇到异常", e);
+        }
+    }
+
+    //rsa切割解码  , ENCRYPT_MODE,加密数据   ,DECRYPT_MODE,解密数据
+    private static byte[] rsaSplitCodec(Cipher cipher, int opmode, byte[] datas, int keySize) {
+        int maxBlock = 0;  //最大块
+        if (opmode == Cipher.DECRYPT_MODE) {
+            maxBlock = keySize / 8;
+        } else {
+            maxBlock = keySize / 8 - 11;
+        }
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] buff;
+        int i = 0;
+        try {
+            while (datas.length > offSet) {
+                if (datas.length - offSet > maxBlock) {
+                    //可以调用以下的doFinal()方法完成加密或解密数据:
+                    buff = cipher.doFinal(datas, offSet, maxBlock);
+                } else {
+                    buff = cipher.doFinal(datas, offSet, datas.length - offSet);
+                }
+                out.write(buff, 0, buff.length);
+                i++;
+                offSet = i * maxBlock;
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("加解密阀值为[" + maxBlock + "]的数据时发生异常", e);
+        }
+        byte[] resultDatas = out.toByteArray();
+        IOUtils.closeQuietly(out);//差个依赖
+        return resultDatas;
+    }
+    /**
+     * 公钥加密过程
+     *
+     * @param publicKey
+     *            公钥
+     * @param plainTextData
+     *            明文数据
+     * @return
+     * @throws Exception
+     *             加密过程中的异常信息
+     */
+    public static byte[] encrypt(RSAPublicKey publicKey, byte[] plainTextData)
+            throws Exception {
+        if (publicKey == null) {
+            throw new Exception("加密公钥为空, 请设置");
+        }
+        Cipher cipher = null;
+        try {
+            // 使用默认RSA
+            cipher = Cipher.getInstance("RSA");
+            // cipher= Cipher.getInstance("RSA", new BouncyCastleProvider());
+            cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+            byte[] output = cipher.doFinal(plainTextData);
+            return output;
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此加密算法");
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+            return null;
+        } catch (InvalidKeyException e) {
+            throw new Exception("加密公钥非法,请检查");
+        } catch (IllegalBlockSizeException e) {
+            throw new Exception("明文长度非法");
+        } catch (BadPaddingException e) {
+            throw new Exception("明文数据已损坏");
+        }
+    }
+
+    /**
+     * 私钥加密过程
+     *
+     * @param privateKey
+     *            私钥
+     * @param plainTextData
+     *            明文数据
+     * @return
+     * @throws Exception
+     *             加密过程中的异常信息
+     */
+    public static byte[] encrypt(RSAPrivateKey privateKey, byte[] plainTextData)
+            throws Exception {
+        if (privateKey == null) {
+            throw new Exception("加密私钥为空, 请设置");
+        }
+        Cipher cipher = null;
+        try {
+            // 使用默认RSA
+            cipher = Cipher.getInstance("RSA");
+            cipher.init(Cipher.ENCRYPT_MODE, privateKey);
+            byte[] output = cipher.doFinal(plainTextData);
+            return output;
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此加密算法");
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+            return null;
+        } catch (InvalidKeyException e) {
+            throw new Exception("加密私钥非法,请检查");
+        } catch (IllegalBlockSizeException e) {
+            throw new Exception("明文长度非法");
+        } catch (BadPaddingException e) {
+            throw new Exception("明文数据已损坏");
+        }
+    }
+
+    /**
+     * 私钥解密过程
+     *
+     * @param privateKey
+     *            私钥
+     * @param cipherData
+     *            密文数据
+     * @return 明文
+     * @throws Exception
+     *             解密过程中的异常信息
+     */
+    public static byte[] decrypt(RSAPrivateKey privateKey, byte[] cipherData)
+            throws Exception {
+        if (privateKey == null) {
+            throw new Exception("解密私钥为空, 请设置");
+        }
+        Cipher cipher = null;
+        try {
+            // 使用默认RSA
+            cipher = Cipher.getInstance("RSA");
+            // cipher= Cipher.getInstance("RSA", new BouncyCastleProvider());
+            cipher.init(Cipher.DECRYPT_MODE, privateKey);
+            byte[] output = cipher.doFinal(cipherData);
+            return output;
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此解密算法");
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+            return null;
+        } catch (InvalidKeyException e) {
+            throw new Exception("解密私钥非法,请检查");
+        } catch (IllegalBlockSizeException e) {
+            throw new Exception("密文长度非法");
+        } catch (BadPaddingException e) {
+            throw new Exception("密文数据已损坏");
+        }
+    }
+
+    /**
+     * 公钥解密过程
+     *
+     * @param publicKey
+     *            公钥
+     * @param cipherData
+     *            密文数据
+     * @return 明文
+     * @throws Exception
+     *             解密过程中的异常信息
+     */
+    public static byte[] decrypt(RSAPublicKey publicKey, byte[] cipherData)
+            throws Exception {
+        if (publicKey == null) {
+            throw new Exception("解密公钥为空, 请设置");
+        }
+        Cipher cipher = null;
+        try {
+            // 使用默认RSA
+            cipher = Cipher.getInstance("RSA");
+            // cipher= Cipher.getInstance("RSA", new BouncyCastleProvider());
+            cipher.init(Cipher.DECRYPT_MODE, publicKey);
+            byte[] output = cipher.doFinal(cipherData);
+            return output;
+        } catch (NoSuchAlgorithmException e) {
+            throw new Exception("无此解密算法");
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+            return null;
+        } catch (InvalidKeyException e) {
+            throw new Exception("解密公钥非法,请检查");
+        } catch (IllegalBlockSizeException e) {
+            throw new Exception("密文长度非法");
+        } catch (BadPaddingException e) {
+            throw new Exception("密文数据已损坏");
+        }
+    }
+
+    /**
+     * 字节数据转十六进制字符串
+     *
+     * @param data
+     *            输入数据
+     * @return 十六进制内容
+     */
+    public static String byteArrayToString(byte[] data) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (int i = 0; i < data.length; i++) {
+            // 取出字节的高四位 作为索引得到相应的十六进制标识符 注意无符号右移
+            stringBuilder.append(HEX_CHAR[(data[i] & 0xf0) >>> 4]);
+            // 取出字节的低四位 作为索引得到相应的十六进制标识符
+            stringBuilder.append(HEX_CHAR[(data[i] & 0x0f)]);
+            if (i < data.length - 1) {
+                stringBuilder.append(' ');
+            }
+        }
+        return stringBuilder.toString();
+    }
+
+    /**
+     * 签名算法
+     */
+    public static final String SIGN_ALGORITHMS = "SHA1WithRSA";
+
+    /**
+     * rsa签名
+     *
+     * @param content
+     *            待签名的字符串
+     * @param privateKey
+     *            rsa私钥字符串
+     * @param charset
+     *            字符编码
+     * @return 签名结果
+     * @throws Exception
+     *             签名失败则抛出异常
+     */
+    public static byte[] rsaSign(String content, RSAPrivateKey priKey)
+            throws SignatureException {
+        try {
+
+            Signature signature = Signature.getInstance("SHA1withRSA");
+            signature.initSign(priKey);
+            signature.update(content.getBytes("utf-8"));
+
+            byte[] signed = signature.sign();
+            return signed;
+        } catch (Exception e) {
+            throw new SignatureException("RSAcontent = " + content
+                    + "; charset = ", e);
+        }
+    }
+
+    /**
+     * rsa验签
+     *
+     * @param content
+     *            被签名的内容
+     * @param sign
+     *            签名后的结果
+     * @return 验签结果
+     * @throws SignatureException
+     *             验签失败,则抛异常
+     */
+    public static boolean doCheck(String content, byte[] sign, RSAPublicKey pubKey)
+            throws SignatureException {
+        try {
+            Signature signature = Signature.getInstance("SHA1withRSA");
+            signature.initVerify(pubKey);
+            signature.update(content.getBytes("utf-8"));
+            return signature.verify((sign));
+        } catch (Exception e) {
+            throw new SignatureException("RSA验证签名[content = " + content
+                    + "; charset = " + "; signature = " + sign + "]发生异常!", e);
+        }
+    }
+
+    /**
+    * RSA签名
+    * @param content 待签名数据
+    * @param privateKey 商户私钥
+    * @param encode 字符集编码
+    * @return 签名值
+    */
+    public static String sign(String content, String privateKey, String encode) {
+        try {
+            PKCS8EncodedKeySpec priPKCS8    = new PKCS8EncodedKeySpec( Base64Utils.decode(privateKey) );
+
+            KeyFactory keyf                 = KeyFactory.getInstance("RSA");
+            PrivateKey priKey               = keyf.generatePrivate(priPKCS8);
+
+            Signature signature = Signature.getInstance(SIGN_ALGORITHMS);
+
+            signature.initSign(priKey);
+            signature.update( content.getBytes(encode));
+
+            byte[] signed = signature.sign();
+
+            return Base64Utils.encode(signed);
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
+    public static String sign(String content, String privateKey) {
+        try {
+            PKCS8EncodedKeySpec priPKCS8    = new PKCS8EncodedKeySpec( Base64Utils.decode(privateKey) );
+            KeyFactory keyf = KeyFactory.getInstance("RSA");
+            PrivateKey priKey = keyf.generatePrivate(priPKCS8);
+            Signature signature = Signature.getInstance(SIGN_ALGORITHMS);
+            signature.initSign(priKey);
+            signature.update( content.getBytes());
+            byte[] signed = signature.sign();
+            return Base64Utils.encode(signed);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+    * RSA验签名检查
+    * @param content 待签名数据
+    * @param sign 签名值
+    * @param publicKey 分配给开发商公钥
+    * @param encode 字符集编码
+    * @return 布尔值
+    */
+    public static boolean doCheck(String content, String sign, String publicKey, String encode) {
+        try {
+            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+            byte[] encodedKey = Base64Utils.decode(publicKey);
+            PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
+
+
+            Signature signature = Signature
+            .getInstance(SIGN_ALGORITHMS);
+
+            signature.initVerify(pubKey);
+            signature.update( content.getBytes(encode) );
+
+            boolean bverify = signature.verify( Base64Utils.decode(sign) );
+            return bverify;
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+
+        return false;
+    }
+
+    public static boolean doCheck(String content, String sign, String publicKey) {
+        try {
+            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+            byte[] encodedKey = Base64Utils.decode(publicKey);
+            PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
+
+
+            Signature signature = Signature
+            .getInstance(SIGN_ALGORITHMS);
+
+            signature.initVerify(pubKey);
+            signature.update( content.getBytes() );
+
+            boolean bverify = signature.verify( Base64Utils.decode(sign) );
+            return bverify;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeySpecException {
+        System.out.println("genKeyPair:"+genKeyPair());
+
+        String publickey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQChtoeuzYBROzA+uYWX8O+kQHKUKeACAba/LhEssZNWZ+j5MePVGF7zGtmHwpiftSQpmWT92aKm/wqj4h2J8TPT1fRfp9LOhOglaux4X4xr9duAjWtPpvwezswVCP/kFUSCeIzZyfRqV3KL3unHtxCrEPph0ojFtFXAdZAorJDpjwIDAQAB";
+        String pricatekey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKG2h67NgFE7MD65hZfw76RAcpQp4AIBtr8uESyxk1Zn6Pkx49UYXvMa2YfCmJ+1JCmZZP3Zoqb/CqPiHYnxM9PV9F+n0s6E6CVq7HhfjGv124CNa0+m/B7OzBUI/+QVRIJ4jNnJ9GpXcove6ce3EKsQ+mHSiMW0VcB1kCiskOmPAgMBAAECgYBh0wZfQydVfGWh/B6JnJGLHgVyBabh7+F540c2bzF++prfbEOzm+uMSni+/IPRUQXQOF/0hBw1w2DPZLCTypqbmz+dnBj6txWBUt1Z87gEgIXzLGd9s7+d/rfsTaKayi/UOOZ45h4UiZlSnTlHYr0PZMK35yDVmDKXVysONwEw+QJBANme7Ls42x3QnmFQ4S6m43wSu+PEJ4VRgSqyCmT63vdf34jk4zLTyGRnCjrmKKsLEtqX34VJdosHTZSxJRRCk1sCQQC+O393VtxN88IA10HewN35NBI+tzPWScpD6681Q7LGRr8FTzcdSoX9xyQ5ySCFuEltj9DN4pI2vi66we8u2VzdAkEAo3PCyzyBF3vB+cYN3ERtSJuplAGYzYHSSoc/V2k2Xwcblm6UV3DKat8Zx/NnSFEg8B5yPGJZL0Nk+fGzr+vxUQJBAIqOX3sWowOMBcQDBREvvP2jtZ5EZdcwi8gIw+ax1magZMWDOwt0mj+LapFEMxHydlj8pQMwgXqp7vNMCeA/pWkCQQDDaseYvTEtGoRUBsjHZdWvyzFbBi/dGyYKE7YH4bo+cjp6vJKEIN30WVmu0mOTaTjoXtP7GrQ3gcOrTfXmRDJo";
+        RSAPublicKey publicKey = null;
+        try {
+            publicKey = RSAUtils.getPublicKey(publickey);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (InvalidKeySpecException e) {
+            e.printStackTrace();
+        }
+
+        System.out.println("publicKey:"+publicKey);
+        String d="15036521585";
+        String s = publicEncrypt(d, publicKey);
+        System.out.println("公钥加密:"+s);
+
+        RSAPrivateKey privateKey = RSAUtils.getPrivateKey(pricatekey);
+//        RSAPrivateKey privateKey = RSAUtils.getPrivateKey("MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALjLu7GbJMOCCaIfoghRIzWb0brsByRF8PYwHQWRmjXKusHoBta37ej38zKkMly/4rfUPt4G05ovFOXMXGg1NQ+CUcVL6mcDnyqTTZtF5HJ0etgFabhPjHbqixalxPjkBay3y/dL+kGkdpdNQTaP9lzH6OZiD/HcmQnrpc6Q5thHAgMBAAECgYBtt9Dt535RciDEGGH87CeqiaRhhgfLepdRpElm6AcWTxLJVDjTPYtM2gKUG7cnKGq02Jim/IigL7oJomdvG8AvO5dJstMXCJTnSsp7Yj/f1MZ0K6Y6J1FflDcoW16Naz0Uo4xLM1jMfj2Mqd6MKzprSawTz5to3OB+8PYa3sDtwQJBAPhCs+Yi0O5Pl7U1ShIPUuoA69b24ecx131RigqlFZbDSMU2ZFRF2lunvIHPp+3fTAvWBZr4symqPj3+NsQsB6cCQQC+jolT2lnQaiyErFHhw05yHKabSnZ5VMtZ/utBmLb6yxyh5f+1qC411xRGEFL7VqmMFVDSdvK/bJbq2nGuZr5hAkABybkx9x46GSimjXOzHZkjRk5sheqql5lNtcCgwv+czls/0Fx4nugrsNGSvcQf2nPZwfjYXOItcqRwHdyXHRoRAkBp8G5ymtsB3nU/kVm4bM9o63rIrN4u2DBxqSJ7hn578X3KmEbQZF7Eef2AckTgDK8X/SXAzHZqa+F/UdCPx/khAkEArPNa/nE0wT59kVeQm5V9I/La/jrTSDjOqYzqZrI3VVsfouqgbnv0q1Hd4Qdo58ei9mBm6jZersfUUbUkS4/Vfg==");
+        String s1 = privateDecrypt(s, privateKey);
+        System.out.println("私钥解密:"+s1);
+
+
+
+
+
+    }
+}

+ 173 - 0
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/common/SnowflakeIdWorker.java

@@ -0,0 +1,173 @@
+package com.hrsk.cloud.eg.domain.common;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * <p>TODO</p>
+ *
+ * @author cheng.jin.peng
+ * @version V1.0.0
+ * @date 2023/5/11 11:17
+ */
+
+public class SnowflakeIdWorker {
+    private static final SnowflakeIdWorker singleBean = new SnowflakeIdWorker(2);
+    /**
+     * 开始时间截 (本次时间戳为:Thu Nov 04 2010 09:42:54 GMT+0800 (中国标准时间)----1288834974657L---1656543015264587776--19 )
+     */
+    private final long startTime = 1546300800L;
+
+    /** 机器id所占的位数 */
+    private final long workerIdBits = 3L;
+
+    /** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
+    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
+
+    /** 序列在id中占的位数 */
+    private final long sequenceBits = 5L;
+
+    /** 机器ID向左移12位 */
+    private final long workerIdShift = sequenceBits;
+
+    /** 时间截向左移22位(10+12) */
+    private final long timestampLeftShift = sequenceBits + workerIdBits;
+
+    /** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */
+    private final long sequenceMask = -1L ^ (-1L << sequenceBits);
+
+    /** 工作机器ID(0~1024) */
+    private long workerId;
+
+    /** 毫秒内序列(0~4095) */
+    private long sequence = 0L;
+
+    /** 上次生成ID的时间截 */
+    private long lastTimestamp = -1L;
+
+    //==============================Constructors=====================================
+
+
+    private SnowflakeIdWorker(){
+    /**
+     * 构造函数
+     * @param workerId 工作ID (0~1024)
+     */
+
+    }
+    private SnowflakeIdWorker(long workerId) {
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(String.format("workerId can't be greater than %d or less than 0", maxWorkerId));
+        }
+        this.workerId = workerId;
+    }
+
+    // ==============================Methods==========================================
+    /**
+     * 获得下一个ID (该方法是线程安全的)
+     * @return SnowflakeId
+     */
+    public static long nextId() {
+        return singleBean.generateNextId();
+    }
+    public synchronized long generateNextId() {
+        long timestamp = timeGen();
+
+        //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
+        if (timestamp < lastTimestamp) {
+            throw new RuntimeException(
+                    String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+        }
+
+        //如果是同一时间生成的,则进行毫秒内序列
+        if (lastTimestamp == timestamp) {
+            sequence = (sequence + 1) & sequenceMask;
+            //毫秒内序列溢出
+            if (sequence == 0) {
+                //阻塞到下一个毫秒,获得新的时间戳
+                timestamp = tilNextMillis(lastTimestamp);
+            }
+        }
+        //时间戳改变,毫秒内序列重置
+        else {
+            sequence = 0L;
+        }
+
+        //上次生成ID的时间截
+        lastTimestamp = timestamp;
+
+        //移位并通过或运算拼到一起组成64位的ID
+        return ((timestamp - startTime) << timestampLeftShift)
+                | (workerId << workerIdShift)
+                | sequence;
+    }
+
+    /**
+     * 阻塞到下一个毫秒,直到获得新的时间戳
+     * @param lastTimestamp 上次生成ID的时间截
+     * @return 当前时间戳
+     */
+    protected long tilNextMillis(long lastTimestamp) {
+        long timestamp = timeGen();
+        while (timestamp <= lastTimestamp) {
+            timestamp = timeGen();
+        }
+        return timestamp;
+    }
+
+    /**
+     * 返回以毫秒为单位的当前时间
+     * @return 当前时间(毫秒)
+     */
+    protected long timeGen() {
+        return System.currentTimeMillis();
+    }
+
+    /**
+     * 测试
+     */
+    public static void main(String[] args) {
+        System.out.println("开始:"+System.currentTimeMillis());
+
+
+
+//        for (int i = 0; i < 50; i++) {
+//            try {
+//                Thread.sleep(1000);
+//            } catch (InterruptedException e) {
+//                throw new RuntimeException(e);
+//            }
+//            long id = idWorker.nextId();
+//            System.out.println(id+"长度="+String.valueOf(id).length());
+//
+//        }
+        //SnowflakeIdWorker idWorker = new SnowflakeIdWorker(2);
+        for(int i=0; i<10; i++){
+            System.out.println(SnowflakeIdWorker.nextId());
+            try {
+                TimeUnit.MILLISECONDS.sleep(1000);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+
+        }
+
+        /*System.out.println("结束:"+System.currentTimeMillis());
+
+        Set<Long> set = new HashSet<>();
+
+        for (int i = 0; i < 100000;i++){
+            long id = idWorker.nextId();
+            try {
+                TimeUnit.MILLISECONDS.sleep(1000);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            System.out.println(id);
+            set.add(id);
+        }
+//        for (Long aLong : set) {
+//            System.out.println(aLong);
+//        }
+        System.out.println(set.size());*/
+    }
+}