Explorar el Código

pdf的生成与下载

M墨鱼—_mo hace 5 años
padre
commit
5a4a1f61ab

+ 71 - 9
picc-admin-server/src/main/java/com/jpsoft/picc/modules/business/controller/InsurancePolicyController.java

@@ -2,28 +2,29 @@ package com.jpsoft.picc.modules.business.controller;
 
 import com.github.pagehelper.Page;
 import com.jpsoft.picc.modules.base.entity.InsuranceAgent;
+import com.jpsoft.picc.modules.base.entity.InsuranceDefinitionLimit;
 import com.jpsoft.picc.modules.base.service.InsuranceAgentService;
+import com.jpsoft.picc.modules.base.service.InsuranceDefinitionLimitService;
 import com.jpsoft.picc.modules.business.entity.*;
 import com.jpsoft.picc.modules.business.service.*;
+import com.jpsoft.picc.modules.common.config.PdfConfig;
 import com.jpsoft.picc.modules.common.constant.PolicyStatus;
-import com.jpsoft.picc.modules.common.utils.PojoUtils;
-import com.jpsoft.picc.modules.common.dto.Sort;
 import com.jpsoft.picc.modules.common.dto.MessageResult;
+import com.jpsoft.picc.modules.common.dto.Sort;
+import com.jpsoft.picc.modules.common.utils.ItextPDFUtil;
+import com.jpsoft.picc.modules.common.utils.PojoUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
-import org.joda.time.DateTime;
 
-import javax.servlet.http.HttpServletRequest;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.*;
 
 @RestController
