Răsfoiți Sursa

1.修改国任代码逻辑

wks 2 ani în urmă
părinte
comite
aca725f9d6

+ 20 - 24
src/main/java/com/ydtech/modules/ins/model/guoRen/RequestDto.java

@@ -1,31 +1,27 @@
 package com.ydtech.modules.ins.model.guoRen;
 
 import cn.hutool.core.date.DateUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.annotation.JSONField;
-import com.ctc.wstx.util.DataUtil;
-import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
-import java.time.format.DateTimeFormatter;
 import java.util.Date;
 
 @Data
 public class RequestDto {
 
-//    @JsonProperty("PACKAGE")
-    @JSONField(name="PACKAGE")
+    //    @JsonProperty("PACKAGE")
+    @JSONField(name = "PACKAGE")
     private RequestPackage rPackage;
 
     @Data
     public static class RequestPackage {
-//        @JsonProperty("HEAD")
-        @JSONField(name="HEAD")
-        private RequestHead rHead ;
+        //        @JsonProperty("HEAD")
+        @JSONField(name = "HEAD")
+        private RequestHead rHead;
 
-//        @JsonProperty("BODY")
-        @JSONField(name="BODY")
-        private Object rBody ;
+        //        @JsonProperty("BODY")
+        @JSONField(name = "BODY")
+        private Object rBody;
 
     }
 
@@ -36,74 +32,74 @@ public class RequestDto {
          * 客户端编码
          * GBK,UTF-8等
          */
-        @JSONField(name="CLIENT_ENCODE")
+        @JSONField(name = "CLIENT_ENCODE")
         private String clientEncode = "UTF-8";
 
         /**
          * 渠道编码
          * 测试环境:jindouyun
          */
-        @JSONField(name="CHANNEL_CODE")
+        @JSONField(name = "CHANNEL_CODE")
         private String channelCode;
 
         /**
          * 接口代码
          * 见具体接口说明
          */
-        @JSONField(name="INTERFACE_CODE")
+        @JSONField(name = "INTERFACE_CODE")
         private String interfaceCode;
 
         /**
          * 服务代码
          * httpJson方式填“GR0002”
          */
-        @JSONField(name="SERVE_CODE")
+        @JSONField(name = "SERVE_CODE")
         private String serveCode;
 
         /**
          * 业务流水号
          * 唯一标识;此流水号在客户方必须唯一性
          */
-        @JSONField(name="BUSINESS_UUID")
+        @JSONField(name = "BUSINESS_UUID")
         private String businessUuid;
 
         /**
          * 访问账号
          * 测试环境:guoren_tp_jdy
          */
-        @JSONField(name="INTERFACE_USER_CODE")
+        @JSONField(name = "INTERFACE_USER_CODE")
         private String interfaceUserCode;
 
         /**
          * 访问口令
          * 测试环境:Q31gIrhZgQc=
          */
-        @JSONField(name="INTERFACE_PWD")
+        @JSONField(name = "INTERFACE_PWD")
         private String interfacePwd;
 
         /**
          * 请求时间
          * 格式:yyyy-MM-dd HH:mm:ss:ssss,要求:精确至毫秒
          */
-        @JSONField(name="REQUEST_TIME")
+        @JSONField(name = "REQUEST_TIME")
         private String requestTime;
 
         /**
          * 报文集合元素标志
          * 报文集合元素名称或名称后缀标识
          */
-        @JSONField(name="XML_LIST_SUFFIX")
+        @JSONField(name = "XML_LIST_SUFFIX")
         private String xmlListSuffix;
 
         /**
          * 环境类型
          * 测试环境填”Y”;生产环境填”N”
          */
-        @JSONField(name="IFTEST")
+        @JSONField(name = "IFTEST")
         private String iftest;
     }
 
-    public static String builRequestDto(Object body,String apiCode){
+    public static RequestDto builRequestDto(Object body, String apiCode) {
         RequestDto dto = new RequestDto();
         RequestDto.RequestHead rHead = new RequestDto.RequestHead();
         //=========
@@ -128,7 +124,7 @@ public class RequestDto {
         rpackage.setRBody(body);
         dto.setRPackage(rpackage);
 
-        return JSON.toJSONString(dto);
+        return dto;
 
     }
 }

+ 12 - 19
src/main/java/com/ydtech/modules/ins/model/guoRen/ResponseDto.java

@@ -2,42 +2,35 @@ package com.ydtech.modules.ins.model.guoRen;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.annotation.JSONField;
-import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
-import org.apache.poi.ss.formula.functions.T;
-
-import java.util.List;
 
 @NoArgsConstructor
 @Data
 public class ResponseDto<T> {
 
 
-    @JSONField(name="PLATFORM_STS")
+    @JSONField(name = "PLATFORM_STS")
     private String platformSts;
-    @JSONField(name="PLATFORM_TYPE")
+
+    @JSONField(name = "PLATFORM_TYPE")
     private String platformType;
-    @JSONField(name="PLATFORM_CODE")
+
+    @JSONField(name = "PLATFORM_CODE")
     private String platformCode;
-    @JSONField(name="PLATFORM_MSG")
+
+    @JSONField(name = "PLATFORM_MSG")
     private String platformMsg;
-    @JSONField(name="RESPONSE_BODY")
+
+    @JSONField(name = "RESPONSE_BODY")
     private T responseBody;
 
 
-    public static <T> T buildBody(ResponseDto dto,Class<T> classObj) {
-        if(null != dto.getResponseBody()){
-            T s = JSON.parseObject(dto.getResponseBody().toString(), classObj);
-            return s;
-//            dto.setResponseBody(s);
+    public static <T> T buildBody(ResponseDto dto, Class<T> classObj) {
+        if (null != dto.getResponseBody()) {
+            return JSON.parseObject(dto.getResponseBody().toString(), classObj);
         }
         return null;
     }
 
-//    @NoArgsConstructor
-//    @Data
-//    public static class RESPONSEBODYDTO {
-//        private Object body;
-//    }
 }

+ 56 - 1
src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java

@@ -1,12 +1,24 @@
 package com.ydtech.modules.order.components.gouren;
 
 
+import com.alibaba.fastjson.JSON;
+import com.ydtech.config.properties.GuorenApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.ins.model.guoRen.RequestDto;
+import com.ydtech.modules.ins.model.guoRen.ResponseDto;
+import com.ydtech.modules.order.components.InsCrawlerOrderComponents;
+import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
+import com.ydtech.modules.order.utils.InsuranceLog;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.*;
+import org.springframework.lang.Nullable;
 import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
 
 
 /**
- * @version
  * @description: 国任财险
  * @author: wenks
  * @date: 2023/10/26 15:54
@@ -15,7 +27,50 @@ import org.springframework.stereotype.Component;
 @Component
 public class GuorenRequestApiComponent {
 
+    private final RestTemplate restTemplate;
 
+    private final InsCrawlerOrderComponents insCrawlerOrderComponents;
+
+    private final GuorenApiConfigurationProperties guorenApiConfigurationProperties;
+
+    public GuorenRequestApiComponent(InsCrawlerOrderComponents insCrawlerOrderComponents, GuorenApiConfigurationProperties guorenApiConfigurationProperties, RestTemplate restTemplate) {
+        this.insCrawlerOrderComponents = insCrawlerOrderComponents;
+        this.guorenApiConfigurationProperties = guorenApiConfigurationProperties;
+        this.restTemplate = restTemplate;
+    }
+
+
+    public <T, B> B post(String logId, String message, @Nullable T requestBody) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+
+        HttpEntity<T> httpEntity = new HttpEntity<>(requestBody, httpHeaders);
+
+        String request = JSON.toJSONString(requestBody);
+        String baseUrl = guorenApiConfigurationProperties.getBaseUrl();
+
+        InsuranceLog.infoLog(logId, "\n\t---------> {} \n\t---------> URL: {} \n\t---------> 请求参数: {}", message, baseUrl, request);
+        ParameterizedTypeReference<ResponseDto<B>> typeRef = new ParameterizedTypeReference<ResponseDto<B>>() {
+
+        };
+        ResponseEntity<ResponseDto<B>> exchange = restTemplate.exchange(baseUrl, HttpMethod.POST, httpEntity, typeRef);
+        ResponseDto<B> body1 = exchange.getBody();
+
+        if (body1 == null) {
+            throw new SystemException(message + "接口请求失败");
+        }
+
+        B body = body1.getResponseBody();
+        String response = JSON.toJSONString(body);
+        InsuranceLog.infoLog(logId, "\n\t---------> {} \n\t---------> 响应参数:{}", message, response);
+        return body;
+    }
+
+    public <B> B request(Object o, PlatformInterfaceCode platformInterfaceCode) {
+        RequestDto requestBody = RequestDto.builRequestDto(o, platformInterfaceCode.getCode());
+        ResponseDto<B> request = post(InsuranceEnum.XDCX.getPinyin(), platformInterfaceCode.getDesc(), requestBody);
+        return request.getResponseBody();
+    }
 
 
 }

+ 44 - 0
src/main/java/com/ydtech/modules/order/entity/api/guoren/constants/PlatformInterfaceCode.java

@@ -0,0 +1,44 @@
+package com.ydtech.modules.order.entity.api.guoren.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum PlatformInterfaceCode {
+
+    API_IIRBT00002("IIRBT00002", "车型(决策单元)查询"),
+
+    API_IIRBT00003("IIRBT00003", "车价查询"),
+
+    API_IIRBT00004("IIRBT00004", "保费计算"),
+
+    API_IIRBT00006("IIRBT00006", "投保单保存"),
+
+    API_IIRBT00007("IIRBT00007", "提交核保"),
+
+    API_IIRBT00008("IIRBT00008", "支付接口"),
+
+    API_IIRBT00009("IIRBT00009", "VIN码查询(针对进口车型)"),
+
+    API_IIRBT00010("IIRBT00010", "投保单状态查询"),
+
+    API_IIRBT00017("IIRBT00017", "匹配多条车型记录需再次做车价查询"),
+
+    API_IIRBT00018("IIRBT00018", "获取出单所需的基本信息"),
+
+    API_IIRBT00027("IIRBT00027", "加密保单号并获取电子保单(标识)下载链接"),
+
+    API_IIRBT00046("IIRBT00046", "获取电子投保单链接(核保通过状态)"),
+
+    API_IIIRBT00053("IIIRBT00053", "查询非车商品信息"),
+
+    API_IIIRBT00054("IIIRBT00054", "创建非车订单");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 69 - 178
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -41,15 +41,16 @@ import com.ydtech.modules.ins.model.yc.ruote.Vhlowner;
 import com.ydtech.modules.ins.service.InsApiLogService;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
 import com.ydtech.modules.order.dao.InsTaskImagesMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.api.guoren.constants.PlatformInterfaceCode;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.vo.*;
 import com.ydtech.modules.order.service.GuorenOrderApiService;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
-import com.ydtech.modules.order.service.YongchengOrderApiService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.*;
 import com.ydtech.utils.baidu.FileUtil;
@@ -57,12 +58,14 @@ import lombok.Data;
 import org.apache.commons.httpclient.methods.multipart.FilePart;
 import org.apache.commons.httpclient.methods.multipart.Part;
 import org.apache.commons.httpclient.methods.multipart.StringPart;
+import org.apache.poi.hssf.record.SSTRecord;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.File;
@@ -125,6 +128,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     @Autowired
     InsTaskImagesMapper insTaskImagesMapper;
 
+    @Autowired
+    private GuorenRequestApiComponent guorenRequestApiComponent;
+
+
     private static ChannelInfoDto channelInfo = null;
 
 
@@ -142,16 +149,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     public HttpResult gainChannelInfo(String thirdCode) {
         Map m = new HashMap();
         m.put("thirdCode", thirdCode);
+//        String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
+        ChannelInfoResp request = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00018);
 
-        String bodyStr = RequestDto.builRequestDto(m, "IIRBT00018");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
-
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        ChannelInfoResp resp = ResponseDto.buildBody(rest, ChannelInfoResp.class);
-//        channelInfo = resp.getData().get(0);
-
-        return HttpResult.ok(resp);
+        return HttpResult.ok(request);
     }
 
 
@@ -160,15 +161,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      */
     @Override
     public HttpResult modelsQueryApi(CarInfoVo carInfo) {
-
         CarModelReq carModelReq = CarModelReq.buildCarModelParam(carInfo);
-
-        String bodyStr = RequestDto.builRequestDto(carModelReq, "IIRBT00002");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
-
-        CarModelResp rest = JsonUtils.toObject(result, CarModelResp.class);
-
-        return HttpResult.ok(rest);
+        CarModelResp request = guorenRequestApiComponent.request(carModelReq, PlatformInterfaceCode.API_IIRBT00002);
+        return HttpResult.ok(request);
     }
 
 
@@ -345,7 +340,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
     /**
      * 获取保险公司订单信息
-     *
      */
     @Override
     @Transactional
@@ -473,25 +467,22 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
         // 获取协议配置信息
         ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
-        if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
         this.channelInfo = channelInfo;
 
         InsOrders order = insOrdersService.getById(iac.getOrderno());
-
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
-
         /**
          *  4、投保单保存
          */
         InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, iac.getInsOrderNo());
-        if (insuranceSlip.getResultCode() == 1) return HttpResult.error(insuranceSlip.getResultMsg());
+        if (insuranceSlip.getResultCode() == 1) {
+            return HttpResult.error(insuranceSlip.getResultMsg());
+        }
         iac.setJqapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoCI());
         iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
-
         //影像上传
         imageUpdate(iac, channelInfo);
         insAreaCompanyService.updateById(iac);
-
         return HttpResult.ok();
     }
 
@@ -511,24 +502,17 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         List<InsUploadImagesDto> insUploadImagesDtos = insTaskImagesMapper.getByOrderNoInsUploadImagesDtoList(iac.getOrderno());
         insUploadImagesDtos.stream().forEach(a -> {
-
             try {
-
 //                FilePart file1 = new FilePart(fileName, new File("https://img0.baidu.com/it/u=3021883569,1259262591&fm=253&fmt=auto&app=120&f=JPEG?w=1140&h=641"));
                 FilePart file1 = new FilePart("file", new File(a.getFilePath()));
 
 
-                Part[] parts = {file1
-                        , new StringPart("businessNo", formMap.get("businessNo").toString())
-                        , new StringPart("operatorCode", formMap.get("operatorCode").toString())
-                        , new StringPart("comCode", formMap.get("comCode").toString())
-                        , new StringPart("fileGroup", formMap.get("fileGroup").toString())
-                };
+                Part[] parts = {file1, new StringPart("businessNo", formMap.get("businessNo").toString()), new StringPart("operatorCode", formMap.get("operatorCode").toString()), new StringPart("comCode", formMap.get("comCode").toString()), new StringPart("fileGroup", formMap.get("fileGroup").toString())};
 
                 String result = HttpUtil.sendPostFromFile(parts, properties.getUploadUrl());
                 if (StringUtils.isEmpty(result)) throw new SystemException("国任,影像上传失败");
 
-                JSONObject jsonObject = JSONObject.parseObject(result);
+                JSONObject jsonObject = JSON.parseObject(result);
                 if (StringUtils.toInt(jsonObject.get("resultCode")) == 0) return;
                 throw new SystemException("国任,影像上传失败,类型:" + a.getImageType());
 
@@ -548,15 +532,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     public PayResp.DataDTO pay(InsAreaCompany iac) {
         //构造请求参数
         PayReq req = PayReq.buildParam(iac, properties.getRedirectUrl(), channelInfo);
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00008");
-
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取支付链接,订单号:" + iac.getId());
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        PayResp resp = ResponseDto.buildBody(rest, PayResp.class);
-
-        if (null != rest) return resp.getData();
-
+        PayResp payResp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00008);
+        if (null != payResp) {
+            return payResp.getData();
+        }
         return null;
     }
 
@@ -565,16 +544,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      */
     public SignatureResp.DataDTO signature(InsAreaCompany iac) {
         //构造请求参数
-        Map req = new HashMap();
+        Map<String, String> req = new HashMap<>();
         req.put("proposalNo", StringUtils.isEmpty(iac.getJqapplyno()) ? iac.getSyapplyno() : iac.getJqapplyno());
-
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00046");
-
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取签名链接,订单号:" + iac.getId());
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        SignatureResp resp = ResponseDto.buildBody(rest, SignatureResp.class);
-
+        SignatureResp resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00046);
         return resp.getData();
 
     }
@@ -583,18 +555,12 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * 电子保单
      */
     public PolicyResp policyPrint(String policyNo) {
-
-        Map m = new HashMap();
+        Map<String, String> m = new HashMap<>();
         m.put("policyNo", policyNo);
-
-        String bodyStr = RequestDto.builRequestDto(m, "IIRBT00027");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        PolicyResp resp = ResponseDto.buildBody(rest, PolicyResp.class);
-
-        if (null != resp && resp.getResultCode() == 0) return resp;
-
+        PolicyResp resp = guorenRequestApiComponent.request(m, PlatformInterfaceCode.API_IIRBT00027);
+        if (null != resp && resp.getResultCode() == 0) {
+            return resp;
+        }
         return null;
     }
 
@@ -1203,16 +1169,14 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * 构造 车价查询uid编号
      */
     private String buildCarPriceQueryUidNum(String orderNo) {
-        String redisNum = orderNo + "-guoRen" + "-CarPriceQuery-uid";
-        return redisNum;
+        return orderNo + "-guoRen" + "-CarPriceQuery-uid";
     }
 
     /**
      * 构造 投保单的redis key
      */
     private String buildInsuranceSlipNum(String orderNo) {
-        String redisNum = orderNo + "-guoRen" + "-InsuranceSlipNum";
-        return redisNum;
+        return orderNo + "-guoRen" + "-InsuranceSlipNum";
     }
 
 
@@ -1223,11 +1187,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @date: 2023年09月13日 0013
      */
     private InsuranceSlipResp gainInsuranceSlip(String orderNo) {
-
         String s = RedisUtils.get(buildInsuranceSlipNum(orderNo));
-
         InsuranceSlipResp insuranceSlip = JSON.parseObject(s, InsuranceSlipResp.class);
-
         return insuranceSlip;
     }
 
@@ -1241,22 +1202,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      */
     public VinQueryResp.DataDTO vinQuery(VinQueryReq vinQueryReq) {
         VinQueryReq req = VinQueryReq.buildParam2(vinQueryReq, channelInfo);
-
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00009");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "vin码查询车辆,车牌号:" + vinQueryReq.getLicenseNo());
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-
-        if (rest.getPlatformCode().equals("T0000000")) {
-            VinQueryResp resp = ResponseDto.buildBody(rest, VinQueryResp.class);
-            if (resp.getResultCode() == 1) {
-                throw new SystemException(resp.getResultMsg() == null ? "未找到车辆信息" : resp.getResultMsg());
-            }
-            return resp.getData().get(0);
+        VinQueryResp resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00009);
+        if (resp.getResultCode() == 1) {
+            throw new SystemException(resp.getResultMsg() == null ? "未找到车辆信息" : resp.getResultMsg());
         }
-
-
-        return null;
+        return resp.getData().get(0);
 
     }
 
@@ -1268,19 +1218,17 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
         //构造请求参数
         CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00003");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "车价查询,车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
+        JSONObject request = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00003);
+        Object cars = request.get("cars");
 
-        if (rest.getPlatformCode().equals("T0000000")) {
+        if (ObjectUtils.isEmpty(cars)) {
 
             //多条
-            CarPriceMuchResp respMuch = ResponseDto.buildBody(rest, CarPriceMuchResp.class);
+            CarPriceMuchResp respMuch = request.toJavaObject(CarPriceMuchResp.class);
 
             //单条
             if (CollUtil.isEmpty(respMuch.getData().getCars())) {
-                CarPriceResp resp = ResponseDto.buildBody(rest, CarPriceResp.class);
-
+                CarPriceResp resp = request.toJavaObject(CarPriceResp.class);
                 if (resp.getResultCode() == 1) {
                     throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
                 }
@@ -1304,9 +1252,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
                     } else {
                         //匹配的车辆信息数据里  未匹配成功   默认选择第一条
                         //排序  年款降序  金额升序
-                        vehicleInfoList = vehicleInfoList.stream().sorted(Comparator.comparing(CarPriceMuchResp.DataDTO.CarsDTO::getCarYear)
-                                        .thenComparing((o1, o2) -> Integer.compare(StringUtils.toInt(o2.getCarYear()), StringUtils.toInt(o1.getCarYear()))).reversed())
-                                .collect(Collectors.toList());
+                        vehicleInfoList = vehicleInfoList.stream().sorted(Comparator.comparing(CarPriceMuchResp.DataDTO.CarsDTO::getCarYear).thenComparing((o1, o2) -> Integer.compare(StringUtils.toInt(o2.getCarYear()), StringUtils.toInt(o1.getCarYear()))).reversed()).collect(Collectors.toList());
 
                         confirmCarMuch = vehicleInfoList.get(0);
                     }
@@ -1327,24 +1273,14 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * (多条)车价查询
      */
     public CarPriceResp.DataDTO carPriceQueryMuch(String uuid, CarPriceMuchResp.DataDTO.CarsDTO carsDTO, String licenseNo) {
-
         //构造请求参数
         CarPriceMuchReq req = new CarPriceMuchReq();
         req.setUuid(uuid);
         req.setCarPriceMuchResp(carsDTO);
-
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00017");
-
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "再次车价查询,车牌:" + licenseNo);
-//        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr);
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-
+        ResponseDto rest = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00017);
 
         if (rest.getPlatformCode().equals("T0000000")) {
-
             CarPriceResp resp = ResponseDto.buildBody(rest, CarPriceResp.class);
-
             if (resp.getResultCode() == 1) {
                 throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
             }
@@ -1372,29 +1308,23 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         StringBuffer flag = new StringBuffer();
 
         while (boo) {
-            String bodyStr = RequestDto.builRequestDto(req, "IIRBT00004");
-            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")) {
 
+            resp = guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00004);
 //                //警告
 //                if (resp.getResultCode() == 0) throw new SystemException(resp.getResultMsg());
 
-                //1、 交强险重复投保 替换时间
-                boo = buildCiRepeatParam(boo, resp, requestInfoList, req);
-                if (boo) {
-                    flag.append("重复投保处理 |");
-                    continue;
-                }
-
-                //2、 转保
-                boo = buildCheckCodeParam(resp, requestInfoList, req);
-                if (boo) {
-                    flag.append("转保处理 |");
-                    continue;
-                }
+            //1、 交强险重复投保 替换时间
+            boo = buildCiRepeatParam(boo, resp, requestInfoList, req);
+            if (boo) {
+                flag.append("重复投保处理 |");
+                continue;
+            }
 
+            //2、 转保
+            boo = buildCheckCodeParam(resp, requestInfoList, req);
+            if (boo) {
+                flag.append("转保处理 |");
+                continue;
             }
 
         }
@@ -1405,8 +1335,10 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         resp.getData().setBiStartDate(req.getBi().getPrpTmain().getStartDate());
         resp.getData().setBiEndDate(req.getBi().getPrpTmain().getEndDate());
 
-        if (null != resp && resp.getResultCode() == 1)
+        if (null != resp && resp.getResultCode() == 1) {
             throw new SystemException(resp.getResultMsg() == null ? "保费计算失败,请联系管理员" : resp.getResultMsg());
+        }
+
         if (null != resp) return resp.getData();
 
 
@@ -1422,17 +1354,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @date: 2023年08月18日 0018
      */
     public InsuranceSlipResp insuranceSlip(BaseQuoteInfoVo yaQuoteInfoVo, String carPriceNum) {
-
         //构造请求参数
         InsuranceSlipReq req = InsuranceSlipReq.buildParam(yaQuoteInfoVo, carPriceNum);
-
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00006");
-        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);
-
-        return resp;
+        return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00006);
     }
 
 
