| | |
| | | import com.ltkj.hosp.sqlDomain.LtkjExamJcbgd; |
| | | import com.ltkj.hosp.sqlDomain.LtkjHybgd; |
| | | import com.ltkj.hosp.sqlDomain.LtkjHysqd; |
| | | import com.ltkj.hosp.vodomain.CsProVo; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDictDataService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ltkj.common.utils.pdfutils.PdfUtils.createTable; |
| | | |
| | | /** |
| | | * 检查 检验报告pdf生成 |
| | |
| | | } |
| | | document1.setMargins(70, 70, 40, 40); |
| | | document1.open(); |
| | | // 非化验项目报告 |
| | | Map<TjOrderRemark, List<TjPdfVO>> printReport = new HashMap<>(); |
| | | notHuaYanData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document1, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | |
| | | if (dictHosp.getHospName().equals("澄合矿务局中心医院")){ |
| | | // 组装体检检查项目报告 |
| | | Map<TjOrderRemark, List<TjPdfVO>> printReport = new HashMap<>(); |
| | | notHuaYanData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document1, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | // 组装检验数据 |
| | | makeHisJianYanTable(document1, map,dictHosp,color); |
| | | |
| | | // 组装pacs检查数据 |
| | | printReport = new HashMap<>(); |
| | | pacsJianChaData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document1, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | }else { |
| | | // 非化验项目报告 |
| | | Map<TjOrderRemark, List<TjPdfVO>> printReport = new HashMap<>(); |
| | | notHuaYanData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document1, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | // 组装检验数据 |
| | | makeHisJianYanTable(document1, map,dictHosp,color); |
| | | } |
| | | // 组装检验数据 |
| | | makeHisJianYanTable(document1, map,dictHosp,color); |
| | | |
| | | |
| | | List<ByteArrayOutputStream> jianchas = makeHisJianChaTable(tjOrder); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | savePDFFile(outputFileName1, tjOrder, customer, finalOutPut); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | public AjaxResult hisPDFNew(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate) throws Exception { |
| | | 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")); |
| | | |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | Document document = new Document(PageSize.A4); |
| | | PdfWriter pdfWriter = null; |
| | | int pageSize = 0; |
| | | try { |
| | | pdfWriter = PdfWriter.getInstance(document, byteArrayOutputStream); |
| | | 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 = "未知"; |
| | | pdfWriter.setPageEvent(new FooterHeaderPageEvent(dictHosp.getHospName(),customer.getCusName(),tjOrder.getTjNumber(),sex,String.valueOf(DateUtil.ageOfNow(customer.getCusBrithday())))); |
| | | pageSize = pdfWriter.getPageNumber(); |
| | | } catch (DocumentException e) { |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | Map<TjOrderRemark, List<TjPdfVO>> printReport = new HashMap<>(); |
| | | notHuaYanData(tjOrder.getTjNumber(), printReport, tjOrder, customer); |
| | | try { |
| | | notHuaYanTable(document, printReport,dictHosp,color); |
| | | } catch (DocumentException e) { |
| | | log.error("非化验项目填充表格异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | PdfReader reader = null; |
| | | |
| | | // 检验数据 |
| | | HashMap<String, Object> map = makeHisJianYan(tjOrder, customer); |
| | | makeHisJianYanTable(document, map,dictHosp,color); |
| | | List<ByteArrayOutputStream> jianchas = makeHisJianChaTable(tjOrder); |
| | | document.close(); |
| | | |
| | | Document document1 = new Document(PageSize.A4); |
| | | ByteArrayOutputStream finalOutPut = new ByteArrayOutputStream(); |
| | | PdfCopy copy = new PdfCopy(document1, finalOutPut); |
| | | byte[] bytes = byteArrayOutputStream.toByteArray(); |
| | | document1.open(); |
| | | reader = new PdfReader(bytes); |
| | | |
| | | int numberOfPages = reader.getNumberOfPages(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | try { |
| | | reader = new PdfReader(byteArrayOutputStream.toByteArray()); |
| | | int numberOfPages1 = reader.getNumberOfPages(); |
| | | for (int i = 1; i <= numberOfPages1; i++) { |
| | | PdfImportedPage page = copy.getImportedPage(reader, i); |
| | | copy.addPage(page); |
| | | } |
| | | for (ByteArrayOutputStream jiancha : jianchas) { |
| | | reader = new PdfReader(jiancha.toByteArray()); |
| | | numberOfPages1 = reader.getNumberOfPages(); |
| | | for (int i = 1; i <= numberOfPages1; i++) { |
| | | PdfImportedPage page = copy.getImportedPage(reader, i); |
| | | copy.addPage(page); |
| | | } |
| | | jiancha.close(); |
| | | } |
| | | reader.close(); |
| | | byteArrayOutputStream.close(); |
| | | document.close(); |
| | | copy.close(); |
| | | } catch (IOException e) { |
| | | log.error("拷贝pdf异常"); |
| | | log.error(String.valueOf(e)); |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /* |
| | | * 第二页检查状态信息 检查科室与检查项目 |
| | | * <span v-if="scope.row.type == '0'">未检</span> |
| | | * <span v-if="scope.row.type == '1'">已检</span> |
| | | * <span v-if="scope.row.type == '2'">弃检</span> |
| | | * <span v-if="scope.row.type == '3'">延期</span> |
| | | * */ |
| | | List<CsProVo> list = tjOrderRemarkService.cSWebGetProByTjNumAndOrderId(tjOrder.getTjNumber(),false); |
| | | |
| | | |
| | | |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void makeHisJianYanTable(Document document1, HashMap<String, Object> map,DictHosp dictHosp,String colorStr) throws DocumentException { |
| | | if (!map.isEmpty()) { |
| | | String[] titles = new String[]{"体检项目", "体检结果","标志", "单位", "参考范围"}; |
| | | float[] titlesWidth = new float[]{270, 80, 40, 80, 100}; |
| | | String[] titles = new String[]{"体检项目", "体检结果","提示", "单位", "参考范围"}; |
| | | float[] titlesWidth = new float[]{280, 100, 40, 100, 120}; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String titleName = entry.getKey().trim(); |
| | | HashMap<String, Object> entryValue = (HashMap<String, Object>) entry.getValue(); |
| | |
| | | LambdaQueryWrapper<TjProject> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProject::getProId, entry.getKey().getProId()); |
| | | TjProject one11 = projectService.getOne(wqqq); |
| | | if (entry.getValue().isEmpty()) continue; |
| | | //判断该项目是否需要打印报告 |
| | | if (null != one11 && "Y".equals(one11.getNeedReport())) { |
| | | TjOrderRemark orderRemark = entry.getKey(); |
| | | List<TjPdfVO> value = entry.getValue(); |
| | | String titleName = null; |
| | | if (null != one11 && "1".equals(one11.getResultType())) { |
| | |
| | | } |
| | | |
| | | |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | // 获取列表数据 |
| | | //设置表头字体样式 |
| | | Font headFont = PdfUtils.setFont(9); |
| | | // 设置正文字体样式:12号 |
| | | Font textFont = PdfUtils.setFont(9); |
| | | //创建表格 将表头字体和正文字体放进去 |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value); |
| | | // String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | // Font headFont = PdfUtils.setFont(9); |
| | | // Font textFont = PdfUtils.setFont(9); |
| | | // PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | // document1.add(table); |
| | | |
| | | document1.add(table); |
| | | if (dictHosp.getHospName().equals("澄合矿务局中心医院") && !value.isEmpty()){ |
| | | if (value.size()>1){ |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(9); |
| | | Font textFont = PdfUtils.setFont(9); |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | document1.add(table); |
| | | }else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | Paragraph ppp = new Paragraph(value.get(0).getSj(), 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(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | }else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(9); |
| | | Font textFont = PdfUtils.setFont(9); |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | document1.add(table); |
| | | } |
| | | //判断备注是否为空 空不能显示null |
| | | if (entry.getKey().getRemark() == null) { |
| | | entry.getKey().setRemark(""); |
| | | } |
| | | 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); |
| | | if (!dictHosp.getHospName().equals("澄合矿务局中心医院")){ |
| | | 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(9); |
| | | 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(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | document1.add(pp); |
| | | } |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | 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(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); |
| | | document1.add(pp); |
| | | } |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); |
| | | document1.add(pp); |
| | | } |
| | | //判断主检医师是否为空 空不能显示null |
| | | zhuJianYiShi(document1, entry); |
| | | zhuJianYiShi(document1, entry,orderRemark.getCreateTime(),dictHosp); |
| | | //分割线 |
| | | if (!dictHosp.getHospName().equals("澄合矿务局中心医院")) { |
| | | LineSeparator objectName = new LineSeparator(); |
| | |
| | | document1.add(paragraph); |
| | | } |
| | | |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | // 获取列表数据 |
| | | //设置表头字体样式 |
| | | Font headFont = PdfUtils.setFont(9); |
| | | // 设置正文字体样式:12号 |
| | | Font textFont = PdfUtils.setFont(9); |
| | | //创建表格 将表头字体和正文字体放进去 |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value); |
| | | document1.add(table); |
| | | // String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | // Font headFont = PdfUtils.setFont(9); |
| | | // Font textFont = PdfUtils.setFont(9); |
| | | // PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | // document1.add(table); |
| | | |
| | | if (dictHosp.getHospName().equals("澄合矿务局中心医院") && !value.isEmpty()){ |
| | | System.out.println("value = " + value); |
| | | if (value.size()>1){ |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(9); |
| | | Font textFont = PdfUtils.setFont(9); |
| | | PdfPTable table = PdfUtils.setTable2(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | document1.add(table); |
| | | }else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | Paragraph ppp = new Paragraph(value.get(0).getSj(), 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(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | }else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(9); |
| | | Font textFont = PdfUtils.setFont(9); |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value,dictHosp.getHospName().equals("澄合矿务局中心医院")); |
| | | document1.add(table); |
| | | } |
| | | |
| | | |
| | | //判断备注是否为空 空不能显示null |
| | | if (entry.getKey().getRemark() == null) { |
| | | entry.getKey().setRemark(""); |
| | | } |
| | | 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); |
| | | if (!dictHosp.getHospName().equals("澄合矿务局中心医院")){ |
| | | 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(9); |
| | | 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(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | document1.add(pp); |
| | | } |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | 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(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, substring); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); |
| | | document1.add(pp); |
| | | } |
| | | } else { |
| | | Font remarkFonts = PdfUtils.setFont(9); |
| | | Paragraph pp = PdfUtils.setParagraph(remarkFonts, remark); |
| | | document1.add(pp); |
| | | } |
| | | //判断主检医师是否为空 空不能显示null |
| | | zhuJianYiShi(document1, entry); |
| | | zhuJianYiShi(document1, entry,orderRemark.getCreateTime(),dictHosp); |
| | | if (!dictHosp.getHospName().equals("澄合矿务局中心医院")) { |
| | | //分割线 |
| | | LineSeparator objectName = new LineSeparator(); |
| | |
| | | * @param entry |
| | | * @throws DocumentException |
| | | */ |
| | | private void zhuJianYiShi(Document document1, Map.Entry<TjOrderRemark, List<TjPdfVO>> entry) throws DocumentException { |
| | | if (null != entry.getKey().getDoctorName() && null != userService.getById(entry.getKey().getDoctorName())) { |
| | | private void zhuJianYiShi(Document document1, Map.Entry<TjOrderRemark, List<TjPdfVO>> entry,Date createTime,DictHosp dictHosp) throws DocumentException { |
| | | if ((null != entry.getKey().getDoctorName() && null != userService.getById(entry.getKey().getDoctorName())) || dictHosp.getHospName().equals("澄合矿务局中心医院") ) { |
| | | //主检医师 |
| | | String key = sysConfigService.selectConfigByKey("is_report_pdf_use_ysqm"); |
| | | SysUser sysUser = userService.getById(entry.getKey().getDoctorName()); |
| | | String doctorNameDefault = "无"; |
| | | if (sysUser != null)doctorNameDefault = sysUser.getNickName(); |
| | | if (!entry.getValue().isEmpty() && StrUtil.isNotBlank(entry.getValue().get(0).getShys()) && dictHosp.getHospName().equals("澄合矿务局中心医院")){ |
| | | doctorNameDefault = entry.getValue().get(0).getShys(); |
| | | } |
| | | Font doctorFonts = PdfUtils.setFont(9); |
| | | if (key.equals("Y")){ |
| | | String qmImg = dictUserInfoMapper.selectQmImgInnerJoinUserByUserId(String.valueOf(sysUser.getUserId())); |
| | |
| | | elements.setSpacingAfter(10f); |
| | | elements.setAlignment(Element.ALIGN_RIGHT); |
| | | Phrase phrase = new Phrase(); |
| | | phrase.add(new Chunk("主检医师:",doctorFonts)); |
| | | if (createTime != null) { |
| | | phrase.add(new Chunk("检查时间:"+new SimpleDateFormat("yyyy-MM-dd").format(createTime)+" 主检医师:", doctorFonts)); |
| | | }else { |
| | | phrase.add(new Chunk("主检医师:", doctorFonts)); |
| | | } |
| | | byte[] decode = Base64.getDecoder().decode(qmImg); |
| | | Image image = null; |
| | | try { |
| | |
| | | elements.add(phrase); |
| | | document1.add(elements); |
| | | } catch (IOException e) { |
| | | String doctorName = "主检医师:" + sysUser.getNickName(); |
| | | String doctorName = "主检医师:" + doctorNameDefault; |
| | | if (createTime != null) doctorName = "检查时间:"+new SimpleDateFormat("yyyy-MM-dd").format(createTime)+" 主检医师:" + doctorNameDefault; |
| | | Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); |
| | | df.setAlignment(Element.ALIGN_RIGHT); |
| | | document1.add(df); |
| | | } |
| | | }else { |
| | | String doctorName = "主检医师:" + sysUser.getNickName(); |
| | | String doctorName = "主检医师:" + doctorNameDefault; |
| | | if (createTime != null) doctorName = "检查时间:"+new SimpleDateFormat("yyyy-MM-dd").format(createTime)+" 主检医师:" + doctorNameDefault; |
| | | Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); |
| | | df.setAlignment(Element.ALIGN_RIGHT); |
| | | document1.add(df); |
| | | } |
| | | }else { |
| | | String doctorName = "主检医师:" + sysUser.getNickName(); |
| | | String doctorName = "主检医师:" + doctorNameDefault; |
| | | if (createTime != null) doctorName = "检查时间:"+new SimpleDateFormat("yyyy-MM-dd").format(createTime)+" 主检医师:" + doctorNameDefault; |
| | | Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); |
| | | df.setAlignment(Element.ALIGN_RIGHT); |
| | | document1.add(df); |
| | | } |
| | | } else { |
| | | String doctorName = "主检医师:" + "无"; |
| | | if (createTime != null) doctorName = "检查时间:"+new SimpleDateFormat("yyyy-MM-dd").format(createTime)+" 主检医师:" + "无"; |
| | | Font doctorFonts = PdfUtils.setFont(9); |
| | | Paragraph df = PdfUtils.setParagraph(doctorFonts, doctorName); |
| | | df.setAlignment(Element.ALIGN_RIGHT); |
| | |
| | | } else { |
| | | tjPdfVO.setCompany("/"); |
| | | } |
| | | tjPdfVO.setProId(String.valueOf(tjOrderDetail.getProject().getProId())); |
| | | LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LtkjExamJcbgd::getTjh,tjNumber); |
| | | wrapper.eq(LtkjExamJcbgd::getXmdm,String.valueOf(tjOrderDetail.getProject().getProParentId())); |
| | | // LtkjExamJcbgd jcbgd = jcbgdService.getOne(wrapper); |
| | | // if (jcbgd != null){ |
| | | // tjPdfVO.setTs(jcbgd.getYxbx()); |
| | | // tjPdfVO.setSj(jcbgd.getBgNr()); |
| | | // tjPdfVO.setShys(jcbgd.getShysxm()); |
| | | // } |
| | | tjPdfVOS.add(tjPdfVO); |
| | | } |
| | | } |
| | | } |
| | | printReport.put(entry.getKey(), tjPdfVOS); |
| | | } |
| | | } |
| | | private void pacsJianChaData(String tjNumber, Map<TjOrderRemark, List<TjPdfVO>> printReport, TjOrder one, TjCustomer customer) { |
| | | // LambdaQueryWrapper<TjOrderRemark> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TjOrderRemark::getTjNumber, tjNumber); |
| | | // wqq.ne(TjOrderRemark::getDeptId, "241"); |
| | | // wqq.in(TjOrderRemark::getDeptId, "269", "270", "253", "254", "255", "257"); |
| | | // wqq.notIn(TjOrderRemark::getProId, projectService.getNneedReprotProId()); |
| | | // List<TjOrderRemark> tjOrderRemarks = tjOrderRemarkService.list(wqq); |
| | | List<TjOrderRemark> tjOrderRemarks = tjOrderRemarkService.pacsJianChaData(tjNumber); |
| | | for (TjOrderRemark tjOrderRemark : tjOrderRemarks) { |
| | | printReport.put(tjOrderRemark, null); |
| | | } |
| | | for (Map.Entry<TjOrderRemark, List<TjPdfVO>> entry : printReport.entrySet()) { |
| | | List<TjPdfVO> tjPdfVOS = new ArrayList<>(); |
| | | List<TjOrderDetail> tjOrderDetails = tjOrderDetailService.getDetailByOrderIdAndParId(one.getOrderId(), entry.getKey().getProId()); |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | if (null != tjProject && tjProject.getNeedReport().equals("Y")) { |
| | | tjOrderDetail.setProject(tjProject); |
| | | |
| | | if (tjOrderDetail.getProject().getProParentId().equals(entry.getKey().getProId())) { |
| | | 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())); |
| | | LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LtkjExamJcbgd::getTjh,tjNumber); |
| | | wrapper.eq(LtkjExamJcbgd::getXmdm,String.valueOf(tjOrderDetail.getProject().getProParentId())); |
| | | LtkjExamJcbgd jcbgd = jcbgdService.getOne(wrapper); |
| | | if (jcbgd != null){ |
| | | tjPdfVO.setTs(jcbgd.getYxbx()); |
| | | tjPdfVO.setSj(jcbgd.getBgNr()); |
| | | tjPdfVO.setShys(jcbgd.getShysxm()); |
| | | } |
| | | tjPdfVOS.add(tjPdfVO); |
| | | } |
| | | } |