ligang134 2 жил өмнө
parent
commit
37211f70d6

+ 16 - 4
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -317,7 +317,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         String textHead = "==========永诚API方式 - 车架号:" + carInfo.getVinNo() + " - 报价 ";
         while (!boo) {
             rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0, textHead);
-            if (rr.getHead().getErrorCode().equals("009999")) return HttpResult.error(rr.getHead().getErrorMessage());
+            if (rr.getHead().getErrorCode().equals("009999") && (rr.getHead().getErrorMessage().contains("车主" ) || rr.getHead().getErrorMessage().contains("投保人" ) || rr.getHead().getErrorMessage().contains("被保人" ))) return HttpResult.error(rr.getHead().getErrorMessage());
             //处理返回信息
             //1、交强险重复投保处理
             boo = ciRepetitionInsure(rr, m);
@@ -374,6 +374,18 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //            updateApiLog(apiLog, iac);
         quoteRespVo.setCompanyId(iac.getId());
 
+
+//        CustomerInfoVo policyHolderInfo = yaQuoteInfoVo.getPolicyHolderInfo().set;
+//        //被保人信息
+//        CustomerInfoVo insuredPersonInfo = yaQuoteInfoVo.getInsuredPersonInfo();
+//        //车主
+//        CustomerInfoVo ownerInfo =
+
+        order.setOwnerinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getOwnerInfo())));
+        order.setInsureinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getInsuredPersonInfo())));
+        order.setApplyinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getPolicyHolderInfo())));
+
+        insOrdersService.updateById(order);
         if (CollUtil.isNotEmpty(requestInfoList)) {
 //            requestInfoList.stream().forEach(c -> {
 //                System.err.println("========请求流程信息==========:" + c);
@@ -607,7 +619,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             String responseData = httpPostResultLog(gainXmlMapper(), m, YcBuildData.API_AUDIT, "永诚API方式 - 核保 - ");
 
             String cleanStr = YcBuildData.cleanResponseStr(responseData);
-            AuditResponse rd = xmlMapper.readValue(cleanStr, AuditResponse.class);
+            AuditResponse rd = gainXmlMapper().readValue(cleanStr, AuditResponse.class);
 
             if (rd.getResponseHead().getReturnCode().equals("0000")) {
                 String statusJq = StringUtils.toString(rd.getStatusJq(), "");
@@ -661,7 +673,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         } catch (SystemException e) {
             return HttpResult.error(e.getMessage());
         } catch (Exception e) {
-//            e.printStackTrace();
+            e.printStackTrace();
             log.error("===永诚API方式--核保报错(订单号-{}):{}", quoteOrderNo, e.getMessage());
             return HttpResult.error("系统错误,请联系管理员");
         }
@@ -2170,7 +2182,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      * @date: 2023年05月18日 0018
      */
     private <T> T requestApi(Object m, T response, InsAreaCompany iac, String reqUrl, InsQuoteFlow iqf, String textHead) {
-        String responseData = httpPostResultLog(xmlMapper, m, reqUrl, textHead);
+        String responseData = httpPostResultLog(gainXmlMapper(), m, reqUrl, textHead);
         if (responseData.contains("报价返回信息异常")) {
             throw new SystemException("永诚报价请求负荷,请稍后重试。");
         }