S_Servlet完成

hechu1
zhai_lw 6 years ago
parent 331e9cbf34
commit 2bd6e8c4c9

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -1,6 +1,6 @@
package core.process;
import core.operation.UploadFileOperation;
import core.operation.UploadFile;
import error.GExcptInit;
import java.io.File;
@ -9,24 +9,24 @@ import java.util.Map;
public class C_StudentUploadOpeningReport extends TempProcess{
File openingReport;
String gaduationDesignId;
String graduationDesignId;
static String file_type = "opening_report";
public void uploadOpeningReport() throws Exception{
if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!");
UploadFileOperation uploadFileOperation=new UploadFileOperation();
uploadFileOperation.setOptions(new HashMap<>());
uploadFileOperation.addOptions("file",this.getOpeningReport());
uploadFileOperation.addOptions("file_type",file_type);
UploadFile uploadFile=new UploadFile();
uploadFile.setOptions(new HashMap<>());
uploadFile.addOptions("file",this.getOpeningReport());
uploadFile.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGaduationDesignId());
uploadFileOperation.addOptions("limits",limits);
uploadFileOperation.execute(null);
limits.put("id",this.getGraduationDesignId());
uploadFile.addOptions("limits",limits);
uploadFile.execute(null);
}
protected boolean check() {
if(this.getGaduationDesignId()==null||this.getOpeningReport()==null)
if(this.getGraduationDesignId()==null||this.getOpeningReport()==null)
return false;
return true;
}
@ -39,11 +39,11 @@ public class C_StudentUploadOpeningReport extends TempProcess{
this.openingReport = openingReport;
}
public String getGaduationDesignId() {
return gaduationDesignId;
public String getGraduationDesignId() {
return graduationDesignId;
}
public void setGaduationDesignId(String gaduationDesignId) {
this.gaduationDesignId = gaduationDesignId;
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
}

@ -9,7 +9,7 @@ import java.util.Map;
public class C_TeacherFillTopicInformation extends TempProcess{
String StudentId;
String studentId;
String mentor_opinion;
Date mentor_opinion_date;
@ -36,11 +36,11 @@ public class C_TeacherFillTopicInformation extends TempProcess{
return true;
}
public String getStudentId() {
return StudentId;
return studentId;
}
public void setStudentId(String studentId) {
StudentId = studentId;
this.studentId = studentId;
}
public String getMentor_opinion() {
return mentor_opinion;

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_CollegeFillOpeningReportOpinion")
public class S_CollegeFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_CollegeFillScoreOpinion")
public class S_CollegeFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_MentorFillOpeningReportOpinion")
public class S_MentorFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_MentorFillReview")
public class S_MentorFillReview extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_ReviewerFillReview")
public class S_ReviewerFillReview extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_SchoolFillScoreOpinion")
public class S_SchoolFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_SecretaryFillOpeningReportRecord")
public class S_SecretaryFillOpeningReportRecord extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_SecretaryFillReplyRecord")
@WebServlet(name = "secretary-fill-reply-record")
public class S_SecretaryFillReplyRecord extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
static String[] vName = {
""
};
}

@ -1,23 +1,29 @@
package servlet;
import core.user.User;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/student-fill-graduation-design-information")
public class S_StudentFillGraduationDesignInformation extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
String content1=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8");
String content2=request.getParameter("score");
try {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
} catch (Exception e) {
e.printStackTrace();
}
}
static String[] vName = {
"chinese_name",
"english_name",
"type_of_topic",
"source_of_design",
"nature_of_design",
"description_of_topic"
};
}

@ -13,13 +13,13 @@ import java.io.IOException;
public class S_StudentSelectTeacher extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
String teacher_id=request.getParameter("id");
String teacherId=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user");
String student_id=user.getId();
String studentId=user.getId();
try {
C_StudentSelectTeacher SST=new C_StudentSelectTeacher();
SST.setTeacherId(teacher_id);
SST.setStudentId(student_id);
SST.setTeacherId(teacherId);
SST.setStudentId(studentId);
SST.select();
} catch (Exception e) {
e.printStackTrace();

@ -1,19 +1,17 @@
package servlet;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(name = "S_StudentUploadFinishedProduct")
@WebServlet(name = "student-upload-finished-product")
@MultipartConfig
public class S_StudentUploadFinishedProduct extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -13,13 +13,13 @@ import java.io.IOException;
public class S_TeacherSelectStudent extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
String student_id=request.getParameter("id");
String studentId=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user");
String teacher_id=user.getId();
String teacherId=user.getId();
try {
C_TeacherSelectStudent TSS=new C_TeacherSelectStudent();
TSS.setTeacherId(teacher_id);
TSS.setStudentId(student_id);
TSS.setTeacherId(teacherId);
TSS.setStudentId(studentId);
TSS.select();
} catch (Exception e) {
e.printStackTrace();

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_TeacherTeamFillOpeningReportOpinion")
@WebServlet(name = "teacher-team-fill-opening-report-opinion")
public class S_TeacherTeamFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
static String[] vName = {
""
};
}

@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet(name = "S_TeacherFillTeamFillScoreOpinion")
public class S_TeacherFillTeamFillScoreOpinion extends HttpServlet {
@WebServlet(name = "S_TeacherTeamFillScoreOpinion")
public class S_TeacherTeamFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
static String[] vName = {
""
};
}

@ -1,4 +1,18 @@
package servlet;
import org.apache.coyote.Request;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Utils {
static Map<String,String> getVMap(String[] vName, HttpServletRequest request){
Map<String,String> vMap = new HashMap<>();
for(int i=0;i<vName.length;i++){
vMap.put(vName[i],request.getParameter(vName[i]));
}
return vMap;
}
}

Loading…
Cancel
Save