Merge remote-tracking branch 'remotes/origin/master' into hechu1

hechu1
何楚 6 years ago
commit 278bab9db0

@ -7,6 +7,9 @@
<element id="directory" name="classes">
<element id="module-output" name="GDMS" />
</element>
<element id="directory" name="lib">
<element id="file-copy" path="C:/Program Files/apache-tomcat-9.0.13/lib/tomcat-jdbc.jar" />
</element>
</element>
</root>
</artifact>

File diff suppressed because it is too large Load Diff

@ -1,7 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="zhai_">
<words>
<w>excpt</w>
<w>gdms</w>
<w>hmmss</w>
<w>mariadb</w>
<w>synchronizable</w>
</words>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JsonSchemaMappingsProjectConfiguration">
<state>
<map>
<entry key="bukkit-plugin">
<value>
<SchemaInfo>
<option name="name" value="bukkit-plugin" />
<option name="relativePathToSchema" value="http://json.schemastore.org/bukkit-plugin" />
<option name="applicationDefined" value="true" />
<option name="patterns">
<list>
<Item>
<option name="path" value="src/core/user/student.json" />
</Item>
</list>
</option>
</SchemaInfo>
</value>
</entry>
</map>
</state>
</component>
</project>

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="tomcat-lib">
<CLASSES>
<root url="file://C:/Program Files/Apache Software Foundation/Tomcat 8.5/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://C:/Program Files/Apache Software Foundation/Tomcat 8.5/lib" recursive="false" />
</library>
</component>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -19,34 +19,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5" level="application_server_libraries" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://E:/tomcat8/apache-tomcat-8.5.37/lib/tomcat-jdbc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/web/WEB-INF/lib/commons-fileupload-1.3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/web/WEB-INF/lib/commons-io-2.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="lib" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5.37" level="application_server_libraries" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="tomcat-lib" level="project" />
</component>
</module>

@ -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 */;

Binary file not shown.

@ -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//答辩意见截止日期

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

@ -0,0 +1,7 @@
status有五种
1, 0 000 未开始
2, 1 001 开始未完成
3, 3 011 开始已完成未结束
4, 5 101 开始未完成已结束
5, 7 111 开始已完成已结束
,,,其余无效

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

@ -15,6 +15,6 @@ public class Delete extends Operation {
for(String table:DBManagement.graduationDesignTables){
DBManagement.delete(table,map);
}
return options;
return this.getOptions();
}
}

@ -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<String, Object> execute(User subject) throws Exception {
String table = (String) this.getOptions().get("file_type");
Map<String,String> limits = (Map<String, String>) this.getOptions().get("limits");
String field = core.operation.utils.Utils.getFileField(table);
List<String> 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();
}
}

@ -1,6 +1,9 @@
{
"options":{
"file_type":"String",
"limits":"Map<String,String>"
},
"return":{}
"return":{
"file":"File"
}
}

@ -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<String, Object> options;
protected User subject;
private Map<String, Object> 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){

@ -1,8 +1,8 @@
{
"options":{
"table": "String",
"fields": "List",
"value": "String",
"fields": "List<String>",
"limits": "Map<String,String>",
"start": "int",
"end": "int"
},

@ -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<String, Object> execute(User subject) throws GExcptSQL {
public Map<String, Object> execute(User subject) throws Exception {
File file = (File) this.getOptions().get("file");
String table = (String) this.getOptions().get("file_type");
Map<String,String> limits = (Map<String, String>) this.getOptions().get("limits");
String field = core.operation.utils.Utils.getFileField(table);
String filePath = core.operation.utils.Utils.getFilePathName(table,file.getName());
Map<String,String> vMap = new HashMap<>();
vMap.put(field,filePath);
file.renameTo(new File(filePath));
//todo
List<String> 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();
}
}

@ -1,6 +1,8 @@
{
"options":{
"file": "File"
"file": "File",
"file_type": "String",
"limits":"Map<String,String>"
},
"return":{}
}

@ -0,0 +1,5 @@
{
"公告文件": "announcement",
"开题报告":"graduation_design_reply",
"毕业设计定稿":"graduation_design_finished_product"
}

@ -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<String,String> 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<String, Object> string2MapOptions(String sOptions) throws GExcptFormat {
sOptions = stringOptionsFormat(sOptions);
Map<String, Object> options = new HashMap<>();
String[] sOpts = sOptions.split(" ");
for(int i=0;i<sOpts.length;i++){
if(Mode.strict==1){
if(sOpts[i].indexOf(0)=='-')
throw new GExcptFormat("options format error");
}
options.put(sOpts[i].substring(1),sOpts[++i]);
}
return options;
}
static String getFileField(String table){
return fileTableField.get(table);
}
static String getFilePath(String table){
return Configuration.filePath+table+"/";
}
static String getFileName(String fileName){
SimpleDateFormat simpleDateFormat;
simpleDateFormat = new SimpleDateFormat("yyMMddHHmmssSSS");
Date date = new Date();
String str = simpleDateFormat.format(date);
str+=(int)(Math.random()*100000);
str+= utils.Utils.getFileType(fileName);
return str;
}
static String getFilePathName(String table, String fileName){
return getFilePath(table)+getFileName(fileName);
}
}

@ -1,26 +0,0 @@
package core.operation.utils;
import error.GExcptFormat;
import gdms.Mode;
import java.util.HashMap;
import java.util.Map;
public interface util {
static String stringOptionsFormat(String options){
return options.replaceAll(" {2,}", " ") ;
}
static Map<String, Object> string2MapOptions(String sOptions) throws GExcptFormat {
sOptions = stringOptionsFormat(sOptions);
Map<String, Object> options = new HashMap<>();
String[] sOpts = sOptions.split(" ");
for(int i=0;i<sOpts.length;i++){
if(Mode.strict==1){
if(sOpts[i].indexOf(0)=='-')
throw new GExcptFormat("options format error");
}
options.put(sOpts[i].substring(1),sOpts[++i]);
}
return options;
}
}

@ -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_StudentSearchTeacher {
Map<String,String> TeacherInfo=new HashMap<String, String>();
public Map<String,String> search(String teacherID) throws Exception {
Search search = new Search() ;
search.setOptions(new HashMap<>());
String table = "teacher";
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",teacherID);
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",1);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
String[] s = result.get(0);
TeacherInfo.put("id",s[0]);
TeacherInfo.put("name",s[2]);
return TeacherInfo;
}
}

@ -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<String,Object> options=select.execute(null);
}
}

