修改学生提交功能

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>
<version>${hutool.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
<build>
<plugins>

View File

@ -484,44 +484,31 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
if(StringUtils.equals("pdf",nameLast)){
zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath());
}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.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<String,String> 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<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());
boolean bol = zyInfoStudentService.updateById(zyInfoStudent, response);