1、Excel优化

Former-commit-id: 0b89bf711c336bc3af3548ce99aa69b582f2f449
master
王兵 5 years ago
parent fffcdcf9b6
commit bf62fde1d6

@ -101,20 +101,8 @@ public class XmlManager {
for (int j = 0; j < tables.getLength(); j++) {
Element tableElement = (Element) tables.item(j);
Table table = new Table();
table.setdBhandle(module);
table.setTableName(tableElement.getAttribute("tableName"));
table.setTableComment(tableElement.getAttribute("tableComment"));
table.setCreate(getBoolean(tableElement.getAttribute("create")));
table.setDelete(getBoolean(tableElement.getAttribute("delete")));
table.setUpdate(getBoolean(tableElement.getAttribute("update")));
table.setFind(getBoolean(tableElement.getAttribute("find")));
table.setGet(getBoolean(tableElement.getAttribute("get")));
table.setSearch(getBoolean(tableElement.getAttribute("search")));
table.setHtml(getBoolean(tableElement.getAttribute("html")));
table.setSys(getBoolean(tableElement.getAttribute("sys")));
NodeList fields = tableElement.getElementsByTagName("field");
if (fields.getLength() > 0) {
for (int k = 0; k < fields.getLength(); k++) {
Element fieldElement = (Element) fields.item(k);
@ -132,6 +120,18 @@ public class XmlManager {
table.putField(field);
}
}
table.setdBhandle(module);
table.setTableName(tableElement.getAttribute("tableName"));
table.setTableComment(tableElement.getAttribute("tableComment"));
table.setCreate(getBoolean(tableElement.getAttribute("create")));
table.setDelete(getBoolean(tableElement.getAttribute("delete")));
table.setUpdate(getBoolean(tableElement.getAttribute("update")));
table.setFind(getBoolean(tableElement.getAttribute("find")));
table.setGet(getBoolean(tableElement.getAttribute("get")));
table.setSearch(getBoolean(tableElement.getAttribute("search")));
table.setHtml(getBoolean(tableElement.getAttribute("html")));
table.setSys(getBoolean(tableElement.getAttribute("sys")));
module.putTable(table);
}
}

@ -560,7 +560,7 @@ public class WExcel<T> implements Serializable, Cloneable {
sheet.setColumnWidth(j + offset, (4 + column.getCellWidth()) * 256);
if (column.getCellList() != null){
CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 65535, j, j);
CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 65535, j+offset, j+offset);
DataValidationHelper helper = sheet.getDataValidationHelper();
DataValidationConstraint constraint = helper.createExplicitListConstraint(column.getCellList());
DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList);
@ -574,7 +574,7 @@ public class WExcel<T> implements Serializable, Cloneable {
dataValidation.setEmptyCellAllowed(true);
dataValidation.setShowPromptBox(true);
dataValidation.createPromptBox("提示", "只能选择下拉框里面的数据");
dataValidation.createPromptBox("提示", "选择下拉框里面的数据");
sheet.addValidationData(dataValidation);
}
}
@ -599,7 +599,7 @@ public class WExcel<T> implements Serializable, Cloneable {
// 添加错误信息详细说明
Cell errsCell = row.createCell(1);
errsCell.setCellStyle(new ErrorCellStyle(workbook).getStyle());
String join = String.join(";", errorList);
String join = String.join("\n", errorList);
errsCell.setCellValue(new XSSFRichTextString(join));
} else {
// 添加结果

Loading…
Cancel
Save

Powered by TurnKey Linux.