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