|
|
@@ -795,7 +795,17 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp |
|
|
|
table4.setAlignment(Element.ALIGN_MIDDLE);//垂直居中显示 |
|
|
|
//查询处理数据 |
|
|
|
List<QuestionHandleVO> questionHandleList = questionHandleMapper.getList(reportInfoVO.getQuestionReportList().get(i).getId()); |
|
|
|
for (int j = 0; j < 15; j++) { |
|
|
|
String[] imgHanders = new String[0]; |
|
|
|
if(StringUtils.isNotEmpty(questionHandleList)){ |
|
|
|
String handlerImage = questionHandleList.get(0).getHandlerImage(); |
|
|
|
//拼接图片域名 |
|
|
|
imgHanders = handlerImage.split(","); |
|
|
|
for (int h = 0; h < imgHanders.length; h++) { |
|
|
|
imgHanders[h] = CommonConfig.imageURL + imgHanders[h]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (int j = 0; j < 14 + imgHanders.length; j++) { |
|
|
|
Cell cell = new Cell(); |
|
|
|
String str = ""; |
|
|
|
Font font = new Font(); |
|
|
@@ -869,25 +879,17 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp |
|
|
|
}else if (j == 13) { |
|
|
|
str = " 处理图片"; |
|
|
|
cell.add(new Paragraph(str, font)); |
|
|
|
}else if (j == 14) { |
|
|
|
cell.setRowspan(imgHanders.length); |
|
|
|
}else if (j >= 14) { |
|
|
|
Image image = null; |
|
|
|
String handlerImage = questionHandleList.get(0).getHandlerImage(); |
|
|
|
|
|
|
|
//拼接图片域名 |
|
|
|
String[] imgHanders = new String[0]; |
|
|
|
if(StringUtils.isNotEmpty(handlerImage)){ |
|
|
|
imgHanders = handlerImage.split(","); |
|
|
|
for (int h = 0; h < imgHanders.length; h++) { |
|
|
|
imgHanders[h] = CommonConfig.imageURL + imgHanders[h]; |
|
|
|
} |
|
|
|
} |
|
|
|
if (new UrlResource(imgHanders[0]).exists()) { |
|
|
|
if (new UrlResource(imgHanders[j-14]).exists()) { |
|
|
|
try { |
|
|
|
image = Image.getInstance(Base64.getDecoder().decode(ImgTypeConvert.requestUrlToBase64(imgHanders[0]))); |
|
|
|
image = Image.getInstance(Base64.getDecoder().decode(ImgTypeConvert.requestUrlToBase64(imgHanders[j-14]))); |
|
|
|
image.setAlignment(Image.ALIGN_CENTER); |
|
|
|
image.scalePercent(100); //依照比例缩放 |
|
|
|
image.setAbsolutePosition(0, 0); |
|
|
|
image.scaleToFit(300, 300);//自定义大 |
|
|
|
cell.setRowspan(1); |
|
|
|
cell.add(image); |
|
|
|
}catch (Exception e){ |
|
|
|
log.info("图片获取失败!"); |