|
|
|
@ -13,6 +13,7 @@ import com.itextpdf.text.pdf.PdfPTable;
|
|
|
|
|
import com.itextpdf.text.pdf.PdfWriter;
|
|
|
|
|
import com.obs.services.model.PutObjectResult;
|
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
@ -561,43 +562,53 @@ public class MesTraceabilityTemp {
|
|
|
|
|
equCell61.setPaddingTop(1);
|
|
|
|
|
equtable.addCell(equCell61);
|
|
|
|
|
int index = 0;
|
|
|
|
|
for (MesWorkCellScanMonitorLog log : dataModel.getMesWorkCellScanMonitorLogs()) {
|
|
|
|
|
// 构建每一列
|
|
|
|
|
PdfPCell equcontentCell00 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
|
equcontentCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
|
equcontentCell00.setBorder(Rectangle.NO_BORDER);
|
|
|
|
|
equcontentCell00.setColspan(1);
|
|
|
|
|
equtable.addCell(equcontentCell00);
|
|
|
|
|
|
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(log.getMessage(), valueFont));
|
|
|
|
|
// 构建每一列
|
|
|
|
|
PdfPCell equcontentCell00 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
|
equcontentCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
|
equcontentCell00.setBorder(Rectangle.NO_BORDER);
|
|
|
|
|
equcontentCell00.setColspan(1);
|
|
|
|
|
equtable.addCell(equcontentCell00);
|
|
|
|
|
if(!CollectionUtils.isEmpty(dataModel.getMesWorkCellScanMonitorLogs())){
|
|
|
|
|
for (MesWorkCellScanMonitorLog log : dataModel.getMesWorkCellScanMonitorLogs()) {
|
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(log.getMessage(), valueFont));
|
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
|
|
equcontentCell11.setPaddingTop(1);
|
|
|
|
|
|
|
|
|
|
if (index % 2 == 0) {
|
|
|
|
|
equcontentCell11.setBackgroundColor(new BaseColor(253, 239, 192));//黄色
|
|
|
|
|
} else {
|
|
|
|
|
equcontentCell11.setBackgroundColor(BaseColor.WHITE);//白色
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
equcontentCell11.setColspan(4);
|
|
|
|
|
equtable.addCell(equcontentCell11);
|
|
|
|
|
|
|
|
|
|
PdfPCell equcontentCell21 = new PdfPCell(new Paragraph(log.getScanInfo(), valueFont));
|
|
|
|
|
equcontentCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
|
equcontentCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
|
equcontentCell21.setPaddingBottom(3);
|
|
|
|
|
equcontentCell21.setPaddingTop(1);
|
|
|
|
|
|
|
|
|
|
if (index % 2 == 0) {
|
|
|
|
|
equcontentCell21.setBackgroundColor(new BaseColor(253, 239, 192));//黄色
|
|
|
|
|
} else {
|
|
|
|
|
equcontentCell21.setBackgroundColor(BaseColor.WHITE);//白色
|
|
|
|
|
}
|
|
|
|
|
equcontentCell21.setColspan(2);
|
|
|
|
|
equtable.addCell(equcontentCell21);
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(" ", valueFont));
|
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
|
|
equcontentCell11.setPaddingTop(1);
|
|
|
|
|
|
|
|
|
|
if (index % 2 == 0) {
|
|
|
|
|
equcontentCell11.setBackgroundColor(new BaseColor(253, 239, 192));//黄色
|
|
|
|
|
} else {
|
|
|
|
|
equcontentCell11.setBackgroundColor(BaseColor.WHITE);//白色
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
equcontentCell11.setColspan(4);
|
|
|
|
|
equcontentCell11.setBackgroundColor(new BaseColor(253, 239, 192));//黄色
|
|
|
|
|
equcontentCell11.setColspan(8);
|
|
|
|
|
equtable.addCell(equcontentCell11);
|
|
|
|
|
|
|
|
|
|
PdfPCell equcontentCell21 = new PdfPCell(new Paragraph(log.getScanInfo(), valueFont));
|
|
|
|
|
equcontentCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
|
equcontentCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
|
equcontentCell21.setPaddingBottom(3);
|
|
|
|
|
equcontentCell21.setPaddingTop(1);
|
|
|
|
|
|
|
|
|
|
if (index % 2 == 0) {
|
|
|
|
|
equcontentCell21.setBackgroundColor(new BaseColor(253, 239, 192));//黄色
|
|
|
|
|
} else {
|
|
|
|
|
equcontentCell21.setBackgroundColor(BaseColor.WHITE);//白色
|
|
|
|
|
}
|
|
|
|
|
equcontentCell21.setColspan(2);
|
|
|
|
|
equtable.addCell(equcontentCell21);
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.add(equtable);
|
|
|
|
|