Просмотр исходного кода

添加泰康 全局使用一个登录token

wlq 1 год назад
Родитель
Сommit
6cc53c5a44

+ 57 - 96
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/client/HttpService.java

@@ -49,10 +49,10 @@ public class HttpService {
      *
      * @param username 账号
      * @param password 密码
-     * @param token    临时 token。通过无参的 {@link #identityToken(String)} 接口获取临时 token。
+     * @param token    临时 token。通过无参的 {@link #identityToken(String, String)} 接口获取临时 token。
      * @return
      */
-    public LoginResult login(String username, String password, String token) {
+    public LoginResult login(String token, String username, String password) {
         String key = "hh43jii5e954eD54";
         String encrypted = AESEncryption.encryptPassing(password, key);
 
@@ -82,10 +82,11 @@ public class HttpService {
      * 2.1 好像可以不用通过登录,写死此值,绕过登录接口。
      * 2.2 没有登录,也没有临时 token 的情况下,仅使用此参数可以获取正式 token。
      *
-     * @param tplatformId
+     * @param token 初次时为 null
+     * @param tplatformId 初次时为 null
      * @return
      */
-    public IdentityTokenResult identityToken(String tplatformId) {
+    public IdentityTokenResult identityToken(String token, String tplatformId) {
         IdentityTokenParam param = new IdentityTokenParam();
 
         param.setChannelCode("OffWeb");
@@ -96,8 +97,8 @@ public class HttpService {
 
         HttpHeaders httpHeaders = new HttpHeaders();
 
-        if (this.token != null) {
-            httpHeaders.add("tkCarRequestToken", this.token);
+        if (token != null) {
+            httpHeaders.add("tkCarRequestToken", token);
         }
 
         IdentityTokenResult.Response response = client.request(HttpURL.identityToken, param, httpHeaders, IdentityTokenResult.Response.class);
@@ -108,17 +109,11 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        IdentityTokenResult data = response.getData();
-
-        if (data != null) {
-            token = data.getTkCarRequesttoken;
-
-            if (logger.isInfoEnabled()) {
-                logger.info("保存新 token:{}", token);
-            }
-        }
+        return response.getData();
+    }
 
-        return data;
+    public IdentityTokenResult identityToken() {
+        return identityToken(null, null);
     }
 
     /**
@@ -158,12 +153,10 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        InitIdentityResult data = response.getData();
-
-        return data;
+        return response.getData();
     }
 
-    public InitBasicDataResult initBasicData() {
+    public InitBasicDataResult initBasicData(String token) {
         InitBasicDataParam param = new InitBasicDataParam();
         param.setChannelCode("OffWeb");
 
@@ -179,9 +172,9 @@ public class HttpService {
 
     /**
      * 03 获取省区市区数据
-     *
+     * <p>
      * 包含投保地区、车牌号码前缀、证件类型
-     *
+     * <p>
      * 可以当前 token 校验的功能,当 token 过期时返回 status 为 0 message 为 您的登录状态已过期,请重新登录!
      *
      * @param tplatformId
@@ -208,24 +201,11 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        String data = response.getData();
-
-        if (data == null || data.isBlank()) {
-            return null;
-        }
-
-        // 解密
-        String json = AESDecryptor.decrypt(data);
-
-        if (logger.isInfoEnabled()) {
-            logger.info("TaiKangHttpClient basicInfo body: {}", json);
-        }
-
-        BasicInfoResult.Response response1 = JsonUtil.readObjcet(json, BasicInfoResult.Response.class);
+        BasicInfoResult.Response decrypt = decrypt(response, BasicInfoResult.Response.class);
 
-        checkResponseUnknownField(response1);
+        checkResponseUnknownField(decrypt);
 
-        return response1.getData();
+        return decrypt.getData();
     }
 
     /**
@@ -249,9 +229,7 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        List<CarTypeResult> data = response.getData();
-
-        return data;
+        return response.getData();
     }
 
     /**
@@ -400,24 +378,11 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        String data = response.getData();
-
-        if (data == null || data.isBlank()) {
-            return null;
-        }
-
-        // 解密
-        String json = AESDecryptor.decrypt(data);
+        CarModelinfoQueryResult.Response decrypt = decrypt(response, CarModelinfoQueryResult.Response.class);
 
-        if (logger.isInfoEnabled()) {
-            logger.info("TaiKangHttpClient carModelinfoQuery decrypt body: {}", json);
-        }
-
-        CarModelinfoQueryResult.Response response1 = JsonUtil.readObjcet(json, CarModelinfoQueryResult.Response.class);
-
-        checkResponseUnknownField(response1);
+        checkResponseUnknownField(decrypt);
 
-        return response1.getData();
+        return decrypt.getData();
     }
 
     /**
@@ -615,7 +580,7 @@ public class HttpService {
      *
      * @return
      */
-    public InitQuotationResult initQuotationFlag2(String token, String tplatformId, String orderId) {
+    public InitQuotationResult initQuotationFlag2(String token, String orderId) {
         InitQuotationParam param = new InitQuotationParam();
         param.setChannelCode("OffWeb");
         param.setOrderID(orderId);
@@ -658,7 +623,7 @@ public class HttpService {
     /**
      * @return
      */
-    public FloatNoticeGetResult floatNoticeGet(String token, String tplatformId, String orderId) {
+    public FloatNoticeGetResult floatNoticeGet(String token, String orderId) {
         FloatNoticeGetParam param = new FloatNoticeGetParam();
         param.setChannelCode("OffWeb");
         param.setOrderID(orderId);
@@ -684,7 +649,6 @@ public class HttpService {
         param.setTplatformId(tplatformId);
         param.setTplatLoginKey(tplatLoginKey);
 
-
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("tkCarRequestToken", token);
 
@@ -692,14 +656,7 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        // 解密
-        String json = AESDecryptor.decrypt(response.getData());
-
-        if (logger.isInfoEnabled()) {
-            logger.info("TaiKangHttpClient initQuotation decrypt body: {}", json);
-        }
-
-        InitProposalResult.Response response1 = JsonUtil.readObjcet(json, InitProposalResult.Response.class);
+        InitProposalResult.Response response1 = decrypt(response, InitProposalResult.Response.class);
 
         checkResponseUnknownField(response1);
 
@@ -713,7 +670,7 @@ public class HttpService {
      *
      * @return
      */
-    public List<EngageEngageQueryResult> engageEngageQuery(String token, String tplatformId, String fromId, String orderId, EngageEngageQueryParam.Privy privy) {
+    public List<EngageEngageQueryResult> engageEngageQuery(String token, String fromId, String orderId, EngageEngageQueryParam.Privy privy) {
         EngageEngageQueryParam param = new EngageEngageQueryParam();
         param.setChannelCode("OffWeb");
         param.setFromId(fromId);
@@ -723,7 +680,6 @@ public class HttpService {
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("tkCarRequestToken", token);
 
-
         EngageEngageQueryResult.Response response = client.request(HttpURL.engageEngageQuery, param, httpHeaders, EngageEngageQueryResult.Response.class);
 
         return response.getData();
@@ -732,7 +688,7 @@ public class HttpService {
     /**
      * @return
      */
-    public Map<String, String> initFindRiskConfig(String token, String tplatformId) {
+    public Map<String, String> initFindRiskConfig(String token) {
         InitFindRiskConfigParam param = new InitFindRiskConfigParam();
         param.setConfigcode("SDMessageControl");
         param.setRiskcode("08");
@@ -741,7 +697,6 @@ public class HttpService {
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("tkCarRequestToken", token);
 
-
         InitFindRiskConfigResult.Response response = client.request(HttpURL.initFindRiskConfig, param, httpHeaders, InitFindRiskConfigResult.Response.class);
 
         return response.getData();
@@ -758,7 +713,6 @@ public class HttpService {
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("tkCarRequestToken", token);
 
-
         GroupOrderGetNewNoticeStatusResult.Response response = client.request(HttpURL.groupOrderGetNewNoticeStatus, param, httpHeaders, GroupOrderGetNewNoticeStatusResult.Response.class);
 
         return response.getData();
@@ -769,7 +723,7 @@ public class HttpService {
      *
      * @return
      */
-    private EntranceResult entranceForDecrypt(String token, String tplatformId, String fromId, String orderId) {
+    private EntranceResult entranceForDecrypt(String token, String fromId, String orderId) {
         EntranceParam param = new EntranceParam();
         param.setChannelCode("OffWeb");
         param.setFromID(fromId);
@@ -786,14 +740,7 @@ public class HttpService {
 
         checkResponseUnknownField(response);
 
-        // 解密
-        String json = AESDecryptor.decrypt(response.getData());
-
-        if (logger.isInfoEnabled()) {
-            logger.info("TaiKangHttpClient entranceForDecrypt decrypt body: {}", json);
-        }
-
-        EntranceResult.Response response1 = JsonUtil.readObjcet(json, EntranceResult.Response.class);
+        EntranceResult.Response response1 = decrypt(response, EntranceResult.Response.class);
 
         checkResponseUnknownField(response1);
 
@@ -820,7 +767,7 @@ public class HttpService {
      *
      * @return
      */
-    private  <B> B entranceForJson(String token, Object param, String actionType, Class<B> responseType) {
+    private <B> B entranceForJson(String token, Object param, String actionType, Class<B> responseType) {
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("Actiontype", actionType);
         httpHeaders.add("tkCarRequestToken", token);
@@ -843,11 +790,32 @@ public class HttpService {
         param.setOrderID(orderId);
         param.setInsureInfo(insureInfo);
 
-        EntranceResult.Response response = entranceForJson(param, "000012", EntranceResult.Response.class);
+        EntranceResult.Response response = entranceForJson(token, param, "000012", EntranceResult.Response.class);
 
         return response.getData();
     }
 
+    private <T> T decrypt(StringResponse response, Class<T> clazz) {
+        if (response == null) {
+            return null;
+        }
+
+        String data = response.getData();
+
+        if (data == null || data.isBlank()) {
+            return null;
+        }
+
+        // 解密
+        String json = AESDecryptor.decrypt(data);
+
+        if (logger.isInfoEnabled()) {
+            logger.info("decrypt body: {}", json);
+        }
+
+        return JsonUtil.readObjcet(json, clazz);
+    }
+
     /**
      * entrance 返回的数据是 json 的情况
      *
@@ -861,22 +829,15 @@ public class HttpService {
         param.setOrderID(orderId);
         param.setIdcardOcrFlag("0"); // todo
 
-        StringResponse response = entranceForJson(param, "000038", StringResponse.class);
+        StringResponse response = entranceForJson(token, param, "000038", StringResponse.class);
 
         checkResponseUnknownField(response);
 
-        // 解密
-        String json = AESDecryptor.decrypt(response.getData());
+        TKEntranceFor000038Result.Response decrypt = decrypt(response, TKEntranceFor000038Result.Response.class);
 
-        if (logger.isInfoEnabled()) {
-            logger.info("TaiKangHttpClient entranceFor000038 decrypt body: {}", json);
-        }
-
-        TKEntranceFor000038Result.Response response1 = JsonUtil.readObjcet(json, TKEntranceFor000038Result.Response.class);
+        checkResponseUnknownField(decrypt);
 
-        checkResponseUnknownField(response1);
-
-        return response1.getData();
+        return decrypt.getData();
     }
 
     /**
@@ -904,7 +865,7 @@ public class HttpService {
      *
      * @return
      */
-    public String carCheckAttorneyList(String token, String tplatformId, String proposalNo) {
+    public String carCheckAttorneyList(String token, String proposalNo) {
         CarCheckAttorneyListParam param = new CarCheckAttorneyListParam();
         param.setProposalNo(proposalNo);
 

+ 16 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/model/api/EntranceParam.java

@@ -61,4 +61,20 @@ public class EntranceParam extends OrderRequest {
      * "080000" 可能表示某个特定的步骤或状态
      */
     private String previousStep;
+
+    /**
+     * 注意这个不是 fromId
+     */
+    private String fromID;
+
+    public void setFromID(String fromID) {
+        this.fromID = fromID;
+        super.setFromId(fromID);
+    }
+
+    @Override
+    public void setFromId(String fromId) {
+        this.fromID = fromId;
+        super.setFromId(fromId);
+    }
 }

+ 16 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/model/api/SaveQuoteParam.java

@@ -12,4 +12,20 @@ public class SaveQuoteParam extends OrderRequest {
      * 报价标志
      */
     private String quoteFlag;
+
+    /**
+     * 注意这个不是 fromId
+     */
+    private String fromID;
+
+    public void setFromID(String fromID) {
+        this.fromID = fromID;
+        super.setFromId(fromID);
+    }
+
+    @Override
+    public void setFromId(String fromId) {
+        this.fromID = fromId;
+        super.setFromId(fromId);
+    }
 }

+ 14 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/model/api/TKEntranceFor000012Param.java

@@ -22,5 +22,19 @@ public class TKEntranceFor000012Param extends OrderRequest {
 
     private TKInsureInfo insureInfo;
 
+    /**
+     * 注意这个不是 fromId
+     */
+    private String fromID;
+
+    public void setFromID(String fromID) {
+        this.fromID = fromID;
+        super.setFromId(fromID);
+    }
 
+    @Override
+    public void setFromId(String fromId) {
+        this.fromID = fromId;
+        super.setFromId(fromId);
+    }
 }

+ 16 - 1
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/model/api/TKEntranceFor000038Param.java

@@ -1,7 +1,6 @@
 package com.jzg.quotation.taikang.model.api;
 
 import com.jzg.quotation.taikang.client.OrderRequest;
-import com.jzg.quotation.taikang.client.UnknownFieldEntity;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -21,4 +20,20 @@ public class TKEntranceFor000038Param extends OrderRequest {
     private String idcardOcrFlag;
 
     private String readTime;
+
+    /**
+     * 注意这个不是 fromId
+     */
+    private String fromID;
+
+    public void setFromID(String fromID) {
+        this.fromID = fromID;
+        super.setFromId(fromID);
+    }
+
+    @Override
+    public void setFromId(String fromId) {
+        this.fromID = fromId;
+        super.setFromId(fromId);
+    }
 }

+ 15 - 18
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/service/TKQuotationBaseServiceImpl.java

@@ -47,7 +47,8 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
         TKLoginSession session = loginSessionRepository.findById(username).orElse(null);
 
         if (session != null) {
-            InitBasicDataResult initBasicDataResult = httpService.initBasicData();
+            // 使用 initBasicData 接口验证一下 token 是否过期,如果过期置为 null,后面就会重新登录获取新 token。
+            InitBasicDataResult initBasicDataResult = httpService.initBasicData(session.getToken());
 
             if (initBasicDataResult == null) {
                 loginSessionRepository.delete(session);
@@ -86,22 +87,22 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
 
 
         // # 申请获取到保单唯一id,后续的所有请求都是对此保单id进行的请求
-        String mainOrderId = tkSimpleService.newOrderId();
+        String mainOrderId = tkSimpleService.newOrderId(session);
 
 
         // # 查询代理机构
-        List<AgentFuzzyResult> agentFuzzyResults = httpService.agentFuzzy(tplatformId, fromId, mainOrderId, intermediaryName);
+        List<AgentFuzzyResult> agentFuzzyResults = httpService.agentFuzzy(null, tplatformId, fromId, mainOrderId, intermediaryName);
         AgentFuzzyResult agentFuzzyResult = agentFuzzyResults.get(0);
 
         // # 查询代理人
-        TKAgentQueryResult agentQueryResult = httpService.agentQuery(tplatformId, mainOrderId, agentFuzzyResult, agentCode);
+        TKAgentQueryResult agentQueryResult = httpService.agentQuery(session.getToken(), tplatformId, mainOrderId, agentFuzzyResult, agentCode);
 
         if (agentQueryResult == null || agentQueryResult.getErrorMessage() != null) {
             throw new RuntimeException("未能获取代理人信息!");
         }
 
         // # 查询代理人区域
-        List<AreaUserResult> areaUserResults = httpService.areaUser(tplatformId, mainOrderId, agentFuzzyResult, agentCode);
+        List<AreaUserResult> areaUserResults = httpService.areaUser(session.getToken(), tplatformId, mainOrderId, agentFuzzyResult, agentCode);
         // todo 先暂时取第1个省第1个城市
         AreaUserResult province = areaUserResults.get(0);
 
@@ -161,7 +162,7 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
                 String deductibleRate = null; // 附加绝对免赔率
                 String serviceTimes = null; // 服务次数
                 KindInfoVo kindInfoVo = new KindInfoVo(kindCode, kindName, platformKindCode, platformKindName,
-                        amount,unitAmount, quantity, premium, deductibleRate, serviceTimes);
+                        amount, unitAmount, quantity, premium, deductibleRate, serviceTimes);
 
 
                 kindInfoVos.add(kindInfoVo);
@@ -186,25 +187,19 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
 
     @Override
     public void underwriting(UnderwritingVo underwritingVo) {
-        IdentityTokenResult result1 = httpService.identityToken(null);
-
-        // 登录
-        // 先获取到一个匿名登录的 `临时token`
-        String firstToken = result1.getTkCarRequestToken();
-
-        LoginResult loginInfo = httpService.login("Tgengchenjie", "Gcj123456#", firstToken);
+        TKLoginSession session = login("Tgengchenjie", "Gcj123456#");
 
         PreciseInitResult preciseInitResult = preciseInitResultRepository.findByOrdersNo(underwritingVo.getOrder().getOrdersNo());
 
         // 保存报价,保存后不能再修改报价。
-        tkSimpleService.orderQuoteSave(loginInfo, preciseInitResult.getMainOrderId());
+        tkSimpleService.orderQuoteSave(session, preciseInitResult.getMainOrderId());
 
-        InitProposalResult initProposalResult = tkSimpleService.queryCarOwner(loginInfo, preciseInitResult.getMainOrderId());
+        InitProposalResult initProposalResult = tkSimpleService.queryCarOwner(session, preciseInitResult.getMainOrderId());
 
         TKInsureInfo insureInfo = tkSimpleService.dataCreateInsureInfo(initProposalResult, "手机号", "地址");
 
         // # 车险投保单报价
-        TKEntranceFor000038Result tkEntranceFor000038Result = tkSimpleService.orderSubmit(loginInfo, preciseInitResult.getMainOrderId(), insureInfo);
+        TKEntranceFor000038Result tkEntranceFor000038Result = tkSimpleService.orderSubmit(session, preciseInitResult.getMainOrderId(), insureInfo);
 
         // 验车标志
         String checkCarFlag = tkEntranceFor000038Result.getCheckCarFlag();
@@ -223,7 +218,7 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
             List<String> underwriteReason = tkEntranceFor000038Result.getUnderwriteReason();
 
             // 验车码
-            String checkCarCode = httpService.entranceFor000133(preciseInitResult.getMainOrderId());
+            String checkCarCode = httpService.entranceFor000133(session.getToken(), preciseInitResult.getMainOrderId());
 
             // 上传视频图像的二维码数据示例:https://car.tk.cn/carTKInsure/#/schema?type=checkcar&fullProposalNo=00671070808142500000004429&orderType=1
             // 其中 00671070808142500000004429 的商业保险单号
@@ -254,8 +249,10 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
 
     @Override
     public String getPaymentLink(OrderBase orderBase) {
+        TKLoginSession session = login("Tgengchenjie", "Gcj123456#");
+
         // todo
-        String url = httpService.payForward(null, null);
+        String url = httpService.payForward(session.getToken(), null, null);
 
         return url;
     }

+ 30 - 28
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/service/TKSimpleService.java

@@ -23,17 +23,17 @@ public class TKSimpleService {
     private HttpService httpService;
 
     public TKLoginSession login(String username, String password) {
-        IdentityTokenResult identityTokenResult = httpService.identityToken(null);
+        IdentityTokenResult identityTokenResult = httpService.identityToken();
 
         // 登录
         // 先获取到一个匿名登录的 `临时token`
         String token = identityTokenResult.getTkCarRequestToken();
 
-        LoginResult loginInfo = httpService.login(username, password, token);
+        LoginResult loginInfo = httpService.login(token, username, password);
 
         String tplatformId = loginInfo.getTplatformId();
 
-        identityTokenResult = httpService.identityToken(tplatformId);
+        identityTokenResult = httpService.identityToken(token, tplatformId);
 
         token = identityTokenResult.getTkCarRequestToken();
 
@@ -208,9 +208,9 @@ public class TKSimpleService {
      *
      * @return
      */
-    public String newOrderId() {
+    public String newOrderId(TKLoginSession session) {
         // 申请一个订单 id ,后续的所有操作包括报价,都要在这个订单 id 上进行。
-        OrderIdResult orderIdResult = httpService.orderId();
+        OrderIdResult orderIdResult = httpService.orderId(session.getToken());
 
         if (orderIdResult == null) {
             throw new RuntimeException("未能获取订单id!(1)");
@@ -253,7 +253,7 @@ public class TKSimpleService {
 
         setLicenseTypeByLicenseNo(carInfoVo, carInfoVo.getLicenseNo());
 
-        String tempOrderId = newOrderId();
+        String tempOrderId = newOrderId(session);
 
         CarModelinfoQueryParam carModelinfoQueryParam = new CarModelinfoQueryParam();
         carModelinfoQueryParam.setTplatformId(session.getTplatformId());
@@ -265,7 +265,7 @@ public class TKSimpleService {
         carModelinfoQueryParam.setAreaInfoVo(area);
         carModelinfoQueryParam.setCarInfoVo(carInfoVo);
 
-        CarModelinfoQueryResult carModelinfoQueryResult = httpService.carModelinfoQuery(carModelinfoQueryParam);
+        CarModelinfoQueryResult carModelinfoQueryResult = httpService.carModelinfoQuery(session.getToken(), carModelinfoQueryParam);
 
         List<TKCarModel> TKCarModels = CarModelinfoQueryResult.hasModel(carModelinfoQueryResult);
 
@@ -692,7 +692,7 @@ public class TKSimpleService {
         param.setOtherInfo(otherInfo);
 
 
-        SaveBasicInfoResult saveBasicInfoResult = httpService.saveBasicInfo(param);
+        SaveBasicInfoResult saveBasicInfoResult = httpService.saveBasicInfo(session.getToken(), param);
 
         if (saveBasicInfoResult == null) {
             throw new RuntimeException("HttpService#saveBasicInfo 失败!");
@@ -707,11 +707,11 @@ public class TKSimpleService {
      */
     public PreciseInitResult orderInit(TKLoginSession session,
                                        String mainOrderId) {
-        // 全局固定参数
         String tplatformId = session.getTplatformId();
         String tplatLoginKey = session.getTplatLoginKey();
+        String token = session.getToken();
 
-        PreciseInitResult preciseInitResult = httpService.preciseInitToInit(tplatformId, tplatLoginKey, mainOrderId);
+        PreciseInitResult preciseInitResult = httpService.preciseInitToInit(token, tplatformId, tplatLoginKey, mainOrderId);
 
         if (preciseInitResult == null) {
             throw new RuntimeException("HttpService#preciseInitToInit 失败!");
@@ -865,7 +865,7 @@ public class TKSimpleService {
         preciseInitParam.setRiskType("0808");
         // orderVersion = 1
 
-        PreciseInitResult preciseQuoteResult = httpService.preciseInitToQuote(preciseInitParam);
+        PreciseInitResult preciseQuoteResult = httpService.preciseInitToQuote(session.getToken(), preciseInitParam);
 
         if (preciseQuoteResult == null) {
             throw new RuntimeException("HttpService#preciseInitToQuote (报价)失败!");
@@ -874,35 +874,36 @@ public class TKSimpleService {
         return preciseQuoteResult;
     }
 
-    public void orderQuoteSave(LoginResult loginInfo, String mainOrderId) {
-        String tplatformId = loginInfo.getTplatformId();
-        String fromId = loginInfo.getWebsysUserVo().getFromid();
-        httpService.saveQuote(tplatformId, fromId, mainOrderId);
+    public void orderQuoteSave(TKLoginSession session, String mainOrderId) {
+        String tplatformId = session.getTplatformId();
+        String fromId = session.getFromid();
+        String token = session.getToken();
+        httpService.saveQuote(token, tplatformId, fromId, mainOrderId);
     }
 
     /**
      * 核保,提交保价
      *
-     * @param loginInfo
+     * @param session
      * @param mainOrderId
      * @param insureInfo
      * @return
      */
-    public TKEntranceFor000038Result orderSubmit(LoginResult loginInfo, String mainOrderId, TKInsureInfo insureInfo) {
-        // 全局固定参数
-        String tplatformId = loginInfo.getTplatformId();
-        String tplatLoginKey = loginInfo.getTplatLoginKey();
-        String fromId = loginInfo.getWebsysUserVo().getFromid();
+    public TKEntranceFor000038Result orderSubmit(TKLoginSession session, String mainOrderId, TKInsureInfo insureInfo) {
+        String tplatformId = session.getTplatformId();
+        String tplatLoginKey = session.getTplatLoginKey();
+        String fromId = session.getFromid();
+        String token = session.getToken();
 
-        httpService.entranceFor000012(tplatformId, fromId, mainOrderId, insureInfo);
+        httpService.entranceFor000012(token, tplatformId, fromId, mainOrderId, insureInfo);
 
-        PreciseInitResult preciseQuoteResult = httpService.preciseInitToVipQuote(tplatformId, tplatLoginKey, mainOrderId, insureInfo);
+        PreciseInitResult preciseQuoteResult = httpService.preciseInitToVipQuote(token, tplatformId, tplatLoginKey, mainOrderId, insureInfo);
 
         if (preciseQuoteResult == null) {
             throw new RuntimeException("HttpService#preciseInitToQuote (报价)失败!");
         }
 
-        TKEntranceFor000038Result tkEntranceFor000038Result = httpService.entranceFor000038(tplatformId, tplatLoginKey, mainOrderId);
+        TKEntranceFor000038Result tkEntranceFor000038Result = httpService.entranceFor000038(token, tplatformId, tplatLoginKey, mainOrderId);
 
         if (preciseQuoteResult == null) {
             throw new RuntimeException("HttpService#preciseQuoteResult (报价)失败!");
@@ -911,11 +912,12 @@ public class TKSimpleService {
         return tkEntranceFor000038Result;
     }
 
-    public InitProposalResult queryCarOwner(LoginResult loginInfo, String mainOrderId) {
+    public InitProposalResult queryCarOwner(TKLoginSession session, String mainOrderId) {
         // 全局固定参数
-        String tplatformId = loginInfo.getTplatformId();
-        String tplatLoginKey = loginInfo.getTplatLoginKey();
-        InitProposalResult initProposalResult = httpService.initProposal(tplatformId, tplatLoginKey, mainOrderId);
+        String tplatformId = session.getTplatformId();
+        String tplatLoginKey = session.getTplatLoginKey();
+        String token = session.getToken();
+        InitProposalResult initProposalResult = httpService.initProposal(token, tplatformId, tplatLoginKey, mainOrderId);
         return initProposalResult;
     }
 }