@ -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<String,String> StudentInfo=new HashMap<String,String>();
public Map<String,String> search(String studentID) throws Exception{
Search search = new Search() ;
search.setOptions(new HashMap<>());
String table = "student";
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",studentID);
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",1);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
String[] s = result.get(0);
StudentInfo.put("id",s[0]);
StudentInfo.put("name",s[2]);
return StudentInfo;
}
}

@ -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<String> list;
public C_TeacherSelectStudent clone(){
C_TeacherSelectStudent tst = new C_TeacherSelectStudent();
tst.setInfo( this.getInfo());
List<String> list = new ArrayList<>();
for(String s:this.list){
list.add(new String(s));
}
return null;
}
public void select(String teacherID,String studentID)throws Exception{
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<String,Object> options=select.execute(null);
}
}

@ -3,7 +3,7 @@ package core.process;
import java.util.ArrayList;
import java.util.List;
public class Condition {
public class Condition {//条件
public List<Process> getProcesses() {
return processes;
}

@ -0,0 +1,4 @@
package core.process;
public abstract class LastProcess extends Process {
}

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

@ -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<Integer> index){
public static Condition getCondition(User user) {
Map<String,Character> status = getStatus(user);
return getCondition(user,status);
}
public static Condition getCondition(User user, Map<String,Character> status){
Condition condition = new Condition();
for(Map.Entry<String,Character> 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<Process> getLastProcesses(User user) {
return null;
}
//Map<graduation_design_id.x_status,status>
public static Map<String,Character> getStatus(User user){
Map<String,String> userTables = DBManagement.getUserTables(user.getType());
String graduationDesignId = null;
for(Map.Entry<String,String> entry:userTables.entrySet()){
String[] ti = entry.getKey().split(".");
String[] ts = entry.getValue().split(".");
}
return null;
}
public static Process getProcess(String process){
return null;
}
}

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

@ -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<String, String> vMap){
super.setAttr(vMap);

@ -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<String, String> vMap){
super.setAttr(vMap);
this.setGrade(vMap.get("grade"));

@ -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<String, String> vMap){
super.setAttr(vMap);

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

@ -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<String,String> 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<String, String> vMap = new HashMap<>();
ResultSetMetaData rsm = rs.getMetaData();
rs.next();
for(int i=0;i<rsm.getColumnCount();i++){
vMap.put(rsm.getCatalogName(i),rs.getString(i));
}
return createUser(userType,vMap);
} catch (SQLException e) {
e.printStackTrace();
if(!rs.getString(2).equals(password))
throw new GExcptAccount("password wrong");
Map<String, String> vMap = new HashMap<>();
ResultSetMetaData rsm = rs.getMetaData();
rs.next();
for(int i=0;i<rsm.getColumnCount();i++){
vMap.put(rsm.getCatalogName(i),rs.getString(i));
}
return null;
return createUser(userType,vMap);
}
static User register(String userType, Map<String, String> vMap) throws GExcptSQL {
static User register(String userType, Map<String, String> 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<String, String> vMap) {
User user = getUser(userType);
static User createUser(String userType, Map<String, String> vMap) throws Exception {
User user = GetObjectByName.getUserByName(userType);
user.setAttr(vMap);
return user;
}

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

@ -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"
};
//<table1.x_id,table2.x_status>
public static Map<String,String> 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<String,String> 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<String,String> getUserTables(String userType){
if(userType.equals("student")){
return graduationDesignStudentTables;
}
if(userType.equals("teacher")){
return graduationDesignTeacherTables;
}
return null;
}
public static void delete(String table, Map<String,String> limits) throws GExcptSQL {
Delete delete = new Delete(table, limits);

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

@ -1,6 +1,6 @@
package gdms;
public interface Mode {
public static int strict = 1;
public static int strict = 0;
public static int debug = 1;
}

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

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

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

@ -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<String,String> 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);
}
}

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

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

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

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

Loading…
Cancel
Save