| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | * @author ltkj |
| | | * @date 2022-12-06 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/system/report") |
| | | @Api(tags = "AAAA_体检报告") |
| | |
| | | private ITjBigPositiveService tjBigPositiveService; |
| | | @Autowired |
| | | private HisPDFUtil hisPDFUtil; |
| | | @Autowired |
| | | private IDictHospService dictHospService; |
| | | |
| | | @GetMapping("/savePdf") |
| | | @ApiOperation(value = "从本地存储模板到数据库") |
| | |
| | | // return error; |
| | | // } |
| | | // return AjaxResult.success("该用户体检未完成,不能打印报告!!!"); |
| | | int num = tjOrderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); |
| | | if (num > 0) { |
| | | return AjaxResult.error("有延期项目暂不能生成报告!!!"); |
| | | String config = configService.selectConfigByKey("sfjcwjhyqxm"); |
| | | if(null != config && config.equalsIgnoreCase("Y")){ |
| | | int num = tjOrderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); |
| | | if (num > 0) return AjaxResult.error("存在未检或延期项目暂不能生成报告!!!"); |
| | | } |
| | | |
| | | // String configByKey = configService.selectConfigByKey("sfkqdyhis"); |
| | |
| | | return shengchengbgmoban(tjNumber, tjOrder, tjCustomer, reportTemplate); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | // 调用撤销 |
| | | // tjReportController.backOnlyCheckType(tjNumber); |
| | | logger.error("生成报告异常"); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate) throws Exception { |
| | | AjaxResult ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate) { |
| | | AjaxResult ajaxResult = null; |
| | | try { |
| | | // ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | ajaxResult = hisPDFUtil.hisPDFNew(tjOrder, tjCustomer, reportTemplate); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | if (!ajaxResult.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } else { |
| | |
| | | // 设置正文字体样式:12号 |
| | | Font textFont = PdfUtils.setFont(9); |
| | | //创建表格 将表头字体和正文字体放进去 |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value); |
| | | DictHosp dictHosp = dictHospService.list().get(0); |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value,dictHosp.equals("澄合矿务局中心医院")); |
| | | document.add(paragraph); |
| | | document.add(table); |
| | | //判断备注是否为空 空不能显示null |
| | |
| | | } |
| | | |
| | | private AjaxResult oldFun(String tjNumber) { |
| | | DictHosp dictHosp = dictHospService.list().get(0); |
| | | long startTime = System.currentTimeMillis(); |
| | | int num = tjOrderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); |
| | | if (num > 0) return AjaxResult.error("有延期项目暂不能生成报告!!!"); |
| | |
| | | // 设置正文字体样式:12号 |
| | | Font textFont = PdfUtils.setFont(9); |
| | | //创建表格 将表头字体和正文字体放进去 |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value); |
| | | PdfPTable table = PdfUtils.setTable(headFont, textFont, titles, value,dictHosp.equals("澄合矿务局中心医院")); |
| | | document.add(paragraph); |
| | | document.add(table); |
| | | |
| | |
| | | one.setStatus(TjConstants.TJ_CONFIRM); |
| | | } |
| | | one.setReportTime(null); |
| | | one.setCheckTime(null); |
| | | //将状态改为未审核 |
| | | // UpdateWrapper updateWrapper=new UpdateWrapper(); |
| | | // updateWrapper.eq("tj_number",tjNumber); |