Search in sources :

Example 6 with ProductType

use of com.bc.pmpheep.back.vo.ProductType in project pmph by BCSquad.

the class ClicWordHelper method fillProductTypeData.

private XWPFTable fillProductTypeData(XWPFTable table, List<ProductType> productTypeList) {
    if (CollectionUtil.isEmpty(productTypeList)) {
        return table;
    }
    /*if (productTypeList.size() > 1) {
			int height = table.getRow(1).getHeight();
			for (int i = 1; i < productTypeList.size(); i++) {
				table.createRow().setHeight(height);
			}
		}*/
    List<XWPFTableRow> rows = table.getRows();
    String typeName = "";
    for (ProductType productType : productTypeList) {
        if (StringUtil.notEmpty(productType.getType_name())) {
            typeName = typeName + productType.getType_name() + ",     ";
        }
    }
    typeName = typeName.substring(0, typeName.lastIndexOf(","));
    if (StringUtil.notEmpty(typeName)) {
        // 每次添加一个换行符
        rows.get(0).getCell(0).setText(typeName);
    }
    return table;
}
Also used : ProductType(com.bc.pmpheep.back.vo.ProductType)

Aggregations

ProductType (com.bc.pmpheep.back.vo.ProductType)6 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)4 LogDetail (com.bc.pmpheep.annotation.LogDetail)3 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)2 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)1 PageResult (com.bc.pmpheep.back.plugin.PageResult)1 SurveyQuestionListVO (com.bc.pmpheep.back.vo.SurveyQuestionListVO)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HttpSession (javax.servlet.http.HttpSession)1 HashedMap (org.apache.commons.collections.map.HashedMap)1 HSSFWorkbook (org.apache.poi.hssf.usermodel.HSSFWorkbook)1 OfficeXmlFileException (org.apache.poi.poifs.filesystem.OfficeXmlFileException)1 Cell (org.apache.poi.ss.usermodel.Cell)1 Row (org.apache.poi.ss.usermodel.Row)1 Sheet (org.apache.poi.ss.usermodel.Sheet)1 Workbook (org.apache.poi.ss.usermodel.Workbook)1 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)1