diff --git a/.idea/artifacts/GDMS_war_exploded.xml b/.idea/artifacts/GDMS_war_exploded.xml index 95189d4..1d55d9c 100644 --- a/.idea/artifacts/GDMS_war_exploded.xml +++ b/.idea/artifacts/GDMS_war_exploded.xml @@ -8,8 +8,8 @@ - + diff --git a/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml b/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml index 3473dc6..fbbe276 100644 --- a/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml +++ b/.idea/dataSources/356b1cbb-8e8d-401f-bdfc-b3e917bc8301.xml @@ -1,9 +1,9 @@ - + 10.3.10 - MARIADB + MariaDB InnoDB lower/lower @@ -1626,516 +1626,536 @@ 1 normal - + 2 - float|0s + char(20)|0s normal - + 3 - text|0s + float|0s normal - + 4 - date|0s + text|0s normal - + 5 + date|0s + normal + + + 6 char(1)|0s normal - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 varchar(255)|0s normal - + 3 varchar(255)|0s normal - + 4 varchar(255)|0s normal - + 5 varchar(255)|0s normal - + 6 varchar(255)|0s normal - + 7 text|0s normal - + 8 char(1)|0s normal - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 date|0s normal - + 3 varchar(255)|0s normal - + 4 varchar(255)|0s normal - + 5 char(20)|0s normal - + 6 char(20)|0s normal - + 7 int(11)|0s normal - + 8 char(1)|0s normal - - 9 - char(1)|0s - normal - - - 10 - char(1)|0s - normal - - - 11 - char(1)|0s - normal - - - 12 - char(1)|0s - normal - - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 - text|0s + char(20)|0s normal - + 3 - date|0s + text|0s normal - + 4 - text|0s + date|0s normal - + 5 - date|0s + text|0s normal - + 6 - text|0s + date|0s normal - + 7 - date|0s + text|0s normal - + 8 - text|0s + date|0s normal - + 9 + text|0s + normal + + + 10 date|0s normal - + + 11 + char(1)|0s + normal + + + 12 + char(1)|0s + normal + + + 13 + char(1)|0s + normal + + + 14 + char(1)|0s + normal + + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 date|0s normal - + 3 varchar(255)|0s normal - + 4 char(20)|0s normal - + 5 char(20)|0s normal - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 - text|0s + char(20)|0s normal - + 3 - date|0s + char(20)|0s normal - + 4 text|0s normal - + 5 date|0s normal - + 6 text|0s normal - + 7 - float|0s + date|0s normal - + 8 - date|0s + text|0s normal - + 9 - text|0s + float|0s normal - + 10 - float|0s + date|0s normal - + 11 - date|0s + text|0s normal - + 12 - text|0s + float|0s normal - + 13 - float|0s + date|0s normal - + 14 - date|0s + text|0s normal - + 15 - char(1)|0s + float|0s normal - + 16 - char(1)|0s + date|0s normal - + 17 char(1)|0s normal - + 18 char(1)|0s normal - + + 19 + char(1)|0s + normal + + + 20 + char(1)|0s + normal + + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 char(20)|0s normal - + 3 char(20)|0s normal - + 1 leader_student_id 1 - + 1 char(20)|0s 1 normal - + 2 char(20)|0s normal - + 3 char(20)|0s normal - + 1 leader_teacher_id 1 - + 1 char(8)|0s 1 normal - + 2 varchar(255)|0s normal - + 3 varchar(255)|0s normal - + 4 varchar(255)|0s normal - + 1 profession_code 1 - + 1 char(20)|0s 1 normal - + 2 char(20)|0s normal - + 3 char(20)|0s normal - + 1 leader_student_id 1 - + 1 char(20)|0s 1 normal - + 2 char(20)|0s normal - + 3 char(20)|0s normal - + 1 leader_teacher_id 1 - + 1 char(20)|0s 1 normal - + 2 char(255)|0s 1 normal - + 3 char(30)|0s normal - + 4 char(40)|0s normal - + 5 char(20)|0s normal - + 6 char(4)|0s normal - + 7 char(8)|0s normal - + 1 id 1 - + 1 char(20)|0s 1 normal - + 2 char(255)|0s 1 normal - + 3 char(30)|0s normal - + 4 char(40)|0s normal - + 5 char(20)|0s normal - + 6 varchar(255)|0s normal - + 7 varchar(255)|0s normal - + 8 char(8)|0s normal - + 1 id 1 diff --git a/.idea/misc.xml b/.idea/misc.xml index df60b67..9486b47 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 b6ef183..20dda90 100644 --- a/GDMS.iml +++ b/GDMS.iml @@ -19,8 +19,8 @@ - - - + + + \ No newline at end of file diff --git a/src/core/operation/UploadFile.java b/src/core/operation/UploadFile.java index b75dcfa..75c76cb 100644 --- a/src/core/operation/UploadFile.java +++ b/src/core/operation/UploadFile.java @@ -14,18 +14,12 @@ import java.util.Map; public class UploadFile extends Operation { @Override 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()); + String filePath = (String) this.getOptions().get("file_url"); Map vMap = new HashMap<>(); vMap.put(field,filePath); - - file.renameTo(new File(filePath)); - //todo - List ls = new ArrayList<>(); ls.add(field); List resultLs = DBManagement.select(ls,table,limits,0,1); diff --git a/src/core/operation/UploadFile.json b/src/core/operation/UploadFile.json index c2a2f65..0181176 100644 --- a/src/core/operation/UploadFile.json +++ b/src/core/operation/UploadFile.json @@ -1,6 +1,6 @@ { "options":{ - "file": "File", + "file_url": "String", "file_type": "String", "limits":"Map" }, diff --git a/src/core/operation/utils/Utils.java b/src/core/operation/utils/Utils.java index 217e8be..6b09955 100644 --- a/src/core/operation/utils/Utils.java +++ b/src/core/operation/utils/Utils.java @@ -35,19 +35,4 @@ public interface Utils { 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); - } } diff --git a/src/core/process/C_CollegeFillOpeningReportOpinion.java b/src/core/process/C_CollegeFillOpeningReportOpinion.java new file mode 100644 index 0000000..27cae0f --- /dev/null +++ b/src/core/process/C_CollegeFillOpeningReportOpinion.java @@ -0,0 +1,50 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_CollegeFillOpeningReportOpinion extends TempProcess{ + String graduationDesignId; + Map vMap; + + static String table="graduation_design_opening_report_opinion_record"; + + public void fillInformation() throws Exception { + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation =new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("college_opinion_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + } + protected boolean check() { + if(this.getGraduationDesignId()==null||this.getVMap()==null) + return false; + return true; + } + public String getGraduationDesignId() { + return graduationDesignId; + } + + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } + + public Map getVMap() { + return vMap; + } +} diff --git a/src/core/process/C_CollegeFillScoreOpinion.java b/src/core/process/C_CollegeFillScoreOpinion.java new file mode 100644 index 0000000..96e4e7d --- /dev/null +++ b/src/core/process/C_CollegeFillScoreOpinion.java @@ -0,0 +1,45 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_CollegeFillScoreOpinion extends TempProcess{ + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_reply_opinion_record_score"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs Init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("college_opinion_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + + public Map getVMap() { + return vMap; + } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } +} diff --git a/src/core/process/C_MentorFillOpeningReportOpinion.java b/src/core/process/C_MentorFillOpeningReportOpinion.java new file mode 100644 index 0000000..139904e --- /dev/null +++ b/src/core/process/C_MentorFillOpeningReportOpinion.java @@ -0,0 +1,43 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_MentorFillOpeningReportOpinion extends TempProcess{ + + Map vMap; + + static String table="graduation_design_opening_report_opinion_record"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("mentor_opinion_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + + } + protected boolean check() { + if(this.getVMap()==null||this.getGraduationDesignId()==null) + return false; + return true; + } + public void setVMap(Map vMap) { + this.vMap = vMap; + } + + public Map getVMap() { + return vMap; + } +} diff --git a/src/core/process/C_SchoolFillScoreOpinion.java b/src/core/process/C_SchoolFillScoreOpinion.java new file mode 100644 index 0000000..652cf1b --- /dev/null +++ b/src/core/process/C_SchoolFillScoreOpinion.java @@ -0,0 +1,53 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_SchoolFillScoreOpinion extends TempProcess { + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_reply_opinion_record_score"; + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("school_opinion_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + @Override + public String getGraduationDesignId() { + return graduationDesignId; + } + + @Override + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + public void setVMap(Map vMap) { + this.vMap = vMap; + } + +} + + + + + diff --git a/src/core/process/C_SecretaryFillOpeningReportOpinion.java b/src/core/process/C_SecretaryFillOpeningReportOpinion.java new file mode 100644 index 0000000..d0398a3 --- /dev/null +++ b/src/core/process/C_SecretaryFillOpeningReportOpinion.java @@ -0,0 +1,50 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_SecretaryFillOpeningReportOpinion extends TempProcess{ + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_opening_report_opinion_record"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("secretary_record_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + @Override + public String getGraduationDesignId() { + return graduationDesignId; + } + + @Override + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } + +} diff --git a/src/core/process/C_SecretaryFillReplyRecord.java b/src/core/process/C_SecretaryFillReplyRecord.java new file mode 100644 index 0000000..0c8c478 --- /dev/null +++ b/src/core/process/C_SecretaryFillReplyRecord.java @@ -0,0 +1,51 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_SecretaryFillReplyRecord extends TempProcess{ + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_reply_opinion_record_score"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs Init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("secretary_record_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + public String getGraduationDesignId() { + return graduationDesignId; + } + @Override + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } + + + +} diff --git a/src/core/process/C_StudentFillGraduationDesignInformation.java b/src/core/process/C_StudentFillGraduationDesignInformation.java new file mode 100644 index 0000000..33e6df4 --- /dev/null +++ b/src/core/process/C_StudentFillGraduationDesignInformation.java @@ -0,0 +1,47 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_StudentFillGraduationDesignInformation extends TempProcess{ + String graduationDesignId; + Map vMap; + + static String table="graduation_design_opening_report_opinion_record"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + @Override + public String getGraduationDesignId() { + return graduationDesignId; + } + + @Override + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } + + +} \ No newline at end of file diff --git a/src/core/process/C_StudentUploadFinishedProduct.java b/src/core/process/C_StudentUploadFinishedProduct.java new file mode 100644 index 0000000..efd36a8 --- /dev/null +++ b/src/core/process/C_StudentUploadFinishedProduct.java @@ -0,0 +1,48 @@ +package core.process; + +import core.operation.UploadFile; +import error.GExcptInit; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +public class C_StudentUploadFinishedProduct { + + File finishedProduct; + String graduationDesignId; + + static String file_type = "finished_product"; + public void uploadOpeningReport() throws Exception{ + if(!check()) throw new GExcptInit("Upload FinishedProduct Attrs init error!"); + UploadFile uploadFile=new UploadFile(); + uploadFile.setOptions(new HashMap<>()); + uploadFile.addOptions("file",this.getFinishedProduct()); + uploadFile.addOptions("file_type",file_type); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + uploadFile.addOptions("limits",limits); + uploadFile.execute(null); + } + + protected boolean check() { + if(this.getFinishedProduct()==null||this.getGraduationDesignId()==null) + return false; + return true; + } + public File getFinishedProduct() { + return finishedProduct; + } + + public void setFinishedProduct(File finishedProduct) { + this.finishedProduct = finishedProduct; + } + public String getGraduationDesignId() { + return graduationDesignId; + } + + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + +} diff --git a/src/core/process/C_StudentUploadOpeningReport.java b/src/core/process/C_StudentUploadOpeningReport.java index 88ed26e..69c70b3 100644 --- a/src/core/process/C_StudentUploadOpeningReport.java +++ b/src/core/process/C_StudentUploadOpeningReport.java @@ -1,6 +1,6 @@ package core.process; -import core.operation.UploadFileOperation; +import core.operation.UploadFile; import error.GExcptInit; import java.io.File; @@ -9,24 +9,24 @@ import java.util.Map; public class C_StudentUploadOpeningReport extends TempProcess{ File openingReport; - String gaduationDesignId; + String graduationDesignId; static String file_type = "opening_report"; public void uploadOpeningReport() throws Exception{ if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!"); - UploadFileOperation uploadFileOperation=new UploadFileOperation(); + UploadFile uploadFileOperation=new UploadFile(); uploadFileOperation.setOptions(new HashMap<>()); uploadFileOperation.addOptions("file",this.getOpeningReport()); uploadFileOperation.addOptions("file_type",file_type); Maplimits = new HashMap<>(); - limits.put("id",this.getGaduationDesignId()); + limits.put("id",this.getGraduationDesignId()); uploadFileOperation.addOptions("limits",limits); uploadFileOperation.execute(null); } protected boolean check() { - if(this.getGaduationDesignId()==null||this.getOpeningReport()==null) + if(this.getGraduationDesignId()==null||this.getOpeningReport()==null) return false; return true; } @@ -39,11 +39,11 @@ public class C_StudentUploadOpeningReport extends TempProcess{ this.openingReport = openingReport; } - public String getGaduationDesignId() { - return gaduationDesignId; + public String getGraduationDesignId() { + return graduationDesignId; } - public void setGaduationDesignId(String gaduationDesignId) { - this.gaduationDesignId = gaduationDesignId; + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; } } diff --git a/src/core/process/C_TeacherFillTopicInformation.java b/src/core/process/C_TeacherFillTopicInformation.java deleted file mode 100644 index 6d72cd4..0000000 --- a/src/core/process/C_TeacherFillTopicInformation.java +++ /dev/null @@ -1,61 +0,0 @@ -package core.process; - -import core.operation.FillInformation; -import error.GExcptInit; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -public class C_TeacherFillTopicInformation extends TempProcess{ - - String StudentId; - String mentor_opinion; - Date mentor_opinion_date; - - static String table="graduation_design_opening_report_opinion_record"; - - public void fillInformation() throws Exception{ - if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); - FillInformation fillInformation=new FillInformation(); - fillInformation.setOptions(new HashMap<>()); - fillInformation.addOptions("table",table); - String date= mentor_opinion_date.toString(); - Map vMap=new HashMap<>(); - vMap.put("mentor_opinion_date",date); - vMap.put("mentor_opinion",this.getMentor_opinion()); - Maplimits = new HashMap<>(); - limits.put("id",this.getStudentId()); - fillInformation.addOptions("limits",limits); - fillInformation.execute(null); - - } - protected boolean check() { - if(this.getMentor_opinion()==null||this.getMentor_opinion_date()==null||this.getStudentId()==null) - return false; - return true; - } - public String getStudentId() { - return StudentId; - } - - public void setStudentId(String studentId) { - StudentId = studentId; - } - public String getMentor_opinion() { - return mentor_opinion; - } - - public void setMentor_opinion(String mentor_opinion) { - this.mentor_opinion = mentor_opinion; - } - - public Date getMentor_opinion_date() { - return mentor_opinion_date; - } - - public void setMentor_opinion_date(Date mentor_opinion_date) { - this.mentor_opinion_date = mentor_opinion_date; - } - -} diff --git a/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java b/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java index 1452c2a..cc0bf06 100644 --- a/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java +++ b/src/core/process/C_TeacherTeamFillOpeningReportOpinion.java @@ -8,14 +8,15 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess { - public String teacherID; - public String teacher_opinion; - public Map vMap; - - static String table="graduation_design_opening_report_opinion_record"; - public void TeacherTeamFillOpeningReportOpinion() throws Exception{ - if(!check()) throw new GExcptInit("TeacherTeamFillOpeningReportOpinion Attrs init error!"); +public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess{ + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_opening_report_opinion_record"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); FillInformation fillInformation=new FillInformation(); fillInformation.setOptions(new HashMap<>()); fillInformation.addOptions("table",table); @@ -23,36 +24,27 @@ public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess { String date=df.format(new Date()); vMap.put("report_teacher_team_opinion_date",date); Maplimits = new HashMap<>(); - limits.put("id",this.getTeacherID()); + limits.put("id",this.getGraduationDesignId()); fillInformation.addOptions("limits",limits); fillInformation.execute(null); } - - - public Map getvMap() { - return vMap; - } - public void setvMap(Map vMap) { - this.vMap = vMap; - } - public String getTeacherID() { - return teacherID; + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; } - public void setTeacherID(String teacherID) { - this.teacherID = teacherID; + @Override + public String getGraduationDesignId() { + return graduationDesignId; } - public String getTeacher_opinion() { - return teacher_opinion; - } - public void setTeacher_opinion(String teacher_opinion) { - this.teacher_opinion = teacher_opinion; - } @Override - protected boolean check() { - if(this.getTeacherID().equals(null)||this.getTeacher_opinion().equals(null)||this.getvMap().equals(null)) - return false; - else - return true; + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; } + + public void setVMap(Map vMap) { + this.vMap = vMap; + } + } diff --git a/src/core/process/C_TeacherTeamFillScoreOpinion.java b/src/core/process/C_TeacherTeamFillScoreOpinion.java new file mode 100644 index 0000000..e87c937 --- /dev/null +++ b/src/core/process/C_TeacherTeamFillScoreOpinion.java @@ -0,0 +1,49 @@ +package core.process; + +import core.operation.FillInformation; +import error.GExcptInit; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class C_TeacherTeamFillScoreOpinion extends TempProcess { + + String graduationDesignId; + Map vMap; + + static String table="graduation_design_reply_opinion_record_score"; + + public void fillInformation() throws Exception{ + if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); + FillInformation fillInformation=new FillInformation(); + fillInformation.setOptions(new HashMap<>()); + fillInformation.addOptions("table",table); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss"); + String date=df.format(new Date()); + vMap.put("teacher_team_opinion_date",date); + Maplimits = new HashMap<>(); + limits.put("id",this.getGraduationDesignId()); + fillInformation.addOptions("limits",limits); + fillInformation.execute(null); + } + protected boolean check() { + if(this.getGraduationDesignId()==null) + return false; + return true; + } + @Override + public String getGraduationDesignId() { + return graduationDesignId; + } + + @Override + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; + } + public void setVMap(Map vMap) { + this.vMap = vMap; + } + +} diff --git a/src/servlet/S_CollegeFillOpeningReportOpinion.java b/src/servlet/S_CollegeFillOpeningReportOpinion.java index 774b28f..f84de95 100644 --- a/src/servlet/S_CollegeFillOpeningReportOpinion.java +++ b/src/servlet/S_CollegeFillOpeningReportOpinion.java @@ -1,19 +1,31 @@ package servlet; +import core.process.C_CollegeFillOpeningReportOpinion; + import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_CollegeFillOpeningReportOpinion") +@WebServlet("college-fill-opening-report-opinion") public class S_CollegeFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); + C_CollegeFillOpeningReportOpinion p =new C_CollegeFillOpeningReportOpinion(); + p.setGraduationDesignId(id); + p.setVMap(vMap); + try { + p.fillInformation(); + } catch (Exception e) { + e.printStackTrace(); + response.sendRedirect("/op_fail.jsp"); + } } -} + static String[] vName = { + "college_opinion" + }; +} \ No newline at end of file diff --git a/src/servlet/S_CollegeFillScoreOpinion.java b/src/servlet/S_CollegeFillScoreOpinion.java index e937d1d..b66ec58 100644 --- a/src/servlet/S_CollegeFillScoreOpinion.java +++ b/src/servlet/S_CollegeFillScoreOpinion.java @@ -1,19 +1,32 @@ package servlet; +import core.process.C_CollegeFillScoreOpinion; + import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_CollegeFillScoreOpinion") +@WebServlet("college-fill-score-opinion") public class S_CollegeFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); + C_CollegeFillScoreOpinion p =new C_CollegeFillScoreOpinion(); + p.setGraduationDesignId(id); + p.setVMap(vMap); + try { + p.fillInformation(); + } catch (Exception e) { + e.printStackTrace(); + response.sendRedirect("/op_fail.jsp"); + } } -} + static String[] vName = { + "college_opinion", + "college_score" + }; +} \ No newline at end of file diff --git a/src/servlet/S_MentorFillOpeningReportOpinion.java b/src/servlet/S_MentorFillOpeningReportOpinion.java index 409ff1f..588215b 100644 --- a/src/servlet/S_MentorFillOpeningReportOpinion.java +++ b/src/servlet/S_MentorFillOpeningReportOpinion.java @@ -1,19 +1,31 @@ package servlet; +import core.process.C_MentorFillOpeningReportOpinion; + import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_MentorFillOpeningReportOpinion") +@WebServlet("mentor-fill-opening-report-opinion") public class S_MentorFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); + C_MentorFillOpeningReportOpinion p = new C_MentorFillOpeningReportOpinion(); + p.setGraduationDesignId(id); + p.setVMap(vMap); + try { + p.fillInformation(); + } catch (Exception e) { + e.printStackTrace(); + response.sendRedirect("/op_fail.jsp"); + } } -} + static String[] vName = { + "mentor_opinion" + }; +} \ No newline at end of file diff --git a/src/servlet/S_MentorFillReview.java b/src/servlet/S_MentorFillReview.java index 732bf0e..1ece272 100644 --- a/src/servlet/S_MentorFillReview.java +++ b/src/servlet/S_MentorFillReview.java @@ -6,14 +6,17 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_MentorFillReview") +@WebServlet("mentor-fill-review") public class S_MentorFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "total_grade", + "review_opinion" + }; +} \ No newline at end of file diff --git a/src/servlet/S_ReviewerFillReview.java b/src/servlet/S_ReviewerFillReview.java index 437556e..f950771 100644 --- a/src/servlet/S_ReviewerFillReview.java +++ b/src/servlet/S_ReviewerFillReview.java @@ -6,14 +6,17 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_ReviewerFillReview") +@WebServlet("reviewer-fill-review") public class S_ReviewerFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "score", + "opinion" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SchoolFillScoreOpinion.java b/src/servlet/S_SchoolFillScoreOpinion.java index 4ece4f4..d6b0e9d 100644 --- a/src/servlet/S_SchoolFillScoreOpinion.java +++ b/src/servlet/S_SchoolFillScoreOpinion.java @@ -6,14 +6,17 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_SchoolFillScoreOpinion") +@WebServlet("school-fill-score-opinion") public class S_SchoolFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "school_opinion", + "school_score" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SecretaryFillOpeningReportRecord.java b/src/servlet/S_SecretaryFillOpeningReportRecord.java index 74926a9..2ef4f62 100644 --- a/src/servlet/S_SecretaryFillOpeningReportRecord.java +++ b/src/servlet/S_SecretaryFillOpeningReportRecord.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_SecretaryFillOpeningReportRecord") +@WebServlet("secretary-fill-opening-report-record") public class S_SecretaryFillOpeningReportRecord extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "secretary_record" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SecretaryFillReplyRecord.java b/src/servlet/S_SecretaryFillReplyRecord.java index ea217f6..90a10fa 100644 --- a/src/servlet/S_SecretaryFillReplyRecord.java +++ b/src/servlet/S_SecretaryFillReplyRecord.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_SecretaryFillReplyRecord") +@WebServlet("secretary-fill-reply-record") public class S_SecretaryFillReplyRecord extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } + static String[] vName = { + "secretary_record" + }; } diff --git a/src/servlet/S_StudentFillGraduationDesignInformation.java b/src/servlet/S_StudentFillGraduationDesignInformation.java index 142b43d..9838562 100644 --- a/src/servlet/S_StudentFillGraduationDesignInformation.java +++ b/src/servlet/S_StudentFillGraduationDesignInformation.java @@ -6,18 +6,22 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet("/student-fill-graduation-design-information") public class S_StudentFillGraduationDesignInformation extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - String content1=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8"); - String content2=request.getParameter("score"); - try { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); - } catch (Exception e) { - e.printStackTrace(); - } } + static String[] vName = { + "chinese_name", + "english_name", + "type_of_topic", + "source_of_design", + "nature_of_design", + "description_of_topic" + }; } diff --git a/src/servlet/S_StudentSelectTeacher.java b/src/servlet/S_StudentSelectTeacher.java index bc76e6c..69b8893 100644 --- a/src/servlet/S_StudentSelectTeacher.java +++ b/src/servlet/S_StudentSelectTeacher.java @@ -13,13 +13,13 @@ 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 teacher_id=request.getParameter("id"); + String teacherId=request.getParameter("id"); User user=(User)request.getSession().getAttribute("user"); - String student_id=user.getId(); + String studentId=user.getId(); try { C_StudentSelectTeacher SST=new C_StudentSelectTeacher(); - SST.setTeacherId(teacher_id); - SST.setStudentId(student_id); + SST.setTeacherId(teacherId); + SST.setStudentId(studentId); SST.select(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 0389973..266671c 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -1,19 +1,19 @@ package servlet; import javax.servlet.ServletException; +import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebServlet(name = "S_StudentUploadFinishedProduct") +@WebServlet("/student-upload-finished-product") +@MultipartConfig public class S_StudentUploadFinishedProduct extends HttpServlet { + static String fileType = "graduation_design_finished_product"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + String id = request.getParameter("id"); + String fileURL = servlet.Utils.saveFile(request, fileType); } } diff --git a/src/servlet/S_StudentUploadOpeningReport.java b/src/servlet/S_StudentUploadOpeningReport.java index 44cc116..4102e91 100644 --- a/src/servlet/S_StudentUploadOpeningReport.java +++ b/src/servlet/S_StudentUploadOpeningReport.java @@ -1,6 +1,5 @@ package servlet; -import core.process.C_StudentUploadOpeningReport; import core.user.User; import javax.servlet.ServletException; @@ -10,17 +9,15 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.Part; -import java.io.File; import java.io.IOException; import java.util.UUID; @WebServlet("/student-upload-opening-report") @MultipartConfig -//学生id+文件 public class S_StudentUploadOpeningReport extends HttpServlet { - private static final long serialVersionUID = 1L; + static String fileType = "graduation_design_opening_report"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - + String id = request.getParameter("id"); + String fileURL = servlet.Utils.saveFile(request, fileType); } } diff --git a/src/servlet/S_TeacherSelectStudent.java b/src/servlet/S_TeacherSelectStudent.java index fe20103..ab880eb 100644 --- a/src/servlet/S_TeacherSelectStudent.java +++ b/src/servlet/S_TeacherSelectStudent.java @@ -13,13 +13,13 @@ 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 student_id=request.getParameter("id"); + String studentId=request.getParameter("id"); User user=(User)request.getSession().getAttribute("user"); - String teacher_id=user.getId(); + String teacherId=user.getId(); try { C_TeacherSelectStudent TSS=new C_TeacherSelectStudent(); - TSS.setTeacherId(teacher_id); - TSS.setStudentId(student_id); + TSS.setTeacherId(teacherId); + TSS.setStudentId(studentId); TSS.select(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java index ac47c5b..c43e7fd 100644 --- a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java +++ b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_TeacherTeamFillOpeningReportOpinion") +@WebServlet("teacher-team-fill-opening-report-opinion") public class S_TeacherTeamFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "report_teacher_team_opinion" + }; +} \ No newline at end of file diff --git a/src/servlet/S_TeacherFillTeamFillScoreOpinion.java b/src/servlet/S_TeacherTeamFillScoreOpinion.java similarity index 52% rename from src/servlet/S_TeacherFillTeamFillScoreOpinion.java rename to src/servlet/S_TeacherTeamFillScoreOpinion.java index e3418ef..a82b234 100644 --- a/src/servlet/S_TeacherFillTeamFillScoreOpinion.java +++ b/src/servlet/S_TeacherTeamFillScoreOpinion.java @@ -6,14 +6,17 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_TeacherFillTeamFillScoreOpinion") -public class S_TeacherFillTeamFillScoreOpinion extends HttpServlet { +@WebServlet("teacher-team-fill-score-opinion") +public class S_TeacherTeamFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } + static String[] vName = { + "teacher_team_opinion", + "teacher_team_score" + }; } diff --git a/src/servlet/Utils.java b/src/servlet/Utils.java new file mode 100644 index 0000000..687b7e9 --- /dev/null +++ b/src/servlet/Utils.java @@ -0,0 +1,60 @@ +package servlet; + +import gdms.Configuration; +import org.apache.coyote.Request; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.Part; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface Utils { + static Map getVMap(String[] vName, HttpServletRequest request){ + Map vMap = new HashMap<>(); + for(int i=0;i