use of com.bc.pmpheep.back.po.DecSci in project pmph by BCSquad.
the class WordHelper method fillDecSciData.
private XWPFTable fillDecSciData(XWPFTable table, List<DecSci> decScis) {
if (CollectionUtil.isEmpty(decScis)) {
return table;
}
if (decScis.size() > 1) {
int height = table.getRow(1).getHeight();
for (int i = 1; i < decScis.size(); i++) {
table.createRow().setHeight(height);
}
}
List<XWPFTableRow> rows = table.getRows();
List<XWPFTableCell> cells;
int rowCount = 1;
for (DecSci decSci : decScis) {
cells = rows.get(rowCount).getTableCells();
String value = decSci.getPaperName();
if (StringUtil.notEmpty(value)) {
cells.get(0).setText(value);
}
value = decSci.getJournalName();
if (StringUtil.notEmpty(value)) {
cells.get(1).setText(value);
}
value = decSci.getFactor();
if (StringUtil.notEmpty(value)) {
cells.get(2).setText(value);
}
Date publishDate = decSci.getPublishDate();
if (null != publishDate) {
value = sdf.format(publishDate);
cells.get(3).setText(value);
}
value = decSci.getNote();
if (StringUtil.notEmpty(value)) {
cells.get(4).setText(value);
}
for (XWPFTableCell cell : cells) {
cell.setVerticalAlignment(XWPFVertAlign.CENTER);
}
rowCount++;
}
return table;
}
Aggregations