/**
* 获取数据信息
*
* @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);
}
}
}
}