diff --git a/.idea/artifacts/GDMS_war_exploded.xml b/.idea/artifacts/GDMS_war_exploded.xml index 6b1fe0c..12d7fe5 100644 --- a/.idea/artifacts/GDMS_war_exploded.xml +++ b/.idea/artifacts/GDMS_war_exploded.xml @@ -7,6 +7,9 @@ + + + diff --git a/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml b/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml index 692fe60..f80b89c 100644 --- a/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml +++ b/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml @@ -21,2141 +21,2121 @@ utf8_general_ci - - utf8_general_ci - - + latin1_swedish_ci - - utf8_general_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 - +
管理员
- +
公告
- +
毕业设计
- +
毕设论文
- +
指导老师评定成绩
- +
评阅老师对论文的评审成绩
- +
毕业设计信息
- +
开题报告
- +
开题报告会纪要
- +
答辩
- +
答辩记录表
- - 状态 -
- +
开题报告秘书组
- +
开题报告老师组
- +
专业信息
- +
答辩秘书小组
- +
答辩教师组
- +
学生用户
- +
老师用户
- + 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 - varchar(255)|0s + char(1)|0s normal - + 5 - float|0s + 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 float|0s normal - + 3 text|0s normal - + 4 date|0s normal - + + 5 + 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 + + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 text|0s normal - + 3 date|0s normal - + 4 text|0s normal - + 5 date|0s normal - + 6 text|0s normal - + 7 date|0s normal - + 8 text|0s normal - + 9 date|0s normal - + + 10 + char(1)|0s + normal + + + 11 + char(1)|0s + normal + + + 12 + char(1)|0s + normal + + + 13 + 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 - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 text|0s normal - + 3 date|0s normal - + 4 text|0s normal - + 5 date|0s normal - + 6 text|0s normal - + 7 float|0s normal - + 8 date|0s normal - + 9 text|0s normal - + 10 float|0s normal - + 11 date|0s normal - + 12 text|0s normal - + 13 float|0s normal - + 14 date|0s normal - - 1 - id - 1 - - - 1 - char(20)|0s - 1 - normal - - - 2 - char(1)|0s - normal - - - 3 - char(1)|0s - normal - - - 4 - char(1)|0s - normal - - - 5 - char(1)|0s - normal - - - 6 - char(1)|0s - normal - - - 7 - char(1)|0s - normal - - - 8 - char(1)|0s - normal - - - 9 - char(1)|0s - normal - - - 10 - char(1)|0s - normal - - - 11 - char(1)|0s - normal - - - 12 - char(1)|0s - normal - - - 13 + + 15 char(1)|0s normal - - 14 + + 16 char(1)|0s normal - - 15 + + 17 char(1)|0s normal - - 16 + + 18 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(8)|0s + char(4)|0s normal - + 7 - char(4)|0s + 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 - char(8)|0s + varchar(255)|0s normal - + 7 varchar(255)|0s normal - + 8 - varchar(255)|0s + char(8)|0s normal - + 1 id 1 diff --git a/.idea/dictionaries/zhai_.xml b/.idea/dictionaries/zhai_.xml index 02285b8..3011932 100644 --- a/.idea/dictionaries/zhai_.xml +++ b/.idea/dictionaries/zhai_.xml @@ -1,7 +1,9 @@ + excpt gdms + hmmss mariadb synchronizable diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml new file mode 100644 index 0000000..8ae97b9 --- /dev/null +++ b/.idea/jsonSchemas.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/tomcat_lib.xml b/.idea/libraries/tomcat_lib.xml new file mode 100644 index 0000000..569121d --- /dev/null +++ b/.idea/libraries/tomcat_lib.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 35bdbab..11bca97 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/GDMS.iml b/GDMS.iml index f7dd5c2..0c72c10 100644 --- a/GDMS.iml +++ b/GDMS.iml @@ -19,34 +19,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/documents/gdms (1).sql b/documents/gdms (1).sql new file mode 100644 index 0000000..8ad3039 --- /dev/null +++ b/documents/gdms (1).sql @@ -0,0 +1,261 @@ +-- -------------------------------------------------------- +-- 主机: 127.0.0.1 +-- 服务器版本: 10.2.18-MariaDB - mariadb.org binary distribution +-- 服务器操作系统: Win64 +-- HeidiSQL 版本: 9.4.0.5125 +-- -------------------------------------------------------- + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; + + +-- 导出 gdms 的数据库结构 +CREATE DATABASE IF NOT EXISTS `gdms` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `gdms`; + +-- 导出 表 gdms.administrator 结构 +CREATE TABLE IF NOT EXISTS `administrator` ( + `id` char(20) NOT NULL, + `password` char(255) NOT NULL, + `name` char(30) DEFAULT NULL, + `e_mail_location` char(40) DEFAULT NULL, + `phone_number` char(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.announcement 结构 +CREATE TABLE IF NOT EXISTS `announcement` ( + `id` char(20) NOT NULL, + `title` text DEFAULT NULL, + `information` text DEFAULT NULL, + `ralease_date` date DEFAULT NULL, + `annex_url` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公告'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design 结构 +CREATE TABLE IF NOT EXISTS `graduation_design` ( + `id` char(20) NOT NULL, + `student_id` char(20) DEFAULT NULL, + `teacher_id` char(20) DEFAULT NULL, + `teacher_choose_student_status` char(1) DEFAULT NULL, + `student_choose_teacher_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='毕业设计'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_finished_product 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_finished_product` ( + `id` char(20) NOT NULL, + `word_count` int(11) DEFAULT NULL, + `final_date` date DEFAULT NULL, + `graduation_design_url` varchar(255) DEFAULT NULL, + `chinese_abstract` text DEFAULT NULL, + `chinese_key_words` text DEFAULT NULL, + `english_abstract` text DEFAULT NULL, + `english_key_words` text DEFAULT NULL, + `score` float DEFAULT NULL, + `finished_product_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='毕设论文'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_finished_product_mentor_score 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_finished_product_mentor_score` ( + `id` char(20) NOT NULL, + `meet_requirement_score` float DEFAULT NULL, + `meaning_value_score` float DEFAULT NULL, + `subject_scale_score` float DEFAULT NULL, + `complexity_score` float DEFAULT NULL, + `ability_consult_literature_score` float DEFAULT NULL, + `comprehensive_use_knowledge_score` float DEFAULT NULL, + `design_capability_score` float DEFAULT NULL, + `ability_use_score` float DEFAULT NULL, + `title_consistent_score` float DEFAULT NULL, + `writing_level_score` float DEFAULT NULL, + `writing_specifications_score` float DEFAULT NULL, + `paper_length_score` float DEFAULT NULL, + `teory_value_score` float DEFAULT NULL, + `ability_use_foreign_language_score` float DEFAULT NULL, + `total_grade` float DEFAULT NULL, + `review_opinion` text DEFAULT NULL, + `review_opinion_date` date DEFAULT NULL, + `finished_product_mentor_score_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='指导老师评定成绩'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_finished_product_reviewer_score 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_finished_product_reviewer_score` ( + `id` char(20) NOT NULL, + `score` float DEFAULT NULL, + `opinion` text DEFAULT NULL, + `reviewer_score_date` date DEFAULT NULL, + `finished_product_reviewer_score_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='评阅老师对论文的评审成绩'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_information 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_information` ( + `id` char(20) NOT NULL, + `chinese_name` varchar(255) DEFAULT NULL, + `english_name` varchar(255) DEFAULT NULL, + `type_of_topic` varchar(255) DEFAULT NULL, + `source_of_design` varchar(255) DEFAULT NULL, + `nature_of_design` varchar(255) DEFAULT NULL, + `description_of_topic` text DEFAULT NULL, + `student_fill_graduation_design_information_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='毕业设计信息'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_opening_report 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_opening_report` ( + `id` char(20) NOT NULL, + `report_date` date DEFAULT NULL, + `report_location` varchar(255) DEFAULT NULL, + `report_url` varchar(255) DEFAULT NULL, + `report_teacher_leader_team_id` char(20) DEFAULT NULL, + `report_secretary_leader_team_id` char(20) DEFAULT NULL, + `estimated_word_count` int(11) DEFAULT NULL, + `opening_report_status` char(1) DEFAULT NULL, + `opening_report_mentor_opinion_status` char(1) DEFAULT NULL, + `opening_report_teacher_team_opinion_status` char(1) DEFAULT NULL, + `opening_report_college_opinion_status` char(1) DEFAULT NULL, + `opening_report_secretary_record_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开题报告'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_opening_report_opinion_record 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_opening_report_opinion_record` ( + `id` char(20) NOT NULL, + `mentor_opinion` text DEFAULT NULL, + `mentor_opinion_date` date DEFAULT NULL, + `secretary_record` text DEFAULT NULL, + `secretary_record_date` date DEFAULT NULL, + `report_teacher_team_opinion` text DEFAULT NULL, + `report_teacher_team_opinion_date` date DEFAULT NULL, + `college_opinion` text DEFAULT NULL, + `college_opinion_date` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开题报告会纪要'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_reply 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_reply` ( + `id` char(20) NOT NULL, + `date` date DEFAULT NULL, + `location` varchar(255) DEFAULT NULL, + `teacher_team_leader_id` char(20) DEFAULT NULL, + `secretary_team_leader_id` char(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='答辩'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.graduation_design_reply_opinion_record_score 结构 +CREATE TABLE IF NOT EXISTS `graduation_design_reply_opinion_record_score` ( + `id` char(20) NOT NULL, + `mentor_opinion text` text DEFAULT NULL, + `mentor_opinion_date date` date DEFAULT NULL, + `secretary_record` text DEFAULT NULL, + `secretary_record_date date` date DEFAULT NULL, + `teacher_team_opinion` text DEFAULT NULL, + `teacher_team_score` float DEFAULT NULL, + `teacher_team_opinion_date` date DEFAULT NULL, + `college_opinion` text DEFAULT NULL, + `college_score` float DEFAULT NULL, + `college_opinion_date` date DEFAULT NULL, + `school_opinion` text DEFAULT NULL, + `school_score` float DEFAULT NULL, + `school_opinion_date` date DEFAULT NULL, + `reply_ secretary_record_status` char(1) DEFAULT NULL, + `reply_ teacher_team_score_status` char(1) DEFAULT NULL, + `reply_ college_score_status` char(1) DEFAULT NULL, + `reply_school_score_status` char(1) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='答辩记录表'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.opening_report_secretary_team 结构 +CREATE TABLE IF NOT EXISTS `opening_report_secretary_team` ( + `leader_student_id` char(20) NOT NULL, + `student1_id` char(20) DEFAULT NULL, + `student2_id` char(20) DEFAULT NULL, + PRIMARY KEY (`leader_student_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开题报告秘书组'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.opening_report_teacher_team 结构 +CREATE TABLE IF NOT EXISTS `opening_report_teacher_team` ( + `leader_teacher_id` char(20) NOT NULL, + `teacher1_id` char(20) DEFAULT NULL, + `teacher2_id` char(20) DEFAULT NULL, + PRIMARY KEY (`leader_teacher_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开题报告老师组'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.profession_information 结构 +CREATE TABLE IF NOT EXISTS `profession_information` ( + `profession_code` char(8) NOT NULL, + `college` varchar(255) DEFAULT NULL, + `department` varchar(255) DEFAULT NULL, + `profession` varchar(255) DEFAULT NULL, + PRIMARY KEY (`profession_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='专业信息'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.reply_secretary_team 结构 +CREATE TABLE IF NOT EXISTS `reply_secretary_team` ( + `leader_student_id` char(20) NOT NULL, + `student1_id` char(20) DEFAULT NULL, + `student2_id` char(20) DEFAULT NULL, + PRIMARY KEY (`leader_student_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='答辩秘书小组'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.reply_teacher_team 结构 +CREATE TABLE IF NOT EXISTS `reply_teacher_team` ( + `leader_teacher_id` char(20) NOT NULL, + `teacher1_id` char(20) DEFAULT NULL, + `teacher2_id` char(20) DEFAULT NULL, + PRIMARY KEY (`leader_teacher_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='答辩教师组'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.student 结构 +CREATE TABLE IF NOT EXISTS `student` ( + `id` char(20) NOT NULL, + `password` char(255) NOT NULL, + `name` char(30) DEFAULT NULL, + `e_mail_location` char(40) DEFAULT NULL, + `phone_number` char(20) DEFAULT NULL, + `grade` char(4) DEFAULT NULL, + `profession_code` char(8) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学生用户'; + +-- 数据导出被取消选择。 +-- 导出 表 gdms.teacher 结构 +CREATE TABLE IF NOT EXISTS `teacher` ( + `id` char(20) NOT NULL, + `password` char(255) NOT NULL, + `name` char(30) DEFAULT NULL, + `e_mail_location` char(40) DEFAULT NULL, + `phone_number` char(20) DEFAULT NULL, + `job_title` varchar(255) DEFAULT NULL, + `education` varchar(255) DEFAULT NULL, + `profession_code` char(8) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='老师用户'; + +-- 数据导出被取消选择。 +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/documents/~$bys中期报告5.pptx b/documents/~$bys中期报告5.pptx deleted file mode 100644 index 2dc2a06..0000000 Binary files a/documents/~$bys中期报告5.pptx and /dev/null differ diff --git a/documents/数据库.txt b/documents/数据库.txt new file mode 100644 index 0000000..635fa76 --- /dev/null +++ b/documents/数据库.txt @@ -0,0 +1,198 @@ +id char 20//用户id +password char 255//用户密码 +name char 30//用户姓名 +e_mail_location char 40//邮箱 +phone_number char 20//电话号码 +url varchar 255//......路径 + +administrator//管理员 + id//管理员ID + password char 255//用户密码 + name char 30//用户姓名 + e_mail_location//电子邮件 + phone_number//电话号码 + +profession_information//专业信息 + profession_code char 8//专业代码 + college varchar 255//学院名称 + department varchar 255//系名称 + profession varchar 255//专业名称 + +student//学生用户 + id char 20//学生ID + password char 255//学生密码 + name char 30//学生姓名 + e_mail_location char 40//学生电子邮箱 + phone_number char 20//电话号码 + grade char 4//学生年级 + profession_code char 8//专业代码 + +teacher//老师 + id char 20//老师ID + password char 255//老师密码 + name char 30 //老师姓名 + e_mail_location char 40 //电子邮件 + phonenumber //电话 + job_title varchar 255//职称 + education varchar 255//老师学历 + profession_code char 8//专业代码 + +graduation_design//毕业设计 + id char 20//论文ID + stu_id char 20//学生id + teacher_id char 20//老师id + teacher_choose_student_status char 1 //指导老师指导学生 + student_choose_teacher_status char 1//学生选择老师 + + + + +graduation_design_information//毕业设计信息 + id char 20//论文ID + chinese_name varchar 255//论文中文名 + english_name varchar 255//论文英文名 + type_of_topic varchar 255//题目类别 + source_of_design varchar 255//选题来源 + nature_of_design varchar 255//选题性质 + description_of_topic text//题目简介 + student_fill_graduation_design_information_status char 1//学生填写选题信息 + +graduation_design_opening_report//开题报告 + id char 20//论文ID + report_date date//开题报告日期 + report_location varchar 255//开题报告地点 + report_url varchar 255 //开题报告路径 + report_teacher_leader_team_id char 20 //开题报告评阅老师组组长 + report_secretary_leader_team_id char 20 //开题报告秘书组长 + estimated_word_count int//预计字数 + opening_report_status char 1//学生提交开题报告书 + opening_report_mentor_opinion_status char 1//指导老师提交开题报告书意见 + opening_report_teacher_team_opinion_status char 1//开题报告会组长提交开题报告会纪要意见 + opening_report_college_opinion_status char 1//学院老师提交开题报告会纪要意见 + opening_report_secretary_record_status char 1//开题秘书提交开题报告会纪要 + +graduation_design_opening_report_opinion_record//开题报告会纪要 + id char 20 //论文ID + mentor_opinion text//导师意见 + mentor_opinion_date date//导师意见填写日期 + secretary_record text//秘书填写会议记录摘要 + secretary_record_date date//秘书记录日期 + report_teacher_team_opinion text//教师指导小组意见 + report_teacher_team_opinion_date date//教师指导小组填写日期 + college_opinion text//学院意见 + college_opinion_date date//学院意见日期 + +opening_report_teacher_team//开题报告老师组 + leader_teacher_id char 20//开题报告老师组组长 + teacher1_id char 20//开题报告老师组成员1 + teacher2_id char 20//开题报告老师组成员2 + +opening_report_secretary_team//开题报告秘书组 + leader_student_id char 20//开题报告秘书组组长 + student1_id char 20//开题报告秘书组成员1 + student2_id char 20//开题报告秘书组成员2 + +graduation_design_finished_product//毕设论文评审表 + id char 20//论文ID + word_count int//论文字数 + final_date date//定稿日期 + graduation_design_url varchar 255//论文路径 + chinese_abstract text//中文摘要 + chinese_key_words text//中文关键词 + english_abstract text//英文摘要 + english_key_words text//英文关键词 + score float//最终分数 + finished_product_status char 1//学生提交定稿 + + +graduation_design_finished_product_mentor_score//指导老师评定成绩 + id char 20//论文ID + meet_requirement_score float//目的明确符合要求 + meaning_value_score float//理论意义或实际价值 + subject_scale_score float//题目规模适当 + complexity_score float//难易度适中 + ability_consult_literature_score float//查阅文献资料能力 + comprehensive_use_knowledge_score float//综合运用知识能力 + design_capability_score float//研究方案的设计能力 + ability_use_score float//研究方法和手段的运用能力 + title_consistent_score float//文题相符 + writing_level_score float//写作水平 + writing_specifications_score float//写作规范 + paper_length_score float//论文篇幅 + teory_value_score float//成果的理论或实际价值 + ability_use_foreign_language_score float//外文应用能力 + total_grade float//总成绩 + review_opinion text//指导老师评审意见 + review_opinion_date date//评审日期 + finished_product_mentor_score_status char 1//指导老师评阅 + +graduation_design_finished_product_reviewer_score//评阅老师对论文的评审成绩 + id char 20//论文ID + score float//分数 + opinion text//意见 + reviewer_score_date date//评阅老师评阅日期 + finished_product_reviewer_score_status char 1//评阅老师评阅 + +graduation_design_reply//答辩 + id char 20//论文ID + date date//答辩日期 + location varchar 255//答辩地点 + teacher_team_leader_id//答辩教师组组长id + secretary_team_leader_id//答辩秘书组组长id + +graduation_design_reply_opinion_record_score//答辩记录表 + id char 20//论文ID + mentor_opinion text//导师意见 + mentor_opinion_date date//导师意见提交日期 + secretary_record text//秘书记录 + secretary_record_date date//秘书记录日期 + teacher_team_opinion text//教师组意见 + teacher_team_score int//教师评分 + teacher_team_opinion_date date//教师意见日期 + college_opinion text//学院意见 + college_score int//学院分数 + college_opinion_date date//学院意见日期 + school_opinion text//学校意见 + school_score int//学校分数 + school_opinion_date date//学校意见日期 + reply_ secretary_record_status char 1//答辩秘书提交答辩记录表 + reply_ teacher_team_score_status char 1//答辩小组提交评分意见 + reply_ college_score_status char 1//学院老师提交评分意见 + reply_school_score_status char 1//学校老师提交评分意见 + +reply_teacher_team//答辩教师组 + leader_teacher_id char 20//组长id + teacher1_id char 20//组员1 + teacher2_id char 20//组员2 + +reply_secretary_team//答辩秘书小组 + leader_student_id char 20//组长 + student1_id char 20//组员1 + student2_id char 20//组员2 + +announcement //公告 + id char 20//公告ID + title text //公告标题 + information text //公告信息 + ralease_date date//公告发布日期 + annex_url varchar 255//附件链接 + + + + + + + + + + + + +global_time_point//全局时间点 + teacher_choose_student_start_date date //开始选题时间 + student_choose_teacher_start_date date //开放选题入口时间 + choose_end_date date//关闭选题入口时间 + opening_report_opinion_deadline_date date//开题报告意见提交截止时间 + finished_product_deadline_date date//定稿上传截止日期 + finished_product_review_deadline_date date//评阅截止日期 + reply_opition_deadline_date date//答辩意见截止日期 \ No newline at end of file diff --git a/documents/数据库E-R图-final (1) (1).jpg b/documents/数据库E-R图-final (1) (1).jpg new file mode 100644 index 0000000..6831761 Binary files /dev/null and b/documents/数据库E-R图-final (1) (1).jpg differ diff --git a/documents/目录.docx b/documents/目录.docx deleted file mode 100644 index cdb9aac..0000000 Binary files a/documents/目录.docx and /dev/null differ diff --git a/documents/约定.txt b/documents/约定.txt new file mode 100644 index 0000000..7b9a7e2 --- /dev/null +++ b/documents/约定.txt @@ -0,0 +1,7 @@ +status有五种: + 1, 0 000 未开始 + 2, 1 001 开始未完成 + 3, 3 011 开始已完成未结束 + 4, 5 101 开始未完成已结束 + 5, 7 111 开始已完成已结束 + ,,,其余无效 \ No newline at end of file diff --git a/documents/设计文档1.0 (1).pdf b/documents/设计文档1.0 (1).pdf deleted file mode 100644 index 666e781..0000000 Binary files a/documents/设计文档1.0 (1).pdf and /dev/null differ diff --git a/documents/设计文档2.0.docx b/documents/设计文档2.0.docx new file mode 100644 index 0000000..3b0127a Binary files /dev/null and b/documents/设计文档2.0.docx differ diff --git a/documents/选题+开题+定稿+答辩-方块图.jpg b/documents/选题+开题+定稿+答辩-方块图.jpg new file mode 100644 index 0000000..167dc75 Binary files /dev/null and b/documents/选题+开题+定稿+答辩-方块图.jpg differ diff --git a/documents/选题开题评阅答辩评分功能 .docx b/documents/选题开题评阅答辩评分功能 .docx new file mode 100644 index 0000000..cda5894 Binary files /dev/null and b/documents/选题开题评阅答辩评分功能 .docx differ diff --git a/documents/需求报告2.01.docx b/documents/需求报告2.01.docx deleted file mode 100644 index 25a6e1b..0000000 Binary files a/documents/需求报告2.01.docx and /dev/null differ diff --git a/src/core/operation/Delete.java b/src/core/operation/Delete.java index 2827091..f9e7acd 100644 --- a/src/core/operation/Delete.java +++ b/src/core/operation/Delete.java @@ -15,6 +15,6 @@ public class Delete extends Operation { for(String table:DBManagement.graduationDesignTables){ DBManagement.delete(table,map); } - return options; + return this.getOptions(); } } diff --git a/src/core/operation/DownloadFile.java b/src/core/operation/DownloadFile.java index f33f474..ddb242d 100644 --- a/src/core/operation/DownloadFile.java +++ b/src/core/operation/DownloadFile.java @@ -1,12 +1,27 @@ package core.operation; import core.user.User; +import dao.DBManagement; +import java.io.File; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; import java.util.Map; public class DownloadFile extends Operation{ @Override public Map execute(User subject) throws Exception { + String table = (String) this.getOptions().get("file_type"); + Map limits = (Map) this.getOptions().get("limits"); + String field = core.operation.utils.Utils.getFileField(table); + List ls = new ArrayList<>(); + ls.add(field); + ResultSet rs = DBManagement.select(ls,table,limits,0,1); + rs.next(); + String filePath = rs.getString(0); + File file = new File(filePath); + this.getOptions().put("file",file); return this.getOptions(); } } diff --git a/src/core/operation/DownloadFile.json b/src/core/operation/DownloadFile.json index ad27ff9..8817266 100644 --- a/src/core/operation/DownloadFile.json +++ b/src/core/operation/DownloadFile.json @@ -1,6 +1,9 @@ { "options":{ - + "file_type":"String", + "limits":"Map" }, - "return":{} + "return":{ + "file":"File" + } } \ No newline at end of file diff --git a/src/core/operation/Operation.java b/src/core/operation/Operation.java index 729a987..37f8c1e 100644 --- a/src/core/operation/Operation.java +++ b/src/core/operation/Operation.java @@ -1,6 +1,7 @@ package core.operation; +import core.operation.utils.Utils; import core.user.User; import error.GExcptFormat; import gdms.Mode; @@ -9,8 +10,8 @@ import java.util.Map; public abstract class Operation { - protected Map options; - protected User subject; + private Map options; + private User subject; Operation(){ super(); } @@ -26,7 +27,7 @@ public abstract class Operation { return options; } public void setOptions(String options) throws GExcptFormat { - this.options = core.operation.utils.util.string2MapOptions(options); + this.options = Utils.string2MapOptions(options); } public void addOptions(String key, Object value){ if ( Mode.strict == 1){ diff --git a/src/core/operation/Search.json b/src/core/operation/Search.json index 5dfe358..5dc66c4 100644 --- a/src/core/operation/Search.json +++ b/src/core/operation/Search.json @@ -1,8 +1,8 @@ { "options":{ "table": "String", - "fields": "List", - "value": "String", + "fields": "List", + "limits": "Map", "start": "int", "end": "int" }, diff --git a/src/core/operation/UploadFileOperation.java b/src/core/operation/UploadFileOperation.java index c3a60dc..527b5ac 100644 --- a/src/core/operation/UploadFileOperation.java +++ b/src/core/operation/UploadFileOperation.java @@ -1,13 +1,38 @@ package core.operation; import core.user.User; +import dao.DBManagement; import error.GExcptSQL; +import java.io.File; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; public class UploadFileOperation extends Operation { @Override - public Map execute(User subject) throws GExcptSQL { + public Map execute(User subject) throws Exception { + File file = (File) this.getOptions().get("file"); + String table = (String) this.getOptions().get("file_type"); + Map limits = (Map) this.getOptions().get("limits"); + + String field = core.operation.utils.Utils.getFileField(table); + String filePath = core.operation.utils.Utils.getFilePathName(table,file.getName()); + Map vMap = new HashMap<>(); + vMap.put(field,filePath); + + file.renameTo(new File(filePath)); + //todo + + List ls = new ArrayList<>(); + ls.add(field); + ResultSet rs = DBManagement.select(ls,table,limits,0,1); + rs.next(); + String lastFilePath = rs.getString(0); + new File(lastFilePath).delete(); + DBManagement.update(table,vMap,limits); return this.getOptions(); } } diff --git a/src/core/operation/UploadFileOperation.json b/src/core/operation/UploadFileOperation.json index ed59a86..c2a2f65 100644 --- a/src/core/operation/UploadFileOperation.json +++ b/src/core/operation/UploadFileOperation.json @@ -1,6 +1,8 @@ { "options":{ - "file": "File" + "file": "File", + "file_type": "String", + "limits":"Map" }, "return":{} } \ No newline at end of file diff --git a/src/core/operation/fileType.json b/src/core/operation/fileType.json new file mode 100644 index 0000000..70b496d --- /dev/null +++ b/src/core/operation/fileType.json @@ -0,0 +1,5 @@ +{ + "公告文件": "announcement", + "开题报告":"graduation_design_reply", + "毕业设计定稿":"graduation_design_finished_product" +} \ No newline at end of file diff --git a/src/core/operation/utils/Utils.java b/src/core/operation/utils/Utils.java new file mode 100644 index 0000000..217e8be --- /dev/null +++ b/src/core/operation/utils/Utils.java @@ -0,0 +1,53 @@ +package core.operation.utils; + +import error.GExcptFormat; +import gdms.Configuration; +import gdms.Mode; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public interface Utils { + Map fileTableField = new HashMap<>() { + { + put("announcement","annex_url"); + put("graduation_design_finished_product","graduation_design_url"); + put("graduation_design_opening_report","report_url"); + }}; + static String stringOptionsFormat(String options){ + return options.replaceAll(" {2,}", " ") ; + } + static Map string2MapOptions(String sOptions) throws GExcptFormat { + sOptions = stringOptionsFormat(sOptions); + Map options = new HashMap<>(); + String[] sOpts = sOptions.split(" "); + for(int i=0;i string2MapOptions(String sOptions) throws GExcptFormat { - sOptions = stringOptionsFormat(sOptions); - Map options = new HashMap<>(); - String[] sOpts = sOptions.split(" "); - for(int i=0;i TeacherInfo=new HashMap(); + public Map search(String teacherID) throws Exception { + Search search = new Search() ; + search.setOptions(new HashMap<>()); + String table = "teacher"; + search.addOptions("table",table); + 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",1); + Map options = search.execute(null); + List result = (List) options.get("result"); + String[] s = result.get(0); + TeacherInfo.put("id",s[0]); + TeacherInfo.put("name",s[2]); + return TeacherInfo; + } +} diff --git a/src/core/process/C_StudentSelectTeacher.java b/src/core/process/C_StudentSelectTeacher.java new file mode 100644 index 0000000..d2b9b93 --- /dev/null +++ b/src/core/process/C_StudentSelectTeacher.java @@ -0,0 +1,22 @@ +package core.process; + +import core.operation.Select; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class C_StudentSelectTeacher extends core.process.Process { + public void select(String studentID,String teacherID)throws Exception{ + Select select=new Select(); + select.setOptions(new HashMap<>()); + String student_id=studentID; + select.addOptions("student_id",student_id); + String teacher_id=teacherID; + select.addOptions("teacher_id",teacher_id); + Map options=select.execute(null); + } + + +} diff --git a/src/core/process/C_TeacherSearchStudent.java b/src/core/process/C_TeacherSearchStudent.java new file mode 100644 index 0000000..8fe27b0 --- /dev/null +++ b/src/core/process/C_TeacherSearchStudent.java @@ -0,0 +1,32 @@ +package core.process; + +import core.operation.Search; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class C_TeacherSearchStudent { + Map StudentInfo=new HashMap(); + public Map search(String studentID) throws Exception{ + Search search = new Search() ; + search.setOptions(new HashMap<>()); + String table = "student"; + search.addOptions("table",table); + 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",1); + Map options = search.execute(null); + List result = (List) options.get("result"); + String[] s = result.get(0); + StudentInfo.put("id",s[0]); + StudentInfo.put("name",s[2]); + return StudentInfo; + } +} diff --git a/src/core/process/C_TeacherSelectStudent.java b/src/core/process/C_TeacherSelectStudent.java new file mode 100644 index 0000000..a13ef73 --- /dev/null +++ b/src/core/process/C_TeacherSelectStudent.java @@ -0,0 +1,33 @@ +package core.process; + +import core.operation.Select; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class C_TeacherSelectStudent extends Process { + List list; + + public C_TeacherSelectStudent clone(){ + C_TeacherSelectStudent tst = new C_TeacherSelectStudent(); + tst.setInfo( this.getInfo()); + List 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.setOptions(new HashMap<>()); + String teacher_id=teacherID; + select.addOptions("teacher_id",teacher_id); + String student_id=studentID; + select.addOptions("student_id",student_id); + Map options=select.execute(null); + } + + +} diff --git a/src/core/process/Condition.java b/src/core/process/Condition.java index 9365dbb..14c5986 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/LastProcess.java b/src/core/process/LastProcess.java new file mode 100644 index 0000000..f376a4d --- /dev/null +++ b/src/core/process/LastProcess.java @@ -0,0 +1,4 @@ +package core.process; + +public abstract class LastProcess extends Process { +} diff --git a/src/core/process/Process.java b/src/core/process/Process.java index b4b818e..a79f94f 100644 --- a/src/core/process/Process.java +++ b/src/core/process/Process.java @@ -2,17 +2,14 @@ package core.process; import core.operation.Operation; -public abstract class Process implements Cloneable{ +public abstract class Process{ + + private char status; private String permission; private Operation operation; private String buttonName; private String info; - @Override - public Process clone(){ - //todo - return null; - } public String getPermission() { return permission; @@ -45,4 +42,12 @@ public abstract class Process implements Cloneable{ public void setInfo(String info) { this.info = info; } + + public char getStatus() { + return status; + } + + public void setStatus(char status) { + this.status = status; + } } diff --git a/src/core/process/ProcessManagement.java b/src/core/process/ProcessManagement.java index 88dcb8f..3d64848 100644 --- a/src/core/process/ProcessManagement.java +++ b/src/core/process/ProcessManagement.java @@ -1,9 +1,46 @@ package core.process; +import core.user.User; +import dao.DBManagement; + import java.util.List; +import java.util.Map; public class ProcessManagement { - public Condition getCondition(String userType, List index){ + public static Condition getCondition(User user) { + Map status = getStatus(user); + return getCondition(user,status); + } + public static Condition getCondition(User user, Map status){ + Condition condition = new Condition(); + for(Map.Entry entry:status.entrySet()){ + String[] s = entry.getKey().split("."); + TempProcess tempProcess = (TempProcess) getProcess(s[1]); + tempProcess.setGraduationDesignId(s[0]); + tempProcess.setStatus(entry.getValue()); + condition.add(tempProcess); + } + condition.add(getLastProcesses(user)); + return condition; + } + + private static List getLastProcesses(User user) { return null; } + //Map + public static Map getStatus(User user){ + + Map userTables = DBManagement.getUserTables(user.getType()); + String graduationDesignId = null; + for(Map.Entry entry:userTables.entrySet()){ + String[] ti = entry.getKey().split("."); + String[] ts = entry.getValue().split("."); + + } + + return null; + } + public static Process getProcess(String process){ + return null; + } } diff --git a/src/core/process/TempProcess.java b/src/core/process/TempProcess.java new file mode 100644 index 0000000..2675bff --- /dev/null +++ b/src/core/process/TempProcess.java @@ -0,0 +1,31 @@ +package core.process; + +public abstract class TempProcess extends Process { + private static String process; + private static String nextProcess; + private String graduationDesignId; + + public String getGraduationDesignId() { + return graduationDesignId; + } + + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + + public static String getProcess() { + return process; + } + + public static void setProcess(String process) { + TempProcess.process = process; + } + + public static String getNextProcess() { + return nextProcess; + } + + public static void setNextProcess(String nextProcess) { + TempProcess.nextProcess = nextProcess; + } +} diff --git a/src/core/user/Administrator.java b/src/core/user/Administrator.java index f56ff0d..71d0c9e 100644 --- a/src/core/user/Administrator.java +++ b/src/core/user/Administrator.java @@ -3,6 +3,11 @@ package core.user; import java.util.Map; public class Administrator extends User { + @Override + public String getType() { + return "administrator"; + } + @Override public void setAttr(Map vMap){ super.setAttr(vMap); diff --git a/src/core/user/Student.java b/src/core/user/Student.java index 7365272..4d4987b 100644 --- a/src/core/user/Student.java +++ b/src/core/user/Student.java @@ -6,6 +6,12 @@ import java.util.Map; public class Student extends User { private String grade; private String profession_code; + + @Override + public String getType() { + return "student"; + } + public void setAttr(Map vMap){ super.setAttr(vMap); this.setGrade(vMap.get("grade")); diff --git a/src/core/user/Teacher.java b/src/core/user/Teacher.java index 2a24d05..9b7c053 100644 --- a/src/core/user/Teacher.java +++ b/src/core/user/Teacher.java @@ -7,6 +7,12 @@ public class Teacher extends User { String job_title; String education; String profession_code; + + @Override + public String getType() { + return "teacher"; + } + @Override public void setAttr(Map vMap){ super.setAttr(vMap); diff --git a/src/core/user/User.java b/src/core/user/User.java index 89b29b0..236c2ae 100644 --- a/src/core/user/User.java +++ b/src/core/user/User.java @@ -89,9 +89,7 @@ public abstract class User implements AccountManageable, ProcessConfigurable{ super(); } - public String getType(){ - return this.getClass().getName(); - } + public abstract String getType(); public void destroy(){ core.user.utils.AccountManagement.destroy(this); diff --git a/src/core/user/utils/AccountManagement.java b/src/core/user/utils/AccountManagement.java index 3467e77..8d70b1d 100644 --- a/src/core/user/utils/AccountManagement.java +++ b/src/core/user/utils/AccountManagement.java @@ -1,6 +1,7 @@ package core.user.utils; import core.user.User; +import core.utils.GetObjectByName; import dao.DBManagement; import error.GExcptAccount; import error.GExcptSQL; @@ -18,7 +19,7 @@ import java.util.Map; import static dao.DBManagement.userTables; public interface AccountManagement { - static User login(String id, String password) throws GExcptSQL, GExcptAccount, SQLException { + static User login(String id, String password) throws Exception { ResultSet rs = null; String userType = null; for(String userTable:userTables){ @@ -27,7 +28,7 @@ public interface AccountManagement { Map limits = new HashMap<>(); limits.put("id",id); try { - rs = DBManagement.select(columns,userTable,limits,1,2); + rs = DBManagement.select(columns,userTable,limits,0,1); } catch (Exception e) { throw new GExcptSQL("QUERY\n\t"+id+"\nfailure"); } @@ -40,22 +41,17 @@ public interface AccountManagement { throw new GExcptAccount("id "+id+"don't exists"); } rs.next(); - try { - if(!rs.getString(2).equals(password)) - throw new GExcptAccount("password wrong"); - Map vMap = new HashMap<>(); - ResultSetMetaData rsm = rs.getMetaData(); - rs.next(); - for(int i=0;i vMap = new HashMap<>(); + ResultSetMetaData rsm = rs.getMetaData(); + rs.next(); + for(int i=0;i vMap) throws GExcptSQL { + static User register(String userType, Map vMap) throws Exception { DBManagement.insert(userType,vMap); return createUser(userType, vMap); } @@ -65,16 +61,8 @@ public interface AccountManagement { static void destroy(User user){ //todo } - static User getUser(String userType){ - try { - return (User) Class.forName("core.user."+ Utils.toUpperFirstChar(userType)).getDeclaredConstructor().newInstance(); - } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | ClassNotFoundException e) { - e.printStackTrace(); - } - return null; - } - static User createUser(String userType, Map vMap) { - User user = getUser(userType); + static User createUser(String userType, Map vMap) throws Exception { + User user = GetObjectByName.getUserByName(userType); user.setAttr(vMap); return user; } diff --git a/src/core/utils/GetObjectByName.java b/src/core/utils/GetObjectByName.java index dcd68a1..72f8a8d 100644 --- a/src/core/utils/GetObjectByName.java +++ b/src/core/utils/GetObjectByName.java @@ -1,12 +1,15 @@ package core.utils; +import core.operation.Operation; +import core.user.User; + public interface GetObjectByName { String userClassPath = "core.user"; String operationClassPath = "core.operation"; - static Object getUserByName(String name) throws Exception { - return Class.forName(userClassPath+"."+name).getDeclaredConstructor().newInstance(); + static User getUserByName(String name) throws Exception { + return (User)Class.forName(userClassPath+"."+utils.Utils.toUpperFirstChar(name)).getDeclaredConstructor().newInstance(); } - static Object getOperationByName(String name) throws Exception{ - return Class.forName(operationClassPath+"."+name).getDeclaredConstructor().newInstance(); + static Operation getOperationByName(String name) throws Exception{ + return (Operation)Class.forName(operationClassPath+"."+utils.Utils.toUpperFirstChar(name)).getDeclaredConstructor().newInstance(); } } diff --git a/src/dao/DBManagement.java b/src/dao/DBManagement.java index dd423cc..703602a 100644 --- a/src/dao/DBManagement.java +++ b/src/dao/DBManagement.java @@ -1,10 +1,12 @@ package dao; import java.sql.*; +import java.util.HashMap; import java.util.List; import java.util.Map; import error.GExcptSQL; +import gdms.Configuration; import org.apache.tomcat.jdbc.pool.DataSource; import org.apache.tomcat.jdbc.pool.PoolProperties; @@ -27,12 +29,28 @@ public class DBManagement { "graduation_design_reply", "graduation_design_reply_opinion_record_score" }; + // + public static Map graduationDesignStudentTables = new HashMap<>(){ + { + put("graduation_design.student_id","graduation_design.student_chooser_teacher_status"); + + + put("opening_report_secretary_team.leader_student_id",""); + put("opening_report_secretary_team.student1_id",""); + put("opening_report_secretary_team.student2_id",""); + put("reply_secretary_team.leader_student_id",""); + put("reply_secretary_team.student1_id",""); + put("reply_secretary_team.student2_id",""); + } + }; + public static Map graduationDesignTeacherTables = new HashMap<>(){ + { + put("",""); + } + }; + public static String driverClassName="org.mariadb.jdbc.Driver"; - static final String driverClassName="org.mariadb.jdbc.Driver"; - static final String url="jdbc:mariadb://localhost:3306/gdms"; - static final String username="gdms"; - static final String password="GDMS"; public static DataSource dataSource = new DataSource(); @@ -40,10 +58,10 @@ public class DBManagement { public static void init(){ PoolProperties poolProperties = new PoolProperties(); - poolProperties.setUrl(url); - poolProperties.setDriverClassName(driverClassName); - poolProperties.setUsername(username); - poolProperties.setPassword(password); + poolProperties.setUrl(Configuration.dbUrl); + poolProperties.setDriverClassName(DBManagement.driverClassName); + poolProperties.setUsername(Configuration.dbUsername); + poolProperties.setPassword(Configuration.dbPassword); dataSource.setPoolProperties(poolProperties); try { Class.forName(driverClassName); @@ -55,12 +73,21 @@ public class DBManagement { public static Connection getConnection(){ if(!ifInit) return null; try { - return DriverManager.getConnection(url,username,password); + return DriverManager.getConnection(Configuration.dbUrl,Configuration.dbUsername,Configuration.dbPassword); } catch (SQLException e) { e.printStackTrace(); } return null; } + public static Map getUserTables(String userType){ + if(userType.equals("student")){ + return graduationDesignStudentTables; + } + if(userType.equals("teacher")){ + return graduationDesignTeacherTables; + } + return null; + } public static void delete(String table, Map limits) throws GExcptSQL { Delete delete = new Delete(table, limits); diff --git a/src/gdms/Configuration.java b/src/gdms/Configuration.java new file mode 100644 index 0000000..4128db3 --- /dev/null +++ b/src/gdms/Configuration.java @@ -0,0 +1,10 @@ +package gdms; + +public interface Configuration { + //file + String filePath = "/"; + //database + String dbUrl="jdbc:mariadb://localhost:3306/gdms"; + String dbUsername="gdms"; + String dbPassword="GDMS"; +} diff --git a/src/gdms/Mode.java b/src/gdms/Mode.java index 4415ae0..347228f 100644 --- a/src/gdms/Mode.java +++ b/src/gdms/Mode.java @@ -1,6 +1,6 @@ package gdms; public interface Mode { - public static int strict = 1; + public static int strict = 0; public static int debug = 1; } diff --git a/src/gdms/test.java b/src/gdms/test.java index aac73b8..9c49cea 100644 --- a/src/gdms/test.java +++ b/src/gdms/test.java @@ -1,5 +1,7 @@ package gdms; +import core.operation.utils.Utils; +import core.process.C_StudentSelectTeacher; import dao.Select; import java.util.ArrayList; @@ -9,6 +11,14 @@ import java.util.Map; public class test { public static void main(String[] args){ + String student_id = "001"; + String teacher_id = "002"; + core.process.Process p = new C_StudentSelectTeacher(); + try { + ((C_StudentSelectTeacher) p).select(student_id,teacher_id); + } catch (Exception e) { + e.printStackTrace(); + } List list = new ArrayList<>(); list.add("q"); list.add("w"); @@ -17,5 +27,12 @@ public class test { map.put("c","d"); Select sql = new Select(list,"zx",map,1,2); System.out.println(sql.getSQL()); + System.out.println(Utils.getFilePathName("a","b")); + String a = "a"; + changeB(a); + System.out.println(a); + } + static void changeB(String a){ + a="B"; } } diff --git a/src/servlet/S_StudentSelectTeacher.java b/src/servlet/S_StudentSelectTeacher.java new file mode 100644 index 0000000..57d6432 --- /dev/null +++ b/src/servlet/S_StudentSelectTeacher.java @@ -0,0 +1,24 @@ +package servlet; + +import core.process.C_StudentSearchTeacher; +import core.process.C_StudentSelectTeacher; +import core.user.User; +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_StudentSelectTeacher extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + super.doPost(request, response); + String student_id=request.getParameter("id"); + User user=(User)request.getSession().getAttribute("user"); + String teacher_id=user.getId(); + try { + new C_StudentSelectTeacher().select(student_id,teacher_id); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/servlet/S_TeacherSelectStudent.java b/src/servlet/S_TeacherSelectStudent.java new file mode 100644 index 0000000..0d3d44d --- /dev/null +++ b/src/servlet/S_TeacherSelectStudent.java @@ -0,0 +1,24 @@ +package servlet; + +import core.process.C_TeacherSelectStudent; +import core.user.User; + +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_TeacherSelectStudent extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + super.doPost(request, response); + String teacher_id=request.getParameter("id"); + User user=(User)request.getSession().getAttribute("user"); + String student_id=user.getId(); + try { + new C_TeacherSelectStudent().select(teacher_id,student_id); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/servlet/account/S_Register.java b/src/servlet/account/S_Register.java new file mode 100644 index 0000000..b3397fb --- /dev/null +++ b/src/servlet/account/S_Register.java @@ -0,0 +1,46 @@ +package servlet.account; + +import core.user.User; +import core.user.utils.AccountManagement; +import error.GExcptAccount; +import error.GExcptSQL; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +public class S_Register extends HttpServlet { + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + super.doPost(request, response); + Map user_info=new HashMap<>(); + String id=request.getParameter("id"); + user_info.put("id",id); + String name=request.getParameter("name"); + user_info.put("name",name); + String e_mail=request.getParameter("e-mail"); + user_info.put("e_mail",e_mail); + String phone_number=request.getParameter("phone-number"); + user_info.put("phone_number",phone_number); + String password=request.getParameter("password"); + user_info.put("password",password); + User user=null; + try { + user = AccountManagement.register("student",user_info); + } catch (GExcptSQL gExcptSQL) { + gExcptSQL.printStackTrace(); + } catch (GExcptAccount gExcptAccount) { + gExcptAccount.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + //注册失败 + request.getSession().setAttribute("User",user); + request.getRequestDispatcher("/home.jsp").forward(request,response); + + } +} \ No newline at end of file diff --git a/src/servlet/account/login.java b/src/servlet/account/login.java index ef1e238..0afd51b 100644 --- a/src/servlet/account/login.java +++ b/src/servlet/account/login.java @@ -28,13 +28,10 @@ public class login extends HttpServlet { gExcptSQL.printStackTrace(); } catch (GExcptAccount gExcptAccount) { gExcptAccount.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); } - request.getSession().setAttribute("User",user); + request.getSession().setAttribute("user",user); request.getRequestDispatcher("/home.jsp").forward(request,response); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - } } diff --git a/src/servlet/account/service.java b/src/servlet/account/service.java deleted file mode 100644 index 0f6cadf..0000000 --- a/src/servlet/account/service.java +++ /dev/null @@ -1,23 +0,0 @@ -package servlet.account; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet( "/service") -public class service extends HttpServlet { - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - System.out.print(request.getParameter("id")); - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - } -} diff --git a/src/utils/Utils.java b/src/utils/Utils.java index d439588..09f8310 100644 --- a/src/utils/Utils.java +++ b/src/utils/Utils.java @@ -27,4 +27,11 @@ public interface Utils { static String cutTail(String s,int i){ return s.substring(0,s.length()-i); } + static String getFileType(String fileName){ + if(fileName.contains(".")){ + return fileName.substring(fileName.lastIndexOf('.')); + }else{ + return ""; + } + } } diff --git a/web/select.jsp b/web/select.jsp index 8793033..7f60717 100644 --- a/web/select.jsp +++ b/web/select.jsp @@ -28,7 +28,7 @@
-
+
c
李先生