| | |
| | | } |
| | | } |
| | | // 拼接数采配置 |
| | | 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() + ","; |
| | | } |
| | | int lastIndex = aggregate.lastIndexOf(","); |
| | | String substring = aggregate.substring(0, lastIndex); |
| | | result.add(substring); |
| | | |
| | | } |
| | | List<Object> result = new ArrayList<>(list); |
| | | // String join = String.join(",", list.stream().map(String::valueOf).collect(Collectors.toList())); |
| | | // result.add(join); |
| | | // 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() + ","; |
| | | // } |
| | | // int lastIndex = aggregate.lastIndexOf(","); |
| | | // String substring = aggregate.substring(0, lastIndex); |
| | | // result.add(substring); |
| | | // |
| | | // } |
| | | // 进行公式计算 |
| | | Object resultValue = calculationFormula(result, v.get(0), k, device); |
| | | map.put(k, resultValue); |