|
|
@ -1,5 +1,6 @@
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.utils;
|
|
|
|
package cn.estsh.i3plus.ext.mes.apiservice.utils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.unit.exception.MesException;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellScanMonitorLog;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellScanMonitorLog;
|
|
|
@ -11,7 +12,6 @@ import com.itextpdf.text.pdf.BaseFont;
|
|
|
|
import com.itextpdf.text.pdf.PdfPCell;
|
|
|
|
import com.itextpdf.text.pdf.PdfPCell;
|
|
|
|
import com.itextpdf.text.pdf.PdfPTable;
|
|
|
|
import com.itextpdf.text.pdf.PdfPTable;
|
|
|
|
import com.itextpdf.text.pdf.PdfWriter;
|
|
|
|
import com.itextpdf.text.pdf.PdfWriter;
|
|
|
|
import com.obs.services.model.PutObjectResult;
|
|
|
|
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@ -20,44 +20,54 @@ import java.io.File;
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
|
|
|
|
|
|
|
import static cn.estsh.i3plus.ext.mes.apiservice.dbinterface.WmsSAPDbQuery.lz;
|
|
|
|
import static cn.estsh.i3plus.ext.mes.apiservice.dbinterface.WmsSAPDbQuery.lz;
|
|
|
|
|
|
|
|
|
|
|
|
public class MesTraceabilityTemp {
|
|
|
|
public class MesTraceabilityTemp {
|
|
|
|
|
|
|
|
|
|
|
|
public static String getMesTraceabilityTemp(MesTraceabilityReportModel mesTraceabilityReportModel) throws DocumentException, IOException {
|
|
|
|
public static String getMesTraceabilityTemp(MesTraceabilityReportModel mesTraceabilityReportModel) throws IOException {
|
|
|
|
Document document = new Document();
|
|
|
|
String url = "";
|
|
|
|
|
|
|
|
File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "追溯报表orgPdf" + mesTraceabilityReportModel.getProductSn() + "-" + mesTraceabilityReportModel.getPartNo() + ".PDF");
|
|
|
|
|
|
|
|
File destFile = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Document document = new Document(PageSize.A4);
|
|
|
|
//本地地址
|
|
|
|
//本地地址
|
|
|
|
//BaseFont bfChinese = BaseFont.createFont("C:\\Windows\\Fonts\\simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
//BaseFont bfChinese = BaseFont.createFont("C:\\Windows\\Fonts\\simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
BaseFont bfChinese = BaseFont.createFont(MesCommonConstant.FONDS_TEMP_PATH + "SIMHEI.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
BaseFont bfChinese = BaseFont.createFont(MesCommonConstant.FONDS_TEMP_PATH + "SIMHEI.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
|
|
|
|
//标题字体
|
|
|
|
|
|
|
|
Font titleFont = new Font(bfChinese, 12, Font.NORMAL);
|
|
|
|
|
|
|
|
titleFont.setColor(new BaseColor(84, 132, 216));
|
|
|
|
|
|
|
|
//白色字体
|
|
|
|
Font whiteFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
Font whiteFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
whiteFont.setColor(BaseColor.WHITE);
|
|
|
|
whiteFont.setColor(BaseColor.WHITE);
|
|
|
|
Font valueFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
//表格上面部分的字体
|
|
|
|
valueFont.setColor(new BaseColor(78, 103, 100));
|
|
|
|
Font topValueFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
|
|
|
|
topValueFont.setColor(new BaseColor(0, 0, 0));
|
|
|
|
|
|
|
|
//表格字体
|
|
|
|
|
|
|
|
Font tableValueFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
|
|
|
|
tableValueFont.setColor(new BaseColor(0, 0, 0));
|
|
|
|
|
|
|
|
//设备
|
|
|
|
Font equFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
Font equFont = new Font(bfChinese, 8, Font.NORMAL);
|
|
|
|
equFont.setColor(new BaseColor(196, 222, 249));
|
|
|
|
equFont.setColor(new BaseColor(196, 222, 249));
|
|
|
|
|
|
|
|
//蓝色背景色
|
|
|
|
Font titleFont = new Font(bfChinese, 24, Font.NORMAL);
|
|
|
|
|
|
|
|
titleFont.setColor(new BaseColor(84, 132, 216));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseColor backgroundColor = new BaseColor(84, 132, 216);
|
|
|
|
BaseColor backgroundColor = new BaseColor(84, 132, 216);
|
|
|
|
|
|
|
|
//创建临时文件
|
|
|
|
File file = new File(System.getProperty("java.io.tmpdir") + File.separator + mesTraceabilityReportModel.getProductSn() + "-" + mesTraceabilityReportModel.getPartNo() + "追溯报表.PDF");
|
|
|
|
|
|
|
|
file.createNewFile();
|
|
|
|
file.createNewFile();
|
|
|
|
PdfWriter.getInstance(document, new FileOutputStream(file));
|
|
|
|
PdfWriter.getInstance(document, new FileOutputStream(file));
|
|
|
|
document.open();
|
|
|
|
document.open();
|
|
|
|
|
|
|
|
//标题
|
|
|
|
|
|
|
|
Paragraph title = new Paragraph();
|
|
|
|
|
|
|
|
title.setFont(titleFont);
|
|
|
|
|
|
|
|
title.add(lz("追溯报表"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.add(title);
|
|
|
|
//最上面内容
|
|
|
|
//最上面内容
|
|
|
|
PdfPTable table0 = new PdfPTable(20);
|
|
|
|
PdfPTable table0 = new PdfPTable(20);
|
|
|
|
//设置间距
|
|
|
|
//设置间距
|
|
|
|
table0.setSpacingBefore(30);
|
|
|
|
table0.setSpacingBefore(15);
|
|
|
|
table0.setWidths(new float[]{5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f});
|
|
|
|
table0.setWidths(new float[]{5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f});
|
|
|
|
table0.setWidthPercentage(100);
|
|
|
|
table0.setWidthPercentage(100);
|
|
|
|
PdfPCell totalCell00 = new PdfPCell(new Paragraph(lz("追溯报表"), titleFont));
|
|
|
|
|
|
|
|
totalCell00.setColspan(20);
|
|
|
|
|
|
|
|
totalCell00.setBorderColor(BaseColor.WHITE);
|
|
|
|
|
|
|
|
totalCell00.setFixedHeight(50f);
|
|
|
|
|
|
|
|
table0.addCell(totalCell00);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell totalCell0 = new PdfPCell(new Paragraph(lz("工厂") + ":", whiteFont));
|
|
|
|
PdfPCell totalCell0 = new PdfPCell(new Paragraph(lz("工厂") + ":", whiteFont));
|
|
|
|
totalCell0.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell0.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
@ -70,7 +80,7 @@ public class MesTraceabilityTemp {
|
|
|
|
totalCell0.setBorderColor(BaseColor.WHITE);
|
|
|
|
totalCell0.setBorderColor(BaseColor.WHITE);
|
|
|
|
table0.addCell(totalCell0);
|
|
|
|
table0.addCell(totalCell0);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell totalCell01 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getOrganizeCode(), valueFont));
|
|
|
|
PdfPCell totalCell01 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getOrganizeCode(), topValueFont));
|
|
|
|
totalCell01.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell01.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell01.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell01.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell01.setPaddingBottom(3);
|
|
|
|
totalCell01.setPaddingBottom(3);
|
|
|
@ -91,7 +101,7 @@ public class MesTraceabilityTemp {
|
|
|
|
totalCell02.setColspan(5);
|
|
|
|
totalCell02.setColspan(5);
|
|
|
|
table0.addCell(totalCell02);
|
|
|
|
table0.addCell(totalCell02);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell totalCell03 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProductSn(), valueFont));
|
|
|
|
PdfPCell totalCell03 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProductSn(), topValueFont));
|
|
|
|
totalCell03.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell03.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell03.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell03.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell03.setBorder(Rectangle.NO_BORDER);
|
|
|
|
totalCell03.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -112,7 +122,7 @@ public class MesTraceabilityTemp {
|
|
|
|
totalCell04.setColspan(5);
|
|
|
|
totalCell04.setColspan(5);
|
|
|
|
table0.addCell(totalCell04);
|
|
|
|
table0.addCell(totalCell04);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell totalCell05 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getWorkCenterCode(), valueFont));
|
|
|
|
PdfPCell totalCell05 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getWorkCenterCode(), topValueFont));
|
|
|
|
totalCell05.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell05.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell05.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell05.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell05.setBorder(Rectangle.NO_BORDER);
|
|
|
|
totalCell05.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -133,7 +143,7 @@ public class MesTraceabilityTemp {
|
|
|
|
totalCell06.setColspan(5);
|
|
|
|
totalCell06.setColspan(5);
|
|
|
|
table0.addCell(totalCell06);
|
|
|
|
table0.addCell(totalCell06);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell totalCell07 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getPartNo(), valueFont));
|
|
|
|
PdfPCell totalCell07 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getPartNo(), topValueFont));
|
|
|
|
totalCell07.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell07.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
totalCell07.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell07.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
totalCell07.setBorder(Rectangle.NO_BORDER);
|
|
|
|
totalCell07.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -145,10 +155,15 @@ public class MesTraceabilityTemp {
|
|
|
|
|
|
|
|
|
|
|
|
document.add(table0);
|
|
|
|
document.add(table0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Paragraph divider = new Paragraph();
|
|
|
|
|
|
|
|
divider.setFont(titleFont);
|
|
|
|
|
|
|
|
//divider.add(new Chunk("\n"));换行
|
|
|
|
|
|
|
|
divider.add("———————————————————————————————————————————");
|
|
|
|
|
|
|
|
document.add(divider);
|
|
|
|
//最上面内容
|
|
|
|
//最上面内容
|
|
|
|
PdfPTable tableTop2 = new PdfPTable(20);
|
|
|
|
PdfPTable tableTop2 = new PdfPTable(20);
|
|
|
|
//设置间距
|
|
|
|
//设置间距
|
|
|
|
tableTop2.setSpacingBefore(10);
|
|
|
|
tableTop2.setSpacingBefore(5);
|
|
|
|
tableTop2.setWidths(new float[]{5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f});
|
|
|
|
tableTop2.setWidths(new float[]{5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f, 5f});
|
|
|
|
tableTop2.setWidthPercentage(100);
|
|
|
|
tableTop2.setWidthPercentage(100);
|
|
|
|
|
|
|
|
|
|
|
@ -164,7 +179,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell00.setColspan(5);
|
|
|
|
tableTop2Cell00.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell00);
|
|
|
|
tableTop2.addCell(tableTop2Cell00);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell01 = new PdfPCell(new Paragraph(MesExtEnumUtil.TRACEABILITY_REPORT_PROD_TYPE.valueOfDescription(mesTraceabilityReportModel.getProdType()), valueFont));
|
|
|
|
PdfPCell tableTop2Cell01 = new PdfPCell(new Paragraph(MesExtEnumUtil.TRACEABILITY_REPORT_PROD_TYPE.valueOfDescription(mesTraceabilityReportModel.getProdType()), topValueFont));
|
|
|
|
tableTop2Cell01.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell01.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell01.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell01.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell01.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell01.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -174,7 +189,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell01.setColspan(5);
|
|
|
|
tableTop2Cell01.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell01);
|
|
|
|
tableTop2.addCell(tableTop2Cell01);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell02 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell02 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell02.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell02.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell02.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell02.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell02.setPaddingBottom(3);
|
|
|
|
tableTop2Cell02.setPaddingBottom(3);
|
|
|
@ -184,7 +199,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell02.setColspan(5);
|
|
|
|
tableTop2Cell02.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell02);
|
|
|
|
tableTop2.addCell(tableTop2Cell02);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell03 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell03 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell03.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell03.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell03.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell03.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell03.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell03.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -206,7 +221,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell10.setColspan(5);
|
|
|
|
tableTop2Cell10.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell10);
|
|
|
|
tableTop2.addCell(tableTop2Cell10);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell11 = new PdfPCell(new Paragraph(MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(mesTraceabilityReportModel.getSnStatus()), valueFont));
|
|
|
|
PdfPCell tableTop2Cell11 = new PdfPCell(new Paragraph(MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(mesTraceabilityReportModel.getSnStatus()), topValueFont));
|
|
|
|
tableTop2Cell11.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell11.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell11.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell11.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -216,7 +231,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell11.setColspan(5);
|
|
|
|
tableTop2Cell11.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell11);
|
|
|
|
tableTop2.addCell(tableTop2Cell11);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell12 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell12 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell12.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell12.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell12.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell12.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell12.setPaddingBottom(3);
|
|
|
|
tableTop2Cell12.setPaddingBottom(3);
|
|
|
@ -226,7 +241,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell12.setColspan(5);
|
|
|
|
tableTop2Cell12.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell12);
|
|
|
|
tableTop2.addCell(tableTop2Cell12);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell14 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell14 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell14.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell14.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell14.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell14.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell14.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell14.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -248,7 +263,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell20.setColspan(5);
|
|
|
|
tableTop2Cell20.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell20);
|
|
|
|
tableTop2.addCell(tableTop2Cell20);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell21 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProduceBegin(), valueFont));
|
|
|
|
PdfPCell tableTop2Cell21 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProduceBegin(), topValueFont));
|
|
|
|
tableTop2Cell21.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell21.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell21.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell21.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -258,7 +273,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell21.setColspan(5);
|
|
|
|
tableTop2Cell21.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell21);
|
|
|
|
tableTop2.addCell(tableTop2Cell21);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell22 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell22 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell22.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell22.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell22.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell22.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell22.setPaddingBottom(3);
|
|
|
|
tableTop2Cell22.setPaddingBottom(3);
|
|
|
@ -268,7 +283,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell22.setColspan(5);
|
|
|
|
tableTop2Cell22.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell22);
|
|
|
|
tableTop2.addCell(tableTop2Cell22);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell24 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell24 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell24.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell24.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell24.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell24.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell24.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell24.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -290,7 +305,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell30.setColspan(5);
|
|
|
|
tableTop2Cell30.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell30);
|
|
|
|
tableTop2.addCell(tableTop2Cell30);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell31 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProduceEnd(), valueFont));
|
|
|
|
PdfPCell tableTop2Cell31 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getProduceEnd(), topValueFont));
|
|
|
|
tableTop2Cell31.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell31.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell31.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell31.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell31.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell31.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -300,7 +315,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell31.setColspan(5);
|
|
|
|
tableTop2Cell31.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell31);
|
|
|
|
tableTop2.addCell(tableTop2Cell31);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell32 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell32 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell32.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell32.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell32.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell32.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell32.setPaddingBottom(3);
|
|
|
|
tableTop2Cell32.setPaddingBottom(3);
|
|
|
@ -310,7 +325,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell32.setColspan(5);
|
|
|
|
tableTop2Cell32.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell32);
|
|
|
|
tableTop2.addCell(tableTop2Cell32);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell34 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell34 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell34.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell34.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell34.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell34.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell34.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell34.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -333,7 +348,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell40.setColspan(5);
|
|
|
|
tableTop2Cell40.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell40);
|
|
|
|
tableTop2.addCell(tableTop2Cell40);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell41 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getDurationStr(), valueFont));
|
|
|
|
PdfPCell tableTop2Cell41 = new PdfPCell(new Paragraph(mesTraceabilityReportModel.getDurationStr(), topValueFont));
|
|
|
|
tableTop2Cell41.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell41.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell41.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell41.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell41.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell41.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -343,7 +358,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell41.setColspan(5);
|
|
|
|
tableTop2Cell41.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell41);
|
|
|
|
tableTop2.addCell(tableTop2Cell41);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell42 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell42 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell42.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell42.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell42.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell42.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell42.setPaddingBottom(3);
|
|
|
|
tableTop2Cell42.setPaddingBottom(3);
|
|
|
@ -353,7 +368,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell42.setColspan(5);
|
|
|
|
tableTop2Cell42.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell42);
|
|
|
|
tableTop2.addCell(tableTop2Cell42);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell44 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell44 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell44.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell44.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell44.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell44.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell44.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell44.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -376,7 +391,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell50.setColspan(5);
|
|
|
|
tableTop2Cell50.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell50);
|
|
|
|
tableTop2.addCell(tableTop2Cell50);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell51 = new PdfPCell(new Paragraph(MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(mesTraceabilityReportModel.getProdStatus()), valueFont));
|
|
|
|
PdfPCell tableTop2Cell51 = new PdfPCell(new Paragraph(MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(mesTraceabilityReportModel.getProdStatus()), topValueFont));
|
|
|
|
tableTop2Cell51.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell51.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell51.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell51.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell51.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell51.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -386,7 +401,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell51.setColspan(5);
|
|
|
|
tableTop2Cell51.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell51);
|
|
|
|
tableTop2.addCell(tableTop2Cell51);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell52 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell52 = new PdfPCell(new Paragraph("", whiteFont));
|
|
|
|
tableTop2Cell52.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell52.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell52.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell52.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell52.setPaddingBottom(3);
|
|
|
|
tableTop2Cell52.setPaddingBottom(3);
|
|
|
@ -396,7 +411,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell52.setColspan(5);
|
|
|
|
tableTop2Cell52.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell52);
|
|
|
|
tableTop2.addCell(tableTop2Cell52);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell53 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell53 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell53.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell53.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell53.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell53.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell53.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell53.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -406,7 +421,6 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell53.setColspan(5);
|
|
|
|
tableTop2Cell53.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell53);
|
|
|
|
tableTop2.addCell(tableTop2Cell53);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//托盘条码
|
|
|
|
//托盘条码
|
|
|
|
PdfPCell tableTop2Cell60 = new PdfPCell(new Paragraph(lz("托盘条码") + ":", whiteFont));
|
|
|
|
PdfPCell tableTop2Cell60 = new PdfPCell(new Paragraph(lz("托盘条码") + ":", whiteFont));
|
|
|
|
tableTop2Cell60.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell60.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
@ -419,7 +433,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell60.setColspan(5);
|
|
|
|
tableTop2Cell60.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell60);
|
|
|
|
tableTop2.addCell(tableTop2Cell60);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell61 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell61 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell61.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell61.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell61.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell61.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell61.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell61.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -429,7 +443,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell61.setColspan(5);
|
|
|
|
tableTop2Cell61.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell61);
|
|
|
|
tableTop2.addCell(tableTop2Cell61);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell62 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell62 = new PdfPCell(new Paragraph("", whiteFont));
|
|
|
|
tableTop2Cell62.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell62.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell62.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell62.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell62.setPaddingBottom(3);
|
|
|
|
tableTop2Cell62.setPaddingBottom(3);
|
|
|
@ -439,7 +453,7 @@ public class MesTraceabilityTemp {
|
|
|
|
tableTop2Cell62.setColspan(5);
|
|
|
|
tableTop2Cell62.setColspan(5);
|
|
|
|
tableTop2.addCell(tableTop2Cell62);
|
|
|
|
tableTop2.addCell(tableTop2Cell62);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell tableTop2Cell63 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell tableTop2Cell63 = new PdfPCell(new Paragraph("", topValueFont));
|
|
|
|
tableTop2Cell63.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell63.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
tableTop2Cell63.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell63.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
tableTop2Cell63.setBorder(Rectangle.NO_BORDER);
|
|
|
|
tableTop2Cell63.setBorder(Rectangle.NO_BORDER);
|
|
|
@ -462,7 +476,7 @@ public class MesTraceabilityTemp {
|
|
|
|
PdfPCell equCell01 = new PdfPCell(new Paragraph(lz("设备/工艺"), whiteFont));
|
|
|
|
PdfPCell equCell01 = new PdfPCell(new Paragraph(lz("设备/工艺"), whiteFont));
|
|
|
|
equCell01.setBackgroundColor(backgroundColor);
|
|
|
|
equCell01.setBackgroundColor(backgroundColor);
|
|
|
|
equCell01.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell01.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell01.setHorizontalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell01.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell01.setPaddingBottom(3);
|
|
|
|
equCell01.setPaddingBottom(3);
|
|
|
|
equCell01.setPaddingTop(1);
|
|
|
|
equCell01.setPaddingTop(1);
|
|
|
|
equCell01.setColspan(1);
|
|
|
|
equCell01.setColspan(1);
|
|
|
@ -471,7 +485,7 @@ public class MesTraceabilityTemp {
|
|
|
|
PdfPCell equCell02 = new PdfPCell(new Paragraph(lz("工艺开始时间"), whiteFont));
|
|
|
|
PdfPCell equCell02 = new PdfPCell(new Paragraph(lz("工艺开始时间"), whiteFont));
|
|
|
|
equCell02.setBackgroundColor(backgroundColor);
|
|
|
|
equCell02.setBackgroundColor(backgroundColor);
|
|
|
|
equCell02.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell02.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell02.setHorizontalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell02.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell02.setPaddingBottom(3);
|
|
|
|
equCell02.setPaddingBottom(3);
|
|
|
|
equCell02.setPaddingTop(1);
|
|
|
|
equCell02.setPaddingTop(1);
|
|
|
|
equCell02.setColspan(1);
|
|
|
|
equCell02.setColspan(1);
|
|
|
@ -480,7 +494,7 @@ public class MesTraceabilityTemp {
|
|
|
|
PdfPCell equCell03 = new PdfPCell(new Paragraph(lz("工艺结束时间"), whiteFont));
|
|
|
|
PdfPCell equCell03 = new PdfPCell(new Paragraph(lz("工艺结束时间"), whiteFont));
|
|
|
|
equCell03.setBackgroundColor(backgroundColor);
|
|
|
|
equCell03.setBackgroundColor(backgroundColor);
|
|
|
|
equCell03.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell03.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell03.setHorizontalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell03.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell03.setPaddingBottom(3);
|
|
|
|
equCell03.setPaddingBottom(3);
|
|
|
|
equCell03.setPaddingTop(1);
|
|
|
|
equCell03.setPaddingTop(1);
|
|
|
|
equCell03.setColspan(1);
|
|
|
|
equCell03.setColspan(1);
|
|
|
@ -489,7 +503,7 @@ public class MesTraceabilityTemp {
|
|
|
|
PdfPCell equCell04 = new PdfPCell(new Paragraph(lz("托盘条码"), whiteFont));
|
|
|
|
PdfPCell equCell04 = new PdfPCell(new Paragraph(lz("托盘条码"), whiteFont));
|
|
|
|
equCell04.setBackgroundColor(backgroundColor);
|
|
|
|
equCell04.setBackgroundColor(backgroundColor);
|
|
|
|
equCell04.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell04.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell04.setHorizontalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell04.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell04.setPaddingBottom(3);
|
|
|
|
equCell04.setPaddingBottom(3);
|
|
|
|
equCell04.setPaddingTop(1);
|
|
|
|
equCell04.setPaddingTop(1);
|
|
|
|
equCell04.setColspan(1);
|
|
|
|
equCell04.setColspan(1);
|
|
|
@ -514,63 +528,64 @@ public class MesTraceabilityTemp {
|
|
|
|
equtable.addCell(equCell06);
|
|
|
|
equtable.addCell(equCell06);
|
|
|
|
|
|
|
|
|
|
|
|
// 构建每一列
|
|
|
|
// 构建每一列
|
|
|
|
PdfPCell equCell00 = new PdfPCell(new Paragraph(dataModel.getEquipmentCode(), valueFont));
|
|
|
|
PdfPCell equCell00 = new PdfPCell(new Paragraph(dataModel.getEquipmentCode(), tableValueFont));
|
|
|
|
equCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
equCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
equCell00.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell00.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell00.setColspan(7);
|
|
|
|
equCell00.setColspan(7);
|
|
|
|
equtable.addCell(equCell00);
|
|
|
|
equtable.addCell(equCell00);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell11 = new PdfPCell(new Paragraph(dataModel.getCraftCode(), valueFont));
|
|
|
|
PdfPCell equCell11 = new PdfPCell(new Paragraph(dataModel.getCraftCode(), tableValueFont));
|
|
|
|
equCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell11.setPaddingBottom(3);
|
|
|
|
equCell11.setPaddingBottom(3);
|
|
|
|
equCell11.setPaddingTop(1);
|
|
|
|
equCell11.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell11);
|
|
|
|
equtable.addCell(equCell11);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell21 = new PdfPCell(new Paragraph(dataModel.getStartDateTime(), valueFont));
|
|
|
|
PdfPCell equCell21 = new PdfPCell(new Paragraph(dataModel.getStartDateTime(), tableValueFont));
|
|
|
|
equCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell21.setPaddingBottom(3);
|
|
|
|
equCell21.setPaddingBottom(3);
|
|
|
|
equCell21.setPaddingTop(1);
|
|
|
|
equCell21.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell21);
|
|
|
|
equtable.addCell(equCell21);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell31 = new PdfPCell(new Paragraph(dataModel.getCompleteDateTime(), valueFont));
|
|
|
|
PdfPCell equCell31 = new PdfPCell(new Paragraph(dataModel.getCompleteDateTime(), tableValueFont));
|
|
|
|
equCell31.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell31.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell31.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell31.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell31.setPaddingBottom(3);
|
|
|
|
equCell31.setPaddingBottom(3);
|
|
|
|
equCell31.setPaddingTop(1);
|
|
|
|
equCell31.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell31);
|
|
|
|
equtable.addCell(equCell31);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell41 = new PdfPCell(new Paragraph(dataModel.getTrayNo(), valueFont));
|
|
|
|
PdfPCell equCell41 = new PdfPCell(new Paragraph(dataModel.getTrayNo(), tableValueFont));
|
|
|
|
equCell41.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell41.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell41.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell41.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell41.setPaddingBottom(3);
|
|
|
|
equCell41.setPaddingBottom(3);
|
|
|
|
equCell41.setPaddingTop(1);
|
|
|
|
equCell41.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell41);
|
|
|
|
equtable.addCell(equCell41);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell51 = new PdfPCell(new Paragraph(dataModel.getDurationStr(), valueFont));
|
|
|
|
PdfPCell equCell51 = new PdfPCell(new Paragraph(dataModel.getDurationStr(), tableValueFont));
|
|
|
|
equCell51.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell51.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell51.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell51.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell51.setPaddingBottom(3);
|
|
|
|
equCell51.setPaddingBottom(3);
|
|
|
|
equCell51.setPaddingTop(1);
|
|
|
|
equCell51.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell51);
|
|
|
|
equtable.addCell(equCell51);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equCell61 = new PdfPCell(new Paragraph(CommonEnumUtil.VALID == dataModel.getIsComplete() ? "OK" : "NO", valueFont));
|
|
|
|
PdfPCell equCell61 = new PdfPCell(new Paragraph(CommonEnumUtil.VALID == dataModel.getIsComplete() ? "OK" : "NO", tableValueFont));
|
|
|
|
equCell61.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell61.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equCell61.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell61.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equCell61.setPaddingBottom(3);
|
|
|
|
equCell61.setPaddingBottom(3);
|
|
|
|
equCell61.setPaddingTop(1);
|
|
|
|
equCell61.setPaddingTop(1);
|
|
|
|
equtable.addCell(equCell61);
|
|
|
|
equtable.addCell(equCell61);
|
|
|
|
int index = 0;
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(dataModel.getMesWorkCellScanMonitorLogs())) {
|
|
|
|
|
|
|
|
for (MesWorkCellScanMonitorLog log : dataModel.getMesWorkCellScanMonitorLogs()) {
|
|
|
|
// 构建每一列
|
|
|
|
// 构建每一列
|
|
|
|
PdfPCell equcontentCell00 = new PdfPCell(new Paragraph("", valueFont));
|
|
|
|
PdfPCell equcontentCell00 = new PdfPCell(new Paragraph("", tableValueFont));
|
|
|
|
equcontentCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
equcontentCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
equcontentCell00.setBorder(Rectangle.NO_BORDER);
|
|
|
|
equcontentCell00.setBorder(Rectangle.NO_BORDER);
|
|
|
|
equcontentCell00.setColspan(1);
|
|
|
|
equcontentCell00.setColspan(1);
|
|
|
|
equtable.addCell(equcontentCell00);
|
|
|
|
equtable.addCell(equcontentCell00);
|
|
|
|
if(!CollectionUtils.isEmpty(dataModel.getMesWorkCellScanMonitorLogs())){
|
|
|
|
|
|
|
|
for (MesWorkCellScanMonitorLog log : dataModel.getMesWorkCellScanMonitorLogs()) {
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(log.getMessage(), tableValueFont));
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(log.getMessage(), valueFont));
|
|
|
|
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
@ -585,7 +600,7 @@ public class MesTraceabilityTemp {
|
|
|
|
equcontentCell11.setColspan(4);
|
|
|
|
equcontentCell11.setColspan(4);
|
|
|
|
equtable.addCell(equcontentCell11);
|
|
|
|
equtable.addCell(equcontentCell11);
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equcontentCell21 = new PdfPCell(new Paragraph(log.getScanInfo(), valueFont));
|
|
|
|
PdfPCell equcontentCell21 = new PdfPCell(new Paragraph(log.getScanInfo(), tableValueFont));
|
|
|
|
equcontentCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell21.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell21.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell21.setPaddingBottom(3);
|
|
|
|
equcontentCell21.setPaddingBottom(3);
|
|
|
@ -600,8 +615,15 @@ public class MesTraceabilityTemp {
|
|
|
|
equtable.addCell(equcontentCell21);
|
|
|
|
equtable.addCell(equcontentCell21);
|
|
|
|
index++;
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(" ", valueFont));
|
|
|
|
// 构建每一列
|
|
|
|
|
|
|
|
PdfPCell equcontentCell00 = new PdfPCell(new Paragraph("", tableValueFont));
|
|
|
|
|
|
|
|
equcontentCell00.setHorizontalAlignment(Element.ALIGN_LEFT);
|
|
|
|
|
|
|
|
equcontentCell00.setBorder(Rectangle.NO_BORDER);
|
|
|
|
|
|
|
|
equcontentCell00.setColspan(1);
|
|
|
|
|
|
|
|
equtable.addCell(equcontentCell00);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PdfPCell equcontentCell11 = new PdfPCell(new Paragraph(" ", tableValueFont));
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell11.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell11.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
|
equcontentCell11.setPaddingBottom(3);
|
|
|
@ -615,11 +637,18 @@ public class MesTraceabilityTemp {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 关闭文档
|
|
|
|
// 关闭文档
|
|
|
|
document.close();
|
|
|
|
document.close();
|
|
|
|
|
|
|
|
//添加分页
|
|
|
|
|
|
|
|
destFile = new File(PageNumPdfPageEvent.addPageNum(file.getPath(), file.getPath().replace("追溯报表orgPdf", "追溯报表")));
|
|
|
|
//文件上传
|
|
|
|
//文件上传
|
|
|
|
PutObjectResult result = HuaWeiOBSUtil.putObjectByMultipartFile(MesCommonConstant.OBS_BUCKET_NAME, file.getName(), convert(file));
|
|
|
|
url = HuaWeiOBSUtil.putObjectByMultipartFile(MesCommonConstant.OBS_BUCKET_NAME, destFile.getName(), convert(destFile)).getObjectUrl();
|
|
|
|
|
|
|
|
} catch (DocumentException | IOException e) {
|
|
|
|
|
|
|
|
MesException.throwMesBusiException("生成PDF文件失败");
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
//删除文件
|
|
|
|
//删除文件
|
|
|
|
file.deleteOnExit();
|
|
|
|
Files.deleteIfExists(destFile.toPath());
|
|
|
|
return result.getObjectUrl();
|
|
|
|
Files.deleteIfExists(file.toPath());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static MultipartFile convert(File file) throws IOException {
|
|
|
|
public static MultipartFile convert(File file) throws IOException {
|
|
|
|