前端代码 const arr = [] conditionalAssignment.simulationColumnSettings.forEach(i=>{ arr.push( `${i.simulationTableWithColumn.tableName}${i.simulationTableWithColumn.column.title}`); if(i.equalTo.equalToType ==='COLUMN'){ arr.push( `${i.equalTo.equalToTableWithColumn.tableName}${i.equalTo.equalToTableWithColumn.column.title}`) } i.subConditions.forEach((j)=>{ if(j.equalTo.equalToType==='COLUMN'){ // 子条件赋值列 arr.push( `${j.equalTo.equalToTableWithColumn.tableName}${j.equalTo.equalToTableWithColumn.column.title}`) } j.compares.forEach((k)=>{ // 子条件里面的被比较列 arr.push(`${k.toCompareTableWithColumn.tableName}${k.toCompareTableWithColumn.column.title}`) // 子条件里面的比较列 if(k.compareValueType === 'COLUMN'){ arr.push(`${k.compareTableWithColumn.tableName}${k.compareTableWithColumn.column.title}`) } }) }) })转成java代码
时间: 2024-04-04 14:28:58 浏览: 57
前端解析excel-vue版
List<String> arr = new ArrayList<>();
for (ConditionalAssignment.SimulationColumnSetting i : conditionalAssignment.getSimulationColumnSettings()) {
arr.add(i.getSimulationTableWithColumn().getTableName() + i.getSimulationTableWithColumn().getColumn().getTitle());
if (i.getEqualTo().getEqualToType().equals("COLUMN")) {
arr.add(i.getEqualTo().getEqualToTableWithColumn().getTableName() + i.getEqualTo().getEqualToTableWithColumn().getColumn().getTitle());
}
for (ConditionalAssignment.SubCondition j : i.getSubConditions()) {
if (j.getEqualTo().getEqualToType().equals("COLUMN")) {
// 子条件赋值列
arr.add(j.getEqualTo().getEqualToTableWithColumn().getTableName() + j.getEqualTo().getEqualToTableWithColumn().getColumn().getTitle());
}
for (ConditionalAssignment.Compare k : j.getCompares()) {
// 子条件里面的被比较列
arr.add(k.getToCompareTableWithColumn().getTableName() + k.getToCompareTableWithColumn().getColumn().getTitle());
// 子条件里面的比较列
if (k.getCompareValueType().equals("COLUMN")) {
arr.add(k.getCompareTableWithColumn().getTableName() + k.getCompareTableWithColumn().getColumn().getTitle());
}
}
}
}
阅读全文