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

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

wlq пре 1 година
родитељ
комит
6436421417

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

@@ -307,7 +307,7 @@ public class TKSimpleService {
         carModelinfoQueryParam.setCarInfoVo(carInfoVo);
         carModelinfoQueryParam.setPremiumTrialFlag(null); // todo
 
-        CarModelinfoQueryResult carModelinfoQueryResult = httpService.carModelinfoQuery(carModelinfoQueryParam);
+        CarModelinfoQueryResult carModelinfoQueryResult = httpService.carModelinfoQuery(session.getToken(), carModelinfoQueryParam);
 
         List<TKCarModel> TKCarModels = CarModelinfoQueryResult.hasModel(carModelinfoQueryResult);
 

+ 26 - 52
tenant/insurance/quotation-taikang/src/test/java/com/jzg/quotation/taikang/service/HttpServiceTest1.java

@@ -27,6 +27,7 @@ public class HttpServiceTest1 {
     private static String orderID;
 
     private static LoginResult loginResult;
+    private static IdentityTokenResult tokenResult;
 
     private static TKAgentQueryResult agentQueryResult;
 
@@ -51,7 +52,7 @@ public class HttpServiceTest1 {
     @Test
     @Order(0)
     public void login() {
-        IdentityTokenResult result1 = httpService.identityToken(null);
+        IdentityTokenResult result1 = httpService.identityToken();
 
         assertNotNull(result1);
 
@@ -93,11 +94,8 @@ public class HttpServiceTest1 {
         // feda77e829d4dedbbd8b4e236bacfac5
         String tplatformId = HttpServiceTest1.loginResult.getTplatformId();
 
-
-
-
         // 通过临时 token 获取正式 token
-        IdentityTokenResult result = httpService.identityToken(tplatformId);
+        IdentityTokenResult result = httpService.identityToken(null, tplatformId);
 
         assertNotNull(result);
         assertNotNull(result.getTkCarRequestToken());
@@ -109,12 +107,14 @@ public class HttpServiceTest1 {
         System.out.println("unknownFields:  " + JSON.toJSONString(unknownFields));
 
         assertNull(unknownFields);
+
+        tokenResult = result;
     }
 
     @Test
     @Order(2)
     public void initBasicData() {
-        InitBasicDataResult result = httpService.initBasicData();
+        InitBasicDataResult result = httpService.initBasicData(tokenResult.getTkCarRequestToken());
 
         assertNotNull(result);
 
@@ -144,7 +144,7 @@ public class HttpServiceTest1 {
 
 
 
-        InitIdentityResult result = httpService.initIdentity(tplatformId, fromid, "WBPC202503041553228380000", comCode);
+        InitIdentityResult result = httpService.initIdentity(tokenResult.getTkCarRequestToken(), tplatformId, fromid, "WBPC202503041553228380000", comCode);
 
         assertNotNull(result);
 
@@ -169,7 +169,7 @@ public class HttpServiceTest1 {
         // 67107
         String fromid = HttpServiceTest1.loginResult.getWebsysUserVo().getFromid();
 
-        BasicInfoResult result = httpService.basicInfo(tplatformId, tplatLoginKey, fromid, "WBPC202503070952533790000");
+        BasicInfoResult result = httpService.basicInfo(tokenResult.getTkCarRequestToken(), tplatformId, tplatLoginKey, fromid, "WBPC202503070952533790000");
 
         assertNotNull(result);
 
@@ -196,7 +196,7 @@ public class HttpServiceTest1 {
         String fromid = HttpServiceTest1.loginResult.getWebsysUserVo().getFromid();
 
 
-        List<CarTypeResult> result = httpService.carType(tplatformId, fromid, comCode);
+        List<CarTypeResult> result = httpService.carType(tokenResult.getTkCarRequestToken(), tplatformId, fromid, comCode);
 
         assertNotNull(result);
 
@@ -231,7 +231,7 @@ public class HttpServiceTest1 {
 
 
 
-        List<AgentFuzzyResult> result = httpService.agentFuzzy(tplatformId, fromid, "WBPC202503051425186530000", "泰康人寿");
+        List<AgentFuzzyResult> result = httpService.agentFuzzy(tokenResult.getTkCarRequestToken(), tplatformId, fromid, "WBPC202503051425186530000", "泰康人寿");
 
         assertNotNull(result);
 
@@ -262,7 +262,7 @@ public class HttpServiceTest1 {
 
         TKAgentFuzzy tkAgentFuzzy = HttpServiceTest1.agentFuzzyResults.get(HttpServiceTest1.agentFuzzyResults.size() - 1);
 
-        TKAgentQueryResult result = httpService.agentQuery(tplatformId, "WBPC202503051401086530000", tkAgentFuzzy, "R35016546");
+        TKAgentQueryResult result = httpService.agentQuery(tokenResult.getTkCarRequestToken(), tplatformId, "WBPC202503051401086530000", tkAgentFuzzy, "R35016546");
 
         assertNotNull(result);
 
@@ -289,7 +289,7 @@ public class HttpServiceTest1 {
         AgentFuzzyResult agentFuzzyResult = HttpServiceTest1.agentFuzzyResults.get(HttpServiceTest1.agentFuzzyResults.size() - 1);
 
 
-        List<AreaUserResult> result = httpService.areaUser(tplatformId, "WBPC202503051401086530000", agentFuzzyResult, "R35016546");
+        List<AreaUserResult> result = httpService.areaUser(tokenResult.getTkCarRequestToken(), tplatformId, "WBPC202503051401086530000", agentFuzzyResult, "R35016546");
 
         assertNotNull(result);
 
@@ -310,7 +310,7 @@ public class HttpServiceTest1 {
     @Test
     @Order(8)
     public void orderId() {
-        OrderIdResult result = httpService.orderId();
+        OrderIdResult result = httpService.orderId(tokenResult.getTkCarRequestToken());
 
         assertNotNull(result);
 
@@ -398,7 +398,7 @@ public class HttpServiceTest1 {
         //carModelinfoQueryParam.setTplatLoginKey("1e6cbb3bf08e8cb8f8c684cff0ee5e161"); // todo 检查 1e6c 是哪来的
         carModelinfoQueryParam.setTplatLoginKey(tplatLoginKey);
 
-        CarModelinfoQueryResult result = httpService.carModelinfoQuery(carModelinfoQueryParam);
+        CarModelinfoQueryResult result = httpService.carModelinfoQuery(tokenResult.getTkCarRequestToken(), carModelinfoQueryParam);
 
         assertNotNull(result);
 
@@ -491,7 +491,7 @@ public class HttpServiceTest1 {
         //carModelinfoQueryParam.setFromId(fromid);
         carModelinfoQueryParam.setTplatLoginKey(tplatLoginKey);
 
-        CarModelinfoQueryResult result = httpService.carModelinfoQuery(carModelinfoQueryParam);
+        CarModelinfoQueryResult result = httpService.carModelinfoQuery(tokenResult.getTkCarRequestToken(), carModelinfoQueryParam);
 
         assertNotNull(result);
 
@@ -601,7 +601,7 @@ public class HttpServiceTest1 {
         //carModelinfoCheckVehicleTypeParam.setOrderId("WBPC202503060839036710000");
         carModelinfoCheckVehicleTypeParam.setCarInfoVo(carInfoVo);
 
-        String carModelinfoCheckVehicleTypeResult = httpService.carModelinfoCheckVehicleType(carModelinfoCheckVehicleTypeParam);
+        String carModelinfoCheckVehicleTypeResult = httpService.carModelinfoCheckVehicleType(tokenResult.getTkCarRequestToken(), carModelinfoCheckVehicleTypeParam);
 
         assertNotNull(carModelinfoCheckVehicleTypeResult);
 
@@ -787,7 +787,7 @@ public class HttpServiceTest1 {
         param.setFromId(fromid);
 
 
-        SaveBasicInfoResult result = httpService.saveBasicInfo(param);
+        SaveBasicInfoResult result = httpService.saveBasicInfo(tokenResult.getTkCarRequestToken(), param);
 
 
         assertNotNull(result);
@@ -815,7 +815,7 @@ public class HttpServiceTest1 {
 
 
 
-        InitQuoteResult result = httpService.initQuote(tplatformId, tplatLoginKey, "WBPC202503061106595800000");
+        InitQuoteResult result = httpService.initQuote(tokenResult.getTkCarRequestToken(), tplatformId, tplatLoginKey, "WBPC202503061106595800000");
 
         assertNotNull(result);
 
@@ -842,7 +842,7 @@ public class HttpServiceTest1 {
 
 
 
-        PreciseInitResult result = httpService.preciseInitToInit(tplatformId, tplatLoginKey, "WBPC202503071419220680000");
+        PreciseInitResult result = httpService.preciseInitToInit(tokenResult.getTkCarRequestToken(), tplatformId, tplatLoginKey, "WBPC202503071419220680000");
 
         assertNotNull(result);
 
@@ -879,7 +879,7 @@ public class HttpServiceTest1 {
         TKChgOwnerInfo.setInstantInureFlagBI("0");
         TKChgOwnerInfo.setTransferDate("2025-03-04");
 
-        PreciseInitResult result = httpService.preciseInitToQuote(tplatformId, tplatLoginKey, "WBPC202503061106595800000", TKChgOwnerInfo);
+        PreciseInitResult result = httpService.preciseInitToQuote(tokenResult.getTkCarRequestToken(), tplatformId, tplatLoginKey, "WBPC202503061106595800000", TKChgOwnerInfo);
 
         assertNotNull(result);
 
@@ -912,7 +912,7 @@ public class HttpServiceTest1 {
 
 
 
-        AgentTaxResult result = httpService.agentTax(tplatformId, "WBPC202503061106595800000");
+        AgentTaxResult result = httpService.agentTax(tokenResult.getTkCarRequestToken(), tplatformId, "WBPC202503061106595800000");
 
         assertNotNull(result);
 
@@ -946,7 +946,7 @@ public class HttpServiceTest1 {
 
 
 
-        InitQuotationResult result = httpService.initQuotationFlag1(null, "WBPC202503110940103410000");
+        InitQuotationResult result = httpService.initQuotationFlag1(tokenResult.getTkCarRequestToken(), null, "WBPC202503110940103410000");
 
         assertNotNull(result);
 
@@ -981,7 +981,7 @@ public class HttpServiceTest1 {
 
 
 
-        SaveQuoteResult result = httpService.saveQuote(tplatformId,  fromid, "WBPC202503071419220680000");
+        SaveQuoteResult result = httpService.saveQuote(tokenResult.getTkCarRequestToken(), tplatformId,  fromid, "WBPC202503071419220680000");
 
         assertNotNull(result);
 
@@ -1043,7 +1043,7 @@ public class HttpServiceTest1 {
         String fromid = HttpServiceTest1.loginResult.getWebsysUserVo().getFromid();
 
 
-        InitProposalResult result = httpService.initProposal(tplatformId,  tplatLoginKey, "WBPC202503071419220680000");
+        InitProposalResult result = httpService.initProposal(tokenResult.getTkCarRequestToken(), tplatformId,  tplatLoginKey, "WBPC202503071419220680000");
 
         assertNotNull(result);
 
@@ -1134,7 +1134,7 @@ public class HttpServiceTest1 {
 
         EngageEngageQueryParam.Privy privy = new EngageEngageQueryParam.Privy();
 
-        GroupOrderGetNewNoticeStatusResult result = httpService.groupOrderGetNewNoticeStatus(tplatformId);
+        GroupOrderGetNewNoticeStatusResult result = httpService.groupOrderGetNewNoticeStatus(tokenResult.getTkCarRequestToken(), tplatformId);
 
         assertNotNull(result);
 
@@ -1159,37 +1159,11 @@ public class HttpServiceTest1 {
 
         EngageEngageQueryParam.Privy privy = new EngageEngageQueryParam.Privy();
 
-        EntranceResult result = httpService.entranceFor000012(tplatformId, fromid, "WBPC202503071419220680000", null);
-
-        assertNotNull(result);
-
-        System.out.println();
-        System.out.println(JSON.toJSONString(result));
-    }
-
-    @Test
-    @Order(21)
-    public void entranceForDecrypt() {
-        // feda77e829d4dedbbd8b4e236bacfac5
-        //String tplatformId = TaiKangHttpServiceTest1.loginResult.getTplatformId();
-
-        // 0114
-        //String comCode = TaiKangHttpServiceTest1.loginResult.getWebsysUserVo().getWebsysUserAreaVos().get(0).getAreacode();
-
-        // 1e6cbb3bf08e8cb8f8c684cff0ee5e161
-        //String tplatLoginKey = TaiKangHttpServiceTest1.loginResult.getTplatLoginKey();
-
-        // 67107
-        //String fromid = TaiKangHttpServiceTest1.loginResult.getWebsysUserVo().getFromid();
-
-        EngageEngageQueryParam.Privy privy = new EngageEngageQueryParam.Privy();
-
-        EntranceResult result = httpService.entranceForDecrypt(null, "67107", "WBPC202503071419220680000");
+        EntranceResult result = httpService.entranceFor000012(tokenResult.getTkCarRequestToken(), tplatformId, fromid, "WBPC202503071419220680000", null);
 
         assertNotNull(result);
 
         System.out.println();
         System.out.println(JSON.toJSONString(result));
     }
-
 }