@@ -1445,14 +1369,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     public SubmitAuditResp submitAudit(InsAreaCompany iac) {
         //构造请求参数
         SubmitAuditReq req = SubmitAuditReq.buildParam(iac, channelInfo);
-        String bodyStr = RequestDto.builRequestDto(req, "IIRBT00007");
 
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "核保提交");
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
-
-        return resp;
+        return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIRBT00007);
     }
 
     /**
@@ -1462,9 +1380,6 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
      * @date: 2023-09-26
      */
     public InsOrderStatusResp insOrderStatus(InsAreaCompany iac) {
-//        //构造请求参数
-//        SubmitAuditReq req = SubmitAuditReq.buildParam(insuranceSlip, channelInfo);
-
 
         List<String> proposalNos = new ArrayList<>();
         String jqNo = iac.getJqapplyno();
@@ -1475,19 +1390,11 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         if (StringUtils.isNotEmpty(syNo)) {
             proposalNos.add(syNo);
         }
-        Map paramMap = new HashMap();
+        Map<String, List<String>> paramMap = new HashMap<>();
         paramMap.put("proposalNos", proposalNos);
 
-
         //投保单状态查询
-        String bodyStr = RequestDto.builRequestDto(paramMap, "IIRBT00010");
-
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "投保单状态查询");
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        InsOrderStatusResp resp = ResponseDto.buildBody(rest, InsOrderStatusResp.class);
-
-        return resp;
+        return guorenRequestApiComponent.request(paramMap, PlatformInterfaceCode.API_IIRBT00010);
     }
 
 
