From 783cf90c9a1485769d15d21b3330ff0764fb0d8a Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Wed, 28 Aug 2024 08:59:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecg-module-main/pom.xml | 4 ++ .../controller/ZyInfoStudentController.java | 63 ++++++++----------- 2 files changed, 29 insertions(+), 38 deletions(-) diff --git a/jeecg-module-main/pom.xml b/jeecg-module-main/pom.xml index 40174c51..fea213ae 100644 --- a/jeecg-module-main/pom.xml +++ b/jeecg-module-main/pom.xml @@ -80,6 +80,10 @@ hutool-http ${hutool.version} + + org.springframework + spring-test + 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 5834c8ef..e7ad55f8 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 @@ -484,44 +484,31 @@ public class ZyInfoStudentController extends JeecgController map = zykService.saveToStufile(zykInfo); - String fileName = map.get("data"); - String pdfName = map.get("pdfData"); - zyInfoStudent.setFilePath(fileName); - zyInfoStudent.setPdfPath(pdfName); - -// if(StringUtils.equals("local",uploadType)){ -// 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); -// }else{ -// ZykInfo zykInfo = new ZykInfo(); -// zykInfo.setBizId(zyInfoStudent.getId()); -// zykInfo.setBizTable("zy_jxdg"); -// zykInfo.setWjlx(WjlxEnum.JXDG.getType()); -// zykInfo.setRwbh(zyInfo.getRwbh()); -// zykInfo.setFileName(zyInfoStudent.getFilePath()); -// Map map = zykService.saveToZykJxdg(zykInfo); -// String fileName = map.get("data"); -// String pdfName = map.get("pdfData"); -// zyInfoStudent.setFilePath(fileName); -// zyInfoStudent.setPdfPath(pdfName); -// } + if(StringUtils.equals("local",uploadType)){ + 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); + }else{ + ZykInfo zykInfo = new ZykInfo(); + zykInfo.setBizId(zyInfoStudent.getId()); + zykInfo.setBizTable("zy_jxdg"); + zykInfo.setWjlx(WjlxEnum.JXDG.getType()); + zykInfo.setRwbh(zyInfo.getRwbh()); + zykInfo.setFileName(zyInfoStudent.getFilePath()); + Map map = zykService.saveToZykJxdg(zykInfo); + String fileName = map.get("data"); + String pdfName = map.get("pdfData"); + zyInfoStudent.setFilePath(fileName); + zyInfoStudent.setPdfPath(pdfName); + } } zyInfoStudent.setPublishTime(new Date()); boolean bol = zyInfoStudentService.updateById(zyInfoStudent, response);