Merge remote-tracking branch 'remotes/origin/wmj'

# Conflicts:
#	src/core/process/C_CollegeFillScoreOpinion.java
#	src/core/process/C_MentorFillOpeningReportOpinion.java
#	src/core/process/C_MentorFillReview.java
#	src/core/process/C_ReviewerFillReview.java
#	src/core/process/C_SchoolFillScoreOpinion.java
#	src/core/process/C_SecretaryFillOpeningReportRecord.java
#	src/core/process/C_SecretaryFillReplyRecord.java
#	src/core/process/C_TeacherTeamFillOpeningReportOpinion.java
#	src/core/process/C_TeacherTeamFillScoreOpinion.java
master
zhai_lw 6 years ago
parent e2102ef75a
commit e9a34cee95

@ -4,13 +4,12 @@ import core.operation.UploadFile;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL; import error.GExcptSQL;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_StudentUploadFinishedProduct extends C_UploadFile { public class C_StudentUploadFinishedProduct extends C_UploadFile {
File finishedProduct; String finishedProductURL;
String graduationDesignId; String graduationDesignId;
private static String buttonName ="提交定稿"; private static String buttonName ="提交定稿";
private static String iconURL="../cssFile/images/upload.png"; private static String iconURL="../cssFile/images/upload.png";
@ -21,11 +20,11 @@ public class C_StudentUploadFinishedProduct extends C_UploadFile {
private static String field ="finished_product_status"; private static String field ="finished_product_status";
static String file_type = "finished_product"; static String file_type = "finished_product";
public void uploadOpeningReport() throws Exception{ public void uploadFinishedProduct() throws Exception{
if(!check()) throw new GExcptInit("Upload FinishedProduct Attrs init error!"); if(!check()) throw new GExcptInit("Upload FinishedProduct Attrs init error!");
UploadFile uploadFile=new UploadFile(); UploadFile uploadFile=new UploadFile();
uploadFile.setOptions(new HashMap<>()); uploadFile.setOptions(new HashMap<>());
uploadFile.addOptions("file",this.getFinishedProduct()); uploadFile.addOptions("file_url",this.getFinishedProductURL());
uploadFile.addOptions("file_type",file_type); uploadFile.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
@ -35,16 +34,16 @@ public class C_StudentUploadFinishedProduct extends C_UploadFile {
} }
protected boolean check() { protected boolean check() {
if(this.getFinishedProduct()==null||this.getGraduationDesignId()==null) if(this.getFinishedProductURL()==null||this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
public File getFinishedProduct() { public String getFinishedProductURL() {
return finishedProduct; return finishedProductURL;
} }
public void setFinishedProduct(File finishedProduct) { public void setFinishedProductURL(String finishedProductURL) {
this.finishedProduct = finishedProduct; this.finishedProductURL = finishedProductURL;
} }
public String getGraduationDesignId() { public String getGraduationDesignId() {
return graduationDesignId; return graduationDesignId;

@ -9,7 +9,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_StudentUploadOpeningReport extends C_UploadFile{ public class C_StudentUploadOpeningReport extends C_UploadFile{
File openingReport; String openingReportURL;
String graduationDesignId; String graduationDesignId;
private static String buttonName ="提交开题报告"; private static String buttonName ="提交开题报告";
private static String file_type = "opening_report"; private static String file_type = "opening_report";
@ -24,7 +24,7 @@ public class C_StudentUploadOpeningReport extends C_UploadFile{
if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!"); if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!");
UploadFile uploadFileOperation=new UploadFile(); UploadFile uploadFileOperation=new UploadFile();
uploadFileOperation.setOptions(new HashMap<>()); uploadFileOperation.setOptions(new HashMap<>());
uploadFileOperation.addOptions("file",this.getOpeningReport()); uploadFileOperation.addOptions("file_url",this.getOpeningReportURL());
uploadFileOperation.addOptions("file_type",file_type); uploadFileOperation.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
@ -34,17 +34,17 @@ public class C_StudentUploadOpeningReport extends C_UploadFile{
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getOpeningReport()==null) if(this.getGraduationDesignId()==null||this.getOpeningReportURL()==null)
return false; return false;
return true; return true;
} }
public File getOpeningReport() { public String getOpeningReportURL() {
return openingReport; return openingReportURL;
} }
public void setOpeningReport(File openingReport) { public void setOpeningReportURL(String openingReportURL) {
this.openingReport = openingReport; this.openingReportURL = openingReportURL;
} }
public String getGraduationDesignId() { public String getGraduationDesignId() {

@ -1,5 +1,7 @@
package servlet; package servlet;
import core.process.C_StudentUploadFinishedProduct;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
@ -14,7 +16,7 @@ public class S_StudentUploadFinishedProduct extends HttpServlet {
static String fileType = "graduation_design_finished_product"; static String fileType = "graduation_design_finished_product";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
String fileURL; String fileURL = null;
try { try {
fileURL = servlet.Utils.saveFile(request, fileType); fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e) }catch (Exception e)
@ -22,5 +24,14 @@ public class S_StudentUploadFinishedProduct extends HttpServlet {
System.out.print(e); System.out.print(e);
response.sendRedirect("/op_fail.jsp"); response.sendRedirect("/op_fail.jsp");
} }
C_StudentUploadFinishedProduct p =new C_StudentUploadFinishedProduct();
p.setFinishedProductURL(fileURL);
p.setGraduationDesignId(id);
try {
p.uploadFinishedProduct();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
} }
} }

@ -1,6 +1,6 @@
package servlet; package servlet;
import core.user.User; import core.process.C_StudentUploadOpeningReport;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
@ -8,9 +8,7 @@ import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.io.IOException; import java.io.IOException;
import java.util.UUID;
@WebServlet("/home/student-upload-opening-report") @WebServlet("/home/student-upload-opening-report")
@MultipartConfig @MultipartConfig
@ -18,6 +16,22 @@ public class S_StudentUploadOpeningReport extends HttpServlet {
static String fileType = "graduation_design_opening_report"; static String fileType = "graduation_design_opening_report";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
//String fileURL = servlet.Utils.saveFile(request, fileType); String fileURL = null;
try {
fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e)
{
System.out.print(e);
response.sendRedirect("/op_fail.jsp");
}
C_StudentUploadOpeningReport p =new C_StudentUploadOpeningReport();
p.setOpeningReportURL(fileURL);
p.setGraduationDesignId(id);
try {
p.uploadOpeningReport();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
} }
} }

Loading…
Cancel
Save