From b03a5458949099b6b20ff1d6a175fae777de53ab Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Wed, 9 Oct 2024 08:50:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SyncZyStudentPdf.java | 6 ++-- .../controller/ZyInfoStudentController.java | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncZyStudentPdf.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncZyStudentPdf.java index 2ef08070..75690c73 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncZyStudentPdf.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/grab/SynchronizationService/SyncZyStudentPdf.java @@ -11,7 +11,7 @@ import org.jeecg.modules.kc.zyInfoScjl.entity.ZyInfoScjl; import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent; import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService; import org.jeecg.modules.tools.Global; -import org.jeecg.modules.tools.pdf.PDFUtil; +import org.jeecg.modules.tools.office.pdf.PDFUtil; import org.quartz.JobExecutionContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -58,7 +58,9 @@ public class SyncZyStudentPdf extends BaseSync { System.out.println("filPath:"+zyInfoStudent.getFilePath()); System.out.println("docPath:"+docPath); System.out.println("pdfPath:"+pdfPath); - PDFUtil.office2PDF(docPath,pdfPath); + + PDFUtil pdfUtil = SpringContextHolder.getBean(PDFUtil.class); + pdfUtil.office2PDF(docPath,pdfPath); zyInfoStudent.setPdfPath("contract/"+namePath); zyInfoStudent.setPublishTime(new Date()); zyInfoStudentService.updateById(zyInfoStudent); diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/controller/ZyInfoStudentController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/controller/ZyInfoStudentController.java index 41870f2e..578dffa5 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/controller/ZyInfoStudentController.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfoStudent/controller/ZyInfoStudentController.java @@ -952,4 +952,32 @@ public class ZyInfoStudentController extends JeecgController SyncZyStudentPdf() { + List ybtkblist = zyInfoStudentService.getDocNoPdfList(); + for(ZyInfoStudent zyInfoStudent:ybtkblist){ + try { + Global global = SpringContextHolder.getBean(Global.class); + FileUtil.mkdir(global.getContractDickPath()); + String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); + String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath(); + String namePath = dd + ".pdf"; + String pdfPath = global.getContractDickPath() + namePath; + System.out.println("filPath:"+zyInfoStudent.getFilePath()); + System.out.println("docPath:"+docPath); + System.out.println("pdfPath:"+pdfPath); + PDFUtil.office2PDF(docPath,pdfPath); + zyInfoStudent.setPdfPath("contract/"+namePath); + zyInfoStudent.setPublishTime(new Date()); + zyInfoStudentService.updateById(zyInfoStudent); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + return Result.OK("批阅完成!"); + } + + }