|
|
|
@ -529,48 +529,8 @@ public class InterfaceLogServiceImpl implements InterfaceLogService { |
|
|
|
// 4. 查询api_log_values_detail明细数据(传递interfaceName作为查询条件) |
|
|
|
List<Map<String, Object>> detailList = apiLogValuesDetailDao.queryDetailList(site, buNo, requestId, requestGroupId, interfaceName); |
|
|
|
|
|
|
|
// 5. 构造JSON请求体 |
|
|
|
Map<String, Object> requestBody = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
// 5.1 处理主表数据(orderref1-20) |
|
|
|
if (headData != null) { |
|
|
|
for (int i = 1; i <= 20; i++) { |
|
|
|
String key = "orderref" + i; |
|
|
|
Object value = headData.get(key); |
|
|
|
if (value != null && !value.toString().trim().isEmpty()) { |
|
|
|
// 根据字段位置映射到实际的字段名 |
|
|
|
String fieldName = getFieldName(i, true); |
|
|
|
requestBody.put(fieldName, value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 5.2 处理明细数据 |
|
|
|
if (detailList != null && !detailList.isEmpty()) { |
|
|
|
List<Map<String, Object>> detailResultList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (Map<String, Object> detail : detailList) { |
|
|
|
Map<String, Object> detailItem = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
for (int i = 1; i <= 20; i++) { |
|
|
|
String key = "orderref" + i; |
|
|
|
Object value = detail.get(key); |
|
|
|
if (value != null && !value.toString().trim().isEmpty()) { |
|
|
|
// 根据字段位置映射到实际的字段名 |
|
|
|
String fieldName = getFieldName(i, false); |
|
|
|
detailItem.put(fieldName, value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!detailItem.isEmpty()) { |
|
|
|
detailResultList.add(detailItem); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!detailResultList.isEmpty()) { |
|
|
|
requestBody.put("DetailList", detailResultList); |
|
|
|
} |
|
|
|
} |
|
|
|
// 5. 根据接口类型构造JSON请求体(使用专用的参数构建方法) |
|
|
|
Map<String, Object> requestBody = buildParamsResult(interfaceName, headData, detailList); |
|
|
|
|
|
|
|
logger.info("构造的请求体: {}", JSON.toJSONString(requestBody)); |
|
|
|
|
|
|
|
|