Search in sources :

Example 6 with MaterialExtension

use of com.bc.pmpheep.back.po.MaterialExtension in project pmph by BCSquad.

the class ExcelHelper method fillDecExtensionVODataPlus.

private ColumnProperties fillDecExtensionVODataPlus(List<MaterialExtension> extensions, List<DecExtensionVO> decExtensionVOs, Row row, ColumnProperties properties) {
    int colCount = properties.getColCount();
    int[] maxLength = properties.getMaxLength();
    if (CollectionUtil.isEmpty(decExtensionVOs)) {
        for (MaterialExtension extension : extensions) {
            row.createCell(colCount++);
        }
    } else {
        for (MaterialExtension extension : extensions) {
            for (DecExtensionVO vo : decExtensionVOs) {
                if (vo.getExtensionId().equals(extension.getId())) {
                    Cell cell = row.createCell(colCount++);
                    String content = vo.getContent();
                    if (StringUtil.notEmpty(content)) {
                        cell.setCellValue(content);
                        maxLength[colCount - 1] = content.length();
                    } else {
                        maxLength[colCount - 1] = 2;
                    }
                    break;
                }
            }
        }
    }
    properties.setColCount(colCount);
    properties.setMaxLength(maxLength);
    return properties;
}
Also used : DecExtensionVO(com.bc.pmpheep.back.vo.DecExtensionVO) MaterialExtension(com.bc.pmpheep.back.po.MaterialExtension) Cell(org.apache.poi.ss.usermodel.Cell)

Aggregations

MaterialExtension (com.bc.pmpheep.back.po.MaterialExtension)6 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)3 Material (com.bc.pmpheep.back.po.Material)2 MaterialContact (com.bc.pmpheep.back.po.MaterialContact)2 MaterialExtra (com.bc.pmpheep.back.po.MaterialExtra)2 MaterialNoteAttachment (com.bc.pmpheep.back.po.MaterialNoteAttachment)2 MaterialNoticeAttachment (com.bc.pmpheep.back.po.MaterialNoticeAttachment)2 PmphUser (com.bc.pmpheep.back.po.PmphUser)2 DecExtensionVO (com.bc.pmpheep.back.vo.DecExtensionVO)2 MaterialProjectEditorVO (com.bc.pmpheep.back.vo.MaterialProjectEditorVO)2 Gson (com.google.gson.Gson)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 HashMap (java.util.HashMap)2 Cell (org.apache.poi.ss.usermodel.Cell)2 ExcelHeader (com.bc.pmpheep.annotation.ExcelHeader)1 DeclarationEtcBO (com.bc.pmpheep.back.bo.DeclarationEtcBO)1 CmsContent (com.bc.pmpheep.back.po.CmsContent)1 MaterialProjectEditor (com.bc.pmpheep.back.po.MaterialProjectEditor)1 MaterialType (com.bc.pmpheep.back.po.MaterialType)1