Przeglądaj źródła

1.修改国任配置

wks 2 lat temu
rodzic
commit
f2481633c9

+ 20 - 27
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ydtech.config.properties.GuorenApiConfigurationProperties;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.InsQuoteFlow;
 import com.ydtech.constants.enums.InsurKind;
@@ -81,14 +82,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
     private static final Logger log = LoggerFactory.getLogger("guoRen");
 
-    @Value("${guoRen.baseUrl}")
-    private String baseUrl;
-
-    @Value("${guoRen.uploadUrl}")
-    private String uploadUrl;
-
-    @Value("${guoRen.redirectUrl}")
-    private String redirectUrl;
+    @Autowired
+    private GuorenApiConfigurationProperties properties;
 
     @Value("${upload.file.path}")
     private String uploadFilePath;
@@ -149,7 +144,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         m.put("thirdCode", thirdCode);
 
         String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr);
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
 
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
@@ -169,7 +164,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         CarModelReq carModelReq = CarModelReq.buildCarModelParam(carInfo);
 
         String bodyStr = RequestDto.builRequestDto(carModelReq, "IIRBT00002");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr);
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
 
         CarModelResp rest = JsonUtils.toObject(result, CarModelResp.class);
 
@@ -351,7 +346,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     /**
      * 获取保险公司订单信息
      *
-     * @param quoteOrderNo
      */
     @Override
     @Transactional
@@ -531,7 +525,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
                         , new StringPart("fileGroup", formMap.get("fileGroup").toString())
                 };
 
-                String result = HttpUtil.sendPostFromFile(parts, uploadUrl);
+                String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
                 if (StringUtils.isEmpty(result)) throw new SystemException("国任,影像上传失败");
 
                 JSONObject jsonObject = JSONObject.parseObject(result);
@@ -553,10 +547,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      */
     public PayResp.DataDTO pay(InsAreaCompany iac) {
         //构造请求参数
-        PayReq req = PayReq.buildParam(iac, redirectUrl, channelInfo);
+        PayReq req = PayReq.buildParam(iac, properties.getRedirectUrl(), channelInfo);
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00008");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "获取支付链接,订单号:" + iac.getId());
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取支付链接,订单号:" + iac.getId());
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         PayResp resp = ResponseDto.buildBody(rest, PayResp.class);
@@ -576,7 +570,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00046");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "获取签名链接,订单号:" + iac.getId());
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取签名链接,订单号:" + iac.getId());
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         SignatureResp resp = ResponseDto.buildBody(rest, SignatureResp.class);
@@ -594,7 +588,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         m.put("policyNo", policyNo);
 
         String bodyStr = RequestDto.builRequestDto(m, "IIRBT00027");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr);
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         PolicyResp resp = ResponseDto.buildBody(rest, PolicyResp.class);
@@ -1249,7 +1243,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         VinQueryReq req = VinQueryReq.buildParam2(vinQueryReq, channelInfo);
 
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00009");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "vin码查询车辆,车牌号:" + vinQueryReq.getLicenseNo());
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "vin码查询车辆,车牌号:" + vinQueryReq.getLicenseNo());
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
 
@@ -1275,7 +1269,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         //构造请求参数
         CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00003");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "车价查询,车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "车价查询,车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
 
         if (rest.getPlatformCode().equals("T0000000")) {
@@ -1341,8 +1335,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00017");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "再次车价查询,车牌:" + licenseNo);
-//        String result = HttpUtil.sendPost(baseUrl, bodyStr);
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "再次车价查询,车牌:" + licenseNo);
+//        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
 
@@ -1379,7 +1373,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         while (boo) {
             String bodyStr = RequestDto.builRequestDto(req, "IIRBT00004");
-            String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "保费计算 |" + flag + ",车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
+            String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "保费计算 |" + flag + ",车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
             ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
             resp = ResponseDto.buildBody(rest, PremiumResp.class);
             if (rest.getPlatformCode().equals("T0000000")) {
@@ -1433,7 +1427,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum);
 
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00006");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "投保单保存,车牌号:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "投保单保存,车牌号:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         InsuranceSlipResp resp = ResponseDto.buildBody(rest, InsuranceSlipResp.class);
@@ -1453,7 +1447,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         SubmitAuditReq req = SubmitAuditReq.buildParam(iac, channelInfo);
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00007");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "核保提交");
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "核保提交");
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
@@ -1488,7 +1482,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         //投保单状态查询
         String bodyStr = RequestDto.builRequestDto(paramMap, "IIRBT00010");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "投保单状态查询");
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "投保单状态查询");
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         InsOrderStatusResp resp = ResponseDto.buildBody(rest, InsOrderStatusResp.class);
@@ -1519,7 +1513,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
 
         String bodyStr = RequestDto.builRequestDto(bodyMap, "IIIRBT00053");
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "获取非车列表,产品号:" + goodsCode);
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取非车列表,产品号:" + goodsCode);
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         NonAutoInsResp resp = ResponseDto.buildBody(rest, NonAutoInsResp.class);
@@ -1547,7 +1541,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         NonAutoInsOrderReq req = NonAutoInsOrderReq.buildParam(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
         String bodyStr = RequestDto.builRequestDto(req, "IIIRBT00054");
 
-        String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "创建非车订单");
+        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "创建非车订单");
 
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
@@ -1622,7 +1616,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     /**
      * 构造交强险  商业险 转报code
      *
-     * @param xlboo true 继续请求
      * @author: lig
      * @date: 2023年10月13日 0013
      */

+ 1 - 1
src/main/resources/application-prod.yml

@@ -224,7 +224,7 @@ api:
 
 
 # 国任财险生产
-guoRen:
+guoren:
   api:
     baseUrl: https://rbt.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
     uploadUrl: https://rbt.guorenpcic.com/api/grecar/photo/upload

+ 1 - 1
src/main/resources/application-test.yml

@@ -324,7 +324,7 @@ api:
 
 
 # 国任财险测试
-guoRen:
+guoren:
   api:
     baseUrl: https://devyun.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
     uploadUrl: https://devyun.guorenpcic.com/api/grecar/photo/upload