zhaowenxuan
1 天以前 ed721d3c77517ce4e3bcc52cad9b7f52aa865c51
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisPDFUtil.java
@@ -1449,7 +1449,7 @@
            zongJianFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE - 6);
            zongJianTitleFont = PdfUtils.setFont(DEFAULT_ZONGJIAN_FONT_SIZE -4);
            zongJianTitleFont.setStyle(Font.BOLD);
            PdfPTable tableQz = new PdfPTable(new float[]{90f, 90f, 60f, 60f, 60f, 60f});
            PdfPTable tableQz = new PdfPTable(new float[]{80f, 80f, 60f, 40f,40f, 60f, 55f});
            tableQz.setTotalWidth(PageSize.A4.getWidth() - 100);
            tableQz.setLockedWidth(true);
            tableQz.setHorizontalAlignment(Element.ALIGN_LEFT);
@@ -1467,8 +1467,8 @@
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setPadding(10);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
//            cell.setPadding(10);
            if (!file.exists()) {
                cell.setPhrase(new Phrase("", zongJianFont));
            } else {
@@ -1492,9 +1492,10 @@
            cell = new PdfPCell();
            cell.setBorder(Rectangle.NO_BORDER);
            cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setPadding(10);
//            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
//            cell.setPadding(10);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            String zongjianysname = sysConfigService.selectConfigByKey("pdf_report_zongjianysname");
            if (zongJianYiShiQianMing == null && StrUtil.isNotBlank(zongjianysname) && !zongjianysname.equals("无")) {
                cell.setPhrase(new Phrase(zongjianysname, zongJianFont));
@@ -1504,9 +1505,10 @@
            } else {
                byte[] bytes = Base64.getDecoder().decode(zongJianYiShiQianMing.getTemplate());
                Image image = Image.getInstance(bytes);
                image.scaleToFit(60, 60);
                image.scaleToFit(20, 20);
//                image.scaleAbsolute(20,20);
//                cell.addElement(image);
                cell.setPaddingLeft(-10);
//                cell.setPaddingTop(5);
//                cell.setPaddingBottom(15);
                String pdfSfsgqz = sysConfigService.selectConfigByKey("pdf_sfsgqz");
@@ -1515,6 +1517,13 @@
                }
                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(0);
            tableQz.addCell(cell);
            cell = new PdfPCell(new Phrase("总检日期:", zongJianTitleFont));
@@ -1527,8 +1536,10 @@
            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);
//            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
//            cell.setPadding(10);
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
            tableQz.addCell(cell);
            document2.add(tableQz);
        } else {
@@ -2484,7 +2495,10 @@
                doctorNameDefault = entry.getValue().get(0).getShys();
            }
            Font doctorFonts = PdfUtils.setFont(9);
            if (key.equals("Y")) {
            if (entry.getValue().get(0).getIsShowYiShi() == null){
                entry.getValue().get(0).setIsShowYiShi(true);
            }
            if (key.equals("Y") && entry.getValue().get(0).getIsShowYiShi()) {
                String qmImg = dictUserInfoMapper.selectQmImgInnerJoinUserByUserId(String.valueOf(sysUser.getUserId()));
                if (null != qmImg && StrUtil.isNotBlank(qmImg)) {
                    Paragraph elements = new Paragraph();
@@ -2522,7 +2536,7 @@
                    df.setAlignment(Element.ALIGN_RIGHT);
                    document1.add(df);
                }
            } else {
            } else if (entry.getValue().get(0).getIsShowYiShi()) {
                String doctorName = "主检医师:" + doctorNameDefault;
                if (createTime != null)
                    doctorName = "检查时间:" + new SimpleDateFormat("yyyy-MM-dd").format(createTime) + "             主检医师:" + doctorNameDefault;
@@ -2681,12 +2695,13 @@
                            } catch (Exception ignored) {
                            }
                        }
                        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);
                        }
                        // 结果弃检重复去除医师打印
//                        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(xmmc);
                        strings.add(groupOnceProResult);
@@ -2699,10 +2714,11 @@
                        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);
//                        if (StrUtil.isNotBlank(shsj)) {
//                            shsj = shsj.split(" ")[0];
//                        }
//                        map.put("shsj", shsj);
                        map.put("shsj","");
                        data.put(xmmc, map);
                    }
                }
@@ -2945,6 +2961,7 @@
                                //                        LambdaQueryWrapper<LtkjExamJcbgd> wrapper = new LambdaQueryWrapper<>();
                                //                        wrapper.eq(LtkjExamJcbgd::getTjh, tjNumber);
                                //                        wrapper.eq(LtkjExamJcbgd::getXmdm, String.valueOf(tjOrderDetail.getProject().getProParentId()));
                                tjPdfVO.setIsShowYiShi(true);
                                tjPdfVOS.add(tjPdfVO);
                            }
                        }
@@ -2961,6 +2978,7 @@
                        tjPdfVO.setProId(String.valueOf(orderRemark.getProId()));
                        tjPdfVO.setPid(String.valueOf(orderRemark.getProId()));
                        tjPdfVO.setXh(1);
                        tjPdfVO.setIsShowYiShi(false);
                        tjPdfVOS.add(tjPdfVO);
                    }
                }