Преглед изворни кода

fix 国任保险登录失效后重新登录,需手动输入验证码

liub пре 4 месеци
родитељ
комит
2b551318c9
12 измењених фајлова са 164 додато и 48 уклоњено
  1. 5 0
      commons/src/main/java/com/jzg/commons/entity/quote/vo/base/LoginBase.java
  2. 2 1
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/component/RequestComponent.java
  3. 4 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/GetCaptchaRequest.java
  4. 1 1
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/GetCaptchaResponse.java
  5. 39 0
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/api/entity/Response/IdentifyCodeDataResponse.java
  6. 35 6
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/component/GuoRenCrawlerRequestComponent.java
  7. 0 24
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/response/GuoRenCrawlerIdentifyCodeData.java
  8. 7 0
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/GuoRenCrawlerOrderService.java
  9. 10 0
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerOrderServiceImpl.java
  10. 18 6
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerQuoteProcessServiceImpl.java
  11. 16 7
      tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerRequestImpl.java
  12. 27 3
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

+ 5 - 0
commons/src/main/java/com/jzg/commons/entity/quote/vo/base/LoginBase.java

@@ -1,5 +1,6 @@
 package com.jzg.commons.entity.quote.vo.base;
 
+import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -38,4 +39,8 @@ public class LoginBase {
      */
     private int signInMethod;
 
+    /**
+     * 协议id 或 账号id
+     */
+    private String agreementId;
 }

+ 2 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/component/RequestComponent.java

