| | |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-jar-plugin</artifactId>--> |
| | | <!-- <version>3.2.0</version>--> |
| | | <!-- <configuration>--> |
| | | <!-- <excludes>--> |
| | | <!-- <!– 排除 Font 文件夹 –>--> |
| | | <!-- <exclude>**/Font/**</exclude>--> |
| | | <!-- </excludes>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | public AjaxResult hisPDFNew2(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate) throws Exception { |
| | | public AjaxResult hisPDFNew2(TjOrder tjOrder, TjCustomer customer, TjReportTemplate tjReportTemplate,TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | pdfPage = 0; |
| | | DictHosp dictHosp = dictHospService.list().get(0); |
| | | String color = sysConfigService.selectConfigByKey("report_title_color"); |
| | |
| | | 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); |
| | | if (zongJianYiShiQianMing == null) { |
| | | cell.setPhrase(new Phrase(sysConfigService.selectConfigByKey("pdf_report_zongjianysname"), zongJianFont)); |
| | | // cell.setPhrase(new Phrase(tjOrder.getCheckDoctor(), 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); |
| | |
| | | // 首页表单 |
| | | 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); |
| | |
| | | tjtype = "个人"; |
| | | hashMap.put("tjtype", tjtype); |
| | | } |
| | | if (StrUtil.isNotBlank(customer.getCompName())){ |
| | | hashMap.put("work", customer.getCompName()); |
| | | }else { |
| | | LambdaQueryWrapper<DictComp> wq111 = new LambdaQueryWrapper<>(); |
| | | wq111.eq(DictComp::getDrugManufacturerId, tjOrder.getFirmId()); |
| | | DictComp dictComp = dictCompService.getOne(wq111); |
| | | |
| | | 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())); |
| | |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusId, byId.getUserId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq1); |
| | | LambdaQueryWrapper<TjReportTemplate> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjReportTemplate::getFlag,"4"); |
| | | wrapper.eq(TjReportTemplate::getOpen,"1"); |
| | | TjReportTemplate zongJianYiShiQianMing = reportTemplateService.getOne(wrapper); |
| | | try { |
| | | shengchengbgmoban(byId.getTjNumber(), byId, tjCustomer, reportTemplate); |
| | | shengchengbgmoban(byId.getTjNumber(), byId, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | byId.setStatus(TjConstants.TJ_END); |
| | | byId.setReportTime(date); |
| | | byId.setPrintLastTime(date); |
| | |
| | | } |
| | | |
| | | |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate) throws Exception { |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate,TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | // AjaxResult ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | // AjaxResult ajaxResult = hisPDFUtil.hisPDFNew(tjOrder, tjCustomer, reportTemplate); |
| | | AjaxResult ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate); |
| | | AjaxResult ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | if (!ajaxResult.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } else { |
| | |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusId, tjOrder.getUserId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq1); |
| | | LambdaQueryWrapper<TjReportTemplate> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjReportTemplate::getFlag,"4"); |
| | | wrapper.eq(TjReportTemplate::getOpen,"1"); |
| | | TjReportTemplate zongJianYiShiQianMing = reportTemplateService.getOne(wrapper); |
| | | try { |
| | | return shengchengbgmoban(tjNumber, tjOrder, tjCustomer, reportTemplate); |
| | | return shengchengbgmoban(tjNumber, tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | log.error(String.valueOf(e)); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate) { |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate,TjReportTemplate zongJianYiShiQianMing) { |
| | | AjaxResult ajaxResult = null; |
| | | try { |
| | | // ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | // ajaxResult = hisPDFUtil.hisPDFNew(tjOrder, tjCustomer, reportTemplate); |
| | | |
| | | ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate); |
| | | ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ltkj.LtkjApplication; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.domain.entity.DictUserInfo; |
| | |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | | * 修改报告 |
| | | */ |
| | | @Test |
| | | public void uploadPdf(){ |
| | | String base64String = PDFBinaryUtil.getPDFBinary("E:\\文档\\报告体检模板new - 首页.pdf"); |
| | |
| | | reportTemplateService.updateById(template); |
| | | } |
| | | |
| | | /** |
| | | * 调用生成报告 |
| | | */ |
| | | @Test |
| | | public void savePdf(){ |
| | | String tjNumber = "8002241205080905"; |
| | | LambdaQueryWrapper<TjReportTemplate> tjReportTemplateLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, 1); |
| | | tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getOpen, 0); |
| | | TjReportTemplate reportTemplate = reportTemplateService.getOne(tjReportTemplateLambdaQueryWrapper); |
| | | |
| | | LambdaQueryWrapper<TjOrder> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(TjOrder::getTjNumber, tjNumber); |
| | | TjOrder tjOrder = orderService.getOne(queryWrapper); |
| | | |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusId, tjOrder.getUserId()); |
| | | TjCustomer tjCustomer = customerService.getOne(wq1); |
| | | |
| | | try { |
| | | hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | } catch (Exception e) { |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | public void uploadzjysqm() throws IOException { |
| | | File file = new File("d:\\Users\\w\\Desktop\\总检医师签名\\ysqm.png"); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | byte[] bytes = new byte[(int) file.length()]; |
| | | fileInputStream.read(bytes); |
| | | String string = Base64.getEncoder().encodeToString(bytes); |
| | | LambdaUpdateWrapper<TjReportTemplate> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.set(TjReportTemplate::getOpen,0); |
| | | wrapper.eq(TjReportTemplate::getFlag,4); |
| | | reportTemplateService.update(wrapper); |
| | | TjReportTemplate template = new TjReportTemplate(); |
| | | template.setReportTemId(IdUtil.getSnowflake().nextId()); |
| | | template.setTemplate(string); |
| | | template.setCreateTime(new Date()); |
| | | template.setCreateBy("超级管理员"); |
| | | template.setDeleted(0); |
| | | template.setFlag("4"); |
| | | template.setName("总检医师签名"); |
| | | template.setRemark("图片必须为PS中画布大小为300*140 PNG透明图"); |
| | | template.setOpen("1"); |
| | | reportTemplateService.save(template); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String str = " (1) 双肾输尿管膀胱B超:\n" + |
| | | " 肝脏、胆囊、胰腺、脾脏声像图所见未见明显异常\n" + |
| | | " 双肾、输尿管声像图未见明显异常\n" + |
| | | " \n" + |
| | | " \n" + |
| | | " \n" + |
| | | " "; |
| | | |
| | | str = str.replaceAll("[\\n\\r]+$", ""); // 去除末尾的换行符 |
| | | str = str.replaceAll("\\s+$", ""); // 去除末尾的空格 |
| | | System.out.println(str); |
| | | } |
| | | } |