| | |
| | | acroFields.setField(key, hashMap.get(key)); |
| | | } |
| | | pdfStamper.setFormFlattening(true); |
| | | |
| | | String isOpenSfzImg = sysConfigService.selectConfigByKey("pdf_isOpenSfzImg"); |
| | | String pathSfzfilePath = sysConfigService.selectConfigByKey("path_sfzfilePath"); |
| | | if (StrUtil.isNotBlank(isOpenSfzImg) && isOpenSfzImg.equalsIgnoreCase("y")){ |
| | | if (StrUtil.isNotBlank(pathSfzfilePath)){ |
| | | String key = DataSourceContextHolder.getDataSourceKey(); |
| | | key = key.replace("ltkjpeis10_",""); |
| | | if (new File(pathSfzfilePath + File.separator + key + File.separator+customer.getCusId()+".png").exists()) { |
| | | String pdfSfzimgwidth = sysConfigService.selectConfigByKey("pdf_sfzimgwidth"); |
| | | String pdfSfzimgheight = sysConfigService.selectConfigByKey("pdf_sfzimgheight"); |
| | | String pdfSfzimgy = sysConfigService.selectConfigByKey("pdf_sfzimgy"); |
| | | String pdfSfzimgx = sysConfigService.selectConfigByKey("pdf_sfzimgx"); |
| | | int width = 100,height = 100,x = 90,y = 180; |
| | | if (StrUtil.isNotBlank(pdfSfzimgwidth)) { |
| | | width = Integer.parseInt(pdfSfzimgwidth); |
| | | } |
| | | if (StrUtil.isNotBlank(pdfSfzimgheight)) { |
| | | height = Integer.parseInt(pdfSfzimgheight); |
| | | } |
| | | if (StrUtil.isNotBlank(pdfSfzimgy)) { |
| | | y = Integer.parseInt(pdfSfzimgy); |
| | | } |
| | | if (StrUtil.isNotBlank(pdfSfzimgx)) { |
| | | x = Integer.parseInt(pdfSfzimgx); |
| | | } |
| | | Image image = Image.getInstance(pathSfzfilePath + File.separator + key + File.separator+customer.getCusId()+".png"); |
| | | // 设置图片位置和大小 |
| | | // image.setAbsolutePosition(90, 190); // 表单左边 |
| | | // image.setAbsolutePosition(495, 742); // 右上角 |
| | | // image.setAbsolutePosition(250, 50); // 中下 |
| | | image.setAbsolutePosition(x, y); |
| | | image.scaleAbsolute(width, height); // 设置图片宽度和高度 |
| | | PdfContentByte content = pdfStamper.getOverContent(1); |
| | | content.addImage(image); |
| | | } |
| | | } |
| | | } |
| | | |
| | | pdfStamper.close(); |
| | | reader4.close(); |
| | | // 将修改后的PDF内容写入 |
| | |
| | | if (StrUtil.isNotBlank(value.get(0).getSj())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj(), remarkFonts); |
| | | ppp = new Paragraph(value.get(0).getSj().replaceAll("\n",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查提示:"+value.get(0).getTs()); |
| | | document1.add(pp); |
| | | // ppp = new Paragraph(value.get(0).getTs(), remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // pp = PdfUtils.setParagraph(remarkFonts, "检查提示:"+value.get(0).getTs().replaceAll("\n","")); |
| | | // document1.add(pp); |
| | | ppp = new Paragraph("检查提示:"+value.get(0).getTs().replaceAll("\n",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } else { |
| | | if (value.get(0).getPid().equals("1862852701533012001")) { |
| | | remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | if (StrUtil.isNotBlank(value.get(0).getSj())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj(), remarkFonts); |
| | | ppp = new Paragraph(value.get(0).getSj().replaceAll("\n",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(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() : value.get(0).getProResult(), remarkFonts); |
| | | 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); |
| | |
| | | // document1.add(pp); |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查提示:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph((value.get(0).getTs() != null ? value.get(0).getTs() : value.get(0).getProResult()), remarkFonts); |
| | | 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); |
| | |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null","").replaceAll("\n",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | |
| | | TjProject tjProjectq = projectService.getById(tjOrderDetail.getProject().getProParentId()); |
| | | TjPdfVO tjPdfVO = new TjPdfVO(); |
| | | tjPdfVO.setProName(tjOrderDetail.getProject().getProName()); |
| | | tjPdfVO.setProResult(tjOrderDetail.getProResult()); |
| | | tjPdfVO.setProResult(tjOrderDetail.getProResult()==null ? null : tjOrderDetail.getProResult().replaceAll("\n","").replaceAll(" ","")); |
| | | tjPdfVO.setExc(tjOrderDetail.getExceptionDesc()); |
| | | if (null != tjProject.getProMetering()) { |
| | | tjPdfVO.setCompany(tjProject.getProMetering()); |
| | |
| | | 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.setTs(yxbx.replaceAll("\n","").replaceAll(" ","")); |
| | | tjPdfVO.setSj(bgNr.replaceAll("\n","").replaceAll(" ","")); |
| | | tjPdfVO.setShys(jcbgd.getShysxm()); |
| | | tjPdfVO.setProName(jcbgd.getXmmc()); |
| | | ids += "|" + jcbgd.getXmdm(); |