/**
* 獲取數據信息
*
* @param selectBOS 原類型列表
* @param i 類型下標(從0開始)
* @param name 類型拼接名稱(拼接后的每行名稱)
* @param rowSize 列數(標題數量)
* @param dataColumn 組裝后的數據結果集
*/
public static void getContent(List<TypeSelectBO> typeBOS, int i, String name, int rowSize, List<List<String>> dataColumn) {
if (i >= selectBOS.size() - 1) {
//最后一個不同的類型下級列表
List<type> TypeInfoBOs = typeBOS.get(i).getTypeInfos();
for (TypeInfoBO typeInfoBO : typeInfoBOs) {
//結果數據
List<String> resultRow = new ArrayList<>();
//組裝各類型名稱
resultRow.add(name + typeInfoBO.getName());
//過濾只保留完整層級的組裝信息
int count = StringUtils.countMatches(name, "-");
if (count == typeBOS.size() - 1) {
//組裝需要的展示數據
for (int j = 0; j < rowSize; j++) {
resultRow.add(new Random().nextInt(1000) + "");
}
dataColumn.add(resultRow);
}
}
} else {
for (; i < typeBOS.size() - 1; i++) {
//維度的選項列表
List<TypeInfoBO> typeInfoBOs = typeBOS.get(i).getTypeInfos();
//循環迭代各維度,組裝維度名稱
for (TypeInfoBO typeInfoBO : typeInfoBOs) {
getContent(typeBOS, i + 1, name + typeInfoBO.getName() + "-", rowSize, dataColumn);
}
}
}
}