Commit 44fbfc88 by jianan

新单跟进v2

parent cf75e1ed
...@@ -487,19 +487,30 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -487,19 +487,30 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 解析响应获取对账公司编码 // 解析响应获取对账公司编码
if (iPageResult != null && iPageResult.getCode() == 200) { if (iPageResult != null && iPageResult.getCode() == 200) {
IPage<ApiInsuranceReconciliationCompanyPageResponse> page = (IPage<ApiInsuranceReconciliationCompanyPageResponse>) iPageResult.getData(); try {
if (page != null && CollectionUtils.isNotEmpty(page.getRecords())) { // Feign 返回的泛型会被反序列化为 LinkedHashMap,需要手动提取
// 遍历分页结果,找到匹配的对账公司 Object data = iPageResult.getData();
String targetBizId = productInfo.getReconciliationCompanyBizId(); if (data instanceof Map) {
for (ApiInsuranceReconciliationCompanyPageResponse response : page.getRecords()) { Map<String, Object> dataMap = (Map<String, Object>) data;
if (response != null && targetBizId.equals(response.getReconciliationCompanyBizId())) { Object recordsObj = dataMap.get("records");
// 尝试从响应中获取对账公司编码 if (recordsObj instanceof List) {
reconciliationCompanyCode = response.getCode(); List<Map<String, Object>> records = (List<Map<String, Object>>) recordsObj;
log.info("从对账公司服务获取编码: reconciliationCompanyBizId={}, code={}", // 遍历分页结果,找到匹配的对账公司
targetBizId, reconciliationCompanyCode); String targetBizId = productInfo.getReconciliationCompanyBizId();
break; // 找到后跳出循环 for (Map<String, Object> record : records) {
String recordBizId = (String) record.get("reconciliationCompanyBizId");
if (targetBizId.equals(recordBizId)) {
// 获取对账公司编码
reconciliationCompanyCode = (String) record.get("code");
log.info("从对账公司服务获取编码: reconciliationCompanyBizId={}, code={}",
targetBizId, reconciliationCompanyCode);
break; // 找到后跳出循环
}
}
} }
} }
} catch (Exception e) {
log.error("解析对账公司响应失败: {}", e.getMessage(), e);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment