mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 10:13:28 +08:00
excel插件 免除非必要的循环
This commit is contained in:
parent
958147e59e
commit
93b493a7f4
@ -92,16 +92,14 @@ public class CellMergeStrategy extends AbstractMergeStrategy {
|
|||||||
// 空值跳过不合并
|
// 空值跳过不合并
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//附加基于注解的合并条件
|
|
||||||
boolean isMerge = isMerge(list, i, field);
|
|
||||||
|
|
||||||
if (!cellValue.equals(val)) {
|
if (!cellValue.equals(val)) {
|
||||||
if ((i - repeatCell.getCurrent() > 1) && isMerge) {
|
if ((i - repeatCell.getCurrent() > 1) && isMerge(list, i, field)) {
|
||||||
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
|
||||||
}
|
}
|
||||||
map.put(field, new RepeatCell(val, i));
|
map.put(field, new RepeatCell(val, i));
|
||||||
} else if (i == list.size() - 1) {
|
} else if (i == list.size() - 1) {
|
||||||
if (i > repeatCell.getCurrent() && isMerge) {
|
if (i > repeatCell.getCurrent() && isMerge(list, i, field)) {
|
||||||
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user