yangys
昨天 833e909fbb25dd1245ec6aabb0c2cbe4c72d31c7
blade-service/blade-mdm/src/main/java/org/springblade/mdm/flow/service/ApproveTableService.java
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.*;
@@ -44,7 +45,7 @@
   private static final String CHECKED_BOX = "☑";
   static Chunk square = new Chunk("o", new Font(Font.FontFamily.ZAPFDINGBATS, 12)); // 空方框
   static Chunk check = new Chunk("4", new Font(Font.FontFamily.ZAPFDINGBATS, 12)); // 带勾方框
   //static SimpleDateFormat
   BaseFont getBaseFont() throws DocumentException, IOException {
      return BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
   }
@@ -155,10 +156,14 @@
      String personName = record.getUserNickname();
      Chunk block1 = square;
      Chunk block2 = square;
      Date programDate = null;
      Date checkDate = null;
      if(StringUtils.equals(record.getTaskDefinitionId(),"programmingTask")){
         block1 = check;
         programDate = record.getCreateTime();
      }else if(StringUtils.equals(record.getTaskDefinitionId(),"check")){
         block2 = check;
         checkDate = record.getCreateTime();
      }
      Phrase p = new Phrase("       "+personName+"        ",underLineFt);
@@ -199,11 +204,20 @@
      table.addCell(getCell("批准/日期",ft));
      PdfPCell cell2 = new PdfPCell();
      cell2.addElement(new Phrase(" ",ft));
      cell2.setColspan(2);
      cell2.addElement(new Phrase(ncProgram.getCode(),ft));//数控程序编号
      table.addCell(cell2);
      table.addCell(getCell(" ",ft));
      table.addCell(getCell(" ",ft));
      String pDateStr = " ";
      if(programDate!=null){
         pDateStr = DateUtil.format(programDate,"yyyy-MM-dd");
      }
      String checkDateStr = " ";
      if(checkDate!=null){
         checkDateStr = DateUtil.format(programDate,"yyyy-MM-dd");
      }
      table.addCell(getCell(pDateStr,ft));//编制日期
      table.addCell(getCell(checkDateStr,ft));
      table.addCell(getCell(" ",ft));
      // 设置表格宽度占页面宽度的100%