修改学生提交功能

This commit is contained in:
yangjun 2024-08-28 08:59:39 +08:00
parent fed517eede
commit 783cf90c9a
2 changed files with 29 additions and 38 deletions

View File

@ -80,6 +80,10 @@
<artifactId>hutool-http</artifactId> <artifactId>hutool-http</artifactId>
<version>${hutool.version}</version> <version>${hutool.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>

View File

@ -484,44 +484,31 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath()); zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath());
}else{ }else{
//目前作业都需要上传到文件服务器 if(StringUtils.equals("local",uploadType)){
ZykInfo zykInfo = new ZykInfo(); Global global = SpringContextHolder.getBean(Global.class);
zykInfo.setBizId(zyInfoStudent.getId()); FileUtil.mkdir(global.getContractDickPath());
zykInfo.setBizTable("zy_jxdg"); String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
zykInfo.setWjlx(WjlxEnum.JXDG.getType()); String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath();
zykInfo.setRwbh(zyInfo.getRwbh()); String namePath = dd + ".pdf";
zykInfo.setFileName(zyInfoStudent.getFilePath()); String pdfPath = global.getContractDickPath() + namePath;
Map<String,String> map = zykService.saveToStufile(zykInfo); System.out.println("filPath:"+zyInfoStudent.getFilePath());
String fileName = map.get("data"); System.out.println("docPath:"+docPath);
String pdfName = map.get("pdfData"); System.out.println("pdfPath:"+pdfPath);
zyInfoStudent.setFilePath(fileName); PDFUtil.office2PDF(docPath,pdfPath);
zyInfoStudent.setPdfPath(pdfName); zyInfoStudent.setPdfPath("contract/"+namePath);
}else{
// if(StringUtils.equals("local",uploadType)){ ZykInfo zykInfo = new ZykInfo();
// Global global = SpringContextHolder.getBean(Global.class); zykInfo.setBizId(zyInfoStudent.getId());
// FileUtil.mkdir(global.getContractDickPath()); zykInfo.setBizTable("zy_jxdg");
// String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); zykInfo.setWjlx(WjlxEnum.JXDG.getType());
// String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath(); zykInfo.setRwbh(zyInfo.getRwbh());
// String namePath = dd + ".pdf"; zykInfo.setFileName(zyInfoStudent.getFilePath());
// String pdfPath = global.getContractDickPath() + namePath; Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
// System.out.println("filPath:"+zyInfoStudent.getFilePath()); String fileName = map.get("data");
// System.out.println("docPath:"+docPath); String pdfName = map.get("pdfData");
// System.out.println("pdfPath:"+pdfPath); zyInfoStudent.setFilePath(fileName);
// PDFUtil.office2PDF(docPath,pdfPath); zyInfoStudent.setPdfPath(pdfName);
// 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<String,String> map = zykService.saveToZykJxdg(zykInfo);
// String fileName = map.get("data");
// String pdfName = map.get("pdfData");
// zyInfoStudent.setFilePath(fileName);
// zyInfoStudent.setPdfPath(pdfName);
// }
} }
zyInfoStudent.setPublishTime(new Date()); zyInfoStudent.setPublishTime(new Date());
boolean bol = zyInfoStudentService.updateById(zyInfoStudent, response); boolean bol = zyInfoStudentService.updateById(zyInfoStudent, response);