Compare commits

..

No commits in common. 'master' and 'wlf' have entirely different histories.
master ... wlf

@ -0,0 +1,17 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="GDMS:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/GDMS_war_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="GDMS/web/Web" />
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="GDMS" />
</element>
<element id="directory" name="lib">
<element id="library" level="project" name="lib" />
<element id="library" level="project" name="tomcat-lib" />
</element>
</element>
</root>
</artifact>
</component>

@ -1,17 +0,0 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="gdms:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/gdms_war_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="gdms/web/Web" />
<element id="directory" name="WEB-INF">
<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 Software Foundation/Tomcat 9.0/lib/tomcat-jdbc.jar" />
<element id="library" level="project" name="lib" />
</element>
</element>
</root>
</artifact>
</component>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="gdms@localhost" uuid="6d4033d6-2147-4c12-a111-2ab915e871da">
<data-source source="LOCAL" name="@localhost:gdms" uuid="356b1cbb-8e8d-401f-bdfc-b3e917bc8301">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>

@ -0,0 +1,2 @@
#n:testsql
!<md> [null, 0, null, null, -2147483648, -2147483648]

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

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

@ -1,10 +1,10 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib" />
<root url="file://$PROJECT_DIR$/web/WEB-INF/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/web/WEB-INF/lib" recursive="false" />
</library>
</component>

@ -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_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/gdms.iml" filepath="$PROJECT_DIR$/gdms.iml" />
<module fileurl="file://$PROJECT_DIR$/GDMS.iml" filepath="$PROJECT_DIR$/GDMS.iml" />
</modules>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -19,16 +19,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 9.0.14" level="application_server_libraries" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://C:/Program Files/Apache Software Foundation/Tomcat 9.0/lib/tomcat-jdbc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" exported="" scope="PROVIDED" name="lib" level="project" />
<orderEntry type="library" exported="" scope="PROVIDED" name="Tomcat 8.5.37" level="application_server_libraries" />
<orderEntry type="library" scope="PROVIDED" name="tomcat-lib" level="project" />
</component>
</module>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -12,7 +12,9 @@ public class Delete extends Operation {
public Map<String, Object> execute(User subject) throws GExcptSQL {
Map<String, String> map = new HashMap<>();
map.put("id",(String)this.getOptions().get("id"));
//todo
for(String table:DBManagement.graduationDesignTables){
DBManagement.delete(table,map);
}
return this.getOptions();
}
}

@ -12,15 +12,17 @@ public class Select extends Operation {
@Override
public Map<String, Object> execute(User subject) throws GExcptSQL {
Map<String, String> vMap = new HashMap<>();
Map<String, String> limits = new HashMap<>();
String id = (String)this.getOptions().get("student_id");
String teacher_id = (String)this.getOptions().get("teacher_id");
limits.put("id",id);
vMap.put("id",id);
vMap.put("student_id",id);
vMap.put("teacher_id",teacher_id);
DBManagement.update("graduation_design", vMap,limits);
DBManagement.insert("graduation_design", vMap);
vMap.remove("student_id");
vMap.remove("teacher_id");
for(int i=1;i<DBManagement.graduationDesignTables.length;i++){
DBManagement.insert(DBManagement.graduationDesignTables[i],vMap);
}
return this.getOptions();
}
}

@ -24,7 +24,6 @@ public class UploadFile extends Operation {
ls.add(field);
List<String[]> resultLs = DBManagement.select(ls,table,limits,0,1);
String lastFilePath = resultLs.get(0)[0];
if(lastFilePath!=null)
new File(lastFilePath).delete();
DBManagement.update(table,vMap,limits);
return this.getOptions();

@ -14,7 +14,7 @@ public interface Utils {
{
put("announcement","annex_url");
put("graduation_design_finished_product","graduation_design_url");
put("graduation_design_opening_report","url");
put("graduation_design_opening_report","report_url");
}};
static String stringOptionsFormat(String options){
return options.replaceAll(" {2,}", " ") ;

@ -1,39 +1,31 @@
package core.process;
import core.operation.FillInformation;
import dao.DBManagement;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import org.apache.commons.lang.ObjectUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_CollegeFillOpeningReportOpinion extends C_FillInformation{
public class C_CollegeFillOpeningReportOpinion extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="学院开题意见";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/college-fill-opening-report-opinion";
private static String info = "";
private static String table="graduation_design_opening_report_opinion_record";
private static String fileds="opening_report_college_opinion_status";
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= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("college_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
@ -48,11 +40,6 @@ public class C_CollegeFillOpeningReportOpinion extends C_FillInformation{
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table,fileds);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
@ -60,30 +47,4 @@ public class C_CollegeFillOpeningReportOpinion extends C_FillInformation{
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("college_opinion");
ls.add(null);
return ls;
}
}

@ -1,43 +1,36 @@
package core.process;
import core.operation.FillInformation;
import dao.DBManagement;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_CollegeFillScoreOpinion extends C_FillInformation{
public class C_CollegeFillScoreOpinion extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="学院老师评分";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/college-fill-score-opinion";
private static String info = "";
private static String table="graduation_design_reply_opinion_record_score";
private static String fileds="reply_college_score_status";
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);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("college_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
if(this.getGraduationDesignId()==null)
return false;
return true;
}
@ -49,36 +42,4 @@ public class C_CollegeFillScoreOpinion extends C_FillInformation{
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table,fileds);
}
@Override
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("college_opinion");
ls.add("college_score");
return ls;
}
}

@ -1,23 +0,0 @@
package core.process;
import dao.DBManagement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public abstract class C_FillInformation extends TempProcess {
public String getJspURL(){
return "/home/fill_Information.jsp";
}
public abstract List<String> getInputName();
public List<String[]> search() throws Exception {
List<String> columns = new ArrayList<>();
columns.add("*");
Map<String,String> limits = new HashMap<>();
limits.put("id",getGraduationDesignId());
List<String[]> ls = DBManagement.select(columns,"graduation_design_information",limits,0,10);
return ls;
}
}

@ -1,8 +0,0 @@
package core.process;
public abstract class C_FillSbjMsg extends TempProcess {
public String getJspURL(){
return "/home/fillSbjMsg.jsp";
}
}

