dataDto.putAll(dto);
} else {
log.error(G4Constants.Exception_Head + "不支持的数据类型!");
}
for (int i = 0; i < fields.size(); i++) {
Cell cell = (Cell) fields.get(i);
String key = getKey(cell.getContents().trim());
String type = getType(cell.getContents().trim());
try {
if (type.equalsIgnoreCase(G4Constants.ExcelTPL_DataType_Number)) {
Number number = new Number(cell.getColumn(), cell.getRow() + j, dataDto.getAsBigDecimal(key)
.doubleValue());
number.setCellFormat(cell.getCellFormat());
wSheet.addCell(number);
} else {
Label label = new Label(cell.getColumn(), cell.getRow() + j, dataDto.getAsString(key));
label.setCellFormat(cell.getCellFormat());
wSheet.addCell(label);
}
} catch (Exception e) {
log.error(G4Constants.Exception_Head + "写入表格字段对象发生错误!");
e.printStackTrace();
}
}
}
int row = 0;
row += fieldList.size();
if (G4Utils.isEmpty(fieldList)) {
if (G4Utils.isNotEmpty(fields)) {
Cell cell = (Cell) fields.get(0);
row = cell.getRow();
wSheet.removeRow(row+5);
wSheet.removeRow(row+4);
wSheet.removeRow(row+3);
wSheet.removeRow(row+2);
wSheet.removeRow(row+1);
wSheet.removeRow(row);
}
}else {
Cell cell = (Cell) fields.get(0);
row += cell.getRow();
fillVariables(wSheet, row);
}
}