| | |
| | | } |
| | | Integer checkStatus = tjOrder.getCheckStatus(); |
| | | if (checkStatus == 1) { |
| | | if ("报表".equals(reportTemplate.getPrint())) { |
| | | TjReport tjReport = new TjReport(); |
| | | tjReport.setTjNumber(String.valueOf(tjNumber)); |
| | | tjReport.setPath(reportTemplate.getUrl() + "?tjNum=" + tjNumber); |
| | | tjReport.setType("体检报告"); |
| | | tjReport.setPrint("报表"); |
| | | tjReportService.save(tjReport); |
| | | //修改order表中的打印报告时间为当前时间 |
| | | LambdaUpdateWrapper<TjOrder> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(TjOrder::getTjNumber, tjNumber); |
| | | updateWrapper.set(TjOrder::getReportTime, new Date()); |
| | | updateWrapper.set(TjOrder::getPrintLastTime, new Date()); |
| | | updateWrapper.set(TjOrder::getDownloadLastTime, new Date()); |
| | | updateWrapper.set(TjOrder::getStatus, TjConstants.TJ_END); |
| | | tjOrderService.update(updateWrapper); |
| | | return AjaxResult.success("已生成报告!可直接点击预览!"); |
| | | } |
| | | String hisRegistrationId = tjOrder.getCardId(); |
| | | Date createTime = tjOrder.getCreateTime(); |
| | | Date finishTime = tjOrder.getFinishTime(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String ksrq = dateFormat.format(createTime); |
| | | String jsrq = dateFormat.format(finishTime); |
| | | String jsrq = dateFormat.format(new Date()); |
| | | HashMap<String, Object> params = new HashMap<>(); |
| | | params.put("his_registration_id", hisRegistrationId); |
| | | params.put("ksbm", ""); |
| | |
| | | params.put("pagecount", 100); |
| | | params.put("page", 1); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | return hisPDFUtil.execHisRequest(map, params, tjOrder, reportTemplate); |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusId, tjOrder.getUserId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq1); |
| | | // return hisPDFUtil.execHisRequest(map, params, tjOrder, reportTemplate); |
| | | try { |
| | | return hisPDFUtil.hisPDF(tjOrder,tjCustomer,reportTemplate); |
| | | } catch (DocumentException e) { |
| | | logger.error("生成报告异常"); |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("生成报告异常"); |
| | | } |
| | | } else { |
| | | return AjaxResult.error("请先总检"); |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | return AjaxResult.success("PDF导出失败"); |
| | | } finally { |
| | | transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjOrder.getCardId()); |
| | | // transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjOrder.getCardId()); |
| | | } |
| | | } |
| | | } |