From 14ecea8537d5b29ca64c75aad4ff49265018415d Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期三, 02 七月 2025 08:51:22 +0800 Subject: [PATCH] zjh20250702 --- ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java index 28f5057..c4ec1cf 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/ReportController.java @@ -21,6 +21,7 @@ import com.ltkj.hosp.sqlDomain.LtkjHysqd; import com.ltkj.hosp.vodomain.ShenGaoTiZhongVo; import com.ltkj.mall.mallOrderUtils.TjConstants; +import com.ltkj.system.service.ISysConfigService; import com.ltkj.web.config.pdfutils.PDFBinaryUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -75,8 +76,8 @@ private IDictCompService compService; @Resource private ITjReportTemplateService reportTemplateService; - @Value("${path.filePath}") - private String value; +// @Value("${path.filePath}") +// private String value; @Resource private LtkjHybgdService ltkjHybgdService; @Resource @@ -85,6 +86,8 @@ private LtkjExamJcbgdService jcbgdService; @Resource private LtkjExamJcsqdService jcsqdService; + @Autowired + private ISysConfigService configService; /** @@ -425,7 +428,7 @@ wq1.eq(TjOrder::getTjNumber, tjNumber); TjOrder tjOrder = orderService.getOne(wq1); - + String value = configService.selectConfigByKey("path_filePath"); LambdaQueryWrapper<TjCustomer> wq2 = new LambdaQueryWrapper<>(); wq2.eq(TjCustomer::getCusId, tjOrder.getUserId()); TjCustomer tjCustomer = customerService.getOne(wq2); @@ -442,9 +445,9 @@ final String substring = uuid.toString().substring(0, 5); // String userId = SecurityUtils.getLoginUser().getUsername(); - PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + "\\" + substring + tjNumber + tjCustomer.getCusName() + "_浣撴鎶ュ憡.pdf"); + PDFBinaryUtil.base64StringToPDF(one.getReport(), FileUtil.mkdir(value).getPath() + File.separator + substring + tjNumber + tjCustomer.getCusName() + "_浣撴鎶ュ憡.pdf"); //String filePath = one.getPath(); - String filePath = value + "\\" + substring + tjNumber + tjCustomer.getCusName() + "_浣撴鎶ュ憡.pdf"; + String filePath = value + File.separator + substring + tjNumber + tjCustomer.getCusName() + "_浣撴鎶ュ憡.pdf"; File f = new File(filePath); if (filePath.isEmpty()) { System.out.println("鏂囦欢涓嶅瓨鍦紒"); -- Gitblit v1.8.0