@ -2,40 +2,30 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_MentorFillOpeningReportOpinion extends C_FillInformation{
public class C_MentorFillOpeningReportOpinion extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="导师开题意见";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/mentor-fill-opening-report-opinion";
private static String info = "";
private static String table="graduation_design_opening_report_opinion_record";
private static String field ="opening_report_mentor_opinion_status";
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= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("mentor_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
@ -43,21 +33,6 @@ public class C_MentorFillOpeningReportOpinion extends C_FillInformation{
return false;
return true;
}
@Override
public String getGraduationDesignId() {
return graduationDesignId;
}
@Override
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
@ -65,30 +40,4 @@ public class C_MentorFillOpeningReportOpinion extends C_FillInformation{
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("mentor_opinion");
ls.add(null);
return ls;
}
}

@ -2,42 +2,44 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
public class C_MentorFillReview extends C_FillInformation {
//指导老师评阅
public class C_MentorFillReview extends TempProcess {
public String graduationDesignId;
public Map<String,String> vMap;
private static String buttonName ="指导老师评阅";
private static String targetURL="/home/mentor-fill-review";
private static String iconURL="../cssFile/images/fill.png";
private static String info = "";
private static String table="graduation_design_finished_product_mentor_score";
private static String field ="finished_product_mentor_score_status";
public void teacherTeamFillOpeningReportOpinion() throws Exception{
static String table="graduation_design_finished_product_mentor_score";
public String getGraduationDesignId() {
return graduationDesignId;
}
public void setGraduationDesignId(String teacherID) {
this.graduationDesignId = graduationDesignId;
}
public Map<String, String> getVMap() {
return vMap;
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public void TeacherTeamFillOpeningReportOpinion() throws Exception{
if(!check()) throw new GExcptInit("MentorFillReview Attrs init error!");
FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("review_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
@Override
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
@ -45,51 +47,5 @@ public class C_MentorFillReview extends C_FillInformation {
else
return true;
}
public String getGraduationDesignId() {
return graduationDesignId;
}
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("review_opinion");
ls.add("total_grade");
return ls;
}
}

@ -2,38 +2,31 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
//评阅老师评阅
public class C_ReviewerFillReview extends C_FillInformation {
public class C_ReviewerFillReview extends TempProcess {
public String graduationDesignId;
public Map<String, String> vMap;
private static String buttonName ="评阅老师评阅";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/reviewer-fill-review";
private static String info = "";
private static String table="graduation_design_finished_product_reviewer_score";
private static String field ="finished_product_reviewer_score_status";
static String table = "graduation_design_finished_product_reviewer_score";
public void TeacherTeamFillOpeningReportOpinion() throws Exception {
if (!check()) throw new GExcptInit("ReviewerFillReview Attrs init error!");
FillInformation fillInformation = new FillInformation();
fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table", table);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date = df.format(new Date());
vMap.put("reviewer_score_date", date);
Map<String, String> limits = new HashMap<>();
limits.put("id", this.getGraduationDesignId());
fillInformation.addOptions("limits", limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
@Override
protected boolean check() {
if (this.getGraduationDesignId() == null|| this.getVMap() == null)
return false;
@ -46,50 +39,13 @@ public class C_ReviewerFillReview extends C_FillInformation {
public void setGraduationDesignId(String teacherID) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public Map<String, String> getVMap() {
return vMap;
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("opinion");
ls.add("score");
return ls;
}
}

@ -2,39 +2,33 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_SchoolFillScoreOpinion extends C_FillInformation {
public class C_SchoolFillScoreOpinion extends TempProcess {
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="学院老师评分";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/school-fill-score-opinion";
private static String info = "";
private static String table="graduation_design_reply_opinion_record_score";
private static String field ="reply_school_score_status";
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);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("school_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
if(this.getGraduationDesignId()==null)
return false;
return true;
}
@ -47,46 +41,10 @@ public class C_SchoolFillScoreOpinion extends C_FillInformation {
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("school_opinion");
ls.add("school_score");
return ls;
}
}

@ -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<String,String> 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);
Map<String, String>limits = 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<String, String> vMap) {
this.vMap = vMap;
}
}

@ -1,89 +0,0 @@
package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
public class C_SecretaryFillOpeningReportRecord extends C_FillInformation{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="提交开题纪要";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/secretary-fill-opening-report-record";
private static String info = "";
private static String table="graduation_design_opening_report_opinion_record";
private static String field ="opening_report_secretary_record_status";
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= Configuration.dateFormat.format(new Date());
vMap.put("secretary_record_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
return false;
return true;
}
@Override
public String getGraduationDesignId() {
return graduationDesignId;
}
@Override
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("secretary_record");
ls.add(null);
return ls;
}
}

@ -2,40 +2,35 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_SecretaryFillReplyRecord extends C_FillInformation{
public class C_SecretaryFillReplyRecord extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="提交答辩记录";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/secretary-fill-reply-record";
private static String info = "";
private static String table="graduation_design_reply_opinion_record_score";
private static String field ="reply_secretary_record_status";
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);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("secretary_record_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
if(this.getGraduationDesignId()==null)
return false;
return true;
}
@ -47,44 +42,10 @@ public class C_SecretaryFillReplyRecord extends C_FillInformation{
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("secretary_record");
ls.add(null);
return ls;
}
}

@ -1,10 +0,0 @@
package core.process;
import java.util.List;
public abstract class C_Select extends TempProcess {
public String getJspURL(){
return "/home/select.jsp";
}
public abstract List<String[]> search(String id)throws Exception;
}

@ -2,21 +2,17 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_StudentFillGraduationDesignInformation extends C_FillSbjMsg {
public class C_StudentFillGraduationDesignInformation extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="填写选题信息";
private static String iconURL="../cssFile/images/filText.png";
private static String targetURL="/home/student-fill-graduation-design-information";
private static String info = "";
private static String table="graduation_design_information";
private static String field ="student_fill_graduation_design_information_status";
static String table="graduation_design_opening_report_opinion_record";
public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
@ -26,12 +22,10 @@ public class C_StudentFillGraduationDesignInformation extends C_FillSbjMsg {
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
if(this.getGraduationDesignId()==null)
return false;
return true;
}
@ -45,37 +39,9 @@ public class C_StudentFillGraduationDesignInformation extends C_FillSbjMsg {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
}

@ -0,0 +1,51 @@
package core.process;
import core.operation.Search;
import error.GExcptInit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class C_StudentSearchTeacher extends TempProcess{
String teacherID;
static String table = "teacher";
Map<String,String> TeacherInfo=new HashMap<String, String>();
public Map<String,String> search() throws Exception {
if(!check()) throw new GExcptInit("teacherID Attrs init error!");
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",this.getTeacherID());
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]);
TeacherInfo.put("e_mail_location",s[3]);
TeacherInfo.put("phone_number",s[4]);
return TeacherInfo;
}
protected boolean check() {
if(this.getTeacherID()==null)
return false;
return true;
}
public String getTeacherID(){
return teacherID;
}
public void setTeacherID(String teacherID){
this.teacherID=teacherID;
}
}

@ -1,27 +1,16 @@
package core.process;
import core.operation.Search;
import core.operation.Select;
import dao.DBManagement;
import error.GExcptInit;
import error.GExcptSQL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class C_StudentSelectTeacher extends C_Select {
public class C_StudentSelectTeacher extends TempProcess {
String studentId;
String teacherId;
private static String buttonName ="选择老师";
private static String targetURL="/home/student-select-teacher";
private static String iconURL="../cssFile/images/select.png";
private static String info = "";
private static String table="graduation_design";
private static String field ="student_choose_teacher_status";
public void select()throws Exception{
if(!check()) throw new GExcptInit("ID Attrs init error!");
@ -30,32 +19,6 @@ public class C_StudentSelectTeacher extends C_Select {
select.addOptions("student_id",this.getStudentId());
select.addOptions("teacher_id",this.getTeacherId());
Map<String,Object> options=select.execute(null);
updateStatus();
}
public List<String[]> search(String teacherId) throws Exception{
if(teacherId==null){
System.out.println("ttt");
}
if(teacherId.equals("*")){
List<String[]> result = DBManagement.selectAll("teacher",0,10);
core.process.Utils.formatResult(result);
return result;
}
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table","teacher");
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("fields",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",teacherId);
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
core.process.Utils.formatResult(result);
return result;
}
protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null)
@ -79,28 +42,5 @@ public class C_StudentSelectTeacher extends C_Select {
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(this.getGraduationDesignId(),table, field);
}
}

@ -2,48 +2,40 @@ package core.process;
import core.operation.UploadFile;
import error.GExcptInit;
import error.GExcptSQL;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class C_StudentUploadFinishedProduct extends C_UploadFile {
public class C_StudentUploadFinishedProduct {
String finishedProductURL;
File finishedProduct;
String graduationDesignId;
private static String buttonName ="提交定稿";
private static String iconURL="../cssFile/images/upload.png";
private static String targetURL="/home/student-upload-finished-product";
private static String info = "";
private static String table="graduation_design_finished_product";
private static String field ="finished_product_status";
static String file_type = "graduation_design_finished_product";
public void uploadFinishedProduct() throws Exception{
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_url",this.getFinishedProductURL());
uploadFile.addOptions("file",this.getFinishedProduct());
uploadFile.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
uploadFile.addOptions("limits",limits);
uploadFile.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getFinishedProductURL()==null||this.getGraduationDesignId()==null)
if(this.getFinishedProduct()==null||this.getGraduationDesignId()==null)
return false;
return true;
}
public String getFinishedProductURL() {
return finishedProductURL;
public File getFinishedProduct() {
return finishedProduct;
}
public void setFinishedProductURL(String finishedProductURL) {
this.finishedProductURL = finishedProductURL;
public void setFinishedProduct(File finishedProduct) {
this.finishedProduct = finishedProduct;
}
public String getGraduationDesignId() {
return graduationDesignId;
@ -53,33 +45,4 @@ public class C_StudentUploadFinishedProduct extends C_UploadFile {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public String getFileType() {
return "上传定稿";
}
}

@ -2,49 +2,41 @@ package core.process;
import core.operation.UploadFile;
import error.GExcptInit;
import error.GExcptSQL;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class C_StudentUploadOpeningReport extends C_UploadFile{
String openingReportURL;
public class C_StudentUploadOpeningReport extends TempProcess{
File openingReport;
String graduationDesignId;
private static String buttonName ="提交开题报告";
private static String file_type = "graduation_design_opening_report";
private static String targetURL="/home/student-upload-opening-report";
private static String iconURL="../cssFile/images/upload.png";
private static String info = "";
private static String table="graduation_design_opening_report";
private static String field ="opening_report_status";
static String file_type = "opening_report";
public void uploadOpeningReport() throws Exception{
if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!");
UploadFile uploadFileOperation=new UploadFile();
uploadFileOperation.setOptions(new HashMap<>());
uploadFileOperation.addOptions("file_url",this.getOpeningReportURL());
uploadFileOperation.addOptions("file",this.getOpeningReport());
uploadFileOperation.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
uploadFileOperation.addOptions("limits",limits);
uploadFileOperation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getOpeningReportURL()==null)
if(this.getGraduationDesignId()==null||this.getOpeningReport()==null)
return false;
return true;
}
public String getOpeningReportURL() {
return openingReportURL;
public File getOpeningReport() {
return openingReport;
}
public void setOpeningReportURL(String openingReportURL) {
this.openingReportURL = openingReportURL;
public void setOpeningReport(File openingReport) {
this.openingReport = openingReport;
}
public String getGraduationDesignId() {
@ -54,34 +46,4 @@ public class C_StudentUploadOpeningReport extends C_UploadFile{
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public String getFileType() {
return "上传开题报告";
}
}

@ -0,0 +1,77 @@
package core.process;
import core.operation.Search;
import error.GExcptInit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class C_TeacherSearchStudent extends TempProcess {
String studentId;
static String table="student";
public Map<String,String> search() throws Exception{
if(!check()) throw new GExcptInit("studentId Attrs init error!");
Map<String,String> studentInfo =new HashMap<>();
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",this.getStudentId());
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]);
studentInfo.put("e_mail_location",s[3]);
studentInfo.put("phone_number",s[4]);
return studentInfo;
}
public List<Map<String,String>> _search() throws Exception{
if(!check()) throw new GExcptInit("studentId Attrs init error!");
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",this.getStudentId());
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");
List<Map<String,String>> studentsInfo = new ArrayList<>();
for(String[] s:result){
Map<String,String> studentInfo = new HashMap<>();
studentInfo.put("id",s[0]);
studentInfo.put("name",s[2]);
studentInfo.put("e_mail_location",s[3]);
studentInfo.put("phone_number",s[4]);
studentsInfo.add(studentInfo);
}
return studentsInfo;
}
protected boolean check() {
if(this.getStudentId()==null)
return false;
return true;
}
public String getStudentId(){
return studentId;
}
public void setStudentId(String studentId){
this.studentId=studentId;
}
}

@ -1,26 +1,16 @@
package core.process;
import core.operation.Search;
import core.operation.Select;
import dao.DBManagement;
import error.GExcptInit;
import error.GExcptSQL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class C_TeacherSelectStudent extends C_Select {
public class C_TeacherSelectStudent extends TempProcess {
String studentId;
String teacherId;
private static String buttonName ="选择学生";
private static String iconURL="../cssFile/images/select.png";
private static String targetURL="/home/teacher-select-student";
private static String info = "";
private static String table="graduation_design";
private static String field ="teacher_choose_student_status";
public void select()throws Exception{
if(!check()) throw new GExcptInit("ID Attrs init error!");
@ -29,29 +19,6 @@ public class C_TeacherSelectStudent extends C_Select {
select.addOptions("teacher_id",this.getTeacherId());
select.addOptions("student_id",this.getStudentId());
Map<String,Object> options=select.execute(null);
updateStatus();
}
public List<String[]> search(String studentId) throws Exception{
if(studentId.equals("*")){
List<String[]> result = DBManagement.selectAll("student",0,10);
core.process.Utils.formatResult(result);
return result;
}
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table","student");
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",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
core.process.Utils.formatResult(result);
return result;
}
protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null)
@ -74,28 +41,6 @@ public class C_TeacherSelectStudent extends C_Select {
this.studentId = studentId;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(this.getGraduationDesignId(),table, field);
}
}

@ -2,90 +2,46 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
public class C_TeacherTeamFillOpeningReportOpinion extends C_FillInformation{
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
//开题报告会小组组长提交开题报告会纪要意见
public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess{
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName ="开题小组意见";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/teacher-team-fill-opening-report-opinion";
private static String info = "";
private static String field ="opening_report_teacher_team_opinion_status";
private static String table="graduation_design_opening_report_opinion_record";
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= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("report_teacher_team_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
return false;
return true;
}
@Override
public String getGraduationDesignId() {
return graduationDesignId;
}
@Override
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
public String getGraduationDesignId() {
return graduationDesignId;
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("report_teacher_team_opinion");
ls.add(null);
return ls;
}
public Map<String, String> getVMap(){return vMap;}
}

@ -2,65 +2,37 @@ package core.process;
import core.operation.FillInformation;
import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.util.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class C_TeacherTeamFillScoreOpinion extends C_FillInformation {
public class C_TeacherTeamFillScoreOpinion extends TempProcess {
String graduationDesignId;
Map<String,String> vMap;
private static String buttonName = "答辩小组评分";
private static String iconURL="../cssFile/images/fill.png";
private static String targetURL="/home/teacher-team-fill-score-opinion";
private static String info = "";
private static String table="graduation_design_reply_opinion_record_score";
private static String field ="reply_teacher_team_score_status";
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);
String date= Configuration.dateFormat.format(new Date());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
String date=df.format(new Date());
vMap.put("teacher_team_opinion_date",date);
Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null);
updateStatus();
}
protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null)
if(this.getGraduationDesignId()==null)
return false;
return true;
}
@Override
public String getInfo() {
return info;
}
@Override
public String getTargetURL() {
return targetURL;
}
@Override
public String getIconURL() {
return iconURL;
}
@Override
public String getButtonName() {
return buttonName;
}
@Override
public String getGraduationDesignId() {
return graduationDesignId;
@ -70,23 +42,8 @@ public class C_TeacherTeamFillScoreOpinion extends C_FillInformation {
public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId;
}
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) {
this.vMap = vMap;
}
public Map<String, String> getVMap() {
return vMap;
}
public List<String> getInputName() {
List<String> ls = new ArrayList<>();
ls.add("teacher_team_opinion");
ls.add("teacher_team_score");
return ls;
}
}

@ -1,8 +0,0 @@
package core.process;
public abstract class C_UploadFile extends TempProcess {
public String getJspURL(){
return "/home/upload_file.jsp";
}
public abstract String getFileType();
}

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

@ -8,9 +8,10 @@ public abstract class Process{
private String permission;
private Operation operation;
public abstract String getJspURL();
private String info;
private static String buttonName;
protected static String targetURL;
protected static String iconURL;
protected abstract boolean check();
public String getPermission() {
@ -29,6 +30,18 @@ public abstract class Process{
this.operation = operation;
}
public String getButtonName() {
return buttonName;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public String getStatus() {
return status;
}
@ -37,11 +50,11 @@ public abstract class Process{
this.status = status;
}
public abstract String getInfo();
public abstract String getTargetURL();
public abstract String getIconURL();
public static String getTargetURL() {
return targetURL;
}
public abstract String getButtonName();
public static String getIconURL() {
return iconURL;
}
}

@ -15,7 +15,7 @@ public class ProcessManagement {
public static Condition getCondition(User user, Map<String, String> status){
Condition condition = new Condition();
for(Map.Entry<String,String> entry:status.entrySet()){
String[] s = entry.getKey().split("\\.");
String[] s = entry.getKey().split(".");
TempProcess tempProcess = (TempProcess) getProcess(s[1]);
tempProcess.setGraduationDesignId(s[0]);
tempProcess.setStatus(entry.getValue());
@ -26,18 +26,17 @@ public class ProcessManagement {
}
private static List<Process> getLastProcesses(User user) {
List<Process> lp = new ArrayList<>();
return lp;
return null;
}
//Map<graduation_design_id.x_status,status>
public static Map<String,String> getStatus(User user) throws Exception {
Map<String, String> status = new HashMap<>();
String[][] userTables = DBManagement.getUserStatusTables(user.getType());
Map<String,String> userTables = DBManagement.getUserStatusTables(user.getType());
String graduationDesignId = null;
for(String[] s:userTables){
String[] ti = s[0].split("\\.");
String[] ts = s[1].split("\\.");
for(Map.Entry<String,String> entry:userTables.entrySet()){
String[] ti = entry.getKey().split(".");
String[] ts = entry.getValue().split(".");
List<String> ls = new ArrayList<>();
ls.add("id");
Map<String,String> limits = new HashMap<>();
@ -56,39 +55,6 @@ public class ProcessManagement {
return status;
}
public static Process getProcess(String process){
switch (process) {
case "teacher_choose_student_status":
return new C_TeacherSelectStudent();
case "student_choose_teacher_status":
return new C_StudentSelectTeacher();
case"student_fill_graduation_design_information_status":
return new C_StudentFillGraduationDesignInformation();
case"opening_report_status":
return new C_StudentUploadOpeningReport();
case"opening_report_mentor_opinion_status":
return new C_MentorFillOpeningReportOpinion();
case"opening_report_teacher_team_opinion_status":
return new C_TeacherTeamFillOpeningReportOpinion();
case"opening_report_college_opinion_status":
return new C_CollegeFillOpeningReportOpinion();
case"opening_report_secretary_record_status":
return new C_SecretaryFillOpeningReportRecord();
case"finished_product_status":
return new C_StudentUploadFinishedProduct();
case"finished_product_mentor_score_status":
return new C_MentorFillReview();
case"finished_product_reviewer_score_status":
return new C_ReviewerFillReview();
case"reply_ secretary_record_status":
return new C_SecretaryFillReplyRecord();
case"reply_ teacher_team_score_status":
return new C_TeacherTeamFillScoreOpinion();
case"reply_college_score_status":
return new C_CollegeFillScoreOpinion();
case"reply_school_score_status":
return new C_SchoolFillScoreOpinion();
default:
return null;
}
}
}

@ -1,13 +1,9 @@
package core.process;
import error.GExcptSQL;
public abstract class TempProcess extends Process {
private static String process;
private static String nextProcess;
protected String graduationDesignId;
protected static String table;
protected static String field;
private String graduationDesignId;
public String getGraduationDesignId() {
return graduationDesignId;
@ -32,6 +28,4 @@ public abstract class TempProcess extends Process {
public static void setNextProcess(String nextProcess) {
TempProcess.nextProcess = nextProcess;
}
public abstract void updateStatus() throws GExcptSQL;
}

@ -1,22 +0,0 @@
package core.process;
import dao.DBManagement;
import error.GExcptSQL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Utils {
static void formatResult(List<String[]> result) {
for(String[] s:result){
s[1] = null;
}
}
static void updateStatus(String id, String table, String field) throws GExcptSQL {
Map<String,String> limits = new HashMap<>();
limits.put("id",id);
DBManagement.updateStatus(table,field,"2",limits);
}
}

@ -1,7 +1,6 @@
package core.user;
import core.process.Condition;
import core.process.ProcessManagement;
import core.user.userFun.AccountManageable;
import core.user.userFun.ProcessConfigurable;
@ -93,11 +92,11 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
public abstract String getType();
public void destroy(){
AccountManagement.destroy(this);
core.user.utils.AccountManagement.destroy(this);
}
public void logout(){
AccountManagement.logout(this);
core.user.utils.AccountManagement.logout(this);
}
@Override
@ -116,9 +115,4 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
this.setE_mail_location(vMap.get("e_mail_location"));
this.setPhone_number(vMap.get("phone_number"));
}
public void initCondition() throws Exception {
this.condition = ProcessManagement.getCondition(this);
}
}

@ -1,6 +1,5 @@
package core.user;
package core.user.utils;
import core.user.Student;
import core.user.User;
import core.utils.GetObjectByName;
import dao.DBManagement;
@ -50,11 +49,7 @@ public interface AccountManagement {
}
static User register(String userType, Map<String, String> vMap) throws Exception {
DBManagement.insert(userType,vMap);
if(userType.equals("student")){
initAllStatus(vMap.get("id"));
}
User user = createUser(userType, vMap);
return user;
return createUser(userType, vMap);
}
static void logout(User user){
//todo
@ -65,28 +60,6 @@ public interface AccountManagement {
static User createUser(String userType, Map<String, String> vMap) throws Exception {
User user = GetObjectByName.getUserByName(userType);
user.setAttr(vMap);
user.initCondition();
return user;
}
String defaultStatus = "0";
static void initAllStatus(String id) throws GExcptSQL {
for(String table:DBManagement.graduationDesignTables){
Map<String,String> vMap = new HashMap<>();
vMap.put("id",id);
DBManagement.insert(table,vMap);
}
for(String[] s:DBManagement.allStatus){
Map<String,String> vMap = new HashMap<>();
Map<String,String> limits = new HashMap<>();
limits.put("id",id);
vMap.put(s[1],defaultStatus);
DBManagement.update(s[0],vMap,limits);
}
//
Map<String,String> vMap = new HashMap<>();
Map<String,String> limits = new HashMap<>();
limits.put("id",id);
vMap.put("student_id",id);
DBManagement.update("graduation_design",vMap,limits);
}
}

@ -2,6 +2,7 @@ package dao;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import error.GExcptSQL;
@ -55,49 +56,36 @@ public class DBManagement {
"phone_number"
};
//<table1.x_id,table2.x_status>
public static String[][] graduationDesignStudentTables ={
{"graduation_design.student_id","graduation_design.student_choose_teacher_status"},
{"graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status"},
{"graduation_design.student_id","graduation_design_opening_report.opening_report_status"},
{"graduation_design_opening_report_view.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
{"graduation_design_opening_report_view.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
{"graduation_design_opening_report_view.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"},
{"graduation_design.student_id","graduation_design_finished_product.finished_product_status"},
{"graduation_design_reply_view.leader_student_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"},
{"graduation_design_reply_view.teacher1_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"},
{"graduation_design_reply_view.teacher2_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"}
};
public static String[][] graduationDesignTeacherTables = {
{"graduation_design.teacher_id","graduation_design.teacher_choose_student_status"},
{"graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status"},
{"graduation_design_opening_report_view.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_view.teacher1_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_view.teacher2_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_opinion_record.opening_report_college_teacher_id","graduation_design_opening_report_opinion_record.opening_report_college_opinion_status"},
{"graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status"},
{"graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status"},
{"graduation_design_reply_view.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_view.teacher1_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_view.teacher2_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_opinion_record_score.reply_college_teacher_id","graduation_design_reply_opinion_record_score.reply_college_score_status"},
{"graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_score_status"}
public static Map<String,String> graduationDesignStudentTables = new HashMap<>(){
{
put("graduation_design.student_id","graduation_design.student_chooser_teacher_status");
put("graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status");
put("graduation_design.student_id","graduation_design_opening_report.opening_report_status");
put("opening_report_secretary_team.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("opening_report_secretary_team.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("opening_report_secretary_team.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
put("graduation_design.student_id","graduation_design_finished_product.finished_product_status");
put("reply_secretary_team.leader_student_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
put("reply_secretary_team.teacher1_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
put("reply_secretary_team.teacher2_id","graduation_design_reply_opinion_record_score.reply_ secretary_record_status");
}
};
public static String[][] allStatus = {
{"graduation_design","teacher_choose_student_status"},
{"graduation_design","student_choose_teacher_status"},
{"graduation_design_information","student_fill_graduation_design_information_status"},
{"graduation_design_opening_report","opening_report_status"},
{"graduation_design_opening_report_opinion_record","opening_report_mentor_opinion_status"},
{"graduation_design_opening_report_opinion_record","opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_opinion_record","opening_report_college_opinion_status"},
{"graduation_design_opening_report_opinion_record","opening_report_secretary_record_status"},
{"graduation_design_finished_product","finished_product_status"},
{"graduation_design_finished_product_mentor_score","finished_product_mentor_score_status"},
{"graduation_design_finished_product_reviewer_score","finished_product_reviewer_score_status"},
{"graduation_design_reply_opinion_record_score","reply_secretary_record_status"},
{"graduation_design_reply_opinion_record_score","reply_teacher_team_score_status"},
{"graduation_design_reply_opinion_record_score","reply_college_score_status"},
{"graduation_design_reply_opinion_record_score","reply_school_score_status"}
public static Map<String,String> graduationDesignTeacherTables = new HashMap<>(){
{
put("graduation_design.teacher_id","graduation_design.teacher_choose_student_status");
put("graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status");
put("opening_report_teacher_team.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("opening_report_teacher_team.teacher1_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("opening_report_teacher_team.teacher2_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
put("graduation_design_opening_report_opinion_record.opening_report_college_teacher_id","graduation_design_opening_report_opinion_record.opening_report_college_opinion_status");
put("graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status");
put("graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status");
put("reply_teacher_team.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("reply_teacher_team. teacher1_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("reply_teacher_team. teacher2_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
put("graduation_design_reply_opinion_record_score.reply_college_teacher_id","graduation_design_reply_opinion_record_score.reply_college_score_status");
put("graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_score_status");
}
};
public static String driverClassName="org.mariadb.jdbc.Driver";
@ -130,7 +118,7 @@ public class DBManagement {
}
return null;
}
public static String[][] getUserStatusTables(String userType){
public static Map<String,String> getUserStatusTables(String userType){
if(userType.equals("student")){
return graduationDesignStudentTables;
}
@ -166,26 +154,11 @@ public class DBManagement {
String sql = select.getSQL();
return query(sql);
}
public static List<String[]> selectAll(String table, int startRow, int endRow) throws Exception {
SelectAll selectAll = new SelectAll(table,startRow,endRow);
String sql = selectAll.getSQL();
return query(sql);
}
public static void update(String table, Map<String,String> vMap, Map<String,String> limits) throws GExcptSQL {
Update update = new Update(table,vMap,limits);
String sql = update.getSQL();
update(sql);
}
public static void updateStatus(String table, String field, String increment, Map<String,String> limits) throws GExcptSQL {
UpdateStatus us = new UpdateStatus(table,field,increment,limits);
String sql = us.getSQL();
update(sql);
}
public static void updateAll(String table, List<String> fields, String increment) throws GExcptSQL {
UpdateAll updateAll = new UpdateAll(table,fields,increment);
String sql = updateAll.getSQL();
update(sql);
}
public static List<String[]> query(String sql) throws Exception {
if(!ifInit) return null;
List<String[]> ls;
@ -205,7 +178,7 @@ public class DBManagement {
ls.add(s);
}
} catch (SQLException e) {
throw new GExcptSQL("Connect Failure\n"+sql);
throw new GExcptSQL("Connect Failure");
}finally {
if(con!=null) {
try {
@ -225,7 +198,7 @@ public class DBManagement {
Statement stmt = con.createStatement();
stmt.executeUpdate(sql);
} catch (SQLException e) {
throw new GExcptSQL("Connect Failure\n"+sql);
throw new GExcptSQL("Connect Failure");
}finally {
if(con!=null) {
try {
@ -236,6 +209,4 @@ public class DBManagement {
}
}
}
}

@ -1,45 +0,0 @@
package dao;
public class SelectAll extends SQLStmt {
static String fs = "SELECT";
private int startRow;
private int endRow;
SelectAll(String table,int startRow, int endRow) {
super(table);
this.setStartRow(startRow);
this.setEndRow(endRow);
}
@Override
public String getSQL() {
return getFs()+getTs()+getLs();
}
@Override
public String getFs() {
return fs+" * ";
}
private String getTs(){
return "FROM "+this.getTable()+" ";
}
private String getLs(){
String sql="LIMIT "+this.getStartRow()+", "+this.getEndRow();
return sql;
}
public int getStartRow() {
return startRow;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public int getEndRow() {
return endRow;
}
public void setEndRow(int endRow) {
this.endRow = endRow;
}
}

@ -1,48 +0,0 @@
package dao;
import java.util.List;
public class UpdateAll extends SQLStmt {
private static final String fs ="UPDATE ";
List<String> fields;
String increment;
public UpdateAll(String table, List<String> fields, String increment) {
super(table);
this.setFields(fields);
this.setIncrement(increment);
}
@Override
public String getSQL() {
return this.getFs()+this.getUs();
}
@Override
public String getFs() {
return fs+this.getTable()+" ";
}
public String getUs(){
String us = "SET ";
for(String s:this.getFields()){
us+=s+" = "+s+" + "+this.getIncrement()+", ";
}
return utils.Utils.cutTail(us,2);
}
public List<String> getFields() {
return fields;
}
public void setFields(List<String> fields) {
this.fields = fields;
}
public String getIncrement() {
return increment;
}
public void setIncrement(String increment) {
this.increment = increment;
}
}

@ -1,58 +0,0 @@
package dao;
import java.util.Map;
public class UpdateStatus extends SQLStmt {
static String fs = "UPDATE ";
String field;
String increment;
Map<String,String> limits;
public UpdateStatus(String table, String field, String increment, Map<String, String> limits) {
super(table);
this.setField(field);
this.setIncrement(increment);
this.setLimits(limits);
}
@Override
public String getSQL() {
return getFs()+getUs()+getLs();
}
@Override
public String getFs() {
return fs+this.getTable()+" ";
}
private String getLs(){
return dao.Utils.whereAnd(this.getLimits());
}
public String getUs(){
String us = "SET ";
us+=this.getField()+" = "+this.getField()+" + "+this.getIncrement()+" ";
return us;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public String getIncrement() {
return increment;
}
public void setIncrement(String increment) {
this.increment = increment;
}
public Map<String, String> getLimits() {
return limits;
}
public void setLimits(Map<String, String> limits) {
this.limits = limits;
}
}

@ -1,7 +0,0 @@
package error;
public class GExcptFileIO extends GExcpt {
public GExcptFileIO(String info) {
super(info);
}
}

@ -1,105 +0,0 @@
package filter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
@WebFilter(urlPatterns = "/*")
public class CharSet implements Filter {
public void destroy() {
}
public void doFilter(ServletRequest req, ServletResponse resp,
FilterChain chain) throws ServletException, IOException {
HttpServletRequest httpServletRequest = (HttpServletRequest) req;
// 对request包装增强
HttpServletRequest myrequest = new MyRequest(httpServletRequest);
((HttpServletResponse)resp).setContentType("text/html;charset=utf-8");
chain.doFilter(myrequest, resp);
}
public void init(FilterConfig config) throws ServletException {
}
}
class MyRequest extends HttpServletRequestWrapper {
private HttpServletRequest request;
private boolean hasEncode;
public MyRequest(HttpServletRequest request) {
super(request);
this.request = request;
}
// 对需要增强方法 进行覆盖
@Override
public Map<String, String[]> getParameterMap() {
// 先获得请求方式
String method = request.getMethod();
if (method.equalsIgnoreCase("post")) {
// post请求
try {
// 处理post乱码
request.setCharacterEncoding("utf-8");
return request.getParameterMap();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
} else if (method.equalsIgnoreCase("get")) {
// get请求
Map<String, String[]> parameterMap = request.getParameterMap();
if (!hasEncode) { // 确保get手动编码逻辑只运行一次
for (String parameterName : parameterMap.keySet()) {
String[] values = parameterMap.get(parameterName);
if (values != null) {
for (int i = 0; i < values.length; i++) {
try {
// 处理get乱码
values[i] = new String(values[i].getBytes("ISO-8859-1"), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
}
hasEncode = true;
}
return parameterMap;
}
return super.getParameterMap();
}
@Override
public String getParameter(String name) {
Map<String, String[]> parameterMap = getParameterMap();
String[] values = parameterMap.get(name);
if (values == null) {
return null;
}
return values[0]; // 取回参数的第一个值
}
@Override
public String[] getParameterValues(String name) {
Map<String, String[]> parameterMap = getParameterMap();
String[] values = parameterMap.get(name);
return values;
}
}

@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home/*")
@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home.jsp")
public class OnlineCheck implements Filter {
public void destroy() {
}

@ -1,13 +1,10 @@
package gdms;
import java.text.SimpleDateFormat;
public interface Configuration {
//file
String filePath = "C:/Users/zhai_/Desktop/gdms/";
String filePath = "/";
//database
String dbUrl="jdbc:mariadb://localhost:3306/gdms";
String dbUsername="gdms";
String dbPassword="GDMS";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}

@ -1,212 +1,26 @@
package gdms;
import dao.DBManagement;
import error.GExcptFileIO;
import error.GExcptFormat;
import error.GExcptInit;
import error.GExcptSQL;
import net.sf.json.JSONObject;
import utils.Utils;
import java.text.ParseException;
import java.util.*;
public class GDMS {
static Map<String, Date> schedules;
static String scheduleName = "GlobalTimePoint.json";
public static void init() throws GExcptInit, GExcptFormat {
static String schedulePath = "";
public static void init() throws GExcptInit {
initSchedule();
Timer timer = new Timer(true);
for(Map.Entry<String, Date> schedule:schedules.entrySet()){
timer.schedule(getTimerTask(schedule.getKey()),schedule.getValue());
}
System.out.println("GDMS init finished");
}
private static TimerTask getTimerTask(String s) throws GExcptInit {
switch (s){
case "teacher_choose_student_start_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("teacher_choose_student start!");
List<String> fields = new ArrayList<>();
fields.add("teacher_choose_student_status");
try {
DBManagement.updateAll("graduation_design",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "student_choose_teacher_start_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("teacher_choose_student start!");
List<String> fields = new ArrayList<>();
fields.add("student_choose_teacher_status");
try {
DBManagement.updateAll("graduation_design",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "choose_end_date":
if(s==""){
return new TimerTask() {
@Override
public void run() {
System.out.println("choose_topic finished!");
List<String> fields = new ArrayList<>();
fields.add("student_choose_teacher_status");
fields.add("teacher_choose_student_status");
try {
DBManagement.updateAll("graduation_design",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("student_fill_graduation_design_information_status");
try {
DBManagement.updateAll("graduation_design_information",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("opening_report_status");
try {
DBManagement.updateAll("graduation_design_opening_report",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("opening_report_mentor_opinion_status");
fields.add("opening_report_teacher_team_opinion_status");
fields.add("opening_report_college_opinion_status");
fields.add("opening_report_secretary_record_status");
try {
DBManagement.updateAll("graduation_design_opening_report_opinion_record",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "opening_report_opinion_deadline_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("opening_report_submit finished");
List<String> fields = new ArrayList<>();
fields.add("opening_report_mentor_opinion_status");
fields.add("opening_report_teacher_team_opinion_status");
fields.add("opening_report_college_opinion_status");
fields.add("opening_report_secretary_record_status");
try {
DBManagement.updateAll("graduation_design_opening_report_opinion_record",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("finished_product_status");
try {
DBManagement.updateAll("graduation_design_finished_product",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "finished_product_deadline_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("finished_product_submit finished!");
List<String> fields = new ArrayList<>();
fields.add("finished_product_status");
try {
DBManagement.updateAll("graduation_design_finished_product",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("finished_product_mentor_score_status");
try {
DBManagement.updateAll("graduation_design_finished_product_mentor_score",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("finished_product_reviewer_score_status");
try {
DBManagement.updateAll("graduation_design_finished_product_reviewer_score",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "finished_product_review_deadline_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("finished_product_review_submit finished!");
List<String> fields = new ArrayList<>();
fields.add("finished_product_mentor_score_status");
try {
DBManagement.updateAll("graduation_design_finished_product_mentor_score",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("finished_product_reviewer_score_status");
try {
DBManagement.updateAll("graduation_design_finished_product_reviewer_score",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
fields = new ArrayList<>();
fields.add("reply_mentor_score_status");
fields.add("reply_teacher_team_score_status");
fields.add("reply_college_score_status");
fields.add("reply_secretary_record_status");
try {
DBManagement.updateAll("graduation_design_reply_opinion_record_score",fields,"1");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
}
};
case "reply_opinion_deadline_date":
return new TimerTask() {
@Override
public void run() {
System.out.println("reply_opinion_submit finished!");
List<String> fields = new ArrayList<>();
fields.add("reply_mentor_score_status");
fields.add("reply_teacher_team_score_status");
fields.add("reply_college_score_status");
fields.add("reply_secretary_record_status");
try {
DBManagement.updateAll("graduation_design_reply_opinion_record_score",fields,"4");
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
System.exit(1);
}
;
}
};
}
@ -214,25 +28,7 @@ public class GDMS {
throw new GExcptInit("GlobalTimePoint.json error");
}
private static void initSchedule() throws GExcptFormat {
schedules = new HashMap<>();
String sets= null;
try {
sets = Utils.readFile(Configuration.filePath+scheduleName);
} catch (GExcptFileIO gExcptFileIO) {
gExcptFileIO.printStackTrace();
}
JSONObject jo=JSONObject.fromObject(sets);
Iterator it = jo.keys();
while (it.hasNext()) {
String key = (String)it.next();
Object value = jo.get(key);
try {
schedules.put(key, Configuration.dateFormat.parse((String) value));
} catch (ParseException e) {
e.printStackTrace();
throw new GExcptFormat("json date format error");
}
}
private static void initSchedule() {
}
}

@ -0,0 +1,9 @@
{
"teacher_choose_student_start_date":"",
"student_choose_teacher_start_date": "",
"choose_end_date": "",
"opening_report_opinion_deadline_date": "",
"finished_product_deadline_date": "",
"finished_product_review_deadline_date": "",
"reply_option_deadline_date": ""
}

@ -2,13 +2,7 @@ package gdms;
import core.operation.utils.Utils;
import core.process.C_StudentSelectTeacher;
import dao.DBManagement;
import dao.Select;
import dao.UpdateAll;
import dao.UpdateStatus;
import error.GExcptFormat;
import error.GExcptInit;
import error.GExcptSQL;
import java.util.ArrayList;
import java.util.HashMap;
@ -17,14 +11,26 @@ import java.util.Map;
public class test {
public static void main(String[] args){
try {
new C_StudentSelectTeacher().updateStatus();
} catch (GExcptSQL gExcptSQL) {
gExcptSQL.printStackTrace();
int i=0;
do{
i++;
System.out.println(i);
}while(i<3);
List<String> list = new ArrayList<>();
list.add("q");
list.add("w");
Map<String,String> map=new HashMap<>();
map.put("a","b");
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);
}
Map<String,String> limits = new HashMap<>();
limits.put("id","100");
UpdateStatus us = new UpdateStatus("table","field","1",limits);
System.out.println(us.getSQL());
static void changeB(String a){
a="B";
}
}

@ -1,9 +1,8 @@
package init;
import core.user.utils.AccountManagement;
import dao.DBManagement;
import error.GExcptFormat;
import error.GExcptInit;
import gdms.GDMS;
import error.GExcptSQL;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
@ -14,22 +13,16 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@WebServlet(name = "Init")
public class Init extends HttpServlet {
static boolean ifInit = false;
public void init(){
if(ifInit) return;
System.out.println("init start");
DBManagement.init();
try {
GDMS.init();
} catch (GExcptInit gExcptInit) {
gExcptInit.printStackTrace();
System.exit(1);
} catch (GExcptFormat gExcptFormat) {
gExcptFormat.printStackTrace();
System.exit(1);
}
ifInit = true;
System.out.println("init finished");
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}

@ -10,12 +10,11 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/college-fill-opening-report-opinion")
@WebServlet("college-fill-opening-report-opinion")
public class S_CollegeFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_CollegeFillOpeningReportOpinion p =new C_CollegeFillOpeningReportOpinion();
p.setGraduationDesignId(id);
p.setVMap(vMap);
@ -25,7 +24,6 @@ public class S_CollegeFillOpeningReportOpinion extends HttpServlet {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"college_opinion"

@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/college-fill-score-opinion")
@WebServlet("college-fill-score-opinion")
public class S_CollegeFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
@ -24,7 +24,6 @@ public class S_CollegeFillScoreOpinion extends HttpServlet {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"college_opinion",

@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/mentor-fill-opening-report-opinion")
@WebServlet("mentor-fill-opening-report-opinion")
public class S_MentorFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
@ -24,7 +24,6 @@ public class S_MentorFillOpeningReportOpinion extends HttpServlet {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"mentor_opinion"

@ -1,7 +1,5 @@
package servlet;
import core.process.C_MentorFillReview;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/mentor-fill-review")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_MentorFillReview p=new C_MentorFillReview();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.teacherTeamFillOpeningReportOpinion();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"total_grade",

@ -1,7 +1,5 @@
package servlet;
import core.process.C_ReviewerFillReview;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/reviewer-fill-review")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_ReviewerFillReview p=new C_ReviewerFillReview();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.TeacherTeamFillOpeningReportOpinion();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"score",

@ -1,7 +1,5 @@
package servlet;
import core.process.C_SchoolFillScoreOpinion;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/school-fill-score-opinion")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_SchoolFillScoreOpinion p=new C_SchoolFillScoreOpinion();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"school_opinion",

@ -1,7 +1,5 @@
package servlet;
import core.process.C_SecretaryFillOpeningReportRecord;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/secretary-fill-opening-report-record")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_SecretaryFillOpeningReportRecord p=new C_SecretaryFillOpeningReportRecord();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"secretary_record"

@ -1,7 +1,5 @@
package servlet;
import core.process.C_SecretaryFillReplyRecord;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/secretary-fill-reply-record")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_SecretaryFillReplyRecord p=new C_SecretaryFillReplyRecord();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"secretary_record"

@ -1,7 +1,5 @@
package servlet;
import core.process.C_StudentFillGraduationDesignInformation;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,23 +8,13 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/student-fill-graduation-design-information")
@WebServlet("/student-fill-graduation-design-information")
public class S_StudentFillGraduationDesignInformation extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_StudentFillGraduationDesignInformation p=new C_StudentFillGraduationDesignInformation();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"chinese_name",

@ -1,5 +1,6 @@
package servlet;
import core.process.C_StudentSearchTeacher;
import core.process.C_StudentSelectTeacher;
import core.user.User;
import javax.servlet.ServletException;
@ -8,9 +9,10 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/home/student-select-teacher")
@WebServlet("/student-select-teacher")
public class S_StudentSelectTeacher extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
String teacherId=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user");
String studentId=user.getId();
@ -23,7 +25,5 @@ public class S_StudentSelectTeacher extends HttpServlet {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("选择成功");
}
}

@ -1,7 +1,5 @@
package servlet;
import core.process.C_StudentUploadFinishedProduct;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
@ -10,29 +8,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/home/student-upload-finished-product")
@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 {
String id = request.getParameter("id");
String fileURL = null;
try {
fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e)
{
System.out.print(e);
response.sendRedirect("/op_fail.jsp");
}
C_StudentUploadFinishedProduct p =new C_StudentUploadFinishedProduct();
p.setFinishedProductURL(fileURL);
p.setGraduationDesignId(id);
try {
p.uploadFinishedProduct();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
String fileURL = servlet.Utils.saveFile(request, fileType);
}
}

@ -1,6 +1,6 @@
package servlet;
import core.process.C_StudentUploadOpeningReport;
import core.user.User;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
@ -8,31 +8,16 @@ import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.io.IOException;
import java.util.UUID;
@WebServlet("/home/student-upload-opening-report")
@WebServlet("/student-upload-opening-report")
@MultipartConfig
public class S_StudentUploadOpeningReport extends HttpServlet {
static String fileType = "graduation_design_opening_report";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
String fileURL = null;
try {
fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e)
{
System.out.print(e);
response.sendRedirect("/op_fail.jsp");
}
C_StudentUploadOpeningReport p =new C_StudentUploadOpeningReport();
p.setOpeningReportURL(fileURL);
p.setGraduationDesignId(id);
try {
p.uploadOpeningReport();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
String fileURL = servlet.Utils.saveFile(request, fileType);
}
}

@ -9,9 +9,10 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/home/teacher-select-student")
@WebServlet("/teacher-select-student")
public class S_TeacherSelectStudent extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
String studentId=request.getParameter("id");
User user=(User)request.getSession().getAttribute("user");
String teacherId=user.getId();
@ -24,6 +25,5 @@ public class S_TeacherSelectStudent extends HttpServlet {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("选择成功");
}
}

@ -1,7 +1,5 @@
package servlet;
import core.process.C_TeacherTeamFillOpeningReportOpinion;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/teacher-team-fill-opening-report-opinion")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_TeacherTeamFillOpeningReportOpinion p=new C_TeacherTeamFillOpeningReportOpinion();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"report_teacher_team_opinion"

@ -1,7 +1,5 @@
package servlet;
import core.process.C_TeacherTeamFillScoreOpinion;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@WebServlet("/home/teacher-team-fill-score-opinion")
@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<String,String> vMap = servlet.Utils.getVMap(vName,request);
C_TeacherTeamFillScoreOpinion p=new C_TeacherTeamFillScoreOpinion();
p.setGraduationDesignId(id);
p.setVMap(vMap);
try {
p.fillInformation();
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect("/op_fail.jsp");
}
response.getWriter().write("提交成功");
}
static String[] vName = {
"teacher_team_opinion",

@ -1,6 +1,7 @@
package servlet;
import gdms.Configuration;
import org.apache.coyote.Request;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@ -39,13 +40,10 @@ public interface Utils {
return getFilePath(table)+getFileName(fileName);
}
static String saveFile(HttpServletRequest request, String table) throws IOException, ServletException {
System.out.println("utils");
Part part = request.getPart("file");
System.out.println("part");
Part part = request.getPart("graduation_design");
String header = part.getHeader("content-disposition");
String path = header.substring(header.indexOf("filename=") + 10, header.length() - 1);
String filePathName = servlet.Utils.getFilePathName(table,path);
System.out.println(filePathName);
File file = new File(filePathName);
InputStream inputStream = part.getInputStream();
FileOutputStream outputStream = new FileOutputStream(file);
@ -57,7 +55,6 @@ public interface Utils {
outputStream.close();
inputStream.close();
part.delete();
System.out.println("end");
return filePathName;
}
}

@ -3,13 +3,15 @@ package servlet.account;
import java.io.IOException;
import java.sql.SQLException;
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 core.user.Student;
import core.user.User;
import core.user.AccountManagement;
import core.user.utils.AccountManagement;
import error.GExcptAccount;
import error.GExcptSQL;
@ -36,7 +38,7 @@ public class S_Login extends HttpServlet {
return;
}
request.getSession().setAttribute("user",user);
response.sendRedirect("/home/home.jsp");
response.sendRedirect("/home.jsp");
return;
}
}

@ -1,7 +1,7 @@
package servlet.account;
import core.user.User;
import core.user.AccountManagement;
import core.user.utils.AccountManagement;
import error.GExcptAccount;
import error.GExcptSQL;
import javax.servlet.ServletException;
@ -43,7 +43,7 @@ public class S_Register extends HttpServlet {
response.sendRedirect("/op_fail.jsp");
}
request.getSession().setAttribute("user",user);
response.sendRedirect("/home/home.jsp");
response.sendRedirect("/home.jsp");
return;
}
}

@ -1,11 +1,5 @@
package utils;
import error.GExcpt;
import error.GExcptFileIO;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -40,29 +34,4 @@ public interface Utils {
return "";
}
}
static String readFile(String path) throws GExcptFileIO {
File file = new File(path);
BufferedReader reader = null;
String str = "";
try {
reader = new BufferedReader(new FileReader(file));
String tempString;
while ((tempString = reader.readLine()) != null) {
str = str + tempString;
}
reader.close();
} catch (Exception e) {
e.printStackTrace();
throw new GExcptFileIO(path+" read error");
} finally {
if (reader != null) {
try {
reader.close();
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
return str;
}
}

Binary file not shown.

Binary file not shown.

@ -3,9 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Init</servlet-name>
<servlet-class>init.Init</servlet-class>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save