| | |
| | | private Integer pdfPage = 0; |
| | | |
| | | private static final int DEFAULT_FONT_SIZE = 10; |
| | | private static final int DEFAULT_LITTLE_TITLE_FONT_SIZE = 11; |
| | | private static final int DEFAULT_TITLE_FONT_SIZE = 12; |
| | | private static final int DEFAULT_ZONGJIAN_FONT_SIZE = 15; |
| | | |
| | | private List<Map<String, Object>> makePDFInfo(HashMap<String, Object> map, AjaxResult ajaxResult, String key) { |
| | | List<Map<String, Object>> data = null; |
| | |
| | | |
| | | writer2.setPageEvent(new FooterHeaderPageEvent(dictHosp.getHospName(), customer.getCusName(), tjOrder.getTjNumber(), sex, String.valueOf(DateUtil.ageOfNow(customer.getCusBrithday())),0)); |
| | | |
| | | document2.setMargins(50, 70, 40, 40); |
| | | document2.setMargins(50, 70, 40, 50); |
| | | document2.open(); |
| | | |
| | | List<CsProVo> list = tjOrderRemarkService.cSWebGetProByTjNumAndOrderId(tjOrder.getTjNumber(), false); |
| | | |
| | | Font defaultFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font defaultTitleFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font defaultTitleFont = PdfUtils.setFont(DEFAULT_LITTLE_TITLE_FONT_SIZE); |
| | | defaultTitleFont.setStyle(Font.BOLD); |
| | | Paragraph paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查科室与检查项目"); |
| | | document2.add(paragraph); |
| | |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | // List<TjOrderRemark> remarks = tjOrderRemarkMapper.getzongjianyishengchakanyichangxiangmu3( tjOrder.getTjNumber()); |
| | | List<TjOrderDetail> orderDetails = tjOrderDetailMapper.getzongjianyishengchakanyichangxiangmu4( tjOrder.getTjNumber()); |
| | | // List<Map<String, Object>> jiancha = new ArrayList<>(); |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查综述:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | |
| | | int xmXh = 1; |
| | | for (Map.Entry<Long, List<TjOrderDetail>> entry : orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)).entrySet()) { |
| | | List<TjOrderDetail> details = entry.getValue(); |
| | | String xmmc = details.get(0).getProName(); |
| | | boolean isXmWrite = false; |
| | | for (TjOrderDetail detail : details) { |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmXh+". "+xmmc, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | int index = 1; |
| | | result = result.replaceAll("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查",""); |
| | | String[] split = result.split("\n"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n","").trim())) continue; |
| | | builder.append(" (").append(index).append(")").append(s).append("\n"); |
| | | index++; |
| | | } |
| | | result = builder.toString(); |
| | | } |
| | | paragraph = new Paragraph(result, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | xmXh++; |
| | | } |
| | | |
| | | for (Map.Entry<String, Object> item : map.entrySet()) { |
| | | String xmmc = item.getKey(); |
| | | HashMap<String, Object> entryValue = (HashMap<String, Object>) item.getValue(); |
| | |
| | | for (List<String> i : lists) { |
| | | if (i.contains("↓") || i.contains("↑")) { |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmmc,defaultFont); |
| | | paragraph = new Paragraph(xmXh+". "+xmmc,defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String content = " ("+index + ") " + i.get(0) + ":" + i.get(1) + " " + i.get(3) + " " + i.get(4) + " " + i.get(2); |
| | | paragraph = new Paragraph(content,defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | index++; |
| | | } |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | xmXh++; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(10f); |
| | | paragraph.setSpacingAfter(10f); |
| | | document2.add(paragraph); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | xmXh = 0; |
| | | for (Map.Entry<String, Object> item : map.entrySet()) { |
| | | String xmmc = item.getKey(); |
| | | HashMap<String, Object> entryValue = (HashMap<String, Object>) item.getValue(); |
| | | ArrayList<List<String>> lists = (ArrayList<List<String>>) entryValue.get("data"); |
| | | boolean isXmWrite = false; |
| | | int index = 1; |
| | | for (List<String> i : lists) { |
| | | if (i.contains("↓") || i.contains("↑")) { |
| | | if (!isXmWrite) { |
| | | xmXh++; |
| | | paragraph = new Paragraph("【"+xmXh+"."+xmmc+"】",defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString()+":"+objectMap.get("nr").toString(),defaultFont); |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString().trim()+objectMap.get("nr").toString().trim(),defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setSpacingBefore(2f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | } |
| | | // } |
| | | index++; |
| | |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | // List<TjOrderRemark> remarks = tjOrderRemarkMapper.getzongjianyishengchakanyichangxiangmu3( tjOrder.getTjNumber()); |
| | | List<TjOrderDetail> orderDetails = tjOrderDetailMapper.getzongjianyishengchakanyichangxiangmu4( tjOrder.getTjNumber()); |
| | | // List<Map<String, Object>> jiancha = new ArrayList<>(); |
| | | |
| | | for (Map.Entry<Long, List<TjOrderDetail>> entry : orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)).entrySet()) { |
| | | List<TjOrderDetail> details = entry.getValue(); |
| | |
| | | int index = 1; |
| | | for (TjOrderDetail detail : details) { |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmmc, defaultFont); |
| | | xmXh++; |
| | | paragraph = new Paragraph("【"+xmXh+"."+xmmc+"】", defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | result = result.replaceAll(" ","").replaceAll("\t",""); |
| | | result = result.replaceAll("\n本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | result = "\n " + result.replaceAll("\n", "\n "); |
| | | // result = result.replaceAll(" ","").replaceAll("\t",""); |
| | | // result = result.replaceAll("\n本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | // result = "\n " + result.replaceAll("\n", "\n "); |
| | | int index1 = 1; |
| | | String[] split = result.split("\n"); |
| | | boolean contains = result.contains("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n","").trim())) continue; |
| | | builder.append(" (").append(index1).append(")").append(s).append("\n"); |
| | | index1++; |
| | | } |
| | | String content = " (" + index + ") " + detail.getProName() + ":" + result; |
| | | content = content.replaceAll("[\\n\\r]+$", ""); |
| | | content = content.replaceAll("\\s+$", ""); |
| | | paragraph = new Paragraph(content, defaultFont); |
| | | if (!contains) builder.append(" (").append(index1).append(")").append("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | else builder.substring(0,builder.length() - 1); |
| | | result = builder.toString(); |
| | | } |
| | | // String content = " (" + index + ") " + detail.getProName() + ":" + result; |
| | | // content = content.replaceAll("[\\n\\r]+$", ""); |
| | | // content = content.replaceAll("\\s+$", ""); |
| | | // paragraph = new Paragraph(content, defaultFont); |
| | | paragraph = new Paragraph(result, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | String str = " "; |
| | | // List<Map<String, Object>> advices = detail.getAdvices(); |
| | | // if (advices != null && !advices.isEmpty()) { |
| | | // for (Map<String, Object> m : advices) { |
| | | // paragraph = new Paragraph(str + m.get("bt").toString() + ":" + m.get("nr").toString(), defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | // } |
| | | // } |
| | | List<Map<String, Object>> maps = tjRulesService.getyichangxiangmujianyiguize(entry.getKey().toString(),"","",tjOrder.getTjNumber()); |
| | | for (Map<String, Object> objectMap : maps) { |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString()+":"+objectMap.get("nr").toString(),defaultFont); |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString()+objectMap.get("nr").toString(),defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | index++; |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:"); |
| | | document2.add(paragraph); |
| | | if (tjOrder.getCheckAdvice() == null) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | Paragraph paragraphNone = new Paragraph("", defaultFont); |
| | | paragraphNone.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | paragraphNone.setLeading(5f); |
| | | paragraphNone.setSpacingBefore(10f); |
| | | paragraphNone.setSpacingAfter(10f); |
| | | document2.add(paragraphNone); |
| | | paragraphNone = new Paragraph("", defaultFont); |
| | | paragraphNone.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | paragraphNone.setLeading(5f); |
| | | paragraphNone.setSpacingBefore(10f); |
| | | paragraphNone.setSpacingAfter(10f); |
| | | document2.add(paragraphNone); |
| | | |
| | | |
| | | PdfPTable tableQz = new PdfPTable(new float[]{100f,100f,50f}); |
| | | tableQz.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | tableQz.setLockedWidth(true); |
| | | tableQz.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | tableQz.getDefaultCell().setBorder(0); |
| | | tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | |
| | | Font zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | Font zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | |
| | | for (int i = 0; i < 3; i++) { |
| | | PdfPCell cell = new PdfPCell(); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPhrase(new Phrase("", defaultFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | tableQz.addCell(cell); |
| | | } |
| | | |
| | | |
| | | PdfPCell cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPhrase(new Phrase("", defaultFont)); |
| | | cell.setRowspan(3); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("体检单位盖章:", zongJianTitleFont)); |
| | | |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("总检医师:", zongJianTitleFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | // cell.setPhrase(new Phrase("何小婷", zongJianFont)); |
| | | cell.setPhrase(new Phrase(tjOrder.getCheckDoctor(), zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("总检日期:", zongJianTitleFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | document2.add(tableQz); |
| | | |
| | | document2.close(); |
| | | |
| | | |
| | | |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | Document document = new Document(PageSize.A4); |
| | | PdfWriter pdfWriter = null; |
| | | // int pageSize = 0; |
| | | // try { |
| | | pdfWriter = PdfWriter.getInstance(document, byteArrayOutputStream); |
| | | pdfWriter.setPageEvent(new FooterHeaderPageEvent(dictHosp.getHospName(), customer.getCusName(), tjOrder.getTjNumber(), sex, String.valueOf(DateUtil.ageOfNow(customer.getCusBrithday())),null)); |
| | | // pageSize = pdfWriter.getPageNumber(); |
| | | // } catch (DocumentException e) { |
| | | // log.error(String.valueOf(e)); |
| | | // return AjaxResult.error(); |
| | | // } |
| | | // 后面页码数量 |
| | | int dataPageNumer = pdfWriter.getPageNumber(); |
| | | document.setMargins(70, 70, 40, 40); |
| | | document.open(); |
| | | |
| | | Map<TjOrderRemark, List<TjPdfVO>> printReport = new HashMap<>(); |
| | | notHuaYanData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document, printReport, dictHosp, color,false); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | PdfReader reader = null; |
| | | makeHisJianYanTable(document, map, dictHosp, color); |
| | | |
| | | printReport = new HashMap<>(); |
| | | pacsJianChaData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document, printReport, dictHosp, color,true); |
| | | } catch (DocumentException e) { |
| | | log.error("pacs项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | document.close(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 首页表单 |
| | | String tjNumber = tjOrder.getTjNumber(); |
| | | String template = tjReportTemplate.getTemplate(); |
| | | LambdaQueryWrapper<DictComp> wq111 = new LambdaQueryWrapper<>(); |
| | | wq111.eq(DictComp::getDrugManufacturerId, tjOrder.getFirmId()); |
| | | DictComp dictComp = dictCompService.getOne(wq111); |
| | | LambdaQueryWrapper<TjOrderDetail> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | wq2.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq2); |
| | | for (TjOrderDetail tjOrderDetail : detailList) { |
| | | TjProject tjProject = projectService.selectTjProjectByProId(tjOrderDetail.getProId()); |
| | | tjOrderDetail.setProject(tjProject); |
| | | } |
| | | ByteArrayOutputStream byteArrayOutputStream4 = new ByteArrayOutputStream(); |
| | | PdfReader reader4 = null; |
| | | PdfStamper pdfStamper = null; |
| | | |
| | | reader4 = new PdfReader(new ByteArrayInputStream(Base64.getDecoder().decode(template))); |
| | | pdfStamper = new PdfStamper(reader4, byteArrayOutputStream4); |
| | | AcroFields acroFields = pdfStamper.getAcroFields(); |
| | | BaseFont bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); |
| | | acroFields.addSubstitutionFont(bf); |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | Long cusSex = customer.getCusSex(); |
| | | String tjtype; |
| | | if (cusSex == 0) { |
| | | sex = "男"; |
| | | } else { |
| | | sex = "女"; |
| | | } |
| | | HashMap<String, String> hashMap = new HashMap<>(); |
| | | hashMap.put("name", customer.getCusName()); |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | tjtype = "团队"; |
| | | hashMap.put("tjtype", tjtype); |
| | | } else { |
| | | tjtype = "个人"; |
| | | hashMap.put("tjtype", tjtype); |
| | | } |
| | | if (dictComp == null) { |
| | | hashMap.put("work", "无"); |
| | | } else { |
| | | hashMap.put("work", dictComp.getCnName()); |
| | | } |
| | | hashMap.put("sex", sex); |
| | | hashMap.put("tjnumber", tjNumber); |
| | | hashMap.put("tjdate", DateUtils.parseDateToStr("yyyy/MM/dd", tjOrder.getCreateTime())); |
| | | hashMap.put("phone", customer.getCusPhone()); |
| | | for (String key : hashMap.keySet()) { |
| | | acroFields.setFieldProperty(key, "textsize", DEFAULT_FONT_SIZE, null); |
| | | acroFields.setField(key, hashMap.get(key)); |
| | | } |
| | | pdfStamper.setFormFlattening(true); |
| | | pdfStamper.close(); |
| | | reader4.close(); |
| | | // 将修改后的PDF内容写入 |
| | | byte[] bytes = byteArrayOutputStream4.toByteArray(); |
| | | |
| | | |
| | | |
| | | ByteArrayOutputStream finalOutput = new ByteArrayOutputStream(); |
| | | Document mergedDocument = new Document(PageSize.A4); |
| | | PdfCopy copy = new PdfCopy(mergedDocument, finalOutput); |
| | | mergedDocument.open(); |
| | | |
| | | reader4 = new PdfReader(new ByteArrayInputStream(bytes)); |
| | | int numberOfPages = reader4.getNumberOfPages(); |
| | | for (int i = 1; i <= numberOfPages; i++) { |
| | | copy.addPage(copy.getImportedPage(reader4, i)); |
| | | } |
| | | |
| | | PdfReader reader2 = new PdfReader(byteArrayOutputStream2.toByteArray()); |
| | | int numberOfPages2 = reader2.getNumberOfPages(); |
| | | for (int i = 1; i <= numberOfPages2; i++) { |
| | | PdfImportedPage page = copy.getImportedPage(reader2, i); |
| | | copy.addPage(page); |
| | | } |
| | | reader2.close(); |
| | | |
| | | PdfReader reader1 = new PdfReader(byteArrayOutputStream.toByteArray()); |
| | | int numberOfPages1 = reader1.getNumberOfPages(); |
| | | for (int i = 1; i <= numberOfPages1; i++) { |
| | | PdfImportedPage page = copy.getImportedPage(reader1, i); |
| | | copy.addPage(page); |
| | | } |
| | | reader1.close(); |
| | | mergedDocument.close(); |
| | | |
| | | String outputFileName1 = customer.getCusId() + tjOrder.getTjNumber() + customer.getCusName() + "_报告.pdf"; |
| | | savePDFFile(outputFileName1, tjOrder, customer, finalOutput); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | public AjaxResult hisPDFNew2(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate) throws Exception { |
| | | pdfPage = 0; |
| | | DictHosp dictHosp = dictHospService.list().get(0); |
| | | String color = sysConfigService.selectConfigByKey("report_title_color"); |
| | | List<SysDictData> sysUserSex = sysDictDataService.list(new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getDictType, "sys_user_sex")); |
| | | // 检验数据 |
| | | HashMap<String, Object> map = makeHisJianYan(tjOrder, customer); |
| | | String sex = ""; |
| | | if (customer.getCusSex() != null) { |
| | | for (SysDictData userSex : sysUserSex) { |
| | | if (userSex.getDictValue().equals(String.valueOf(customer.getCusSex()))) { |
| | | sex = userSex.getDictLabel(); |
| | | } |
| | | } |
| | | } |
| | | if (StrUtil.isBlank(sex)) sex = "未知"; |
| | | |
| | | |
| | | |
| | | // 生成 document2 并将其内容保存到 byteArrayOutputStream2 中 |
| | | ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(); |
| | | Document document2 = new Document(PageSize.A4); |
| | | PdfWriter writer2 = PdfWriter.getInstance(document2, byteArrayOutputStream2); |
| | | |
| | | writer2.setPageEvent(new FooterHeaderPageEvent(dictHosp.getHospName(), customer.getCusName(), tjOrder.getTjNumber(), sex, String.valueOf(DateUtil.ageOfNow(customer.getCusBrithday())),0)); |
| | | |
| | | document2.setMargins(50, 70, 40, 50); |
| | | document2.open(); |
| | | |
| | | List<CsProVo> list = tjOrderRemarkService.cSWebGetProByTjNumAndOrderId(tjOrder.getTjNumber(), false); |
| | | |
| | | Font defaultFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font defaultTitleFont = PdfUtils.setFont(DEFAULT_LITTLE_TITLE_FONT_SIZE); |
| | | defaultTitleFont.setStyle(Font.BOLD); |
| | | Paragraph paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查科室与检查项目"); |
| | | document2.add(paragraph); |
| | | |
| | | PdfPTable table = new PdfPTable(new float[]{80, 100, 80, 80}); |
| | | table.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | table.setLockedWidth(true); |
| | | table.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | String[] titles = {"科室", "体检项目", "检查状态", "检查时间"}; |
| | | |
| | | for (String head : titles) { |
| | | table.addCell(PdfUtils.createCell(head, defaultFont, Rectangle.BOX, Element.ALIGN_CENTER,5f,5f)); |
| | | } |
| | | Map<String, List<CsProVo>> listMap = list.stream().collect(Collectors.groupingBy(i -> i.getDeptId()+"_"+i.getDeptName())); |
| | | // List<CsProVo> sortedList = list.stream() |
| | | // .sorted(Comparator.comparingLong(CsProVo::getProId)) |
| | | // .collect(Collectors.toList()); |
| | | for (Map.Entry<String, List<CsProVo>> entry : listMap.entrySet()) { |
| | | String dept = entry.getKey().split("_")[1]; |
| | | List<CsProVo> proVos = entry.getValue(); |
| | | proVos = proVos.stream() |
| | | .sorted(Comparator.comparingLong(CsProVo::getProId)) |
| | | .collect(Collectors.toList()); |
| | | PdfPCell deptCell = new PdfPCell(); |
| | | deptCell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | deptCell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | deptCell.setPhrase(new Phrase(dept, defaultFont)); |
| | | deptCell.setPaddingTop(5f); |
| | | deptCell.setPaddingBottom(5f); |
| | | if (proVos.size()>1) |
| | | deptCell.setRowspan(proVos.size()); |
| | | table.addCell(deptCell); |
| | | proVos.forEach(proVo -> { |
| | | table.addCell(PdfUtils.createCell(proVo.getProName(), defaultFont,Rectangle.BOX,Element.ALIGN_CENTER,5f,5f)); |
| | | String tjType = ""; |
| | | switch (proVo.getType()) { |
| | | case 0: |
| | | tjType = "未检"; |
| | | break; |
| | | case 1: |
| | | tjType = "已检"; |
| | | break; |
| | | case 2: |
| | | tjType = "弃检"; |
| | | break; |
| | | case 3: |
| | | tjType = "延期"; |
| | | break; |
| | | } |
| | | table.addCell(PdfUtils.createCell(tjType, defaultFont,Rectangle.BOX,Element.ALIGN_CENTER,5f,5f)); |
| | | String tjTime = ""; |
| | | if (proVo.getQdcreateTime() != null) { |
| | | tjTime = new SimpleDateFormat("yyyy-MM-dd").format(proVo.getQdcreateTime()); |
| | | } |
| | | table.addCell(PdfUtils.createCell(tjTime, defaultFont,Rectangle.BOX,Element.ALIGN_CENTER,5f,5f)); |
| | | }); |
| | | } |
| | | document2.add(table); |
| | | |
| | | for (int i = 0; i < 2; i++) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | // List<TjOrderRemark> remarks = tjOrderRemarkMapper.getzongjianyishengchakanyichangxiangmu3( tjOrder.getTjNumber()); |
| | | List<TjOrderDetail> orderDetails = tjOrderDetailMapper.getzongjianyishengchakanyichangxiangmu4( tjOrder.getTjNumber()); |
| | | // List<Map<String, Object>> jiancha = new ArrayList<>(); |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "检查综述:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | |
| | | int xmXh = 1; |
| | | |
| | | Map<Long, List<TjOrderDetail>> collect = orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)); |
| | | for (Map.Entry<String, List<CsProVo>> deptEntry : listMap.entrySet()) { |
| | | List<CsProVo> proVos = deptEntry.getValue(); |
| | | if (proVos.size()>1){ |
| | | proVos = proVos.stream() |
| | | .sorted(Comparator.comparingLong(CsProVo::getProId)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | // 已经遍历过的 |
| | | ArrayList<String> jianYanYiDa = new ArrayList<>(); |
| | | for (CsProVo proVo : proVos) { |
| | | |
| | | // 检查 |
| | | for (Map.Entry<Long, List<TjOrderDetail>> entry : collect.entrySet()) { |
| | | if (!entry.getKey().equals(proVo.getProId())) continue; |
| | | List<TjOrderDetail> details = entry.getValue(); |
| | | String xmmc = details.get(0).getProName(); |
| | | boolean isXmWrite = false; |
| | | for (TjOrderDetail detail : details) { |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmXh + ". " + xmmc, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | int index = 1; |
| | | result = result.replaceAll("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | String[] split = result.split("\n"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n", "").trim())) continue; |
| | | builder.append(" (").append(index).append(")").append(s).append("\n"); |
| | | index++; |
| | | } |
| | | result = builder.toString(); |
| | | } |
| | | paragraph = new Paragraph(result, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | xmXh++; |
| | | } |
| | | |
| | | // 检验 |
| | | for (Map.Entry<String, Object> item : map.entrySet()) { |
| | | String xmmc = item.getKey(); |
| | | HashMap<String, Object> entryValue = (HashMap<String, Object>) item.getValue(); |
| | | ArrayList<List<String>> lists = (ArrayList<List<String>>) entryValue.get("data"); |
| | | boolean isXmWrite = false; |
| | | int index = 1; |
| | | for (List<String> i : lists) { |
| | | if (!i.get(6).contains(String.valueOf(proVo.getProId()))) continue; |
| | | if (i.contains("↓") || i.contains("↑")) { |
| | | if (jianYanYiDa.contains(i.get(5))) continue; |
| | | jianYanYiDa.add(i.get(5)); |
| | | if (!isXmWrite) { |
| | | paragraph = new Paragraph(xmXh + ". " + xmmc, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String content = " (" + index + ") " + i.get(0) + ":" + i.get(1) + " " + i.get(3) + " " + i.get(4) + " " + i.get(2); |
| | | paragraph = new Paragraph(content, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | index++; |
| | | } |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | xmXh++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(10f); |
| | | paragraph.setSpacingAfter(10f); |
| | | document2.add(paragraph); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "医生建议:"); |
| | | paragraph.setSpacingBefore(3f); |
| | | paragraph.setSpacingAfter(2f); |
| | | document2.add(paragraph); |
| | | xmXh = 0; |
| | | for (Map.Entry<String, Object> item : map.entrySet()) { |
| | | String xmmc = item.getKey(); |
| | | HashMap<String, Object> entryValue = (HashMap<String, Object>) item.getValue(); |
| | | ArrayList<List<String>> lists = (ArrayList<List<String>>) entryValue.get("data"); |
| | | boolean isXmWrite = false; |
| | | int index = 1; |
| | | for (List<String> i : lists) { |
| | | if (i.contains("↓") || i.contains("↑")) { |
| | | if (!isXmWrite) { |
| | | xmXh++; |
| | | paragraph = new Paragraph("【"+xmXh+"."+xmmc+"】",defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String content = " ("+index + ")" + i.get(0) + ":" + i.get(1) + " " + i.get(3) + " " + i.get(4) + " " + i.get(2); |
| | | paragraph = new Paragraph(content,defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | // 第六位是lis项目id |
| | | // LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjProject::getLisXmbm,i.get(5)); |
| | | // TjProject project = projectService.getOne(wrapper); |
| | | // if (project != null) { |
| | | // LambdaQueryWrapper<TjRules> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // queryWrapper.eq(TjRules::getProId,project.getProId()); |
| | | // List<TjRules> rules = tjRulesService.list(queryWrapper); |
| | | // if (!rules.isEmpty()){ |
| | | // |
| | | // } |
| | | String str = " "; |
| | | List<Map<String, Object>> maps = tjRulesService.getyichangxiangmujianyiguize(i.get(5),"",i.get(2),tjOrder.getTjNumber()); |
| | | if (!maps.isEmpty()){ |
| | | for (Map<String, Object> objectMap : maps) { |
| | | // paragraph = new Paragraph(str+"建议标题",defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | // |
| | | // paragraph = new Paragraph(str+objectMap.get("bt").toString(),defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | // |
| | | // paragraph = new Paragraph(str+"建议内容",defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | // |
| | | // paragraph = new Paragraph(str+objectMap.get("nr").toString(),defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString().trim()+objectMap.get("nr").toString().trim(),defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setSpacingBefore(2f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | } |
| | | // } |
| | | index++; |
| | | } |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | for (Map.Entry<Long, List<TjOrderDetail>> entry : orderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProId)).entrySet()) { |
| | | List<TjOrderDetail> details = entry.getValue(); |
| | | String xmmc = details.get(0).getProName(); |
| | | boolean isXmWrite = false; |
| | | int index = 1; |
| | | for (TjOrderDetail detail : details) { |
| | | if (!isXmWrite) { |
| | | xmXh++; |
| | | paragraph = new Paragraph("【"+xmXh+"."+xmmc+"】", defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | isXmWrite = true; |
| | | } |
| | | String result = detail.getProResult(); |
| | | if (StrUtil.isNotBlank(result)) { |
| | | // result = result.replaceAll(" ","").replaceAll("\t",""); |
| | | // result = result.replaceAll("\n本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查", ""); |
| | | // result = "\n " + result.replaceAll("\n", "\n "); |
| | | int index1 = 1; |
| | | String[] split = result.split("\n"); |
| | | boolean contains = result.contains("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String s : split) { |
| | | if (StrUtil.isBlank(s.replaceAll("\n","").trim())) continue; |
| | | builder.append(" (").append(index1).append(")").append(s).append("\n"); |
| | | index1++; |
| | | } |
| | | if (!contains) builder.append(" (").append(index1).append(")").append("本报告仅对本次检查负责,临床医生依据病情如有疑问,请及时复查或进一步检查"); |
| | | else builder.substring(0,builder.length() - 1); |
| | | result = builder.toString(); |
| | | } |
| | | // String content = " (" + index + ") " + detail.getProName() + ":" + result; |
| | | // content = content.replaceAll("[\\n\\r]+$", ""); |
| | | // content = content.replaceAll("\\s+$", ""); |
| | | // paragraph = new Paragraph(content, defaultFont); |
| | | paragraph = new Paragraph(result, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | String str = " "; |
| | | List<Map<String, Object>> maps = tjRulesService.getyichangxiangmujianyiguize(entry.getKey().toString(),"","",tjOrder.getTjNumber()); |
| | | for (Map<String, Object> objectMap : maps) { |
| | | paragraph = new Paragraph(str+objectMap.get("bt").toString()+objectMap.get("nr").toString(),defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | index++; |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | paragraph.setLeading(0f); |
| | | paragraph.setSpacingBefore(0f); |
| | | paragraph.setSpacingAfter(5f); |
| | | document2.add(paragraph); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 1; i++) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:"); |
| | | document2.add(paragraph); |
| | | if (tjOrder.getCheckAdvice() == null) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | | document2.add(paragraph); |
| | | } else { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraph); |
| | | } |
| | | |
| | | |
| | | Paragraph paragraphNone = new Paragraph("", defaultFont); |
| | | paragraphNone.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | paragraphNone.setLeading(5f); |
| | | paragraphNone.setSpacingBefore(10f); |
| | | paragraphNone.setSpacingAfter(10f); |
| | | document2.add(paragraphNone); |
| | | paragraphNone = new Paragraph("", defaultFont); |
| | | paragraphNone.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | paragraphNone.setLeading(5f); |
| | | paragraphNone.setSpacingBefore(10f); |
| | | paragraphNone.setSpacingAfter(10f); |
| | | document2.add(paragraphNone); |
| | | |
| | | |
| | | PdfPTable tableQz = new PdfPTable(new float[]{100f,100f,50f}); |
| | | tableQz.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | tableQz.setLockedWidth(true); |
| | | tableQz.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | tableQz.getDefaultCell().setBorder(0); |
| | | tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | |
| | | Font zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | Font zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | |
| | | for (int i = 0; i < 3; i++) { |
| | | PdfPCell cell = new PdfPCell(); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPhrase(new Phrase("", defaultFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | tableQz.addCell(cell); |
| | | } |
| | | |
| | | |
| | | PdfPCell cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPhrase(new Phrase("", defaultFont)); |
| | | cell.setRowspan(3); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("体检单位盖章:", zongJianTitleFont)); |
| | | |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("总检医师:", zongJianTitleFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | // cell.setPhrase(new Phrase("何小婷", zongJianFont)); |
| | | cell.setPhrase(new Phrase(tjOrder.getCheckDoctor(), zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase("总检日期:", zongJianTitleFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | cell.setPhrase(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | document2.add(tableQz); |
| | | |
| | | document2.close(); |
| | | |
| | | |
| | | |
| | |
| | | strings.add(jgdw); |
| | | strings.add(fwz); |
| | | strings.add(hybgd.getJcxmid()); |
| | | strings.add(hysqd.getXmid()); |
| | | lists.add(strings); |
| | | } |
| | | if (!lists.isEmpty()) { |