浏览代码

pdf文档生成bug修复

M墨鱼—_mo 5 年之前
父节点
当前提交
e9447f9ad3
共有 1 个文件被更改,包括 29 次插入17 次删除
  1. 29 17
      picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/ItextPDFUtil.java

+ 29 - 17
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/ItextPDFUtil.java

@@ -274,31 +274,43 @@ public class ItextPDFUtil {
 
         table.addCell(PdfTable.createCell("二、承保信息", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
 
-        table.addCell(PdfTable.createCell("主险", textfont, Element.ALIGN_CENTER,2,7,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(insuranceApplication.getDefinitionName(), textfont, Element.ALIGN_CENTER,2,mapList.size()+1,BaseColor.WHITE,false));
 
         table.addCell(PdfTable.createCell("限额名称", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
         table.addCell(PdfTable.createCell("责任限额/免赔额", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
         table.addCell(PdfTable.createCell("保险费(元)", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
 
-        table.addCell(PdfTable.createCell("累计责任限额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(cumulativeValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(String.valueOf(insuranceApplication.getInsuranceFee()), textfont, Element.ALIGN_CENTER,1,6,BaseColor.WHITE,false));
 
-        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,1,4,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(accidentValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
-
-        table.addCell(PdfTable.createCell("每人伤亡责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(casualtiesValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
-
-        table.addCell(PdfTable.createCell("每人医疗费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(medicalCareValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+        int n =0;
+        for (Map<String,Object> mapData : mapList){
+            table.addCell(PdfTable.createCell(mapData.get("name").toString(), textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+            table.addCell(PdfTable.createCell(mapData.get("limit").toString()+mapData.get("unit"), textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+            n++;
+            if (n==1){
+                table.addCell(PdfTable.createCell(String.valueOf(insuranceApplication.getInsuranceFee()), textfont, Element.ALIGN_CENTER,1,mapList.size(),BaseColor.WHITE,false));
+            }
+        }
 
-        table.addCell(PdfTable.createCell("法律费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell(lawValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
 
-        table.addCell(PdfTable.createCell("每次事故每人医疗费用免赔额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell("累计责任限额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(cumulativeValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(String.valueOf(insuranceApplication.getInsuranceFee()), textfont, Element.ALIGN_CENTER,1,6,BaseColor.WHITE,false));
+//
+//        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,1,4,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell("每次事故责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(accidentValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//
+//        table.addCell(PdfTable.createCell("每人伤亡责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(casualtiesValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//
+//        table.addCell(PdfTable.createCell("每人医疗费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(medicalCareValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//
+//        table.addCell(PdfTable.createCell("法律费用责任限额", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell(lawValue, textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
+//
+//        table.addCell(PdfTable.createCell("每次事故每人医疗费用免赔额", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+//        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
 
         table.addCell(PdfTable.createCell("附加险", textfont, Element.ALIGN_CENTER,2,4,BaseColor.WHITE,false));
         table.addCell(PdfTable.createCell("□附加职业病责任保险", textfont, Element.ALIGN_LEFT,4,1,BaseColor.WHITE,false));