|
|
@@ -16,6 +16,7 @@ import com.jzg.quotation.taikang.model.api.*;
|
|
|
import com.jzg.quotation.taikang.model.entity.*;
|
|
|
import com.jzg.quotation.taikang.repository.TKLoginSessionRepository;
|
|
|
import com.jzg.quotation.taikang.repository.TKPreciseInitResultRepository;
|
|
|
+import io.micrometer.core.instrument.simple.SimpleConfig;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.actuate.logging.LoggersEndpoint;
|
|
|
@@ -38,11 +39,16 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
|
|
|
@Resource
|
|
|
private TKLoginSessionRepository loginSessionRepository;
|
|
|
|
|
|
- private final String agentCode = "R35016546";
|
|
|
- private final String intermediaryName = "泰康人寿(个险)(64827)";
|
|
|
@Autowired
|
|
|
private LoggersEndpoint loggersEndpoint;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SimpleConfig simpleConfig;
|
|
|
+
|
|
|
+ private final String agentCode = "R35016546";
|
|
|
+
|
|
|
+ private final String intermediaryName = "泰康人寿(个险)(64827)";
|
|
|
+
|
|
|
private TKLoginSession login(String username, String password) {
|
|
|
TKLoginSession session = loginSessionRepository.findById(username).orElse(null);
|
|
|
|
|
|
@@ -83,24 +89,26 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
|
|
|
String tplatLoginKey = session.getTplatLoginKey();
|
|
|
String fromId = session.getFromid();
|
|
|
|
|
|
- loginSessionRepository.save(session);
|
|
|
-
|
|
|
-
|
|
|
// # 申请获取到保单唯一id,后续的所有请求都是对此保单id进行的请求
|
|
|
String mainOrderId = tkSimpleService.newOrderId(session);
|
|
|
|
|
|
|
|
|
- // # 查询代理机构
|
|
|
- List<AgentFuzzyResult> agentFuzzyResults = httpService.agentFuzzy(null, tplatformId, fromId, mainOrderId, intermediaryName);
|
|
|
- AgentFuzzyResult agentFuzzyResult = agentFuzzyResults.get(0);
|
|
|
+ // 查询代理机构
|
|
|
+ AgentFuzzyResult agentFuzzyResult = tkSimpleService.agentChannel(session, mainOrderId, intermediaryName);
|
|
|
+
|
|
|
+ if (agentFuzzyResult == null) {
|
|
|
+ throw new RuntimeException("未能获取代理人信息!");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// # 查询代理人
|
|
|
- TKAgentQueryResult agentQueryResult = httpService.agentQuery(session.getToken(), tplatformId, mainOrderId, agentFuzzyResult, agentCode);
|
|
|
+ TKAgentQueryResult agentQueryResult = tkSimpleService.agentQuery(session, mainOrderId, agentFuzzyResult, agentCode);
|
|
|
|
|
|
if (agentQueryResult == null || agentQueryResult.getErrorMessage() != null) {
|
|
|
throw new RuntimeException("未能获取代理人信息!");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// # 查询代理人区域
|
|
|
List<AreaUserResult> areaUserResults = httpService.areaUser(session.getToken(), tplatformId, mainOrderId, agentFuzzyResult, agentCode);
|
|
|
// todo 先暂时取第1个省第1个城市
|