Browse Source

REPORT-21871 批量添加单元格组 合并场景

feature/big-screen
hades 5 years ago
parent
commit
38863dc13b
  1. 14
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

14
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -27,6 +27,7 @@ import com.fr.design.selection.SelectionListener;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.ColumnRowGroup; import com.fr.stable.ColumnRowGroup;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -451,9 +452,21 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
int r = cellselection.getRow(); int r = cellselection.getRow();
int rs = cellselection.getRowSpan(); int rs = cellselection.getRowSpan();
String allColumnRow = newValue.toString(); String allColumnRow = newValue.toString();
System.out.println("all: " + allColumnRow);
newAdd.clear(); newAdd.clear();
for (int i = 0; i < cs; i++) { for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) { for (int j = 0; j < rs; j++) {
TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j );
if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) {
String value = cellElement.toString();
System.out.println(newAdd);
if (!newAdd.contains(value) && !allColumnRow.contains(value)) {
add.addColumnRow(ColumnRow.valueOf(value));
}
newAdd.add(value);
}
if (cellElement == null) {
ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j); ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j);
if (!allColumnRow.contains(columnRow.toString())) { if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow); add.addColumnRow(columnRow);
@ -461,6 +474,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
newAdd.add(columnRow.toString()); newAdd.add(columnRow.toString());
} }
} }
}
int oldSize = oldAdd.size(); int oldSize = oldAdd.size();
int newSize = newAdd.size(); int newSize = newAdd.size();
if (oldSize > newSize && oldAdd.containsAll(newAdd)) { if (oldSize > newSize && oldAdd.containsAll(newAdd)) {

Loading…
Cancel
Save