@@ -545,7 +545,6 @@ public class RequestComponent {
      * @return <Response> ResponseEntity<Response>
      */
     public <Response> ResponseEntity<Response> post(String url, Object body, Class<Response> responseClass, HttpHeaders headers) {
-        log.info("URL的值:{},body的值1:{}", url, body);
         WebClient webClient = selectNoSSLWebClient2();
         try {
             // 创建一个不带Accept-Encoding的请求头,避免服务器返回压缩数据
@@ -577,6 +576,8 @@ public class RequestComponent {
             // 判断返回的字符串是否为有效的JSON格式
             if (isValidJson(responseBody)) {
                 result = JSON.parseObject(responseBody, responseClass);
+                InsuranceLog.infoLog(InsuranceEnum.XDCX.getPinyin(), "\t---------> URl: {} \t---------> 请求参数:{}", url, BodyInserters.fromValue(body));
+                InsuranceLog.infoLog(InsuranceEnum.XDCX.getPinyin(), "\t---------> 响应参数:{}", result);
             }else{
                 result = (Response)responseBody;
             }

+ 4 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/GetCaptchaRequest.java

@@ -34,4 +34,8 @@ public class GetCaptchaRequest implements Serializable {
      */
     private String phone;
 
+    /**
+     * 协议id 或 账号id
+     */
+    private String agreementId;
 }

+ 1 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/GetCaptchaResponse.java

@@ -22,7 +22,7 @@ public class GetCaptchaResponse  implements Serializable {
     /**
      * 验证码编号
      */
-    private String captchaId;
+    private String identifyId;
 
     /**
      * 验证码图片

+ 39 - 0
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/api/entity/Response/IdentifyCodeDataResponse.java

@@ -0,0 +1,39 @@
+package com.jzg.quotation.guoren.api.entity.Response;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+/**
+ * @author wks
+ * @version 1.0
+ * @description: 【国任财险】 直连 发送验证码响应
+ * @date 2025/11/11 15:12
+ */
+@NoArgsConstructor
+@Data
+public class IdentifyCodeDataResponse {
+
+    @JsonProperty(value = "resultCode")
+    @JSONField(name = "resultCode")
+    private Integer resultCode;
+    @JsonProperty(value = "resultMsg")
+    @JSONField(name = "resultMsg")
+    private String resultMsg;
+    @JsonProperty(value = "data")
+    @JSONField(name = "data")
+    private DataDTO data;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+    /**
+     * 验证码编号
+     */
+    @JsonProperty("identifyId")
+    private String identifyId;
+
+    }
+}

+ 35 - 6
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/component/GuoRenCrawlerRequestComponent.java

@@ -2,19 +2,24 @@ package com.jzg.quotation.guoren.crawler.component;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.TypeReference;
 import com.jzg.commons.constants.quote.enums.base.InsuranceEnum;
 import com.jzg.commons.entity.po.SysUploadFiles;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.commons.exception.TokenExpireException;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.commons.client.PlatformClient;
 import com.jzg.quotation.commons.component.RequestComponent;
 import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
 import com.jzg.quotation.commons.utils.HttpUtil;
 import com.jzg.quotation.commons.utils.InsuranceLog;
+import com.jzg.quotation.guoren.api.entity.Response.IdentifyCodeDataResponse;
 import com.jzg.quotation.guoren.crawler.constant.enums.RequestUrl;
 import com.jzg.quotation.guoren.crawler.entity.dto.GuoRenPrpTitemCarDTO;
 import com.jzg.quotation.guoren.crawler.entity.dto.PrpTMainDTO;
@@ -124,9 +129,11 @@ public class GuoRenCrawlerRequestComponent {
      * @param username 用户名称
      * @return 验证码编号
      */
-    public GuoRenCrawlerIdentifyCodeData identifyCode(String username) {
+    public IdentifyCodeDataResponse identifyCode(String username) {
         GuoRenCrawlerIdentifyCodeRequest identifyCodeRequest = new GuoRenCrawlerIdentifyCodeRequest(username);
-        return request(RequestUrl.IDENTIFY_CODE, identifyCodeRequest, new HttpHeaders());
+        IdentifyCodeDataResponse request = request(RequestUrl.IDENTIFY_CODE, identifyCodeRequest, IdentifyCodeDataResponse.class, new HttpHeaders());
+//        JSONObject.parseObject(request, IdentifyCodeDataResponse.class);
+        return request;
     }
 
     /**
@@ -140,7 +147,12 @@ public class GuoRenCrawlerRequestComponent {
      */
     public GuoRenCrawlerTokenData getToken(String username, String password, String identifyId, String identifyCode) {
         GuoRenCrawlerTokenRequest tokenRequest = new GuoRenCrawlerTokenRequest(username, password, identifyId, identifyCode);
-        return request(RequestUrl.LOGIN, tokenRequest, new HttpHeaders());
+        GuoRenCrawlerBaseResponse<GuoRenCrawlerTokenData> response = request(RequestUrl.LOGIN, tokenRequest, new ParameterizedTypeReference<>() {
+        }, new HttpHeaders());
+        if (response.getResultCode() == 40102 || response.getResultCode() == 40104) {
+            throw new SystemException(response.getResultMsg());
+        }
+        return response.getData();
     }
 
     /**
@@ -149,12 +161,29 @@ public class GuoRenCrawlerRequestComponent {
      * @param username    用户名
      * @param comCode     归属机构编码
      * @param httpHeaders 请求头
-     * @return 归属机构
+     * @return 归属机构(登录失效时resultCode为40301)
      */
     public GuoRenCrawlerGetLoginComInfoResponse getLoginComInfo(String username, String comCode, HttpHeaders httpHeaders) {
+        String url = guoRenCrawlerProperties.getBaseUrl() + RequestUrl.GET_LOGIN_COM_INFO.getUri();
         GuoRenCrawlerGetLoginComInfoRequest guoRenCrawlerGetLoginComInfoRequest = new GuoRenCrawlerGetLoginComInfoRequest(username);
-        List<GuoRenCrawlerGetLoginComInfoResponse> getLoginComInfoResponseList = request(RequestUrl.GET_LOGIN_COM_INFO, guoRenCrawlerGetLoginComInfoRequest, new ParameterizedTypeReference<>() {
-        }, httpHeaders);
+        HttpRequest request = HttpRequest.post(url)
+                .header(httpHeaders)
+                .body(JSON.toJSONString(guoRenCrawlerGetLoginComInfoRequest));
+        HttpResponse httpResponse = request.execute();
+        String body = httpResponse.body();
+
+        List<GuoRenCrawlerGetLoginComInfoResponse> getLoginComInfoResponseList;
+        // 判断返回是数组还是对象(登录失效可能返回对象)
+        if (body.trim().startsWith("[")) {
+            getLoginComInfoResponseList = JSON.parseArray(body, GuoRenCrawlerGetLoginComInfoResponse.class);
+        } else {
+            GuoRenCrawlerBaseResponse<List<GuoRenCrawlerGetLoginComInfoResponse>> response = JSON.parseObject(body, new TypeReference<>() {});
+            // 检查登录失效,返回特殊code码
+            if (response != null && response.getResultCode() == 40301) {
+                throw new  TokenExpireException();
+            }
+            getLoginComInfoResponseList = response.getData();
+        }
 
         if (CollectionUtils.isEmpty(getLoginComInfoResponseList)) {
             throw new SystemException("归属机构查询失败, 列表为空");

+ 0 - 24
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/entity/response/GuoRenCrawlerIdentifyCodeData.java

@@ -1,24 +0,0 @@
-package com.jzg.quotation.guoren.crawler.entity.response;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-
-/**
- * @author wks
- * @version 1.0
- * @description: 【国任财险】 直连 发送验证码响应
- * @date 2025/11/11 15:12
- */
-@NoArgsConstructor
-@Data
-public class GuoRenCrawlerIdentifyCodeData {
-
-    /**
-     * 验证码编号
-     */
-    @JsonProperty("identifyId")
-    private String identifyId;
-
-}

+ 7 - 0
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/GuoRenCrawlerOrderService.java

@@ -1,6 +1,7 @@
 package com.jzg.quotation.guoren.crawler.service;
 
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.quotation.guoren.crawler.entity.po.GuoRenCrawlerOrder;
 import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerProposalNoSaveData;
 
@@ -23,4 +24,10 @@ public interface GuoRenCrawlerOrderService {
      */
     GuoRenCrawlerOrder getById(String id);
 
+    /**
+     * 国任财险登录
+     *
+     * @param loginBase 登录信息
+     */
+     void guoRenlogin(LoginBase loginBase);
 }

+ 10 - 0
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerOrderServiceImpl.java

@@ -1,10 +1,12 @@
 package com.jzg.quotation.guoren.crawler.service.impl;
 
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.quotation.guoren.crawler.entity.po.GuoRenCrawlerOrder;
 import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerProposalNoSaveData;
 import com.jzg.quotation.guoren.crawler.repository.GuoRenCrawlerOrderRepository;
 import com.jzg.quotation.guoren.crawler.service.GuoRenCrawlerOrderService;
+import com.jzg.quotation.guoren.crawler.service.GuoRenCrawlerQuoteProcessService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -14,6 +16,8 @@ public class GuoRenCrawlerOrderServiceImpl implements GuoRenCrawlerOrderService
 
     private final GuoRenCrawlerOrderRepository guoRenCrawlerOrderRepository;
 
+    private final GuoRenCrawlerQuoteProcessService guoRenCrawlerQuoteProcessService;
+
     @Override
     public void saveOrderInfo(QuoteVo quoteVo, GuoRenCrawlerProposalNoSaveData guoRenCrawlerProposalNoSaveData) {
         GuoRenCrawlerOrder guoRenCrawlerOrder = new GuoRenCrawlerOrder();
@@ -30,4 +34,10 @@ public class GuoRenCrawlerOrderServiceImpl implements GuoRenCrawlerOrderService
         return guoRenCrawlerOrderRepository.getById(id);
     }
 
+    @Override
+    public void guoRenlogin(LoginBase loginBase) {
+        guoRenCrawlerQuoteProcessService.login(loginBase);
+    }
+
+
 }

+ 18 - 6
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerQuoteProcessServiceImpl.java

@@ -1,10 +1,16 @@
 package com.jzg.quotation.guoren.crawler.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.entity.quote.vo.identify.ReinsuranceCaptchaVo;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.commons.exception.TokenExpireException;
+import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.StringUtils;
+import com.jzg.quotation.commons.client.PlatformClient;
 import com.jzg.quotation.commons.service.ExteriorUtilsRequest;
 import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
 import com.jzg.quotation.commons.utils.TimeProcessing;
@@ -21,6 +27,9 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Service;
 
+import java.util.Map;
+import java.util.stream.Collectors;
+
 @Service
 @RequiredArgsConstructor
 public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteProcessService {
@@ -31,6 +40,7 @@ public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteP
 
     private final ExteriorUtilsRequest exteriorUtilsRequest;
 
+    private final PlatformClient platformClient;
 
     // 常量定义,消除魔法字符串
     private static final String CODE_TYPE_COM_CODE = "ComCode";
@@ -41,20 +51,22 @@ public class GuoRenCrawlerQuoteProcessServiceImpl implements GuoRenCrawlerQuoteP
 
     private static final String CODE_TYPE_PRPDUNIT_MAIN = "PrpdunitMain";
 
-
     @Override
     public void login(LoginBase loginBase) {
-        GuoRenCrawlerTokenData token = guoRenCrawlerRequestComponent.getToken(loginBase.getUsername(), loginBase.getPassword(), loginBase.getCaptchaId(), loginBase.getCaptcha());
-        guoRenCrawlerCacheComponent.cacheToken(loginBase.getUsername(), token.getToken());
+        HttpResult<PtlAgreementAttribution> agreementAttribution = platformClient.getAgreementAttribution(loginBase.getAgreementId());
+        AssertionUtils.isFail(agreementAttribution.getCode() == 500, "获取协议属性失败");
+        PtlAgreementAttribution ptlAgreementAttribution = agreementAttribution.getData();
+        GuoRenCrawlerTokenData token = guoRenCrawlerRequestComponent.getToken(ptlAgreementAttribution.getUsername(), ptlAgreementAttribution.getPassword(), loginBase.getCaptchaId(), loginBase.getCaptcha());
+        guoRenCrawlerCacheComponent.cacheToken(ptlAgreementAttribution.getUsername(), token.getToken());
     }
 
     @Override
     public HttpHeaders getHeaders(String username) {
         HttpHeaders headers = new HttpHeaders();
-//        String token = guoRenCrawlerCacheComponent.getToken(username);
-        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3Nzg5MjY2MDB9.UYGTs0DQgbZJinMWJExUV18JhfJW23JonveQVVq6N5Muy_vu6Py8pL-AI5Ohv0BDoCCfdOD7SjLmiCqGy4uU9130O1_QlLzyxsriiBKUPXPJKbipftpqSdjYyFSgfNSIySO99hs005Ip89HnkaT34ephMA-C8jyyxGShQdNkuxI";
+        String token = guoRenCrawlerCacheComponent.getToken(username);
+//        String token = "eyJzdWIiOiJXMzAwMDM5OSIsInVzZXJJZCI6IjQ5NjE4MSIsIm5hbWUiOiLmnY7mmKXmooUiLCJleHAiOjE3Nzg5MjY2MDB9.UYGTs0DQgbZJinMWJExUV18JhfJW23JonveQVVq6N5Muy_vu6Py8pL-AI5Ohv0BDoCCfdOD7SjLmiCqGy4uU9130O1_QlLzyxsriiBKUPXPJKbipftpqSdjYyFSgfNSIySO99hs005Ip89HnkaT34ephMA-C8jyyxGShQdNkuxI";
         if (!StringUtils.hasText(token)) {
-            throw new SystemException("登录失败,请重新登录");
+            throw new TokenExpireException();
         }
         headers.add(HttpHeaders.AUTHORIZATION, token);
         return headers;

+ 16 - 7
tenant/insurance/quotation-guoren/src/main/java/com/jzg/quotation/guoren/crawler/service/impl/GuoRenCrawlerRequestImpl.java

@@ -1,17 +1,22 @@
 package com.jzg.quotation.guoren.crawler.service.impl;
 
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.agreement.po.PtlAgreementAttribution;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.entity.quote.vo.base.OrderBase;
+import com.jzg.commons.util.AssertionUtils;
 import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
+import com.jzg.quotation.commons.client.PlatformClient;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.quotation.commons.entity.GetCaptchaRequest;
 import com.jzg.quotation.commons.entity.GetCaptchaResponse;
 import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
 import com.jzg.quotation.commons.utils.TimeProcessing;
+import com.jzg.quotation.guoren.api.entity.Response.IdentifyCodeDataResponse;
 import com.jzg.quotation.guoren.crawler.build.GuoRenCrawlerQuoteResultsVoBuild;
 import com.jzg.quotation.guoren.crawler.component.GuoRenCrawlerRequestComponent;
 import com.jzg.quotation.guoren.crawler.constant.enums.RequestUrl;
@@ -44,19 +49,19 @@ public class GuoRenCrawlerRequestImpl implements GuoRenCrawlerRequest {
 
     private final GuoRenCrawlerOrderService guoRenCrawlerOrderService;
 
+    private final PlatformClient platformClient;
+
     @Override
     public GetCaptchaResponse getCaptcha(GetCaptchaRequest sendCaptchaRequest) {
-        GuoRenCrawlerIdentifyCodeData guoRenCrawlerIdentifyCodeData = guoRenCrawlerRequestComponent.identifyCode(sendCaptchaRequest.getUsername());
+        HttpResult<PtlAgreementAttribution> agreementAttribution = platformClient.getAgreementAttribution(sendCaptchaRequest.getAgreementId());
+        AssertionUtils.isFail(agreementAttribution.getCode() == 500, "获取协议属性失败");
+        PtlAgreementAttribution ptlAgreementAttribution = agreementAttribution.getData();
+        IdentifyCodeDataResponse guoRenCrawlerIdentifyCodeData = guoRenCrawlerRequestComponent.identifyCode(ptlAgreementAttribution.getUsername());
         GetCaptchaResponse getCaptchaResponse = new GetCaptchaResponse();
-        getCaptchaResponse.setCaptchaId(guoRenCrawlerIdentifyCodeData.getIdentifyId());
+        getCaptchaResponse.setIdentifyId(guoRenCrawlerIdentifyCodeData.getData().getIdentifyId());
         return getCaptchaResponse;
     }
 
-    @Override
-    public void login(LoginBase loginBase) {
-        guoRenCrawlerQuoteProcessService.login(loginBase);
-    }
-
     @Override
     public QuoteResultsVo quote(QuoteVo quoteVo) throws Exception {
         HttpHeaders headers = guoRenCrawlerQuoteProcessService.getHeaders(quoteVo.getOrder().getAttributionInformationVo().getUsername());
@@ -244,4 +249,8 @@ public class GuoRenCrawlerRequestImpl implements GuoRenCrawlerRequest {
     }
 
 
+    @Override
+    public void login(LoginBase loginBase) {
+        guoRenCrawlerQuoteProcessService.login(loginBase);
+    }
 }

+ 27 - 3
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -23,6 +23,7 @@ import com.jzg.commons.entity.enums.MessageCodeEnum;
 import com.jzg.commons.entity.enums.YesNoEnum;
 import com.jzg.commons.entity.orders.po.*;
 import com.jzg.commons.entity.po.*;
+import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
@@ -37,8 +38,12 @@ import com.jzg.commons.exception.TokenExpireException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.commons.client.PlatformClient;
+import com.jzg.quotation.commons.entity.GetCaptchaRequest;
+import com.jzg.quotation.commons.entity.GetCaptchaResponse;
+import com.jzg.quotation.commons.service.GetCaptchaBaseService;
 import com.jzg.quotation.commons.service.QuotationBaseService;
 import com.jzg.quotation.commons.utils.SnowFlakeUtil;
+import com.jzg.quotation.guoren.crawler.service.GuoRenCrawlerOrderService;
 import com.jzg.quotation.summary.aop.AuditVerification;
 import com.jzg.quotation.summary.aop.OrderOperationLog;
 import com.jzg.quotation.summary.aop.QuoteVerification;
@@ -138,6 +143,12 @@ public class UnifyOrderManager {
     @Autowired
     InsFeeOrdersService insFeeOrdersService;
 
+    @Autowired
+    GuoRenCrawlerOrderService guoRenCrawlerOrderService;
+
+    @Autowired
+    GetCaptchaBaseService captchaBaseService;
+
     @Autowired
     private ZhongMeiCrawlerRequest zhongMeiCrawlerRequest;
     @Autowired
@@ -893,13 +904,26 @@ public class UnifyOrderManager {
         return HttpResult.ok(insOrdersPdfUrl);
     }
 
-    @PostMapping("test")
-    @Operation(summary = "测试")
-    public HttpResult test(@RequestBody LoginBase loginBase) {
+    @PostMapping("login")
+    @Operation(summary = "登录")
+    public HttpResult login(@RequestBody LoginBase loginBase) {
         zhongMeiCrawlerRequest.login(loginBase);
         return HttpResult.ok();
     }
 
+    @PostMapping("guoRenlogin")
+    @Operation(summary = "国任登录")
+    public HttpResult guoRenlogin(@RequestBody LoginBase loginBase) {
+        guoRenCrawlerOrderService.guoRenlogin(loginBase);
+        return HttpResult.ok();
+    }
+
+    @PostMapping("getGuoRenCaptcha")
+    @Operation(summary = "国任登录验证码")
+    public HttpResult getGuoRenCaptcha(@RequestBody GetCaptchaRequest sendCaptchaRequest) {
+        return HttpResult.ok(captchaBaseService.getCaptcha(sendCaptchaRequest));
+    }
+
     /**
      * 判断已使用金额不超过可用金额
      *