mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
Pre Merge pull request !455 from simple/excelCellMerge
This commit is contained in:
commit
d6a14b6cfd
@ -93,14 +93,28 @@ public class CellMergeStrategy extends AbstractMergeStrategy {
|
|||||||
// 空值跳过不合并
|
// 空值跳过不合并
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!cellValue.equals(val)) {
|
if (j == 0) {
|
||||||
if (i - repeatCell.getCurrent() > 1) {
|
if (!cellValue.equals(val)) {
|
||||||
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
|
if (i - repeatCell.getCurrent() > 1) {
|
||||||
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
|
||||||
|
}
|
||||||
|
map.put(field, new RepeatCell(val, i));
|
||||||
|
} else if (i == list.size() - 1) {
|
||||||
|
if (i > repeatCell.getCurrent()) {
|
||||||
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
map.put(field, new RepeatCell(val, i));
|
} else {
|
||||||
} else if (i == list.size() - 1) {
|
RepeatCell firstCell = map.get(mergeFields.get(0));
|
||||||
if (i > repeatCell.getCurrent()) {
|
if (repeatCell.getCurrent() != firstCell.getCurrent()) {
|
||||||
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
|
if (i - repeatCell.getCurrent() > 1) {
|
||||||
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
|
||||||
|
}
|
||||||
|
map.put(field, new RepeatCell(val, i));
|
||||||
|
} else if (i == list.size() - 1) {
|
||||||
|
if (i > repeatCell.getCurrent()) {
|
||||||
|
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user