Merge remote-tracking branches 'remotes/origin/wlf', 'remotes/origin/wmj' and 'remotes/origin/zgl'

zgl
zhai_lw 6 years ago
commit c6e5983cef

@ -9,6 +9,7 @@
</element> </element>
<element id="directory" name="lib"> <element id="directory" name="lib">
<element id="file-copy" path="C:/Program Files/apache-tomcat-9.0.13/lib/tomcat-jdbc.jar" /> <element id="file-copy" path="C:/Program Files/apache-tomcat-9.0.13/lib/tomcat-jdbc.jar" />
<element id="library" level="project" name="lib" />
</element> </element>
</element> </element>
</root> </root>

@ -1738,77 +1738,77 @@
<DataType>char(1)|0s</DataType> <DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<key id="420" parent="337" name="PRIMARY"> <column id="420" parent="337" name="opening_report_mentor_opinion_status">
<Position>9</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="421" parent="337" name="opening_report_teacher_team_opinion_status">
<Position>10</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="422" parent="337" name="opening_report_college_opinion_status">
<Position>11</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="423" parent="337" name="opening_report_secretary_record_status">
<Position>12</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<key id="424" parent="337" name="PRIMARY">
<NameSurrogate>1</NameSurrogate> <NameSurrogate>1</NameSurrogate>
<ColNames>id</ColNames> <ColNames>id</ColNames>
<Primary>1</Primary> <Primary>1</Primary>
</key> </key>
<column id="421" parent="338" name="id"> <column id="425" parent="338" name="id">
<Position>1</Position> <Position>1</Position>
<DataType>char(20)|0s</DataType> <DataType>char(20)|0s</DataType>
<NotNull>1</NotNull> <NotNull>1</NotNull>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="422" parent="338" name="mentor_opinion"> <column id="426" parent="338" name="mentor_opinion">
<Position>2</Position> <Position>2</Position>
<DataType>text|0s</DataType> <DataType>text|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="423" parent="338" name="mentor_opinion_date"> <column id="427" parent="338" name="mentor_opinion_date">
<Position>3</Position> <Position>3</Position>
<DataType>date|0s</DataType> <DataType>date|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="424" parent="338" name="secretary_record"> <column id="428" parent="338" name="secretary_record">
<Position>4</Position> <Position>4</Position>
<DataType>text|0s</DataType> <DataType>text|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="425" parent="338" name="secretary_record_date"> <column id="429" parent="338" name="secretary_record_date">
<Position>5</Position> <Position>5</Position>
<DataType>date|0s</DataType> <DataType>date|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="426" parent="338" name="report_teacher_team_opinion"> <column id="430" parent="338" name="report_teacher_team_opinion">
<Position>6</Position> <Position>6</Position>
<DataType>text|0s</DataType> <DataType>text|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="427" parent="338" name="report_teacher_team_opinion_date"> <column id="431" parent="338" name="report_teacher_team_opinion_date">
<Position>7</Position> <Position>7</Position>
<DataType>date|0s</DataType> <DataType>date|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="428" parent="338" name="college_opinion"> <column id="432" parent="338" name="college_opinion">
<Position>8</Position> <Position>8</Position>
<DataType>text|0s</DataType> <DataType>text|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="429" parent="338" name="college_opinion_date"> <column id="433" parent="338" name="college_opinion_date">
<Position>9</Position> <Position>9</Position>
<DataType>date|0s</DataType> <DataType>date|0s</DataType>
<ColumnKind>normal</ColumnKind> <ColumnKind>normal</ColumnKind>
</column> </column>
<column id="430" parent="338" name="opening_report_mentor_opinion_status">
<Position>10</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="431" parent="338" name="opening_report_teacher_team_opinion_status">
<Position>11</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="432" parent="338" name="opening_report_college_opinion_status">
<Position>12</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<column id="433" parent="338" name="opening_report_secretary_record_status">
<Position>13</Position>
<DataType>char(1)|0s</DataType>
<ColumnKind>normal</ColumnKind>
</column>
<key id="434" parent="338" name="PRIMARY"> <key id="434" parent="338" name="PRIMARY">
<NameSurrogate>1</NameSurrogate> <NameSurrogate>1</NameSurrogate>
<ColNames>id</ColNames> <ColNames>id</ColNames>

