From 38863dc13bcb3e5b3067a28db61ea60ee2acdd7d Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Sep 2019 11:50:24 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-21871=20=E6=89=B9=E9=87=8F=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC=E7=BB=84=20=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../submit/SmartInsertDBManipulationPane.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index f9433aade..418a080b6 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/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.FloatSelection; import com.fr.grid.selection.Selection; +import com.fr.report.cell.TemplateCellElement; import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRowGroup; import com.fr.stable.StringUtils; @@ -451,14 +452,27 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { int r = cellselection.getRow(); int rs = cellselection.getRowSpan(); String allColumnRow = newValue.toString(); + System.out.println("all: " + allColumnRow); newAdd.clear(); for (int i = 0; i < cs; i++) { for (int j = 0; j < rs; j++) { - ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j); - if (!allColumnRow.contains(columnRow.toString())) { - add.addColumnRow(columnRow); + 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); + if (!allColumnRow.contains(columnRow.toString())) { + add.addColumnRow(columnRow); + } + newAdd.add(columnRow.toString()); } - newAdd.add(columnRow.toString()); } } int oldSize = oldAdd.size();