| | |
| | | |
| | | @GetMapping("/toPdf/{TjNumber}") |
| | | @ApiOperation(value = "打印体检报告为pdf") |
| | | @Transactional |
| | | // @Transactional |
| | | public AjaxResult toPdf(@PathVariable("TjNumber") @ApiParam(value = "体检号") String tjNumber) { |
| | | // AjaxResult error = null; |
| | | // 之前的代码 优化速度 |
| | |
| | | try { |
| | | return shengchengbgmoban(tjNumber, tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | log.error(String.valueOf(e)); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | log.error("生成报告失败:"+e.getMessage(),String.valueOf(e)); |
| | | tjOrder.setReportTime(null); |
| | | tjOrder.setCheckTime(null); |
| | | tjOrder.setCheckStatus(0); |
| | | tjOrder.setPrintLastTime(null); |
| | | tjOrderService.updateById(tjOrder); |
| | | |
| | | logger.error(String.valueOf(e)); |
| | | // logger.error(String.valueOf(e)); |
| | | return AjaxResult.error("生成报告失败"); |
| | | } |
| | | } else { |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate,TjReportTemplate zongJianYiShiQianMing) { |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate,TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | AjaxResult ajaxResult = null; |
| | | try { |
| | | // ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | |
| | | |
| | | ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate,zongJianYiShiQianMing); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | // e.printStackTrace(); |
| | | // log.error(String.valueOf(e)); |
| | | throw new Exception(e); |
| | | } |
| | | if (!ajaxResult.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("生成报告失败"); |
| | | } else { |
| | | Long userId = tjCustomer.getCusId(); |
| | | String outputFileName1 = userId + tjNumber + tjCustomer.getCusName() + "_报告.pdf"; |