|
|
@ -2,7 +2,6 @@ package dao;
|
|
|
|
|
|
|
|
|
|
|
|
import java.sql.*;
|
|
|
|
import java.sql.*;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
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;
|
|
|
@ -56,56 +55,49 @@ public class DBManagement {
|
|
|
|
"phone_number"
|
|
|
|
"phone_number"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//<table1.x_id,table2.x_status>
|
|
|
|
//<table1.x_id,table2.x_status>
|
|
|
|
public static Map<String,String> graduationDesignStudentTables = new HashMap<>(){
|
|
|
|
public static String[][] graduationDesignStudentTables ={
|
|
|
|
{
|
|
|
|
{"graduation_design.student_id","graduation_design.student_choose_teacher_status"},
|
|
|
|
put("graduation_design.student_id","graduation_design.student_chooser_teacher_status");
|
|
|
|
{"graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status"},
|
|
|
|
put("graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status");
|
|
|
|
{"graduation_design.student_id","graduation_design_opening_report.opening_report_status"},
|
|
|
|
put("graduation_design.student_id","graduation_design_opening_report.opening_report_status");
|
|
|
|
{"graduation_design_opening_report_view.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
|
|
|
|
put("opening_report_secretary_team.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
|
|
|
|
{"graduation_design_opening_report_view.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
|
|
|
|
put("opening_report_secretary_team.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
|
|
|
|
{"graduation_design_opening_report_view.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
|
|
|
|
put("opening_report_secretary_team.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
|
|
|
|
{"graduation_design.student_id","graduation_design_finished_product.finished_product_status"},
|
|
|
|
put("graduation_design.student_id","graduation_design_finished_product.finished_product_status");
|
|
|
|
{"graduation_design_reply_view.leader_student_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"},
|
|
|
|
put("reply_secretary_team.leader_student_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
|
|
|
|
{"graduation_design_reply_view.teacher1_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"},
|
|
|
|
put("reply_secretary_team.teacher1_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
|
|
|
|
{"graduation_design_reply_view.teacher2_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 String[][] graduationDesignTeacherTables = {
|
|
|
|
{
|
|
|
|
{"graduation_design.teacher_id","graduation_design.teacher_choose_student_status"},
|
|
|
|
put("graduation_design.teacher_id","graduation_design.teacher_choose_student_status");
|
|
|
|
{"graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status"},
|
|
|
|
put("graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status");
|
|
|
|
{"graduation_design_opening_report_view.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
|
|
|
|
put("opening_report_teacher_team.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
|
|
|
|
{"graduation_design_opening_report_view.teacher1_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");
|
|
|
|
{"graduation_design_opening_report_view.teacher2_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");
|
|
|
|
{"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_opening_report_opinion_record.opening_report_college_teacher_id","graduation_design_opening_report_opinion_record.opening_report_college_opinion_status");
|
|
|
|
{"graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status"},
|
|
|
|
put("graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status");
|
|
|
|
{"graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status"},
|
|
|
|
put("graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status");
|
|
|
|
{"graduation_design_reply_view.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
|
|
|
|
put("reply_teacher_team.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
|
|
|
|
{"graduation_design_reply_view.teacher1_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");
|
|
|
|
{"graduation_design_reply_view.teacher2_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");
|
|
|
|
{"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_college_teacher_id","graduation_design_reply_opinion_record_score.reply_college_score_status");
|
|
|
|
{"graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_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 Map<String,String> allStatus = new HashMap<>(){
|
|
|
|
public static String[][] allStatus = {
|
|
|
|
{
|
|
|
|
{"graduation_design","teacher_choose_student_status"},
|
|
|
|
put("graduation_design","teacher_choose_student_status");
|
|
|
|
{"graduation_design","student_choose_teacher_status"},
|
|
|
|
put("graduation_design","student_choose_teacher_status");
|
|
|
|
{"graduation_design_information","student_fill_graduation_design_information_status"},
|
|
|
|
put("graduation_design_information","student_fill_graduation_design_information_status");
|
|
|
|
{"graduation_design_opening_report","opening_report_status"},
|
|
|
|
put("graduation_design_opening_report","opening_report_status");
|
|
|
|
{"graduation_design_opening_report_opinion_record","opening_report_mentor_opinion_status"},
|
|
|
|
put("graduation_design_opening_report_opinion_record","opening_report_mentor_opinion_status");
|
|
|
|
{"graduation_design_opening_report_opinion_record","opening_report_teacher_team_opinion_status"},
|
|
|
|
put("graduation_design_opening_report_opinion_record","opening_report_teacher_team_opinion_status");
|
|
|
|
{"graduation_design_opening_report_opinion_record","opening_report_college_opinion_status"},
|
|
|
|
put("graduation_design_opening_report_opinion_record","opening_report_college_opinion_status");
|
|
|
|
{"graduation_design_opening_report_opinion_record","opening_report_secretary_record_status"},
|
|
|
|
put("graduation_design_opening_report_opinion_record","opening_report_secretary_record_status");
|
|
|
|
{"graduation_design_finished_product","finished_product_status"},
|
|
|
|
put("graduation_design_finished_product","finished_product_status");
|
|
|
|
{"graduation_design_finished_product_mentor_score","finished_product_mentor_score_status"},
|
|
|
|
put("graduation_design_finished_product_mentor_score","finished_product_mentor_score_status");
|
|
|
|
{"graduation_design_finished_product_reviewer_score","finished_product_reviewer_score_status"},
|
|
|
|
put("graduation_design_finished_product_reviewer_score","finished_product_reviewer_score_status");
|
|
|
|
{"graduation_design_reply_opinion_record_score","reply_secretary_record_status"},
|
|
|
|
put("graduation_design_reply_opinion_record_score","reply_ secretary_record_status");
|
|
|
|
{"graduation_design_reply_opinion_record_score","reply_teacher_team_score_status"},
|
|
|
|
put("graduation_design_reply_opinion_record_score","reply_ teacher_team_score_status");
|
|
|
|
{"graduation_design_reply_opinion_record_score","reply_college_score_status"},
|
|
|
|
put("graduation_design_reply_opinion_record_score","reply_college_score_status");
|
|
|
|
{"graduation_design_reply_opinion_record_score","reply_school_score_status"}
|
|
|
|
put("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";
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +130,7 @@ public class DBManagement {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public static Map<String,String> getUserStatusTables(String userType){
|
|
|
|
public static String[][] getUserStatusTables(String userType){
|
|
|
|
if(userType.equals("student")){
|
|
|
|
if(userType.equals("student")){
|
|
|
|
return graduationDesignStudentTables;
|
|
|
|
return graduationDesignStudentTables;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -198,7 +190,7 @@ public class DBManagement {
|
|
|
|
ls.add(s);
|
|
|
|
ls.add(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new GExcptSQL("Connect Failure");
|
|
|
|
throw new GExcptSQL("Connect Failure\n"+sql);
|
|
|
|
}finally {
|
|
|
|
}finally {
|
|
|
|
if(con!=null) {
|
|
|
|
if(con!=null) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -218,7 +210,7 @@ public class DBManagement {
|
|
|
|
Statement stmt = con.createStatement();
|
|
|
|
Statement stmt = con.createStatement();
|
|
|
|
stmt.executeUpdate(sql);
|
|
|
|
stmt.executeUpdate(sql);
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
throw new GExcptSQL("Connect Failure");
|
|
|
|
throw new GExcptSQL("Connect Failure\n"+sql);
|
|
|
|
}finally {
|
|
|
|
}finally {
|
|
|
|
if(con!=null) {
|
|
|
|
if(con!=null) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|