diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index c685b63..81ea5c7 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,7 +1,7 @@ - + mariadb true org.mariadb.jdbc.Driver diff --git a/.idea/dataSources/9ab10673-d584-44a7-a783-8ac833d52c51.xml b/.idea/dataSources/9ab10673-d584-44a7-a783-8ac833d52c51.xml new file mode 100644 index 0000000..b9251ad --- /dev/null +++ b/.idea/dataSources/9ab10673-d584-44a7-a783-8ac833d52c51.xml @@ -0,0 +1,2272 @@ + + + + + 10.3.10 + MariaDB + InnoDB + lower/lower + + + 1 + 1 + utf8_general_ci + + + utf8_general_ci + + + utf8_general_ci + + + utf8_general_ci + + + latin1_swedish_ci + + + utf8_general_ci + + + armscii8 + 0 + + + armscii8 + 1 + + + armscii8 + 0 + + + armscii8 + 0 + + + ascii + 0 + + + ascii + 1 + + + ascii + 0 + + + ascii + 0 + + + big5 + 0 + + + big5 + 1 + + + big5 + 0 + + + big5 + 0 + + + binary + 1 + + + cp1250 + 0 + + + cp1250 + 0 + + + cp1250 + 0 + + + cp1250 + 1 + + + cp1250 + 0 + + + cp1250 + 0 + + + cp1250 + 0 + + + cp1251 + 0 + + + cp1251 + 0 + + + cp1251 + 1 + + + cp1251 + 0 + + + cp1251 + 0 + + + cp1251 + 0 + + + cp1251 + 0 + + + cp1256 + 0 + + + cp1256 + 1 + + + cp1256 + 0 + + + cp1256 + 0 + + + cp1257 + 0 + + + cp1257 + 1 + + + cp1257 + 0 + + + cp1257 + 0 + + + cp1257 + 0 + + + cp850 + 0 + + + cp850 + 1 + + + cp850 + 0 + + + cp850 + 0 + + + cp852 + 0 + + + cp852 + 1 + + + cp852 + 0 + + + cp852 + 0 + + + cp866 + 0 + + + cp866 + 1 + + + cp866 + 0 + + + cp866 + 0 + + + cp932 + 0 + + + cp932 + 1 + + + cp932 + 0 + + + cp932 + 0 + + + dec8 + 0 + + + dec8 + 0 + + + dec8 + 1 + + + dec8 + 0 + + + eucjpms + 0 + + + eucjpms + 1 + + + eucjpms + 0 + + + eucjpms + 0 + + + euckr + 0 + + + euckr + 1 + + + euckr + 0 + + + euckr + 0 + + + gb2312 + 0 + + + gb2312 + 1 + + + gb2312 + 0 + + + gb2312 + 0 + + + gbk + 0 + + + gbk + 1 + + + gbk + 0 + + + gbk + 0 + + + geostd8 + 0 + + + geostd8 + 1 + + + geostd8 + 0 + + + geostd8 + 0 + + + greek + 0 + + + greek + 1 + + + greek + 0 + + + greek + 0 + + + hebrew + 0 + + + hebrew + 1 + + + hebrew + 0 + + + hebrew + 0 + + + hp8 + 0 + + + hp8 + 1 + + + hp8 + 0 + + + hp8 + 0 + + + keybcs2 + 0 + + + keybcs2 + 1 + + + keybcs2 + 0 + + + keybcs2 + 0 + + + koi8r + 0 + + + koi8r + 1 + + + koi8r + 0 + + + koi8r + 0 + + + koi8u + 0 + + + koi8u + 1 + + + koi8u + 0 + + + koi8u + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 0 + + + latin1 + 1 + + + latin1 + 0 + + + latin2 + 0 + + + latin2 + 0 + + + latin2 + 0 + + + latin2 + 1 + + + latin2 + 0 + + + latin2 + 0 + + + latin2 + 0 + + + latin5 + 0 + + + latin5 + 0 + + + latin5 + 1 + + + latin5 + 0 + + + latin7 + 0 + + + latin7 + 0 + + + latin7 + 1 + + + latin7 + 0 + + + latin7 + 0 + + + latin7 + 0 + + + macce + 0 + + + macce + 1 + + + macce + 0 + + + macce + 0 + + + macroman + 0 + + + macroman + 1 + + + macroman + 0 + + + macroman + 0 + + + sjis + 0 + + + sjis + 1 + + + sjis + 0 + + + sjis + 0 + + + swe7 + 0 + + + swe7 + 0 + + + swe7 + 1 + + + swe7 + 0 + + + tis620 + 0 + + + tis620 + 0 + + + tis620 + 1 + + + tis620 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 1 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ucs2 + 0 + + + ujis + 0 + + + ujis + 1 + + + ujis + 0 + + + ujis + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 1 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16 + 0 + + + utf16le + 0 + + + utf16le + 1 + + + utf16le + 0 + + + utf16le + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 1 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf32 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 1 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 1 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + utf8mb4 + 0 + + + 管理员 +
+ + 公告 +
+ + 毕业设计 +
+ + 毕设论文 +
+ + 指导老师评定成绩 +
+ + 评阅老师对论文的评审成绩 +
+ + 毕业设计信息 +
+ + 开题报告 +
+ + 开题报告会纪要 +
+ + 答辩 +
+ + 答辩记录表 +
+ + 开题报告秘书组 +
+ + 开题报告老师组 +
+ + 专业信息 +
+ + 答辩秘书小组 +
+ + 答辩教师组 +
+ + 学生用户 +
+ + 老师用户 +
+ + 898 + + + 772 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(255)|0s + 1 + normal + + + 3 + char(30)|0s + normal + + + 4 + char(40)|0s + normal + + + 5 + char(20)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + text|0s + normal + + + 3 + text|0s + normal + + + 4 + date|0s + normal + + + 5 + varchar(255)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 4 + char(1)|0s + normal + + + 5 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + int(11)|0s + normal + + + 3 + date|0s + normal + + + 4 + varchar(255)|0s + normal + + + 5 + text|0s + normal + + + 6 + text|0s + normal + + + 7 + text|0s + normal + + + 8 + text|0s + normal + + + 9 + float|0s + normal + + + 10 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + float|0s + normal + + + 3 + float|0s + normal + + + 4 + float|0s + normal + + + 5 + float|0s + normal + + + 6 + float|0s + normal + + + 7 + float|0s + normal + + + 8 + float|0s + normal + + + 9 + float|0s + normal + + + 10 + float|0s + normal + + + 11 + float|0s + normal + + + 12 + float|0s + normal + + + 13 + float|0s + normal + + + 14 + float|0s + normal + + + 15 + float|0s + normal + + + 16 + float|0s + normal + + + 17 + text|0s + normal + + + 18 + date|0s + normal + + + 19 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + float|0s + normal + + + 4 + text|0s + normal + + + 5 + date|0s + normal + + + 6 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + varchar(255)|0s + normal + + + 3 + varchar(255)|0s + normal + + + 4 + varchar(255)|0s + normal + + + 5 + varchar(255)|0s + normal + + + 6 + varchar(255)|0s + normal + + + 7 + text|0s + normal + + + 8 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + date|0s + normal + + + 3 + varchar(255)|0s + normal + + + 4 + varchar(255)|0s + normal + + + 5 + char(20)|0s + normal + + + 6 + char(20)|0s + normal + + + 7 + int(11)|0s + normal + + + 8 + char(1)|0s + normal + + + teacher_leader_team_id + btree + + + secretary_leader_team_id + btree + + + 1 + id + 1 + + + teacher_leader_team_id + gdms + opening_report_teacher_team + leader_teacher_id + + + secretary_leader_team_id + gdms + opening_report_secretary_team + leader_student_id + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + text|0s + normal + + + 4 + date|0s + normal + + + 5 + text|0s + normal + + + 6 + date|0s + normal + + + 7 + text|0s + normal + + + 8 + date|0s + normal + + + 9 + text|0s + normal + + + 10 + date|0s + normal + + + 11 + char(1)|0s + normal + + + 12 + char(1)|0s + normal + + + 13 + char(1)|0s + normal + + + 14 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + date|0s + normal + + + 3 + varchar(255)|0s + normal + + + 4 + char(20)|0s + normal + + + 5 + char(20)|0s + normal + + + teacher_team_leader_id + btree + + + secretary_team_leader_id + btree + + + 1 + id + 1 + + + teacher_team_leader_id + gdms + reply_teacher_team + leader_teacher_id + + + secretary_team_leader_id + gdms + reply_secretary_team + leader_student_id + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 4 + text|0s + normal + + + 5 + date|0s + normal + + + 6 + text|0s + normal + + + 7 + date|0s + normal + + + 8 + text|0s + normal + + + 9 + float|0s + normal + + + 10 + date|0s + normal + + + 11 + text|0s + normal + + + 12 + float|0s + normal + + + 13 + date|0s + normal + + + 14 + text|0s + normal + + + 15 + float|0s + normal + + + 16 + date|0s + normal + + + 17 + char(1)|0s + normal + + + 18 + char(1)|0s + normal + + + 19 + char(1)|0s + normal + + + 20 + char(1)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 1 + leader_student_id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 1 + leader_teacher_id + 1 + + + 1 + char(8)|0s + 1 + normal + + + 2 + varchar(255)|0s + normal + + + 3 + varchar(255)|0s + normal + + + 4 + varchar(255)|0s + normal + + + 1 + profession_code + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 1 + leader_student_id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(20)|0s + normal + + + 3 + char(20)|0s + normal + + + 1 + leader_teacher_id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(255)|0s + 1 + normal + + + 3 + char(30)|0s + normal + + + 4 + char(40)|0s + normal + + + 5 + char(20)|0s + normal + + + 6 + char(4)|0s + normal + + + 7 + char(8)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + normal + + + 2 + char(255)|0s + 1 + normal + + + 3 + char(30)|0s + normal + + + 4 + char(40)|0s + normal + + + 5 + char(20)|0s + normal + + + 6 + varchar(255)|0s + normal + + + 7 + varchar(255)|0s + normal + + + 8 + char(8)|0s + normal + + + 1 + id + 1 + + + 1 + char(20)|0s + 1 + + + 2 + char(20)|0s + 1 + + + 3 + char(20)|0s + + + 4 + char(20)|0s + + + 5 + char(20)|0s + 1 + + + 6 + char(20)|0s + + + 7 + char(20)|0s + + + 1 + char(20)|0s + 1 + + + 2 + char(20)|0s + 1 + + + 3 + char(20)|0s + + + 4 + char(20)|0s + + + 5 + char(20)|0s + 1 + + + 6 + char(20)|0s + + + 7 + char(20)|0s + +
+
\ No newline at end of file diff --git a/.idea/dictionaries/zhai_.xml b/.idea/dictionaries/zhai_.xml new file mode 100644 index 0000000..826cb6a --- /dev/null +++ b/.idea/dictionaries/zhai_.xml @@ -0,0 +1,7 @@ + + + + mariadb + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index df60b67..e0844bc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1dd..8306744 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/src/core/operation/Delete.java b/src/core/operation/Delete.java index f9e7acd..678aeaf 100644 --- a/src/core/operation/Delete.java +++ b/src/core/operation/Delete.java @@ -12,9 +12,7 @@ public class Delete extends Operation { public Map execute(User subject) throws GExcptSQL { Map map = new HashMap<>(); map.put("id",(String)this.getOptions().get("id")); - for(String table:DBManagement.graduationDesignTables){ - DBManagement.delete(table,map); - } + //todo return this.getOptions(); } } diff --git a/src/core/operation/Select.java b/src/core/operation/Select.java index 9d09797..7b5b6ab 100644 --- a/src/core/operation/Select.java +++ b/src/core/operation/Select.java @@ -12,17 +12,15 @@ public class Select extends Operation { @Override public Map execute(User subject) throws GExcptSQL { Map vMap = new HashMap<>(); + Map limits = new HashMap<>(); String id = (String)this.getOptions().get("student_id"); String teacher_id = (String)this.getOptions().get("teacher_id"); - vMap.put("id",id); + limits.put("id",id); vMap.put("student_id",id); vMap.put("teacher_id",teacher_id); - DBManagement.insert("graduation_design", vMap); + DBManagement.update("graduation_design", vMap,limits); vMap.remove("student_id"); vMap.remove("teacher_id"); - for(int i=1;i vMap; - private static String buttonName ="学院开题意见"; + protected static String buttonName ="学院开题意见"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/college-fill-opening-report-opinion"; + protected static String info = ""; static String table="graduation_design_opening_report_opinion_record"; @@ -50,4 +51,23 @@ public class C_CollegeFillOpeningReportOpinion extends TempProcess{ public Map getVMap() { return vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_CollegeFillScoreOpinion.java b/src/core/process/C_CollegeFillScoreOpinion.java index 6758f1c..73f2eb8 100644 --- a/src/core/process/C_CollegeFillScoreOpinion.java +++ b/src/core/process/C_CollegeFillScoreOpinion.java @@ -12,12 +12,11 @@ public class C_CollegeFillScoreOpinion extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="学院老师评分"; + protected static String buttonName ="学院老师评分"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/college-fill-score-opinion"; - - protected static String iconURL="../cssFile/images/fill.png"; static String table="graduation_design_reply_opinion_record_score"; + protected static String info = ""; public void fillInformation() throws Exception{ if(!check()) throw new GExcptInit("FillInformation Attrs Init error!"); @@ -46,4 +45,23 @@ public class C_CollegeFillScoreOpinion extends TempProcess{ public void setVMap(Map vMap) { this.vMap = vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_FillInformation.java b/src/core/process/C_FillInformation.java new file mode 100644 index 0000000..642301b --- /dev/null +++ b/src/core/process/C_FillInformation.java @@ -0,0 +1,8 @@ +package core.process; + +public abstract class C_FillInformation extends TempProcess { + public String getJspURL(){ + return "/home/.jsp"; + } + +} diff --git a/src/core/process/C_FillSbjMsg.java b/src/core/process/C_FillSbjMsg.java new file mode 100644 index 0000000..5743e63 --- /dev/null +++ b/src/core/process/C_FillSbjMsg.java @@ -0,0 +1,8 @@ +package core.process; + +public abstract class C_FillSbjMsg extends TempProcess { + public String getJspURL(){ + return "/home/upload_file.jsp"; + } + +} diff --git a/src/core/process/C_MentorFillOpeningReportOpinion.java b/src/core/process/C_MentorFillOpeningReportOpinion.java index 2c8d671..06b4933 100644 --- a/src/core/process/C_MentorFillOpeningReportOpinion.java +++ b/src/core/process/C_MentorFillOpeningReportOpinion.java @@ -12,11 +12,11 @@ public class C_MentorFillOpeningReportOpinion extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="导师开题意见"; + protected static String buttonName ="导师开题意见"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/mentor-fill-opening-report-opinion"; + protected static String info = ""; - protected static String iconURL="../cssFile/images/fill.png"; static String table="graduation_design_opening_report_opinion_record"; public void fillInformation() throws Exception{ @@ -55,4 +55,23 @@ public class C_MentorFillOpeningReportOpinion extends TempProcess{ public Map getVMap() { return vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_MentorFillReview.java b/src/core/process/C_MentorFillReview.java index 49c6402..d92986f 100644 --- a/src/core/process/C_MentorFillReview.java +++ b/src/core/process/C_MentorFillReview.java @@ -12,9 +12,10 @@ public class C_MentorFillReview extends TempProcess { public String graduationDesignId; public Map vMap; - private static String buttonName ="指导老师评阅"; + protected static String buttonName ="指导老师评阅"; protected static String targetURL="/home/mentor-fill-review"; protected static String iconURL="../cssFile/images/fill.png"; + protected static String info = ""; static String table="graduation_design_finished_product_mentor_score"; @@ -52,5 +53,25 @@ public class C_MentorFillReview extends TempProcess { public Map getVMap() { return vMap; } + + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_ReviewerFillReview.java b/src/core/process/C_ReviewerFillReview.java index d501066..59f24ef 100644 --- a/src/core/process/C_ReviewerFillReview.java +++ b/src/core/process/C_ReviewerFillReview.java @@ -11,9 +11,10 @@ import java.util.Map; public class C_ReviewerFillReview extends TempProcess { public String graduationDesignId; public Map vMap; - private static String buttonName ="评阅老师评阅"; + protected static String buttonName ="评阅老师评阅"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/reviewer-fill-review"; + protected static String info = ""; static String table="graduation_design_finished_product_reviewer_score"; @@ -50,6 +51,25 @@ public class C_ReviewerFillReview extends TempProcess { public void setVMap(Map vMap) { this.vMap = vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_SchoolFillScoreOpinion.java b/src/core/process/C_SchoolFillScoreOpinion.java index e512506..02006a3 100644 --- a/src/core/process/C_SchoolFillScoreOpinion.java +++ b/src/core/process/C_SchoolFillScoreOpinion.java @@ -12,9 +12,10 @@ public class C_SchoolFillScoreOpinion extends TempProcess { String graduationDesignId; Map vMap; - private static String buttonName ="学院老师评分"; + protected static String buttonName ="学院老师评分"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/school-fill-score-opinion"; + protected static String info = ""; static String table="graduation_design_reply_opinion_record_score"; public void fillInformation() throws Exception{ @@ -52,6 +53,25 @@ public class C_SchoolFillScoreOpinion extends TempProcess { return vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_SecretaryFillOpeningReportOpinion.java b/src/core/process/C_SecretaryFillOpeningReportRecord.java similarity index 77% rename from src/core/process/C_SecretaryFillOpeningReportOpinion.java rename to src/core/process/C_SecretaryFillOpeningReportRecord.java index a0ad1c7..f5e3b2a 100644 --- a/src/core/process/C_SecretaryFillOpeningReportOpinion.java +++ b/src/core/process/C_SecretaryFillOpeningReportRecord.java @@ -8,13 +8,14 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -public class C_SecretaryFillOpeningReportOpinion extends TempProcess{ +public class C_SecretaryFillOpeningReportRecord extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="提交开题纪要"; + protected static String buttonName ="提交开题纪要"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/secretary-fill-opening-report-record"; + protected static String info = ""; static String table="graduation_design_opening_report_opinion_record"; @@ -53,4 +54,23 @@ public class C_SecretaryFillOpeningReportOpinion extends TempProcess{ return vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_SecretaryFillReplyRecord.java b/src/core/process/C_SecretaryFillReplyRecord.java index 17557dd..5d5e670 100644 --- a/src/core/process/C_SecretaryFillReplyRecord.java +++ b/src/core/process/C_SecretaryFillReplyRecord.java @@ -12,9 +12,10 @@ public class C_SecretaryFillReplyRecord extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="提交答辩记录"; + protected static String buttonName ="提交答辩记录"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/secretary-fill-reply-record"; + protected static String info = ""; static String table="graduation_design_reply_opinion_record_score"; @@ -54,4 +55,23 @@ public class C_SecretaryFillReplyRecord extends TempProcess{ } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_Select.java b/src/core/process/C_Select.java new file mode 100644 index 0000000..89c0ccb --- /dev/null +++ b/src/core/process/C_Select.java @@ -0,0 +1,4 @@ +package core.process; + +public class C_Select { +} diff --git a/src/core/process/C_StudentFillGraduationDesignInformation.java b/src/core/process/C_StudentFillGraduationDesignInformation.java index 6462ecf..5a8d43a 100644 --- a/src/core/process/C_StudentFillGraduationDesignInformation.java +++ b/src/core/process/C_StudentFillGraduationDesignInformation.java @@ -11,9 +11,10 @@ import java.util.Map; public class C_StudentFillGraduationDesignInformation extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="填写选题信息"; + protected static String buttonName ="填写选题信息"; protected static String iconURL="../cssFile/images/filText.png"; protected static String targetURL="/home/student-fill-graduation-design-information"; + protected static String info = ""; static String table="graduation_design_opening_report_opinion_record"; @@ -51,4 +52,23 @@ public class C_StudentFillGraduationDesignInformation extends TempProcess{ } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } \ No newline at end of file diff --git a/src/core/process/C_StudentSearchTeacher.java b/src/core/process/C_StudentSearchTeacher.java index 65931e4..6bd755f 100644 --- a/src/core/process/C_StudentSearchTeacher.java +++ b/src/core/process/C_StudentSearchTeacher.java @@ -11,6 +11,10 @@ import java.util.Map; public class C_StudentSearchTeacher extends TempProcess{ String teacherID; + protected static String buttonName = ""; + protected static String iconURL=""; + protected static String targetURL=""; + protected static String info = ""; static String table = "teacher"; Map TeacherInfo=new HashMap(); @@ -36,6 +40,25 @@ public class C_StudentSearchTeacher extends TempProcess{ TeacherInfo.put("phone_number",s[4]); return TeacherInfo; } + public List> _search() throws Exception{ + if(!check()) throw new GExcptInit("teacherId Attrs init error!"); + Search search = new Search() ; + search.setOptions(new HashMap<>()); + search.addOptions("table",table); + List fields = new ArrayList<>(); + fields.add("*"); + search.addOptions("field",fields); + Map limits = new HashMap<>(); + limits.put("id",this.getTeacherID()); + search.addOptions("limits",limits); + search.addOptions("start",0); + search.addOptions("end",10); + Map options = search.execute(null); + List result = (List) options.get("result"); + List> teachersInfo = new ArrayList<>(); + core.process.Utils.formatResult(result, teachersInfo); + return teachersInfo; + } protected boolean check() { if(this.getTeacherID()==null) @@ -48,4 +71,23 @@ public class C_StudentSearchTeacher extends TempProcess{ public void setTeacherID(String teacherID){ this.teacherID=teacherID; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_StudentSelectTeacher.java b/src/core/process/C_StudentSelectTeacher.java index 2a42db7..695fa10 100644 --- a/src/core/process/C_StudentSelectTeacher.java +++ b/src/core/process/C_StudentSelectTeacher.java @@ -1,5 +1,6 @@ package core.process; +import core.operation.Search; import core.operation.Select; import error.GExcptInit; @@ -11,9 +12,10 @@ import java.util.Map; public class C_StudentSelectTeacher extends TempProcess { String studentId; String teacherId; - private static String buttonName ="选择老师"; + protected static String buttonName ="选择老师"; protected static String targetURL="/home/student-select-teacher"; protected static String iconURL="../cssFile/images/select.png"; + protected static String info = ""; public void select()throws Exception{ if(!check()) throw new GExcptInit("ID Attrs init error!"); @@ -23,6 +25,24 @@ public class C_StudentSelectTeacher extends TempProcess { select.addOptions("teacher_id",this.getTeacherId()); Map options=select.execute(null); } + public List> search(String teacherId) throws Exception{ + Search search = new Search() ; + search.setOptions(new HashMap<>()); + search.addOptions("table","teacher"); + List fields = new ArrayList<>(); + fields.add("*"); + search.addOptions("field",fields); + Map limits = new HashMap<>(); + limits.put("id",teacherId); + search.addOptions("limits",limits); + search.addOptions("start",0); + search.addOptions("end",10); + Map options = search.execute(null); + List result = (List) options.get("result"); + List> teachersInfo = new ArrayList<>(); + core.process.Utils.formatResult(result, teachersInfo); + return teachersInfo; + } protected boolean check() { if(this.getStudentId()==null||this.getTeacherId()==null) return false; @@ -45,5 +65,24 @@ public class C_StudentSelectTeacher extends TempProcess { } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_StudentUploadFinishedProduct.java b/src/core/process/C_StudentUploadFinishedProduct.java index 8bb0ea3..8ebd9ff 100644 --- a/src/core/process/C_StudentUploadFinishedProduct.java +++ b/src/core/process/C_StudentUploadFinishedProduct.java @@ -7,13 +7,14 @@ import java.io.File; import java.util.HashMap; import java.util.Map; -public class C_StudentUploadFinishedProduct extends TempProcess { +public class C_StudentUploadFinishedProduct extends C_UploadFile { File finishedProduct; String graduationDesignId; - private static String buttonName ="提交定稿"; + protected static String buttonName ="提交定稿"; protected static String iconURL="../cssFile/images/upload.png"; protected static String targetURL="/home/student-upload-finished-product"; + protected static String info = ""; static String file_type = "finished_product"; public void uploadOpeningReport() throws Exception{ @@ -48,4 +49,23 @@ public class C_StudentUploadFinishedProduct extends TempProcess { this.graduationDesignId = graduationDesignId; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_StudentUploadOpeningReport.java b/src/core/process/C_StudentUploadOpeningReport.java index 3ccb7e3..27ebda3 100644 --- a/src/core/process/C_StudentUploadOpeningReport.java +++ b/src/core/process/C_StudentUploadOpeningReport.java @@ -10,10 +10,11 @@ import java.util.Map; public class C_StudentUploadOpeningReport extends TempProcess{ File openingReport; String graduationDesignId; - private static String buttonName ="提交开题报告"; + protected static String buttonName ="提交开题报告"; static String file_type = "opening_report"; protected static String targetURL="/home/student-upload-opening-report"; protected static String iconURL="../cssFile/images/upload.png"; + protected static String info = ""; public void uploadOpeningReport() throws Exception{ if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!"); @@ -48,4 +49,24 @@ public class C_StudentUploadOpeningReport extends TempProcess{ public void setGraduationDesignId(String graduationDesignId) { this.graduationDesignId = graduationDesignId; } + + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_TeacherSearchStudent.java b/src/core/process/C_TeacherSearchStudent.java index c915c93..9ad9010 100644 --- a/src/core/process/C_TeacherSearchStudent.java +++ b/src/core/process/C_TeacherSearchStudent.java @@ -11,6 +11,10 @@ import java.util.Map; public class C_TeacherSearchStudent extends TempProcess { String studentId; + protected static String buttonName = ""; + protected static String iconURL=""; + protected static String targetURL=""; + protected static String info = ""; static String table="student"; public Map search() throws Exception{ @@ -48,18 +52,11 @@ public class C_TeacherSearchStudent extends TempProcess { limits.put("id",this.getStudentId()); search.addOptions("limits",limits); search.addOptions("start",0); - search.addOptions("end",1); + search.addOptions("end",10); Map options = search.execute(null); List result = (List) options.get("result"); List> studentsInfo = new ArrayList<>(); - for(String[] s:result){ - Map studentInfo = new HashMap<>(); - studentInfo.put("id",s[0]); - studentInfo.put("name",s[2]); - studentInfo.put("e_mail_location",s[3]); - studentInfo.put("phone_number",s[4]); - studentsInfo.add(studentInfo); - } + core.process.Utils.formatResult(result, studentsInfo); return studentsInfo; } protected boolean check() { @@ -74,4 +71,23 @@ public class C_TeacherSearchStudent extends TempProcess { this.studentId=studentId; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_TeacherSelectStudent.java b/src/core/process/C_TeacherSelectStudent.java index 2e2d290..8b74212 100644 --- a/src/core/process/C_TeacherSelectStudent.java +++ b/src/core/process/C_TeacherSelectStudent.java @@ -1,5 +1,6 @@ package core.process; +import core.operation.Search; import core.operation.Select; import error.GExcptInit; @@ -11,9 +12,10 @@ import java.util.Map; public class C_TeacherSelectStudent extends TempProcess { String studentId; String teacherId; - private static String buttonName ="选择学生"; + protected static String buttonName ="选择学生"; protected static String iconURL=""; protected static String targetURL="/home/teacher-select-student"; + protected static String info = ""; public void select()throws Exception{ if(!check()) throw new GExcptInit("ID Attrs init error!"); @@ -23,6 +25,24 @@ public class C_TeacherSelectStudent extends TempProcess { select.addOptions("student_id",this.getStudentId()); Map options=select.execute(null); } + public List> search(String studentId) throws Exception{ + Search search = new Search() ; + search.setOptions(new HashMap<>()); + search.addOptions("table","student"); + List fields = new ArrayList<>(); + fields.add("*"); + search.addOptions("field",fields); + Map limits = new HashMap<>(); + limits.put("id",studentId); + search.addOptions("limits",limits); + search.addOptions("start",0); + search.addOptions("end",10); + Map options = search.execute(null); + List result = (List) options.get("result"); + List> studentsInfo = new ArrayList<>(); + core.process.Utils.formatResult(result, studentsInfo); + return studentsInfo; + } protected boolean check() { if(this.getStudentId()==null||this.getTeacherId()==null) return false; @@ -44,6 +64,24 @@ public class C_TeacherSelectStudent extends TempProcess { this.studentId = studentId; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java b/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java index 467dc50..1ce9a94 100644 --- a/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java +++ b/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java @@ -12,9 +12,10 @@ public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess{ String graduationDesignId; Map vMap; - private static String buttonName ="开题小组意见"; + protected static String buttonName ="开题小组意见"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/teacher-team-fill-opening-report-opinion"; + protected static String info = ""; static String table="graduation_design_opening_report_opinion_record"; @@ -54,5 +55,24 @@ public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess{ return vMap; } + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } } diff --git a/src/core/process/C_TeacherTeamFillScoreOpinion.java b/src/core/process/C_TeacherTeamFillScoreOpinion.java index 8a223a8..3fe8529 100644 --- a/src/core/process/C_TeacherTeamFillScoreOpinion.java +++ b/src/core/process/C_TeacherTeamFillScoreOpinion.java @@ -10,9 +10,10 @@ import java.util.Map; public class C_TeacherTeamFillScoreOpinion extends TempProcess { - private static String buttonName = "答辩小组评分"; + protected static String buttonName = "答辩小组评分"; protected static String iconURL="../cssFile/images/fill.png"; protected static String targetURL="/home/teacher-team-fill-score-opinion"; + protected static String info = ""; String graduationDesignId; Map vMap; @@ -36,6 +37,27 @@ public class C_TeacherTeamFillScoreOpinion extends TempProcess { return false; return true; } + + @Override + public String getInfo() { + return info; + } + + @Override + public String getTargetURL() { + return targetURL; + } + + @Override + public String getIconURL() { + return iconURL; + } + + @Override + public String getButtonName() { + return buttonName; + } + @Override public String getGraduationDesignId() { return graduationDesignId; diff --git a/src/core/process/C_UploadFile.java b/src/core/process/C_UploadFile.java index 15917dd..4593b24 100644 --- a/src/core/process/C_UploadFile.java +++ b/src/core/process/C_UploadFile.java @@ -1,4 +1,7 @@ package core.process; -public class C_UploadFile extends TempProcess { +public abstract class C_UploadFile extends TempProcess { + public String getJspURL(){ + return "/home/upload_file.jsp"; + } } diff --git a/src/core/process/Condition.java b/src/core/process/Condition.java index 14c5986..9365dbb 100644 --- a/src/core/process/Condition.java +++ b/src/core/process/Condition.java @@ -3,7 +3,7 @@ package core.process; import java.util.ArrayList; import java.util.List; -public class Condition {//条件 +public class Condition { public List getProcesses() { return processes; } diff --git a/src/core/process/Process.java b/src/core/process/Process.java index be06a88..d7ff13d 100644 --- a/src/core/process/Process.java +++ b/src/core/process/Process.java @@ -4,16 +4,10 @@ import core.operation.Operation; public abstract class Process{ - private static String buttonName; - protected static String targetURL; - - protected static String iconURL; - private String status; private String permission; private Operation operation; - private String info; protected abstract boolean check(); @@ -33,18 +27,6 @@ public abstract class Process{ this.operation = operation; } - public String getButtonName() { - return buttonName; - } - - public String getInfo() { - return info; - } - - public void setInfo(String info) { - this.info = info; - } - public String getStatus() { return status; } @@ -53,11 +35,11 @@ public abstract class Process{ this.status = status; } - public static String getTargetURL() { - return targetURL; - } + public abstract String getInfo(); - public static String getIconURL() { - return iconURL; - } + public abstract String getTargetURL(); + + public abstract String getIconURL(); + + public abstract String getButtonName(); } diff --git a/src/core/process/ProcessManagement.java b/src/core/process/ProcessManagement.java index a961f10..a800b13 100644 --- a/src/core/process/ProcessManagement.java +++ b/src/core/process/ProcessManagement.java @@ -15,7 +15,7 @@ public class ProcessManagement { public static Condition getCondition(User user, Map status){ Condition condition = new Condition(); for(Map.Entry entry:status.entrySet()){ - String[] s = entry.getKey().split("."); + String[] s = entry.getKey().split("\\."); TempProcess tempProcess = (TempProcess) getProcess(s[1]); tempProcess.setGraduationDesignId(s[0]); tempProcess.setStatus(entry.getValue()); @@ -26,17 +26,18 @@ public class ProcessManagement { } private static List getLastProcesses(User user) { - return null; + List lp = new ArrayList<>(); + return lp; } //Map public static Map getStatus(User user) throws Exception { Map status = new HashMap<>(); - Map userTables = DBManagement.getUserStatusTables(user.getType()); + String[][] userTables = DBManagement.getUserStatusTables(user.getType()); String graduationDesignId = null; - for(Map.Entry entry:userTables.entrySet()){ - String[] ti = entry.getKey().split("."); - String[] ts = entry.getValue().split("."); + for(String[] s:userTables){ + String[] ti = s[0].split("\\."); + String[] ts = s[1].split("\\."); List ls = new ArrayList<>(); ls.add("id"); Map limits = new HashMap<>(); @@ -81,12 +82,13 @@ public class ProcessManagement { case"reply_ secretary_record_status": return new C_SecretaryFillReplyRecord(); case"reply_ teacher_team_score_status": - return new C_TeacherFillTeamFillScoreOpinion(); + return new C_TeacherTeamFillScoreOpinion(); case"reply_college_score_status": return new C_CollegeFillScoreOpinion(); case"reply_school_score_status": return new C_SchoolFillScoreOpinion(); - + default: + return null; } } } diff --git a/src/core/process/Utils.java b/src/core/process/Utils.java new file mode 100644 index 0000000..9c1fc12 --- /dev/null +++ b/src/core/process/Utils.java @@ -0,0 +1,18 @@ +package core.process; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface Utils { + static void formatResult(List result, List> studentsInfo) { + for(String[] s:result){ + Map studentInfo = new HashMap<>(); + studentInfo.put("id",s[0]); + studentInfo.put("name",s[2]); + studentInfo.put("e_mail_location",s[3]); + studentInfo.put("phone_number",s[4]); + studentsInfo.add(studentInfo); + } + } +} diff --git a/src/core/user/User.java b/src/core/user/User.java index 236c2ae..b848a3c 100644 --- a/src/core/user/User.java +++ b/src/core/user/User.java @@ -1,8 +1,10 @@ package core.user; import core.process.Condition; +import core.process.ProcessManagement; import core.user.userFun.AccountManageable; import core.user.userFun.ProcessConfigurable; +import core.user.utils.AccountManagement; import java.util.List; import java.util.Map; @@ -115,4 +117,9 @@ public abstract class User implements AccountManageable, ProcessConfigurable{ this.setE_mail_location(vMap.get("e_mail_location")); this.setPhone_number(vMap.get("phone_number")); } + + + public void initCondition() throws Exception { + this.condition = ProcessManagement.getCondition(this); + } } diff --git a/src/core/user/utils/AccountManagement.java b/src/core/user/utils/AccountManagement.java index f832674..d9c4ebd 100644 --- a/src/core/user/utils/AccountManagement.java +++ b/src/core/user/utils/AccountManagement.java @@ -1,5 +1,6 @@ package core.user.utils; +import core.user.Student; import core.user.User; import core.utils.GetObjectByName; import dao.DBManagement; @@ -49,7 +50,11 @@ public interface AccountManagement { } static User register(String userType, Map vMap) throws Exception { DBManagement.insert(userType,vMap); - return createUser(userType, vMap); + if(userType.equals("student")){ + initAllStatus(vMap.get("id")); + } + User user = createUser(userType, vMap); + return user; } static void logout(User user){ //todo @@ -60,6 +65,28 @@ public interface AccountManagement { static User createUser(String userType, Map vMap) throws Exception { User user = GetObjectByName.getUserByName(userType); user.setAttr(vMap); + user.initCondition(); return user; } + String defaultStatus = "1"; + static void initAllStatus(String id) throws GExcptSQL { + for(String table:DBManagement.graduationDesignTables){ + Map vMap = new HashMap<>(); + vMap.put("id",id); + DBManagement.insert(table,vMap); + } + for(String[] s:DBManagement.allStatus){ + Map vMap = new HashMap<>(); + Map limits = new HashMap<>(); + limits.put("id",id); + vMap.put(s[1],defaultStatus); + DBManagement.update(s[0],vMap,limits); + } + // + Map vMap = new HashMap<>(); + Map limits = new HashMap<>(); + limits.put("id",id); + vMap.put("student_id",id); + DBManagement.update("graduation_design",vMap,limits); + } } diff --git a/src/dao/DBManagement.java b/src/dao/DBManagement.java index 23c8ec5..696ae88 100644 --- a/src/dao/DBManagement.java +++ b/src/dao/DBManagement.java @@ -2,7 +2,6 @@ package dao; import java.sql.*; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import error.GExcptSQL; @@ -56,36 +55,49 @@ public class DBManagement { "phone_number" }; // - public static Map graduationDesignStudentTables = new HashMap<>(){ - { - 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","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"); - put("opening_report_secretary_team.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"); - put("graduation_design.student_id","graduation_design_finished_product.finished_product_status"); - put("reply_secretary_team.leader_student_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"); - put("reply_secretary_team.teacher2_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status"); - } + public static String[][] graduationDesignStudentTables ={ + {"graduation_design.student_id","graduation_design.student_choose_teacher_status"}, + {"graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status"}, + {"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"}, + {"graduation_design_opening_report_view.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"}, + {"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"}, + {"graduation_design_reply_view.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"} }; - public static Map graduationDesignTeacherTables = new HashMap<>(){ - { - 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[][] graduationDesignTeacherTables = { + {"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"}, + {"graduation_design_opening_report_view.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"}, + {"graduation_design_opening_report_view.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"}, + {"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"}, + {"graduation_design_reply_view.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"}, + {"graduation_design_reply_view.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"}, + {"graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_score_status"} + }; + public static String[][] allStatus = { + {"graduation_design","teacher_choose_student_status"}, + {"graduation_design","student_choose_teacher_status"}, + {"graduation_design_information","student_fill_graduation_design_information_status"}, + {"graduation_design_opening_report","opening_report_status"}, + {"graduation_design_opening_report_opinion_record","opening_report_mentor_opinion_status"}, + {"graduation_design_opening_report_opinion_record","opening_report_teacher_team_opinion_status"}, + {"graduation_design_opening_report_opinion_record","opening_report_college_opinion_status"}, + {"graduation_design_opening_report_opinion_record","opening_report_secretary_record_status"}, + {"graduation_design_finished_product","finished_product_status"}, + {"graduation_design_finished_product_mentor_score","finished_product_mentor_score_status"}, + {"graduation_design_finished_product_reviewer_score","finished_product_reviewer_score_status"}, + {"graduation_design_reply_opinion_record_score","reply_secretary_record_status"}, + {"graduation_design_reply_opinion_record_score","reply_teacher_team_score_status"}, + {"graduation_design_reply_opinion_record_score","reply_college_score_status"}, + {"graduation_design_reply_opinion_record_score","reply_school_score_status"} }; public static String driverClassName="org.mariadb.jdbc.Driver"; @@ -118,7 +130,7 @@ public class DBManagement { } return null; } - public static Map getUserStatusTables(String userType){ + public static String[][] getUserStatusTables(String userType){ if(userType.equals("student")){ return graduationDesignStudentTables; } @@ -159,6 +171,11 @@ public class DBManagement { String sql = update.getSQL(); update(sql); } + public static void updateAll(String table, List fields, String increment) throws GExcptSQL { + UpdateAll updateAll = new UpdateAll(table,fields,increment); + String sql = updateAll.getSQL(); + update(sql); + } public static List query(String sql) throws Exception { if(!ifInit) return null; List ls; @@ -178,7 +195,7 @@ public class DBManagement { ls.add(s); } } catch (SQLException e) { - throw new GExcptSQL("Connect Failure"); + throw new GExcptSQL("Connect Failure\n"+sql); }finally { if(con!=null) { try { @@ -198,7 +215,7 @@ public class DBManagement { Statement stmt = con.createStatement(); stmt.executeUpdate(sql); } catch (SQLException e) { - throw new GExcptSQL("Connect Failure"); + throw new GExcptSQL("Connect Failure\n"+sql); }finally { if(con!=null) { try { @@ -209,4 +226,6 @@ public class DBManagement { } } } + + } diff --git a/src/dao/UpdateAll.java b/src/dao/UpdateAll.java new file mode 100644 index 0000000..356af2e --- /dev/null +++ b/src/dao/UpdateAll.java @@ -0,0 +1,48 @@ +package dao; + +import java.util.List; + +public class UpdateAll extends SQLStmt { + private static final String fs ="UPDATE "; + List fields; + String increment; + + public UpdateAll(String table, List fields, String increment) { + super(table); + this.setFields(fields); + this.setIncrement(increment); + } + + @Override + public String getSQL() { + return this.getFs()+this.getUs(); + } + + @Override + public String getFs() { + return fs+this.getTable()+" "; + } + public String getUs(){ + String us = "SET "; + for(String s:this.getFields()){ + us+=s+" = "+s+" + "+this.getIncrement()+", "; + } + return utils.Utils.cutTail(us,2); + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } + + public String getIncrement() { + return increment; + } + + public void setIncrement(String increment) { + this.increment = increment; + } +} diff --git a/src/filter/OnlineCheck.java b/src/filter/OnlineCheck.java index e6e1ec4..222b4dc 100644 --- a/src/filter/OnlineCheck.java +++ b/src/filter/OnlineCheck.java @@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home.jsp") +@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home/*") public class OnlineCheck implements Filter { public void destroy() { } diff --git a/src/gdms/Configuration.java b/src/gdms/Configuration.java index 4128db3..3143a95 100644 --- a/src/gdms/Configuration.java +++ b/src/gdms/Configuration.java @@ -2,7 +2,7 @@ package gdms; public interface Configuration { //file - String filePath = "/"; + String filePath = "C:/Users/zhai_/Desktop/"; //database String dbUrl="jdbc:mariadb://localhost:3306/gdms"; String dbUsername="gdms"; diff --git a/src/gdms/GDMS.java b/src/gdms/GDMS.java index 3a10322..900f903 100644 --- a/src/gdms/GDMS.java +++ b/src/gdms/GDMS.java @@ -1,6 +1,8 @@ package gdms; +import dao.DBManagement; import error.GExcptInit; +import error.GExcptSQL; import java.util.*; @@ -15,14 +17,72 @@ public class GDMS { } } + private static TimerTask getTimerTask(String s) throws GExcptInit { - if(s==""){ - return new TimerTask() { - @Override - public void run() { - ; - } - }; + switch (s){ + case "teacher_choose_student_start_date": + return new TimerTask() { + @Override + public void run() { + List fields = new ArrayList<>(); + fields.add("teacher_choose_student_status"); + try { + DBManagement.updateAll("graduation_design",fields,"1"); + } catch (GExcptSQL gExcptSQL) { + gExcptSQL.printStackTrace(); + System.exit(1); + } + } + }; + case "student_choose_teacher_start_date": + return new TimerTask() { + @Override + public void run() { + List fields = new ArrayList<>(); + fields.add("teacher_choose_student_status"); + try { + DBManagement.updateAll("graduation_design",fields,"1"); + } catch (GExcptSQL gExcptSQL) { + gExcptSQL.printStackTrace(); + System.exit(1); + } + } + }; + case "choose_end_date": + return new TimerTask() { + @Override + public void run() { + ; + } + }; + case "opening_report_opinion_deadline_date": + return new TimerTask() { + @Override + public void run() { + ; + } + }; + case "finished_product_deadline_date": + return new TimerTask() { + @Override + public void run() { + ; + } + }; + case "finished_product_review_deadline_date": + return new TimerTask() { + @Override + public void run() { + ; + } + }; + case "reply_opinion_deadline_date": + return new TimerTask() { + @Override + public void run() { + ; + } + }; } throw new GExcptInit("GlobalTimePoint.json error"); diff --git a/src/gdms/GlobalTimePoint.json b/src/gdms/GlobalTimePoint.json index b5d8112..73ae364 100644 --- a/src/gdms/GlobalTimePoint.json +++ b/src/gdms/GlobalTimePoint.json @@ -5,5 +5,5 @@ "opening_report_opinion_deadline_date": "", "finished_product_deadline_date": "", "finished_product_review_deadline_date": "", - "reply_opition_deadline_date": "" + "reply_opinion_deadline_date": "" } \ No newline at end of file diff --git a/src/gdms/test.java b/src/gdms/test.java index 55dbfa0..05c12b5 100644 --- a/src/gdms/test.java +++ b/src/gdms/test.java @@ -2,7 +2,9 @@ package gdms; import core.operation.utils.Utils; import core.process.C_StudentSelectTeacher; +import dao.DBManagement; import dao.Select; +import dao.UpdateAll; import java.util.ArrayList; import java.util.HashMap; @@ -11,14 +13,12 @@ import java.util.Map; public class test { public static void main(String[] args){ - int i=0; - do{ - i++; - System.out.println(i); - }while(i<3); + List ls = new ArrayList<>(); + ls.add("teacher_choose_student_status"); + ls.add("student_choose_teacher_status"); + UpdateAll s = new UpdateAll("graduation_design",ls,"10"); + + System.out.println(s.getSQL()); - } - static void changeB(String a){ - a="B"; } } diff --git a/src/servlet/S_MentorFillReview.java b/src/servlet/S_MentorFillReview.java index 77f4f8a..87ce1be 100644 --- a/src/servlet/S_MentorFillReview.java +++ b/src/servlet/S_MentorFillReview.java @@ -20,7 +20,7 @@ public class S_MentorFillReview extends HttpServlet { p.setGraduationDesignId(id); p.setVMap(vMap); try { - p.fillInformation(); + p.teacherTeamFillOpeningReportOpinion(); } catch (Exception e) { e.printStackTrace(); response.sendRedirect("/op_fail.jsp"); diff --git a/src/servlet/S_ReviewerFillReview.java b/src/servlet/S_ReviewerFillReview.java index 1d2231a..a51e431 100644 --- a/src/servlet/S_ReviewerFillReview.java +++ b/src/servlet/S_ReviewerFillReview.java @@ -20,7 +20,7 @@ public class S_ReviewerFillReview extends HttpServlet { p.setGraduationDesignId(id); p.setVMap(vMap); try { - p.fillInformation(); + p.TeacherTeamFillOpeningReportOpinion(); } catch (Exception e) { e.printStackTrace(); response.sendRedirect("/op_fail.jsp"); diff --git a/src/servlet/S_StudentSelectTeacher.java b/src/servlet/S_StudentSelectTeacher.java index 452beaf..618e323 100644 --- a/src/servlet/S_StudentSelectTeacher.java +++ b/src/servlet/S_StudentSelectTeacher.java @@ -1,6 +1,5 @@ package servlet; -import core.process.C_StudentSearchTeacher; import core.process.C_StudentSelectTeacher; import core.user.User; import javax.servlet.ServletException; @@ -26,4 +25,5 @@ public class S_StudentSelectTeacher extends HttpServlet { response.sendRedirect("/op_fail.jsp"); } } + } diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 23e888e..393a567 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -13,17 +13,14 @@ import java.io.IOException; public class S_StudentUploadFinishedProduct extends HttpServlet { static String fileType = "graduation_design_finished_product"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String id = "000"; - //String files = request.getParameter("file"); - System.out.print("123"); - System.out.print( request.getPart("file")); - System.out.print("123"); + String id = request.getParameter("id"); + String fileURL; try { - String fileURL = servlet.Utils.saveFile(request, fileType); + fileURL = servlet.Utils.saveFile(request, fileType); }catch (Exception e) { System.out.print(e); + response.sendRedirect("/op_fail.jsp"); } - System.out.print("222"); } } diff --git a/web/home/home.jsp b/web/home/home.jsp index 11b685a..a11e5d3 100644 --- a/web/home/home.jsp +++ b/web/home/home.jsp @@ -36,7 +36,7 @@ String type=user.getType(); pageContext.setAttribute("userType",type); Condition condition=user.getCondition(); - //List pList=condition.getProcesses(); + /*List pList=condition.getProcesses();*/ int length=0; int index=0; %> diff --git a/web/home/result_list.jsp b/web/home/result_list.jsp index f2f4e13..a680834 100644 --- a/web/home/result_list.jsp +++ b/web/home/result_list.jsp @@ -7,19 +7,17 @@ --%> <%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %> -<%String a=request.getParameter("id"); -String b[][]=new String[3][3]; -for(int i=0;i<3;i++) - for(int j=0;j<3;j++) - b[i][j]="hello"; +<% + String id=request.getParameter("id"); + String searchType=request.getParameter("searchType"); %> <%%>
-
<%=a%>
+
<%=searchType%>
<%for(int k=0;k<2;k++) for (int n=0;n<2;n++) - out.print("
电话号码:"+b[k][n]+"
"); + out.print("
电话号码:"+k+n+"
"); %>
电话号码:18711191679
diff --git a/web/home/select.jsp b/web/home/select.jsp index 042817e..4f5fe83 100644 --- a/web/home/select.jsp +++ b/web/home/select.jsp @@ -11,7 +11,6 @@ <%@ page import="java.util.HashMap" %> <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> -<%@ page import="core.process.C_TeacherSearchStudent" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> @@ -54,7 +53,7 @@
-
+
diff --git a/web/index.jsp b/web/index.jsp new file mode 100644 index 0000000..5c5bf47 --- /dev/null +++ b/web/index.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: zhai_ + Date: 2019/1/15 + Time: 16:43 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + $END$ + + diff --git a/web/jsFile/search.js b/web/jsFile/search.js index b74575a..25a1a4f 100644 --- a/web/jsFile/search.js +++ b/web/jsFile/search.js @@ -1,10 +1,12 @@ $(document).ready(function () { - $(document).off('click',searchmsg).on('click','.search-button',searchmsg); - $(document).off('keydown',searchmsg).on('keydown','.search-input',KDsearchmsg); + $(document).off('click',searchStuMsg).on('click','.search-button.teacher',searchStuMsg); + $(document).off('click',searchTeaMsg).on('click','.search-button.student',searchTeaMsg); + $(document).off('keydown',KDsearchSmsg).on('keydown','.search-button.teacher',KDsearchSmsg); + $(document).off('keydown',KDsearchTmsg).on('keydown','.search-button.student',KDsearchTmsg); $(document).off('click',teacherSelect).on('click','.select-it.teacher',teacherSelect); $(document).off('click',studentSelect).on('click','.select-it.student',studentSelect); }) -function searchmsg(e) { +function searchStuMsg(e) { if($('.search-input').val()=='') { e.preventDefault(); @@ -12,15 +14,36 @@ function searchmsg(e) { } else { var id=$('.search-input').val(); - var rqDate={"id":id}; + var searchType='teacher'; + var rqDate={"id":id,"searchType":searchType}; var Url1='result_list.jsp'; $('.list-frame').load(Url1,rqDate); } } -function KDsearchmsg(e) { +function searchTeaMsg(e) { + if($('.search-input').val()=='') + { + e.preventDefault(); + alert('请输入学号'); + } + else { + var id=$('.search-input').val(); + var searchType='student'; + var rqDate={"id":id,"searchType":searchType}; + var Url1='result_list.jsp'; + $('.list-frame').load(Url1,rqDate); + } +} +function KDsearchSmsg(e) { + if(e.keyCode==13) + { + searchStuMsg(e); + } +} +function KDsearchTmsg(e) { if(e.keyCode==13) { - searchmsg(e); + searchTeaMsg(e); } } function select_one(Url2,button) { @@ -40,5 +63,5 @@ function studentSelect() { } function teacherSelect() { var button=$(this); - select_one("testfrom.jsp",button); + select_one("/home/teacher-select-student",button); } \ No newline at end of file diff --git a/web/jsFile/upload_action.js b/web/jsFile/upload_action.js index 866ac3a..7f0de15 100644 --- a/web/jsFile/upload_action.js +++ b/web/jsFile/upload_action.js @@ -5,7 +5,7 @@ $(document).ready(function () { }) function sendFile() { var fileData =new FormData(); - var Url4='student-upload-finished-product'; + var Url4='/student-upload-finished-product'; var file=$('#select')[0].files[0]; if($('.true-select').val()=='') {