@ -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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

@ -17,10 +17,18 @@
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5.37" level="application_server_libraries" /> <orderEntry type="library" exported="" name="lib" level="project" />
<orderEntry type="library" name="lib" level="project" /> <orderEntry type="library" exported="" scope="PROVIDED" name="Tomcat 9.0.13" level="application_server_libraries" />
<orderEntry type="library" name="tomcat-lib" level="project" /> <orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/out/artifacts/GDMS_war_exploded/WEB-INF/lib/tomcat-jdbc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>

@ -1,24 +1,29 @@
package core.process; package core.process;
import core.operation.Search; import core.operation.Search;
import error.GExcptInit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_StudentSearchTeacher { public class C_StudentSearchTeacher extends TempProcess{
String teacherID;
static String table = "teacher";
Map<String,String> TeacherInfo=new HashMap<String, String>(); Map<String,String> TeacherInfo=new HashMap<String, String>();
public Map<String,String> search(String teacherID) throws Exception { public Map<String,String> search() throws Exception {
if(!check()) throw new GExcptInit("teacherID Attrs init error!");
Search search = new Search() ; Search search = new Search() ;
search.setOptions(new HashMap<>()); search.setOptions(new HashMap<>());
String table = "teacher";
search.addOptions("table",table); search.addOptions("table",table);
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
fields.add("*"); fields.add("*");
search.addOptions("field",fields); search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>(); Map<String,String> limits = new HashMap<>();
limits.put("id",teacherID); limits.put("id",this.getTeacherID());
search.addOptions("limits",limits); search.addOptions("limits",limits);
search.addOptions("start",0); search.addOptions("start",0);
search.addOptions("end",1); search.addOptions("end",1);
@ -27,6 +32,20 @@ public class C_StudentSearchTeacher {
String[] s = result.get(0); String[] s = result.get(0);
TeacherInfo.put("id",s[0]); TeacherInfo.put("id",s[0]);
TeacherInfo.put("name",s[2]); TeacherInfo.put("name",s[2]);
TeacherInfo.put("e_mail_location",s[3]);
TeacherInfo.put("phone_number",s[4]);
return TeacherInfo; return TeacherInfo;
} }
protected boolean check() {
if(this.getTeacherID()==null)
return false;
return true;
}
public String getTeacherID(){
return teacherID;
}
public void setTeacherID(String teacherID){
this.teacherID=teacherID;
}
} }

@ -1,22 +1,46 @@
package core.process; package core.process;
import core.operation.Select; import core.operation.Select;
import error.GExcptInit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_StudentSelectTeacher extends core.process.Process { public class C_StudentSelectTeacher extends TempProcess {
public void select(String studentID,String teacherID)throws Exception{ String studentId;
String teacherId;
public void select()throws Exception{
if(!check()) throw new GExcptInit("ID Attrs init error!");
Select select=new Select(); Select select=new Select();
select.setOptions(new HashMap<>()); select.setOptions(new HashMap<>());
String student_id=studentID; select.addOptions("student_id",this.getStudentId());
select.addOptions("student_id",student_id); select.addOptions("teacher_id",this.getTeacherId());
String teacher_id=teacherID;
select.addOptions("teacher_id",teacher_id);
Map<String,Object> options=select.execute(null); 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,24 +1,29 @@
package core.process; package core.process;
import core.operation.Search; import core.operation.Search;
import error.GExcptInit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_TeacherSearchStudent { public class C_TeacherSearchStudent extends TempProcess {
Map<String,String> StudentInfo=new HashMap<String,String>(); String studentId;
public Map<String,String> search(String studentID) throws Exception{
static String table="student";
Map<String,String> StudentInfo=new HashMap<String, String>();
public Map<String,String> search() throws Exception{
if(!check()) throw new GExcptInit("studentId Attrs init error!");
Search search = new Search() ; Search search = new Search() ;
search.setOptions(new HashMap<>()); search.setOptions(new HashMap<>());
String table = "student";
search.addOptions("table",table); search.addOptions("table",table);
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
fields.add("*"); fields.add("*");
search.addOptions("field",fields); search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>(); Map<String,String> limits = new HashMap<>();
limits.put("id",studentID); limits.put("id",this.getStudentId());
search.addOptions("limits",limits); search.addOptions("limits",limits);
search.addOptions("start",0); search.addOptions("start",0);
search.addOptions("end",1); search.addOptions("end",1);
@ -27,6 +32,20 @@ public class C_TeacherSearchStudent {
String[] s = result.get(0); String[] s = result.get(0);
StudentInfo.put("id",s[0]); StudentInfo.put("id",s[0]);
StudentInfo.put("name",s[2]); StudentInfo.put("name",s[2]);
StudentInfo.put("e_mail_location",s[3]);
StudentInfo.put("phone_number",s[4]);
return StudentInfo; return StudentInfo;
} }
protected boolean check() {
if(this.getStudentId()==null)
return false;
return true;
}
public String getStudentId(){
return studentId;
}
public void setStudentId(String studentId){
this.studentId=studentId;
}
} }

@ -1,33 +1,46 @@
package core.process; package core.process;
import core.operation.Select; import core.operation.Select;
import error.GExcptInit;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_TeacherSelectStudent extends Process { public class C_TeacherSelectStudent extends TempProcess {
List<String> list; String studentId;
String teacherId;
public C_TeacherSelectStudent clone(){ public void select()throws Exception{
C_TeacherSelectStudent tst = new C_TeacherSelectStudent(); if(!check()) throw new GExcptInit("ID Attrs init error!");
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{
Select select=new Select(); Select select=new Select();
select.setOptions(new HashMap<>()); select.setOptions(new HashMap<>());
String teacher_id=teacherID; select.addOptions("teacher_id",this.getTeacherId());
select.addOptions("teacher_id",teacher_id); select.addOptions("student_id",this.getStudentId());
String student_id=studentID;
select.addOptions("student_id",student_id);
Map<String,Object> options=select.execute(null); 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;
}
} }

@ -13,6 +13,7 @@ public abstract class Process{
protected static String targetURL; protected static String targetURL;
protected static String iconURL; protected static String iconURL;
protected abstract boolean check();
public String getPermission() { public String getPermission() {
return permission; return permission;
} }

@ -5,7 +5,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import error.GExcptSQL; import error.GExcptSQL;
import gdms.Configuration; import gdms.Configuration;
import org.apache.tomcat.jdbc.pool.DataSource; import org.apache.tomcat.jdbc.pool.DataSource;
@ -60,19 +59,32 @@ public class DBManagement {
public static Map<String,String> graduationDesignStudentTables = new HashMap<>(){ public static Map<String,String> graduationDesignStudentTables = new HashMap<>(){
{ {
put("graduation_design.student_id","graduation_design.student_chooser_teacher_status"); put("graduation_design.student_id","graduation_design.student_chooser_teacher_status");
put("graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status");
put("graduation_design.student_id","graduation_design_opening_report.opening_report_status");
put("opening_report_secretary_team.leader_student_id",""); put("opening_report_secretary_team.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("opening_report_secretary_team.student1_id",""); put("opening_report_secretary_team.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("opening_report_secretary_team.student2_id",""); put("opening_report_secretary_team.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("reply_secretary_team.leader_student_id",""); put("graduation_design.student_id","graduation_design_finished_product.finished_product_status");
put("reply_secretary_team.student1_id",""); put("reply_secretary_team.leader_student_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
put("reply_secretary_team.student2_id",""); put("reply_secretary_team.teacher1_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
put("reply_secretary_team.teacher2_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
} }
}; };
public static Map<String,String> graduationDesignTeacherTables = new HashMap<>(){ public static Map<String,String> graduationDesignTeacherTables = new HashMap<>(){
{ {
put("",""); put("graduation_design.teacher_id","graduation_design.teacher_choose_student_status");
put("graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status");
put("opening_report_teacher_team.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("opening_report_teacher_team.teacher1_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("opening_report_teacher_team.teacher2_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("graduation_design_opening_report_opinion_record.opening_report_college_teacher_id","graduation_design_opening_report_opinion_record.opening_report_college_opinion_status");
put("graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status");
put("graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status");
put("reply_teacher_team.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("reply_teacher_team. teacher1_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("reply_teacher_team. teacher2_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("graduation_design_reply_opinion_record_score.reply_college_teacher_id","graduation_design_reply_opinion_record_score.reply_college_score_status");
put("graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_score_status");
} }
}; };
public static String driverClassName="org.mariadb.jdbc.Driver"; public static String driverClassName="org.mariadb.jdbc.Driver";

@ -1,22 +1,25 @@
package servlet; package servlet.Select;
import core.process.C_StudentSearchTeacher; import core.process.C_StudentSearchTeacher;
import core.process.C_StudentSelectTeacher; import core.process.C_StudentSelectTeacher;
import core.user.User; import core.user.User;
import javax.servlet.ServletException; import javax.servlet.ServletException;
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 java.io.IOException; import java.io.IOException;
@WebServlet("/studentselectteacher")
public class S_StudentSelectTeacher extends HttpServlet { public class S_StudentSelectTeacher extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response); super.doPost(request, response);
String student_id=request.getParameter("id"); String teacher_id=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user"); User user=(User)request.getSession().getAttribute("user");
String teacher_id=user.getId(); String student_id=user.getId();
try { 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) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -1,22 +1,25 @@
package servlet; package servlet.Select;
import core.process.C_TeacherSelectStudent; import core.process.C_TeacherSelectStudent;
import core.user.User; import core.user.User;
import javax.servlet.ServletException; import javax.servlet.ServletException;
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 java.io.IOException; import java.io.IOException;
@WebServlet("/teacherselectstudent")
public class S_TeacherSelectStudent extends HttpServlet { public class S_TeacherSelectStudent extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response); super.doPost(request, response);
String teacher_id=request.getParameter("id"); String student_id=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user"); User user=(User)request.getSession().getAttribute("user");
String student_id=user.getId(); String teacher_id=user.getId();
try { 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) { } catch (Exception e) {
e.printStackTrace(); 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;
}
}

@ -10,12 +10,11 @@ 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 java.io.IOException; import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@WebServlet("/register") @WebServlet("/register")
public class Register extends HttpServlet { public class S_Register extends HttpServlet {
@Override @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Map<String,String> user_info=new HashMap<>(); Map<String,String> user_info=new HashMap<>();

@ -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;
}
}

@ -48,7 +48,6 @@
<input type="button" class="submit-text" value="提交"> <input type="button" class="submit-text" value="提交">
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</body> </body>

@ -28,7 +28,7 @@
<div class="select-blank"></div> <div class="select-blank"></div>
<div class="selected-bottom"></div> <div class="selected-bottom"></div>
</div> </div>
<div class="list-frame bar-hange">c <div class="list-frame bar-hange">
<div class="list-child"> <div class="list-child">
<div class="name"><span class="the-name">李先生</span></div> <div class="name"><span class="the-name">李先生</span></div>
<div class="other-msgs"> <div class="other-msgs">

Loading…
Cancel
Save