@@ -32,6 +33,12 @@ import java.util.*;
 public class InsurancePolicyController {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
+    /*@Autowired
+    private ItextPDFUtil itextPDFUtil;*/
+
+    @Autowired
+    private PdfConfig pdfConfig;
+
     @Autowired
     private InsurancePolicyService insurancePolicyService;
 
@@ -50,6 +57,11 @@ public class InsurancePolicyController {
     @Autowired
     private InsurancePolicyMemberService insurancePolicyMemberService;
 
+    @Autowired
+    private InsuranceDefinitionLimitService insuranceDefinitionLimitService;
+
+
+
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<InsurancePolicy> create(){
@@ -62,7 +74,7 @@ public class InsurancePolicyController {
 
         return msgResult;
     }
-    
+
     @ApiOperation(value="添加信息")
     @PostMapping("add")
     public MessageResult<InsurancePolicy> add(@RequestBody InsurancePolicy insurancePolicy,@RequestAttribute String subject){
@@ -73,7 +85,7 @@ public class InsurancePolicyController {
             insurancePolicy.setDelFlag(false);
             insurancePolicy.setCreateBy(subject);
             insurancePolicy.setCreateTime(new Date());
-            
+
             int affectCount = insurancePolicyService.insert(insurancePolicy);
 
             if (affectCount > 0) {
@@ -128,7 +140,7 @@ public class InsurancePolicyController {
         try {
             insurancePolicy.setUpdateBy(subject);
             insurancePolicy.setUpdateTime(new Date());
-            
+
             int affectCount = insurancePolicyService.update(insurancePolicy);
 
             if (affectCount > 0) {
@@ -538,6 +550,56 @@ public class InsurancePolicyController {
     }
 
 
+    @ApiOperation(value="pdf文档生成与下载")
+    @RequestMapping(value = "downloadApplicationData",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name="applicationId",value = "投保单ID",required = true,paramType = "query"),
+            @ApiImplicitParam(name="policyId",value = "每月投保单ID",required = true,paramType = "query")
+
+    })
+    public MessageResult<Integer> downloadApplicationData(String applicationId,String policyId){
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+        String logoUrl = pdfConfig.getLogoUrl();
+        String downloadFilePath = pdfConfig.getDownloadFilePath();
+
+        try{
+        InsuranceApplication insuranceApplication = insuranceApplicationService.get(applicationId);
+        List<InsuranceDefinitionLimit> insuranceDefinitionLimitList = insuranceDefinitionLimitService.findByDefinitionId(insuranceApplication.getDefinitionId());
+
+        List<Map<String,Object>> mapList = new ArrayList<Map<String,Object>>();
+
+        for(InsuranceDefinitionLimit  insuranceDefinitionLimit:insuranceDefinitionLimitList){
+            Map<String,Object> map1 = new HashMap<String,Object>();
+            map1.put("id",insuranceDefinitionLimit.getId());
+            map1.put("name",insuranceDefinitionLimit.getName());
+            map1.put("limit",insuranceDefinitionLimit.getLimit());
+            map1.put("unit",insuranceDefinitionLimit.getUnit());
+            mapList.add(map1);
+        }
+
+        List<InsurancePolicyMember> list = insurancePolicyMemberService.findByPolicyId(policyId);
+
+
+
+            ItextPDFUtil.createPdf(insuranceApplication,mapList,list,logoUrl,downloadFilePath);
+            msgResult.setMessage("pdf文档生成成功");
+            msgResult.setResult(true);
+
+        }catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setMessage(ex.getMessage());
+            msgResult.setResult(false);
+
+        }
+
+        return msgResult;
+    }
+
+
+
+
+
     private Integer approval(String applicationId,String id,String processStatus,String opinion,String status,String subject){
 
         int affectCount = 0;

+ 3 - 2
picc-admin-server/src/main/resources/application.yml

@@ -102,5 +102,6 @@ oss:
   urlPrefix: http://vod.wzgh.org
   objectPre: picc
 
-
-
+pdf:
+  logoUrl: C:/Users/Administrator/Desktop/picc/logo.png
+  downloadFilePath: C:/Users/Administrator/Desktop/投保单.pdf

+ 1 - 4
picc-admin-server/src/test/java/com/jpsoft/picc/test/PdfTest.java

@@ -6,9 +6,6 @@ package com.jpsoft.picc.test;
  */
 
 
-import com.jpsoft.picc.modules.common.utils.ItextPDFUtil;
-import java.util.ArrayList;
-
 /**
  * 创建的pdf适合于桌面设备查看
  */
@@ -16,7 +13,7 @@ import java.util.ArrayList;
 public class PdfTest {
     public static void main(String[] args) throws Exception {
 
-        ItextPDFUtil.createPdf(new ArrayList());
+     //   ItextPDFUtil.createPdf(new ArrayList());
 
     }
 

+ 17 - 0
picc-common/src/main/java/com/jpsoft/picc/modules/common/config/PdfConfig.java

@@ -0,0 +1,17 @@
+package com.jpsoft.picc.modules.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author 墨鱼_mo
+ * @date 2020-2-14 18:40
+ */
+@Component
+@ConfigurationProperties(prefix = "pdf")
+@Data
+public class PdfConfig {
+    private String logoUrl;
+    private String downloadFilePath;
+}

+ 101 - 42
picc-common/src/main/java/com/jpsoft/picc/modules/common/utils/ItextPDFUtil.java

@@ -1,23 +1,29 @@
 package com.jpsoft.picc.modules.common.utils;
 
+import cn.hutool.core.convert.Convert;
 import com.itextpdf.text.*;
 import com.itextpdf.text.pdf.*;
-import com.itextpdf.text.pdf.codec.Base64;
 import com.itextpdf.text.pdf.draw.LineSeparator;
+import com.jpsoft.picc.modules.business.entity.InsuranceApplication;
+import com.jpsoft.picc.modules.business.entity.InsurancePolicyMember;
 
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.ArrayList;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author 墨鱼_mo
  * @date 2020-2-5 18:39
  */
+
 public class ItextPDFUtil {
 
+
     /**
      * 斜角排列、全屏多个重复的花式文字水印
      *
@@ -97,10 +103,13 @@ public class ItextPDFUtil {
     }
 
 
-    public static void createPdf(List list)throws Exception{
+    public static void createPdf(InsuranceApplication insuranceApplication, List<Map<String,Object>> mapList,List<InsurancePolicyMember> list,String logoUrl,String downloadFilePath)throws Exception{
         //测试pdf保存路径
-        String filePath = "C:/Users/Administrator/Desktop/test4.pdf";
-        File file = new File(filePath);
+     //   String filePath = "C:/Users/Administrator/Desktop/投保单.pdf";
+        File file = new File(downloadFilePath);
+
+
+
 
 
         //创建文件
@@ -116,12 +125,23 @@ public class ItextPDFUtil {
         writer.setPageEvent(new MyHeaderFooter());
         //打开文件
         document.open();
-        // 4.向文档中添加内容
-        new ItextPDFUtil().generatePDF(document);
-        //关闭文档
+        try{
+            // 4.向文档中添加内容
+            new ItextPDFUtil().generatePDF(document,insuranceApplication,mapList,list,logoUrl);
+        }catch (Exception ex){
+            throw new Exception(ex.getMessage());
+        }finally {
+            //关闭文档
+            document.close();
+            //关闭书写器
+            writer.close();
+        }
+
+
+       /* //关闭文档
         document.close();
         //关闭书写器
-        writer.close();
+        writer.close();*/
 
     }
 
@@ -150,8 +170,9 @@ public class ItextPDFUtil {
 
     // 生成PDF文件
 
-    public void generatePDF(Document document) throws Exception {
-        Image image1 = Image.getInstance("C:/Users/Administrator/Desktop/picc/logo.png");
+    public void generatePDF(Document document,InsuranceApplication insuranceApplication, List<Map<String,Object>> mapList,List<InsurancePolicyMember> list,String logoUrl) throws Exception {
+     //   Image image1 = Image.getInstance("C:/Users/Administrator/Desktop/picc/logo.png");
+        Image image1 = Image.getInstance(logoUrl);
         Paragraph p1 = new Paragraph("00000000000001", titlefont);
         //设置文字居中 0靠左   1,居中     2,靠右
         p1.setAlignment(2);
@@ -183,41 +204,77 @@ public class ItextPDFUtil {
         PdfPTable table = PdfTable.createTable(new float[]{20, 65, 60, 70, 60, 65,120});
         table.addCell(PdfTable.createCell("一、投保人、被保险人信息", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
         table.addCell(PdfTable.createCell("投保人名称", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(insuranceApplication.getInsuredName(), 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(insuranceApplication.getInsuredTel(), textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
 
         table.addCell(PdfTable.createCell("被保险人信息", textfont, Element.ALIGN_CENTER,1,5,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(insuranceApplication.getInsuredName(), 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(insuranceApplication.getBusinessNature(), 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("组织机构代码证\n" +"□税务登记证\n" +"□工商登记证\n"+"□营业执照", textfont, Element.ALIGN_LEFT,3,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("组织机构代码证\n" +"□税务登记证\n" +"□工商登记证\n"+"□营业执照", textfont, Element.ALIGN_LEFT,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(insuranceApplication.getUsccCode(), 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(insuranceApplication.getBusinessScope(), 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(insuranceApplication.getIndustryType(), 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,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(String.valueOf(insuranceApplication.getEmployeesNumber()), 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,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(String.valueOf(list.size()), 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,1,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(insuranceApplication.getInsuredTel(), 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(insuranceApplication.getCompanyAddress(), 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(insuranceApplication.getPostal(), 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("", textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell(insuranceApplication.getLossInRecentYears(), textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
+
+
+     //   List<Map<String,Object>> mapList = (List<Map<String, Object>>) map.get("insuranceDefinitionLimitList");
+        //累计责任限额
+        String cumulativeValue = "";
+        //每次事故
+        String accidentValue = "";
+        //每人伤亡
+        String casualtiesValue = "";
+        //每人医疗
+        String medicalCareValue = "";
+        //法律费用
+        String lawValue = "";
+
+
+        for (Map<String,Object> mapData : mapList){
+            if ("累计责任限额".equals(mapData.get("name"))){
+                cumulativeValue = (String)mapData.get("limit")+(String)mapData.get("unit");
+            }
+            if ("每次事故责任限额".equals(mapData.get("name"))){
+                accidentValue = (String)mapData.get("limit")+(String)mapData.get("unit");
+            }
+            if ("伤亡责任限额".equals(mapData.get("name"))){
+                casualtiesValue = (String)mapData.get("limit")+(String)mapData.get("unit");
+            }
+            if ("医疗费用限额".equals(mapData.get("name"))){
+                medicalCareValue = (String)mapData.get("limit")+(String)mapData.get("unit");
+            }
+            if ("累计法律诉讼费用限额".equals(mapData.get("name"))){
+                lawValue = (String)mapData.get("limit")+(String)mapData.get("unit");
+            }
+
+
+        }
+
+
 
         table.addCell(PdfTable.createCell("二、承保信息", textfont, Element.ALIGN_LEFT, 7,1,BaseColor.PINK, true));
 
@@ -228,21 +285,21 @@ public class ItextPDFUtil {
         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("", textfont, Element.ALIGN_CENTER,1,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell("", textfont, Element.ALIGN_CENTER,1,6,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("", textfont, Element.ALIGN_CENTER,1,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("", textfont, Element.ALIGN_CENTER,1,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("", textfont, Element.ALIGN_CENTER,1,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("", textfont, Element.ALIGN_CENTER,1,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));
@@ -261,10 +318,12 @@ public class ItextPDFUtil {
         table.addCell(PdfTable.createCell("", 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("(大写):\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000(小写):¥ ", textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("(大写):"+ Convert.digitToChinese(insuranceApplication.getInsuranceFee())+"\u3000\u3000\u3000\u3000(小写):¥ "+new DecimalFormat("#,##0.00").format(insuranceApplication.getInsuranceFee()).toString(), textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
+
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
 
         table.addCell(PdfTable.createCell("保险期间", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
-        table.addCell(PdfTable.createCell("自\u3000\u3000\u3000年\u3000月\u3000日零时起至\u3000\u3000\u3000年\u3000月\u3000日二十四时止。", textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
+        table.addCell(PdfTable.createCell("自"+simpleDateFormat.format(insuranceApplication.getStartTime())+"零时起至"+simpleDateFormat.format(insuranceApplication.getEndTime())+"二十四时止。", textfont, Element.ALIGN_CENTER,5,1,BaseColor.WHITE,false));
 
         table.addCell(PdfTable.createCell("保险合同争议处理", textfont, Element.ALIGN_CENTER,2,1,BaseColor.WHITE,false));
         table.addCell(PdfTable.createCell("□提交______________仲裁委员会仲裁  □诉讼", textfont, Element.ALIGN_LEFT,5,1,BaseColor.WHITE,false));
@@ -347,16 +406,16 @@ public class ItextPDFUtil {
         table4.addCell(PdfTable.createCell("岗位/工种", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
         table4.addCell(PdfTable.createCell("健康情况", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
 
-        List list = new ArrayList();
+     //   List<InsurancePolicyMember> list = new ArrayList();
         for (int i =0;i<list.size();i++){
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
-            table4.addCell(PdfTable.createCell(list.get(i).toString(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(String.valueOf(i+1), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getName(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getCardType(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getCardNo(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getSex()==true?"男":"女", textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(String.valueOf(list.get(i).getCompanyMember().getAge()), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getJobName(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
+            table4.addCell(PdfTable.createCell(list.get(i).getCompanyMember().getHealthStatus(), textfont, Element.ALIGN_CENTER, 1,1,BaseColor.WHITE, true));
         }