| | |
| | | return AjaxResult.success(); |
| | | }*/ |
| | | |
| | | public AjaxResult hisPDFNew2(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate, TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | public AjaxResult hisPDFNew2(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate, TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | try { |
| | | String s1 = sysConfigService.selectConfigByKey("tjreport_font_size_second_page_info"); |
| | | String s2 = sysConfigService.selectConfigByKey("tjreport_font_size_second_page_title"); |
| | |
| | | // List<TjOrderRemark> remarks = tjOrderRemarkMapper.getzongjianyishengchakanyichangxiangmu3( tjOrder.getTjNumber()); |
| | | List<TjOrderDetail> orderDetails = tjOrderDetailMapper.getzongjianyishengchakanyichangxiangmu4(tjOrder.getTjNumber()); |
| | | // List<Map<String, Object>> jiancha = new ArrayList<>(); |
| | | |
| | | Font zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | Font zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | PdfPCell cell; |
| | | |
| | | |
| | | String zjjyandqmgzIstop = sysConfigService.selectConfigByKey("pdf_zjjyandqmgz_istop"); |
| | | boolean zjjyandqmgzIstopFlag = false; |
| | | if (StrUtil.isNotBlank(zjjyandqmgzIstop) && zjjyandqmgzIstop.equalsIgnoreCase("y")){ |
| | | zjjyandqmgzIstopFlag = true; |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:"); |
| | | document2.add(paragraph); |
| | | if (tjOrder.getCheckAdvice() == null) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | | document2.add(paragraph); |
| | | } else { |
| | | Paragraph paragraphs = new Paragraph(tjOrder.getCheckAdvice(), defaultFont); |
| | | //设置文字居中 |
| | | paragraphs.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | // paragraphs.setLeading(5f); |
| | | //设置段落上空白 |
| | | paragraphs.setSpacingBefore(10f); |
| | | //设置段落下空白 |
| | | paragraphs.setSpacingAfter(10f); |
| | | // paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraphs); |
| | | } |
| | | makeZjjyAndQmgzTab(tjOrder, zongJianYiShiQianMing, zongJianFont, zongJianTitleFont, value, document2, defaultFont); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | List<Map<String, Object>> collect1 = maps.stream().distinct().collect(Collectors.toList()); |
| | | for (Map<String, Object> objectMap : collect1) { |
| | | String content = str + objectMap.get("bt").toString() + objectMap.get("nr").toString(); |
| | | if (StrUtil.isBlank(content)) content = " "; |
| | | paragraph = new Paragraph(content, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | // if (StrUtil.isBlank(content)) content = " "; |
| | | // paragraph = new Paragraph(content, defaultFont); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // document2.add(paragraph); |
| | | if (StrUtil.isNotBlank(content) && StrUtil.isNotBlank(content.trim())){ |
| | | paragraph = new Paragraph(content, defaultFont); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | document2.add(paragraph); |
| | | } |
| | | } |
| | | index++; |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | |
| | | paragraph = PdfUtils.setParagraph(defaultFont, ""); |
| | | document2.add(paragraph); |
| | | } |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:"); |
| | | document2.add(paragraph); |
| | | if (tjOrder.getCheckAdvice() == null) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | | if (!zjjyandqmgzIstopFlag){ |
| | | paragraph = PdfUtils.setParagraph(defaultTitleFont, "总检医生建议:"); |
| | | document2.add(paragraph); |
| | | } else { |
| | | Paragraph paragraphs = new Paragraph(tjOrder.getCheckAdvice(), defaultFont); |
| | | //设置文字居中 |
| | | paragraphs.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | if (tjOrder.getCheckAdvice() == null) { |
| | | paragraph = PdfUtils.setParagraph(defaultFont, "无"); |
| | | document2.add(paragraph); |
| | | } else { |
| | | Paragraph paragraphs = new Paragraph(tjOrder.getCheckAdvice(), defaultFont); |
| | | //设置文字居中 |
| | | paragraphs.setAlignment(Element.ALIGN_LEFT); |
| | | //行间距 |
| | | // paragraphs.setLeading(5f); |
| | | //设置段落上空白 |
| | | paragraphs.setSpacingBefore(10f); |
| | | //设置段落下空白 |
| | | paragraphs.setSpacingAfter(10f); |
| | | //设置段落上空白 |
| | | paragraphs.setSpacingBefore(10f); |
| | | //设置段落下空白 |
| | | paragraphs.setSpacingAfter(10f); |
| | | // paragraph = PdfUtils.setParagraph(defaultFont, tjOrder.getCheckAdvice()); |
| | | document2.add(paragraphs); |
| | | document2.add(paragraphs); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Paragraph paragraphNone = new Paragraph("", defaultFont); |
| | |
| | | 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); |
| | | if (!zjjyandqmgzIstopFlag){ |
| | | makeZjjyAndQmgzTab(tjOrder, zongJianYiShiQianMing, zongJianFont, zongJianTitleFont, value, document2, defaultFont); |
| | | } |
| | | |
| | | |
| | | 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); |
| | | |
| | | File file = new File(value + File.separator + "yinzhang.png"); |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | if (!file.exists()) { |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | }else { |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | byte[] fileBytes = new byte[(int) file.length()]; |
| | | fileInputStream.read(fileBytes); |
| | | fileInputStream.close(); |
| | | Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes))); |
| | | image.scaleToFit(90, 90); |
| | | cell.addElement(image); |
| | | } |
| | | 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); |
| | | String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname"); |
| | | if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) { |
| | | cell.setPhrase(new Phrase(zongjianysname, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) { |
| | | String nickName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | cell.setPhrase(new Phrase(nickName, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | } else { |
| | | byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate()); |
| | | Image image = Image.getInstance(bytes); |
| | | image.scaleToFit(100, 100); |
| | | cell.addElement(image); |
| | | 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(); |
| | | |
| | | |
| | | zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | |
| | | |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | |
| | | makeHisJianYanTable(document, map, dictHosp, color); |
| | | |
| | | printReport = new HashMap<>(); |
| | | pacsJianChaData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | // pacsJianChaData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | newpacsJianChaData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document, printReport, dictHosp, color, true); |
| | | // notHuaYanTable(document, printReport, dictHosp, color, true); |
| | | pacsTable(document, printReport, dictHosp, color, true); |
| | | } catch (DocumentException e) { |
| | | log.error("pacs项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | |
| | | } catch (Exception e) { |
| | | log.error(String.valueOf(e)); |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | private void makeZjjyAndQmgzTab(TjOrder tjOrder, TjReportTemplate zongJianYiShiQianMing, Font zongJianFont, Font zongJianTitleFont, String value, Document document2, Font defaultFont) throws IOException, DocumentException { |
| | | PdfPCell cell; |
| | | String pdfQzgzpailie = sysConfigService.selectConfigByKey("pdf_qzgzpailie"); |
| | | if (StrUtil.isNotBlank(pdfQzgzpailie) && pdfQzgzpailie.equalsIgnoreCase("h")){ |
| | | zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 2); |
| | | zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 2); |
| | | zongJianTitleFont.setStyle(Font.BOLD); |
| | | PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 60f, 60f, 60f, 60f}); |
| | | tableQz.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | tableQz.setLockedWidth(true); |
| | | tableQz.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | tableQz.getDefaultCell().setBorder(1); |
| | | tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | |
| | | cell = new PdfPCell(new Phrase("体检单位盖章:", zongJianTitleFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPadding(10); |
| | | tableQz.addCell(cell); |
| | | |
| | | File file = new File(value + File.separator + "yinzhang.png"); |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | if (!file.exists()) { |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | } else { |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | byte[] fileBytes = new byte[(int) file.length()]; |
| | | fileInputStream.read(fileBytes); |
| | | fileInputStream.close(); |
| | | Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes))); |
| | | image.scaleToFit(60, 60); |
| | | cell.addElement(image); |
| | | } |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(new Phrase("总检医师:", zongJianTitleFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPadding(10); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | |
| | | String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname"); |
| | | if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) { |
| | | cell.setPhrase(new Phrase(zongjianysname, zongJianFont)); |
| | | } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) { |
| | | String nickName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | cell.setPhrase(new Phrase(nickName, zongJianFont)); |
| | | } else { |
| | | byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate()); |
| | | Image image = Image.getInstance(bytes); |
| | | image.scaleToFit(60, 60); |
| | | // cell.addElement(image); |
| | | |
| | | // cell.setPaddingTop(5); |
| | | // cell.setPaddingBottom(15); |
| | | String pdfSfsgqz = sysConfigService.selectConfigByKey("pdf_sfsgqz"); |
| | | if (StrUtil.isNotBlank(pdfSfsgqz) && pdfSfsgqz.equalsIgnoreCase("Y")) { |
| | | cell.setVerticalAlignment(Element.ALIGN_TOP); |
| | | } |
| | | cell.setImage(image); |
| | | } |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(new Phrase("总检日期:", zongJianTitleFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | cell.setPadding(10); |
| | | tableQz.addCell(cell); |
| | | |
| | | cell = new PdfPCell(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont)); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_CENTER); |
| | | cell.setPadding(10); |
| | | tableQz.addCell(cell); |
| | | document2.add(tableQz); |
| | | } else { |
| | | PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 70f}); |
| | | tableQz.setTotalWidth(PageSize.A4.getWidth() - 100); |
| | | tableQz.setLockedWidth(true); |
| | | tableQz.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | // tableQz.getDefaultCell().setBorder(1); |
| | | tableQz.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT); |
| | | |
| | | for (int i = 0; i < 3; i++) { |
| | | 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); |
| | | } |
| | | |
| | | |
| | | 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.setPaddingRight(50); |
| | | cell.setPhrase(new Phrase("体检单位盖章:", zongJianTitleFont)); |
| | | |
| | | tableQz.addCell(cell); |
| | | |
| | | File file = new File(value + File.separator + "yinzhang.png"); |
| | | cell = new PdfPCell(); |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | // cell.setPaddingRight(50); |
| | | if (!file.exists()) { |
| | | cell.setPhrase(new Phrase("", zongJianFont)); |
| | | }else { |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | byte[] fileBytes = new byte[(int) file.length()]; |
| | | fileInputStream.read(fileBytes); |
| | | fileInputStream.close(); |
| | | Image image = Image.getInstance(Base64.getDecoder().decode(Base64.getEncoder().encodeToString(fileBytes))); |
| | | image.scaleToFit(90, 90); |
| | | cell.addElement(image); |
| | | } |
| | | 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.setPaddingRight(50); |
| | | 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_LEFT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | // cell.setPaddingRight(50); |
| | | String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname"); |
| | | if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) { |
| | | cell.setPhrase(new Phrase(zongjianysname, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | } else if (zongJianYiShiQianMing == null && zongjianysname.equals("无")) { |
| | | String nickName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | cell.setPhrase(new Phrase(nickName, zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | } else { |
| | | byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate()); |
| | | Image image = Image.getInstance(bytes); |
| | | image.scaleToFit(100, 100); |
| | | cell.addElement(image); |
| | | 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.setPaddingRight(50); |
| | | 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_LEFT); |
| | | cell.setPaddingTop(10); |
| | | cell.setPaddingBottom(10); |
| | | // cell.setPaddingRight(50); |
| | | cell.setPhrase(new Phrase(new SimpleDateFormat("yyyy-MM-dd").format(tjOrder.getCheckTime()), zongJianFont)); |
| | | tableQz.addCell(cell); |
| | | |
| | | document2.add(tableQz); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void pacsTable(Document document1, Map<TjOrderRemark, List<TjPdfVO>> printReport, DictHosp dictHosp, String colorStr, boolean isPacs)throws DocumentException{ |
| | | try { |
| | | List<TjReportSpecialProject> tjReportSpecialProjects = tjReportSpecialProjectService.list(); |
| | | for (Map.Entry<TjOrderRemark, List<TjPdfVO>> entry : printReport.entrySet()) { |
| | | |
| | | if (entry.getValue() == null || entry.getValue().isEmpty()) continue; |
| | | //判断该项目是否需要打印报告 |
| | | |
| | | TjOrderRemark orderRemark = entry.getKey(); |
| | | List<TjPdfVO> value = entry.getValue().stream().distinct().collect(Collectors.toList()); |
| | | if (StrUtil.isBlank(value.get(0).getProResult()) && (StrUtil.isBlank(value.get(0).getTs()) && StrUtil.isBlank(value.get(0).getSj()))) { |
| | | continue; |
| | | } |
| | | String titleName = null; |
| | | |
| | | if (entry.getValue().get(0).getProName().contains(";")) |
| | | titleName = entry.getValue().get(0).getProName(); |
| | | else titleName = orderRemark.getProName(); |
| | | // 设置标题字体样式 |
| | | Font titleFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph paragraph = PdfUtils.setParagraph(titleFonts, titleName); |
| | | |
| | | if (StrUtil.isBlank(value.get(0).getProResult()) && (StrUtil.isBlank(value.get(0).getTs().replaceAll("\n","")) |
| | | && StrUtil.isBlank(value.get(0).getSj().replaceAll("\n","")))) { |
| | | continue; |
| | | } |
| | | Font titleFont = PdfUtils.setFont(DEFAULT_TITLE_FONT_SIZE); |
| | | titleFont.setStyle(Font.BOLD); |
| | | PdfPCell cellTitle = new PdfPCell(PdfUtils.setParagraph(titleFont, titleName)); |
| | | cellTitle.setBorder(Rectangle.NO_BORDER); |
| | | Color color = Color.decode("#B4CDCD"); |
| | | cellTitle.setBackgroundColor(new BaseColor(color.getRed(), color.getGreen(), color.getBlue())); // 设置背景颜色(十六进制 RGB) |
| | | // 创建表格并添加单元格 |
| | | PdfPTable tableTitle = new PdfPTable(1); |
| | | tableTitle.setWidthPercentage(100); |
| | | tableTitle.addCell(cellTitle); |
| | | // 将表格添加到文档中 |
| | | document1.add(tableTitle); |
| | | |
| | | if (!value.isEmpty()) { |
| | | if (value.size() > 1) { |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font textFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value, isPacs, new float[]{240, 240, 240}); |
| | | document1.add(table); |
| | | } |
| | | |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | |
| | | if (isPacs) { |
| | | Paragraph pp; |
| | | Paragraph ppp; |
| | | |
| | | if (StrUtil.isNotBlank(value.get(0).getSj()) || StrUtil.isNotBlank(value.get(0).getProResult())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj() != null ? value.get(0).getSj().replaceAll("\n","") : value.get(0).getProResult().replaceAll("\n",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查提示:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph((value.get(0).getTs() != null ? value.get(0).getTs().replaceAll("\n","") : value.get(0).getProResult().replaceAll("\n","")), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | } else { |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font textFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value, false, new float[]{240, 300}); |
| | | document1.add(table); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Font textFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value, isPacs); |
| | | document1.add(table); |
| | | } |
| | | |
| | | |
| | | //判断备注是否为空 空不能显示null |
| | | if (entry.getKey().getRemark() == null) { |
| | | entry.getKey().setRemark(""); |
| | | } |
| | | // if (!dictHosp.getHospName().equals("澄合矿务局中心医院")){ |
| | | if (!true) { |
| | | String remark = "备注:" + entry.getKey().getRemark(); |
| | | if (entry.getKey().getRemark().length() > 50) { |
| | | int j = 0; |
| | | for (int i = 0; i < remark.length() / 50; i++) { |
| | | String substring = remark.substring(j, j + 50); |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | document1.add(pp); |
| | | j = j + 50; |
| | | } |
| | | if (remark.length() % 50 != 0) { |
| | | String substring = remark.substring((remark.length() / 50) * 50, remark.length() - 1); |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | document1.add(pp); |
| | | } |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); |
| | | document1.add(pp); |
| | | } |
| | | } |
| | | //判断主检医师是否为空 空不能显示null |
| | | zhuJianYiShi(document1, entry, orderRemark.getCreateTime(), dictHosp); |
| | | // if (!dictHosp.getHospName().equals("澄合矿务局中心医院")) { |
| | | if (!true) { |
| | | //分割线 |
| | | LineSeparator objectName = new LineSeparator(); |
| | | document1.add(objectName); |
| | | } |
| | | |
| | | |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (DocumentException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 目前写死 只有碳13、14 模板都是一样的只不过参考值不同 |
| | | * 凌云:{"dy":"4.0","xy":"4.0","title":"阳性参考值:","dystr":"DOB值: ≥ ${dy} HP-阳性","xystr":" < ${xy} 正常","en":"DOB"} |
| | |
| | | .collect(Collectors.toMap(LtkjHybgd::getJcxm, p -> p, (existing, replacement) -> existing)) |
| | | .values()); |
| | | |
| | | // hybgds=hybgds.stream().sorted(Comparator.comparing(LtkjHybgd::getJcxm, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | |
| | | Map<String, List<LtkjHybgd>> listMap = hybgds.stream().collect(Collectors.groupingBy(LtkjHybgd::getJyjg)); |
| | | boolean isGroupOnce = false; |
| | | String groupOnceProResult = ""; |
| | | if (listMap.size()==1){ |
| | | String firstKey = listMap.keySet().stream().findFirst().orElse(null); |
| | | LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(SysDictData::getDictType,"qj_type"); |
| | | wrapper.eq(SysDictData::getDictLabel,firstKey); |
| | | List<SysDictData> dictList = sysDictDataService.list(); |
| | | if (!dictList.isEmpty()) { |
| | | isGroupOnce = true; |
| | | groupOnceProResult = firstKey; |
| | | } |
| | | } |
| | | |
| | | // hybgds=hybgds.stream().sorted(Comparator.comparing(LtkjHybgd::getJcxm, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // hybgds = hybgds.stream() |
| | | // .sorted(Comparator.comparingInt( |
| | | // a -> a.getJcxm().length() // 根据名字的长度排序 |
| | | // )) |
| | | // .collect(Collectors.toList()); |
| | | if (!isGroupOnce){ |
| | | // 大类项目名称 |
| | | //TODO 查看是否可以加条码号进行区分 现在是根据项目名称进行区分 |
| | | String xmmc = hysqd.getXmmc(); |
| | | ArrayList<List<String>> lists = new ArrayList<>(); |
| | | HashSet<String> hashSet = new HashSet<>(); |
| | | String shsj = ""; |
| | | for (LtkjHybgd hybgd : hybgds) { |
| | | shsj = hybgd.getShsj(); |
| | | // 检查项目 |
| | | String jcxm = hybgd.getJcxm() != null ? hybgd.getJcxm().trim() : null; |
| | | // 检验结果 |
| | | String jyjg = hybgd.getJyjg() != null ? hybgd.getJyjg().trim() : null; |
| | | // 结果单位 |
| | | String jgdw = hybgd.getJgdw() != null ? hybgd.getJgdw().trim() : null; |
| | | // 范围值 |
| | | String fwz = hybgd.getFwz() != null ? hybgd.getFwz().trim() : null; |
| | | // 检验医师 |
| | | // String jyys = hybgd.getJyys(); |
| | | //审核医生 |
| | | String shysmc = hybgd.getShysmc() != null ? hybgd.getShysmc().trim() : null; |
| | | // 审核医师编码 |
| | | String shys = hybgd.getShys() != null ? hybgd.getShys().trim() : null; |
| | | String ycbz = ""; |
| | | |
| | | // 大类项目名称 |
| | | String xmmc = hysqd.getXmmc(); |
| | | ArrayList<List<String>> lists = new ArrayList<>(); |
| | | HashSet<String> hashSet = new HashSet<>(); |
| | | String shsj = ""; |
| | | for (LtkjHybgd hybgd : hybgds) { |
| | | if (jyjg != null && StrUtil.isNotBlank(jyjg) && fwz != null && StrUtil.isNotBlank(fwz)) { |
| | | try { |
| | | String[] fwzs = fwz.split("-"); |
| | | BigDecimal min = new BigDecimal(fwzs[0]); |
| | | BigDecimal max = new BigDecimal(fwzs[1]); |
| | | BigDecimal jyjgval = new BigDecimal(jyjg); |
| | | // 比较检验结果和范围值 |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | // jyjg 小于范围最小值,添加下箭头 |
| | | // jyjg = jyjg + " ↓"; |
| | | ycbz = "↓"; |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | // jyjg 大于范围最大值,添加上箭头 |
| | | // jyjg = jyjg + " ↑"; |
| | | ycbz = "↑"; |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | // LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // queryWrapper.eq(SysUser::getUserName,jyys); |
| | | // List<SysUser> sysUsers = userService.list(queryWrapper); |
| | | // if (!sysUsers.isEmpty()) |
| | | // hashSet.add(sysUsers.get(0).getNickName()); |
| | | String key = sysConfigService.selectConfigByKey("is_report_pdf_use_ysqm"); |
| | | if (null != shys && null != shysmc && key.equals("Y")) { |
| | | hashSet.add(shysmc + "|" + shys); |
| | | } else { |
| | | if (null != shysmc) hashSet.add(shysmc); |
| | | } |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | strings.add(jcxm); |
| | | strings.add(jyjg); |
| | | strings.add(ycbz); |
| | | strings.add(jgdw); |
| | | strings.add(fwz); |
| | | strings.add(hybgd.getJcxmid()); |
| | | strings.add(hysqd.getXmid()); |
| | | lists.add(strings); |
| | | } |
| | | if (!lists.isEmpty()) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data", lists); |
| | | map.put("jyys", hashSet); |
| | | if (StrUtil.isNotBlank(shsj)) { |
| | | shsj = shsj.split(" ")[0]; |
| | | } |
| | | map.put("shsj", shsj); |
| | | data.put(xmmc, map); |
| | | } |
| | | }else { |
| | | String xmmc = hysqd.getXmmc(); |
| | | ArrayList<List<String>> lists = new ArrayList<>(); |
| | | HashSet<String> hashSet = new HashSet<>(); |
| | | LtkjHybgd hybgd = hybgds.get(0); |
| | | String shsj = ""; |
| | | shsj = hybgd.getShsj(); |
| | | // 检查项目 |
| | | String jcxm = hybgd.getJcxm() != null ? hybgd.getJcxm().trim() : null; |
| | | // 检验结果 |
| | | String jyjg = hybgd.getJyjg() != null ? hybgd.getJyjg().trim() : null; |
| | | // 结果单位 |
| | | String jgdw = hybgd.getJgdw() != null ? hybgd.getJgdw().trim() : null; |
| | | // 范围值 |
| | | String fwz = hybgd.getFwz() != null ? hybgd.getFwz().trim() : null; |
| | | // 检验医师 |
| | | // String jyys = hybgd.getJyys(); |
| | | //审核医生 |
| | | String shysmc = hybgd.getShysmc() != null ? hybgd.getShysmc().trim() : null; |
| | | // 审核医师编码 |
| | | String shys = hybgd.getShys() != null ? hybgd.getShys().trim() : null; |
| | | String ycbz = ""; |
| | | |
| | | if (jyjg != null && StrUtil.isNotBlank(jyjg) && fwz != null && StrUtil.isNotBlank(fwz)) { |
| | | if (StrUtil.isNotBlank(groupOnceProResult) && fwz != null && StrUtil.isNotBlank(fwz)) { |
| | | try { |
| | | String[] fwzs = fwz.split("-"); |
| | | BigDecimal min = new BigDecimal(fwzs[0]); |
| | | BigDecimal max = new BigDecimal(fwzs[1]); |
| | | BigDecimal jyjgval = new BigDecimal(jyjg); |
| | | // 比较检验结果和范围值 |
| | | BigDecimal jyjgval = new BigDecimal(groupOnceProResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | // jyjg 小于范围最小值,添加下箭头 |
| | | // jyjg = jyjg + " ↓"; |
| | | ycbz = "↓"; |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | // jyjg 大于范围最大值,添加上箭头 |
| | | // jyjg = jyjg + " ↑"; |
| | | ycbz = "↑"; |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | // LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // queryWrapper.eq(SysUser::getUserName,jyys); |
| | | // List<SysUser> sysUsers = userService.list(queryWrapper); |
| | | // if (!sysUsers.isEmpty()) |
| | | // hashSet.add(sysUsers.get(0).getNickName()); |
| | | String key = sysConfigService.selectConfigByKey("is_report_pdf_use_ysqm"); |
| | | if (null != shys && null != shysmc && key.equals("Y")) { |
| | | hashSet.add(shysmc + "|" + shys); |
| | |
| | | if (null != shysmc) hashSet.add(shysmc); |
| | | } |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | strings.add(jcxm); |
| | | strings.add(jyjg); |
| | | strings.add(xmmc); |
| | | strings.add(groupOnceProResult); |
| | | strings.add(ycbz); |
| | | strings.add(jgdw); |
| | | strings.add(fwz); |
| | | strings.add(hybgd.getJcxmid()); |
| | | strings.add(hysqd.getXmid()); |
| | | lists.add(strings); |
| | | } |
| | | if (!lists.isEmpty()) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data", lists); |
| | | map.put("jyys", hashSet); |
| | |
| | | tjOrderDetails = tjOrderDetails.stream().filter(i -> StrUtil.isNotBlank(i.getProResult())).collect(Collectors.toList()); |
| | | tjOrderDetails = new ArrayList<>(tjOrderDetails.stream() |
| | | .collect(Collectors.toMap(TjOrderDetail::getProId, i -> i, (existing, replacement) -> existing)).values()); |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | TjProject tjProject = projectService.getById(String.valueOf(tjOrderDetail.getProId())); |
| | | if (null != tjProject && tjProject.getNeedReport().equals("Y")) { |
| | | tjOrderDetail.setProject(tjProject); |
| | | |
| | | if (tjOrderDetail.getProject().getProParentId().equals(entry.getKey().getProId()) && entry.getKey().getType() == 1) { |
| | | TjPdfVO tjPdfVO = new TjPdfVO(); |
| | | tjPdfVO.setProName(tjOrderDetail.getProject().getProName()); |
| | | tjPdfVO.setProResult(tjOrderDetail.getProResult()); |
| | | tjPdfVO.setExc(tjOrderDetail.getExceptionDesc()); |
| | | if (null != tjProject.getProMetering()) { |
| | | tjPdfVO.setCompany(tjProject.getProMetering()); |
| | | } else { |
| | | tjPdfVO.setCompany("/"); |
| | | } |
| | | tjPdfVO.setProId(String.valueOf(tjOrderDetail.getProject().getProId())); |
| | | tjPdfVO.setPid(String.valueOf(tjProject.getProParentId())); |
| | | // LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjExamJcbgd::getTjh, tjNumber); |
| | | // wrapper.eq(LtkjExamJcbgd::getXmdm, String.valueOf(tjOrderDetail.getProject().getProParentId())); |
| | | tjPdfVOS.add(tjPdfVO); |
| | | |
| | | boolean isGroupOnce = false; |
| | | String groupOnceProResult = ""; |
| | | if (tjOrderDetails.size() > 1) { |
| | | Map<String, List<TjOrderDetail>> listMap = tjOrderDetails.stream().collect(Collectors.groupingBy(TjOrderDetail::getProResult)); |
| | | if (listMap.size() == 1){ |
| | | String firstKey = listMap.keySet().stream().findFirst().orElse(null); |
| | | LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(SysDictData::getDictType,"qj_type"); |
| | | wrapper.eq(SysDictData::getDictLabel,firstKey); |
| | | List<SysDictData> list = sysDictDataService.list(); |
| | | if (!list.isEmpty()) { |
| | | isGroupOnce = true; |
| | | groupOnceProResult = firstKey; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!isGroupOnce) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | TjProject tjProject = projectService.getById(String.valueOf(tjOrderDetail.getProId())); |
| | | if (null != tjProject && tjProject.getNeedReport().equals("Y")) { |
| | | tjOrderDetail.setProject(tjProject); |
| | | |
| | | if (tjOrderDetail.getProject().getProParentId().equals(entry.getKey().getProId()) && entry.getKey().getType() == 1) { |
| | | TjPdfVO tjPdfVO = new TjPdfVO(); |
| | | tjPdfVO.setProName(tjOrderDetail.getProject().getProName()); |
| | | tjPdfVO.setProResult(tjOrderDetail.getProResult()); |
| | | tjPdfVO.setExc(tjOrderDetail.getExceptionDesc()); |
| | | if (null != tjProject.getProMetering()) { |
| | | tjPdfVO.setCompany(tjProject.getProMetering()); |
| | | } else { |
| | | tjPdfVO.setCompany("/"); |
| | | } |
| | | tjPdfVO.setProId(String.valueOf(tjOrderDetail.getProject().getProId())); |
| | | tjPdfVO.setPid(String.valueOf(tjProject.getProParentId())); |
| | | tjPdfVO.setXh(tjProject.getXh()); |
| | | // LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjExamJcbgd::getTjh, tjNumber); |
| | | // wrapper.eq(LtkjExamJcbgd::getXmdm, String.valueOf(tjOrderDetail.getProject().getProParentId())); |
| | | tjPdfVOS.add(tjPdfVO); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | TjOrderRemark orderRemark = entry.getKey(); |
| | | TjProject project = projectService.getById(orderRemark.getProId()); |
| | | if (null != project && project.getNeedReport().equals("Y") && orderRemark.getType() == 1) { |
| | | TjPdfVO tjPdfVO = new TjPdfVO(); |
| | | tjPdfVO.setProName(project.getProName()); |
| | | tjPdfVO.setProResult(groupOnceProResult); |
| | | tjPdfVO.setExc(0L); |
| | | tjPdfVO.setCompany("/"); |
| | | tjPdfVO.setProId(String.valueOf(orderRemark.getProId())); |
| | | tjPdfVO.setPid(String.valueOf(orderRemark.getProId())); |
| | | tjPdfVO.setXh(1); |
| | | tjPdfVOS.add(tjPdfVO); |
| | | } |
| | | } |
| | | if(!tjPdfVOS.isEmpty()){ |
| | | tjPdfVOS=tjPdfVOS.stream().sorted(Comparator.comparing(TjPdfVO::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | tjPdfVOS = tjPdfVOS.stream() |
| | | .sorted(Comparator.comparingInt( |
| | | tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | )) |
| | | .collect(Collectors.toList()); |
| | | // tjPdfVOS=tjPdfVOS.stream().sorted(Comparator.comparing(TjPdfVO::getProName, Collator.getInstance(Locale.CHINA))).collect(Collectors.toList()); |
| | | // tjPdfVOS = tjPdfVOS.stream() |
| | | // .sorted(Comparator.comparingInt( |
| | | // tjPdfVO -> tjPdfVO.getProName().length() // 根据名字的长度排序 |
| | | // )) |
| | | // .collect(Collectors.toList()); |
| | | tjPdfVOS=tjPdfVOS.stream().sorted(Comparator.comparing(TjPdfVO::getXh)).collect(Collectors.toList()); |
| | | } |
| | | printReport.put(entry.getKey(), tjPdfVOS); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void newpacsJianChaData(String tjNumber, Map<TjOrderRemark, List<TjPdfVO>> printReport, TjOrder one, TjCustomer customer) { |
| | | try { |
| | | List<TjOrderRemark> tjOrderRemarks = tjOrderRemarkService.newpacsJianChaData(tjNumber); |
| | | for (TjOrderRemark tjOrderRemark : tjOrderRemarks) { |
| | | List<TjPdfVO> tjPdfVOS = new ArrayList<>(); |
| | | TjPdfVO tjPdfVO = new TjPdfVO(); |
| | | tjPdfVO.setProResult(null); |
| | | tjPdfVO.setExc(0L); |
| | | tjPdfVO.setCompany("/"); |
| | | tjPdfVO.setProId(tjOrderRemark.getProsId()); |
| | | String yxbx = tjOrderRemark.getRemark(); |
| | | String bgNr = tjOrderRemark.getJgbx(); |
| | | // 正则表达式:匹配数字后跟 '.' 或 '、' |
| | | String regex = "\\d+[\\.,、]"; |
| | | // 使用正则替换,匹配的数字后添加换行符 |
| | | if(StringUtil.isNotBlank(yxbx)) yxbx = yxbx.replaceAll(regex, "\n$0"); |
| | | if(StringUtil.isBlank(bgNr)) bgNr = ""; |
| | | if(StringUtil.isBlank(yxbx)) yxbx = ""; |
| | | tjPdfVO.setTs(yxbx); |
| | | tjPdfVO.setSj(bgNr); |
| | | tjPdfVO.setShys(tjOrderRemark.getDoctorName()); |
| | | tjPdfVO.setProName(tjOrderRemark.getProName()); |
| | | tjPdfVOS.add(tjPdfVO); |
| | | printReport.put(tjOrderRemark, tjPdfVOS); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置用户信息 |
| | | * |