@@ -1500,28 +1407,18 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
     @Override
     public NonAutoInsResp.DataDTO gainNonAutoInsList(String goodsCode) {
 
+        Map<String, Object> bodyMap = new HashMap<>();
 
-        Map bodyMap = new HashMap();
-        Map bodyParamsMap = new HashMap();
+        Map<String, Object> bodyParamsMap = new HashMap<>();
         bodyParamsMap.put("goodsCode", goodsCode);
         bodyMap.put("data", bodyParamsMap);
-
         bodyMap.put("systemCode", "TQDL");
         bodyMap.put("requestTime", Instant.now().getEpochSecond() * 1000);
 
-//        String params = JSON.toJSONString(bodyMap);
-
-
-        String bodyStr = RequestDto.builRequestDto(bodyMap, "IIIRBT00053");
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "获取非车列表,产品号:" + goodsCode);
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        NonAutoInsResp resp = ResponseDto.buildBody(rest, NonAutoInsResp.class);
-
-//        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-//        SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
-        if (null != resp.getData()) return resp.getData();
-
+        NonAutoInsResp resp = guorenRequestApiComponent.request(bodyMap, PlatformInterfaceCode.API_IIIRBT00053);
+        if (null != resp.getData()) {
+            return resp.getData();
+        }
 
         return null;
     }
@@ -1539,14 +1436,8 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         VinQueryResp.DataDTO vinQ = new VinQueryResp.DataDTO();
         //构造请求参数
         NonAutoInsOrderReq req = NonAutoInsOrderReq.buildParam(yaQuoteInfoVo, vinQ, accidentalDrivingVo, channelInfo, carPriceUuid);
-        String bodyStr = RequestDto.builRequestDto(req, "IIIRBT00054");
-
-        String result = HttpUtil.sendPost(properties.getBaseUrl(), bodyStr, log, "创建非车订单");
-
-        ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
-        SubmitAuditResp resp = ResponseDto.buildBody(rest, SubmitAuditResp.class);
 
-        return resp;
+        return guorenRequestApiComponent.request(req, PlatformInterfaceCode.API_IIIRBT00054);
     }
 
 
@@ -1572,7 +1463,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
             String newEndDate = "";
 
             //及时起保
-            if (start.getHour() > 0 && start.getHour() < 59) {
+            if (start.getHour() > 0) {
                 LocalDateTime end = start.plusYears(1L);
                 newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
                 newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);