| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import jodd.util.StringUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public AjaxResult savePdf() { |
| | | //从文件地址读入PDF文件 仅存储一次 |
| | | String base64String = PDFBinaryUtil.getPDFBinary(configService.selectConfigByKey("default_pdf5Template")); |
| | | if(StringUtil.isNotBlank(base64String)){ |
| | | reportTemplateService.remove(new LambdaQueryWrapper<TjReportTemplate>().eq(TjReportTemplate::getName,"体检报告模板5")); |
| | | TjReportTemplate tem = new TjReportTemplate(); |
| | | tem.setName("体检报告模板5"); |
| | |
| | | if (save) { |
| | | return AjaxResult.success("保存成功"); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("保存失败"); |
| | | // String base64String2 = PDFBinaryUtil.getPDFBinary("D:\\Tjreport\\心电图1.pdf"); |
| | | // TjReport tem2 = new TjReport(); |
| | |
| | | we.eq(TjReport::getType, "体检报告"); |
| | | TjReport one = tjReportService.getOne(we); |
| | | if (one == null) { |
| | | return AjaxResult.error("暂无体检报告"); |
| | | return AjaxResult.error("暂无体检报告,请撤回到总检未审核页面,需总检医生重新审核并生成报告!"); |
| | | } |
| | | if ("pdf".equals(one.getPrint())) { |
| | | res.put("flag", "0"); |
| | |
| | | res.put("url", one.getPath()); |
| | | return AjaxResult.success(res); |
| | | } else { |
| | | return AjaxResult.error("暂无体检报告"); |
| | | return AjaxResult.error("暂无体检报告,请撤回到总检未审核页面,需总检医生重新审核并生成报告!"); |
| | | } |
| | | |
| | | } |
| | |
| | | // 不在使用逻辑删除 逻辑删除导致打印报告生成 查询sql缓慢 |
| | | int i = tjReportService.deleteTjReportByReId(tjReport.getReId()); |
| | | if (i == 0) { |
| | | return AjaxResult.error("撤回失败!"); |
| | | return AjaxResult.error("暂无体检报告,请撤回到总检未审核页面,需总检医生重新审核并生成报告!"); |
| | | } |
| | | } |
| | | |
| | |
| | | one.setPrintLastTime(null); |
| | | one.setDownloadLastTime(null); |
| | | if (tjOrderService.updateById(one)) { |
| | | // ycxmService.delOrderYcXmJyByTjh(tjNumber); |
| | | return AjaxResult.success("撤回成功!"); |
| | | } |
| | | } |
| | | return AjaxResult.error("撤回失败!"); |
| | | return AjaxResult.error("该人员体检记录不存在,请核实人员信息!"); |
| | | |
| | | } |
| | | |