Search in sources :

Example 6 with DecPublishReward

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;
}
Also used : XWPFTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell) DecPublishReward(com.bc.pmpheep.back.po.DecPublishReward) Date(java.util.Date) XWPFTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow)

Aggregations

DecPublishReward (com.bc.pmpheep.back.po.DecPublishReward)6 DecAcade (com.bc.pmpheep.back.po.DecAcade)4 DecAcadeReward (com.bc.pmpheep.back.po.DecAcadeReward)4 DecAchievement (com.bc.pmpheep.back.po.DecAchievement)4 DecClinicalReward (com.bc.pmpheep.back.po.DecClinicalReward)4 DecCourseConstruction (com.bc.pmpheep.back.po.DecCourseConstruction)4 DecEduExp (com.bc.pmpheep.back.po.DecEduExp)4 DecIntention (com.bc.pmpheep.back.po.DecIntention)4 DecLastPosition (com.bc.pmpheep.back.po.DecLastPosition)4 DecMonograph (com.bc.pmpheep.back.po.DecMonograph)4 DecMoocDigital (com.bc.pmpheep.back.po.DecMoocDigital)4 DecNationalPlan (com.bc.pmpheep.back.po.DecNationalPlan)4 DecResearch (com.bc.pmpheep.back.po.DecResearch)4 DecSci (com.bc.pmpheep.back.po.DecSci)4 DecTeachExp (com.bc.pmpheep.back.po.DecTeachExp)4 DecTextbook (com.bc.pmpheep.back.po.DecTextbook)4 DecTextbookPmph (com.bc.pmpheep.back.po.DecTextbookPmph)4 DecWorkExp (com.bc.pmpheep.back.po.DecWorkExp)4 DecExtensionVO (com.bc.pmpheep.back.vo.DecExtensionVO)4 ArrayList (java.util.ArrayList)4