| | |
| | | // 从 JSON 数据中提取 data 数组 |
| | | JSONArray dataList = JSONArray.parseArray(jsonObject.get("data").toString()); |
| | | dataConfig.forEach((k, v) -> { |
| | | AtomicInteger numberOfDataEntries = new AtomicInteger(); |
| | | AtomicInteger numberOfDataEntries = new AtomicInteger(0); |
| | | List<Object> list = new ArrayList<>(); |
| | | for (int config = 0; config < v.size(); config++) { |
| | | // String refery = v.get(config).getRefery(); |
| | |
| | | List<Object> result = new ArrayList<>(); |
| | | for (int i = 0; i < numberOfDataEntries.get(); i++) { |
| | | String aggregate = ""; |
| | | for (int j = 0; j < v.size(); j++) { |
| | | int index; |
| | | if (j == 0) { |
| | | index = i; |
| | | } else { |
| | | index = numberOfDataEntries.get() + i; |
| | | } |
| | | aggregate += list.get(index).toString() + ","; |
| | | } |
| | | // for (int j = 0; j < v.size(); j++) { |
| | | // int index; |
| | | // if (j == 0) { |
| | | // index = i; |
| | | // } else { |
| | | // index = numberOfDataEntries.get() + i; |
| | | // } |
| | | // } |
| | | aggregate += list.get(i).toString() + ","; |
| | | int lastIndex = aggregate.lastIndexOf(","); |
| | | String substring = aggregate.substring(0, lastIndex); |
| | | result.add(substring); |