zgl
commit
c6e5983cef
@ -1,10 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="tomcat-lib">
|
||||
<CLASSES>
|
||||
<root url="file://C:/Program Files/Apache Software Foundation/Tomcat 8.5/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<jarDirectory url="file://C:/Program Files/Apache Software Foundation/Tomcat 8.5/lib" recursive="false" />
|
||||
</library>
|
||||
</component>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -1,22 +1,46 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Select;
|
||||
import error.GExcptInit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_StudentSelectTeacher extends core.process.Process {
|
||||
public void select(String studentID,String teacherID)throws Exception{
|
||||
public class C_StudentSelectTeacher extends TempProcess {
|
||||
String studentId;
|
||||
String teacherId;
|
||||
|
||||
public void select()throws Exception{
|
||||
if(!check()) throw new GExcptInit("ID Attrs init error!");
|
||||
Select select=new Select();
|
||||
select.setOptions(new HashMap<>());
|
||||
String student_id=studentID;
|
||||
select.addOptions("student_id",student_id);
|
||||
String teacher_id=teacherID;
|
||||
select.addOptions("teacher_id",teacher_id);
|
||||
select.addOptions("student_id",this.getStudentId());
|
||||
select.addOptions("teacher_id",this.getTeacherId());
|
||||
Map<String,Object> options=select.execute(null);
|
||||
}
|
||||
protected boolean check() {
|
||||
if(this.getStudentId()==null||this.getTeacherId()==null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public String getTeacherId() {
|
||||
return teacherId;
|
||||
}
|
||||
|
||||
public void setTeacherId(String teacherId) {
|
||||
this.teacherId = teacherId;
|
||||
}
|
||||
|
||||
public String getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(String studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.UploadFileOperation;
|
||||
import error.GExcptInit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_StudentUploadOpeningReport extends TempProcess{
|
||||
File openingReport;
|
||||
String gaduationDesignId;
|
||||
|
||||
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);
|
||||
Map<String, String>limits = new HashMap<>();
|
||||
limits.put("id",this.getGaduationDesignId());
|
||||
uploadFileOperation.addOptions("limits",limits);
|
||||
uploadFileOperation.execute(null);
|
||||
}
|
||||
|
||||
protected boolean check() {
|
||||
if(this.getGaduationDesignId()==null||this.getOpeningReport()==null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public File getOpeningReport() {
|
||||
return openingReport;
|
||||
}
|
||||
|
||||
public void setOpeningReport(File openingReport) {
|
||||
this.openingReport = openingReport;
|
||||
}
|
||||
|
||||
public String getGaduationDesignId() {
|
||||
return gaduationDesignId;
|
||||
}
|
||||
|
||||
public void setGaduationDesignId(String gaduationDesignId) {
|
||||
this.gaduationDesignId = gaduationDesignId;
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.FillInformation;
|
||||
import error.GExcptInit;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_TeacherFillTopicInformation extends TempProcess{
|
||||
|
||||
String StudentId;
|
||||
String mentor_opinion;
|
||||
Date mentor_opinion_date;
|
||||
|
||||
static String table="graduation_design_opening_report_opinion_record";
|
||||
|
||||
public void fillInformation() throws Exception{
|
||||
if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
|
||||
FillInformation fillInformation=new FillInformation();
|
||||
fillInformation.setOptions(new HashMap<>());
|
||||
fillInformation.addOptions("table",table);
|
||||
String date= mentor_opinion_date.toString();
|
||||
Map<String,String> vMap=new HashMap<>();
|
||||
vMap.put("mentor_opinion_date",date);
|
||||
vMap.put("mentor_opinion",this.getMentor_opinion());
|
||||
Map<String, String>limits = new HashMap<>();
|
||||
limits.put("id",this.getStudentId());
|
||||
fillInformation.addOptions("limits",limits);
|
||||
fillInformation.execute(null);
|
||||
|
||||
}
|
||||
protected boolean check() {
|
||||
if(this.getMentor_opinion()==null||this.getMentor_opinion_date()==null||this.getStudentId()==null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public String getStudentId() {
|
||||
return StudentId;
|
||||
}
|
||||
|
||||
public void setStudentId(String studentId) {
|
||||
StudentId = studentId;
|
||||
}
|
||||
public String getMentor_opinion() {
|
||||
return mentor_opinion;
|
||||
}
|
||||
|
||||
public void setMentor_opinion(String mentor_opinion) {
|
||||
this.mentor_opinion = mentor_opinion;
|
||||
}
|
||||
|
||||
public Date getMentor_opinion_date() {
|
||||
return mentor_opinion_date;
|
||||
}
|
||||
|
||||
public void setMentor_opinion_date(Date mentor_opinion_date) {
|
||||
this.mentor_opinion_date = mentor_opinion_date;
|
||||
}
|
||||
|
||||
}
|
@ -1,33 +1,46 @@
|
||||
package core.process;
|
||||
|
||||
import core.operation.Select;
|
||||
import error.GExcptInit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class C_TeacherSelectStudent extends Process {
|
||||
List<String> list;
|
||||
public class C_TeacherSelectStudent extends TempProcess {
|
||||
String studentId;
|
||||
String teacherId;
|
||||
|
||||
public C_TeacherSelectStudent clone(){
|
||||
C_TeacherSelectStudent tst = new C_TeacherSelectStudent();
|
||||
tst.setInfo( this.getInfo());
|
||||
List<String> list = new ArrayList<>();
|
||||
for(String s:this.list){
|
||||
list.add(new String(s));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void select(String teacherID,String studentID)throws Exception{
|
||||
public void select()throws Exception{
|
||||
if(!check()) throw new GExcptInit("ID Attrs init error!");
|
||||
Select select=new Select();
|
||||
select.setOptions(new HashMap<>());
|
||||
String teacher_id=teacherID;
|
||||
select.addOptions("teacher_id",teacher_id);
|
||||
String student_id=studentID;
|
||||
select.addOptions("student_id",student_id);
|
||||
select.addOptions("teacher_id",this.getTeacherId());
|
||||
select.addOptions("student_id",this.getStudentId());
|
||||
Map<String,Object> options=select.execute(null);
|
||||
}
|
||||
protected boolean check() {
|
||||
if(this.getStudentId()==null||this.getTeacherId()==null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public String getTeacherId() {
|
||||
return teacherId;
|
||||
}
|
||||
|
||||
public void setTeacherId(String teacherId) {
|
||||
this.teacherId = teacherId;
|
||||
}
|
||||
|
||||
public String getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(String studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,22 +1,25 @@
|
||||
package servlet;
|
||||
package servlet.Select;
|
||||
|
||||
import core.process.C_StudentSearchTeacher;
|
||||
import core.process.C_StudentSelectTeacher;
|
||||
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;
|
||||
|
||||
@WebServlet("/studentselectteacher")
|
||||
public class S_StudentSelectTeacher extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
String student_id=request.getParameter("id");
|
||||
String teacher_id=request.getParameter("id");
|
||||
User user=(User)request.getSession().getAttribute("user");
|
||||
String teacher_id=user.getId();
|
||||
String student_id=user.getId();
|
||||
try {
|
||||
new C_StudentSelectTeacher().select(student_id,teacher_id);
|
||||
C_StudentSelectTeacher test=new C_StudentSelectTeacher();
|
||||
test.setTeacherId(teacher_id);
|
||||
test.setStudentId(student_id);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
@ -1,22 +1,25 @@
|
||||
package servlet;
|
||||
package servlet.Select;
|
||||
|
||||
import core.process.C_TeacherSelectStudent;
|
||||
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;
|
||||
|
||||
@WebServlet("/teacherselectstudent")
|
||||
public class S_TeacherSelectStudent extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
String teacher_id=request.getParameter("id");
|
||||
String student_id=request.getParameter("id");
|
||||
User user=(User)request.getSession().getAttribute("user");
|
||||
String student_id=user.getId();
|
||||
String teacher_id=user.getId();
|
||||
try {
|
||||
new C_TeacherSelectStudent().select(teacher_id,student_id);
|
||||
C_TeacherSelectStudent test=new C_TeacherSelectStudent();
|
||||
test.setTeacherId(teacher_id);
|
||||
test.setStudentId(student_id);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package servlet.Submit;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
public class S_ScoreSubmit extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
String score = request.getParameter("score");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package servlet.Submit;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
public class S_StudentFillTopicInformation 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 {
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package servlet.Submit;
|
||||
|
||||
import core.user.User;
|
||||
|
||||
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 javax.servlet.http.Part;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
@WebServlet("/upload")
|
||||
@MultipartConfig
|
||||
//学生id+文件
|
||||
public class S_StudentUploadOpeningReport extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
User user=(User) request.getSession().getAttribute("user");
|
||||
String student_id=user.getId();
|
||||
|
||||
try {
|
||||
|
||||
//获取上传的文件
|
||||
Part part=request.getPart("file");
|
||||
//获取请求的信息
|
||||
String name=part.getHeader("content-disposition");
|
||||
//获取上传文件的目录
|
||||
String root=request.getServletContext().getRealPath("/upload");
|
||||
|
||||
|
||||
request.setAttribute("info", "上传文件成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
request.setAttribute("info", "上传文件失败");
|
||||
}
|
||||
|
||||
request.getRequestDispatcher("/upload.jsp").forward(request, response);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package servlet.Submit;
|
||||
|
||||
|
||||
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;
|
||||
@WebServlet("/textsubmit")
|
||||
public class S_TextSubmit extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
String content=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8");
|
||||
String score=request.getParameter("score");
|
||||
try {
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package servlet.account;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
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 core.user.Student;
|
||||
import core.user.User;
|
||||
import core.user.utils.AccountManagement;
|
||||
import error.GExcptAccount;
|
||||
import error.GExcptSQL;
|
||||
|
||||
@WebServlet("/login")
|
||||
public class S_Login extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
String id=request.getParameter("id");
|
||||
String password=request.getParameter("password");
|
||||
User user = null;
|
||||
try {
|
||||
user = AccountManagement.login(id,password);
|
||||
} catch (GExcptSQL | SQLException gExcptSQL) {
|
||||
gExcptSQL.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
} catch (GExcptAccount gExcptAccount) {
|
||||
gExcptAccount.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
}
|
||||
request.getSession().setAttribute("user",user);
|
||||
response.sendRedirect("/home.jsp");
|
||||
return;
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
package servlet.account;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
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 core.user.Student;
|
||||
import core.user.User;
|
||||
import core.user.utils.AccountManagement;
|
||||
import error.GExcptAccount;
|
||||
import error.GExcptSQL;
|
||||
|
||||
@WebServlet("/login")
|
||||
public class login extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
String id=request.getParameter("id");
|
||||
String password=request.getParameter("password");
|
||||
User user = null;
|
||||
try {
|
||||
user = AccountManagement.login(id,password);
|
||||
} catch (GExcptSQL | SQLException gExcptSQL) {
|
||||
gExcptSQL.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
} catch (GExcptAccount gExcptAccount) {
|
||||
gExcptAccount.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.sendRedirect("/op_fail.jsp");
|
||||
return;
|
||||
}
|
||||
request.getSession().setAttribute("user",user);
|
||||
response.sendRedirect("/home.jsp");
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue