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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true"> <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> <driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize> <synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver> <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"> <component name="libraryTable">
<library name="lib"> <library name="lib">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib" /> <root url="file://$PROJECT_DIR$/web/WEB-INF/lib" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/web/WEB-INF/lib" recursive="false" />
</library> </library>
</component> </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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <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> </modules>
</component> </component>
</project> </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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
</project> </project>

@ -19,16 +19,8 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Tomcat 9.0.14" level="application_server_libraries" /> <orderEntry type="library" exported="" scope="PROVIDED" name="lib" level="project" />
<orderEntry type="library" name="lib" level="project" /> <orderEntry type="library" exported="" scope="PROVIDED" name="Tomcat 8.5.37" level="application_server_libraries" />
<orderEntry type="module-library"> <orderEntry type="library" scope="PROVIDED" name="tomcat-lib" level="project" />
<library>
<CLASSES>
<root url="jar://C:/Program Files/Apache Software Foundation/Tomcat 9.0/lib/tomcat-jdbc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </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 { public Map<String, Object> execute(User subject) throws GExcptSQL {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("id",(String)this.getOptions().get("id")); map.put("id",(String)this.getOptions().get("id"));
//todo for(String table:DBManagement.graduationDesignTables){
DBManagement.delete(table,map);
}
return this.getOptions(); return this.getOptions();
} }
} }

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

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

@ -14,7 +14,7 @@ public interface Utils {
{ {
put("announcement","annex_url"); put("announcement","annex_url");
put("graduation_design_finished_product","graduation_design_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){ static String stringOptionsFormat(String options){
return options.replaceAll(" {2,}", " ") ; return options.replaceAll(" {2,}", " ") ;

@ -1,39 +1,31 @@
package core.process; package core.process;
import core.operation.FillInformation; import core.operation.FillInformation;
import dao.DBManagement;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import org.apache.commons.lang.ObjectUtils;
import java.text.SimpleDateFormat; 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; String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_opening_report_opinion_record";
private static String fileds="opening_report_college_opinion_status";
public void fillInformation() throws Exception { public void fillInformation() throws Exception {
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
FillInformation fillInformation =new FillInformation(); FillInformation fillInformation =new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("college_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null||this.getVMap()==null)
@ -48,11 +40,6 @@ public class C_CollegeFillOpeningReportOpinion extends C_FillInformation{
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table,fileds);
}
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = vMap; this.vMap = vMap;
} }
@ -60,30 +47,4 @@ public class C_CollegeFillOpeningReportOpinion extends C_FillInformation{
public Map<String, String> getVMap() { public Map<String, String> getVMap() {
return vMap; 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; package core.process;
import core.operation.FillInformation; import core.operation.FillInformation;
import dao.DBManagement;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat; 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; String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_reply_opinion_record_score";
private static String fileds="reply_college_score_status";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs Init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs Init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("college_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
@ -49,36 +42,4 @@ public class C_CollegeFillScoreOpinion extends C_FillInformation{
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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 core.operation.FillInformation;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_MentorFillOpeningReportOpinion extends C_FillInformation{ public class C_MentorFillOpeningReportOpinion extends TempProcess{
String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_opening_report_opinion_record";
private static String field ="opening_report_mentor_opinion_status";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("mentor_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
@ -43,21 +33,6 @@ public class C_MentorFillOpeningReportOpinion extends C_FillInformation{
return false; return false;
return true; 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) { public void setVMap(Map<String, String> vMap) {
this.vMap = vMap; this.vMap = vMap;
} }
@ -65,30 +40,4 @@ public class C_MentorFillOpeningReportOpinion extends C_FillInformation{
public Map<String, String> getVMap() { public Map<String, String> getVMap() {
return vMap; 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 core.operation.FillInformation;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import gdms.Configuration;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.text.SimpleDateFormat; //指导老师评阅
import java.util.*; public class C_MentorFillReview extends TempProcess {
public String graduationDesignId;
public class C_MentorFillReview extends C_FillInformation {
public String graduationDesignId;
public Map<String,String> vMap; 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!"); if(!check()) throw new GExcptInit("MentorFillReview Attrs init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("review_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
@Override @Override
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null||this.getVMap()==null)
@ -45,51 +47,5 @@ public class C_MentorFillReview extends C_FillInformation {
else else
return true; 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,40 +2,33 @@ package core.process;
import core.operation.FillInformation; import core.operation.FillInformation;
import error.GExcptInit; 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 String graduationDesignId;
public Map<String,String> vMap; public Map<String, String> vMap;
private static String buttonName ="评阅老师评阅"; static String table = "graduation_design_finished_product_reviewer_score";
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"; public void TeacherTeamFillOpeningReportOpinion() throws Exception {
private static String field ="finished_product_reviewer_score_status"; if (!check()) throw new GExcptInit("ReviewerFillReview Attrs init error!");
FillInformation fillInformation = new FillInformation();
public void TeacherTeamFillOpeningReportOpinion() throws Exception{
if(!check()) throw new GExcptInit("ReviewerFillReview Attrs init error!");
FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); fillInformation.addOptions("table", table);
String date= Configuration.dateFormat.format(new Date()); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-ddHH:mm:ss");
vMap.put("reviewer_score_date",date); String date = df.format(new Date());
Map<String, String>limits = new HashMap<>(); vMap.put("reviewer_score_date", date);
limits.put("id",this.getGraduationDesignId()); Map<String, String> limits = new HashMap<>();
fillInformation.addOptions("limits",limits); limits.put("id", this.getGraduationDesignId());
fillInformation.addOptions("vMap",vMap); fillInformation.addOptions("limits", limits);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
@Override
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if (this.getGraduationDesignId() == null|| this.getVMap() == null)
return false; return false;
else else
return true; return true;
@ -46,44 +39,12 @@ public class C_ReviewerFillReview extends C_FillInformation {
public void setGraduationDesignId(String teacherID) { public void setGraduationDesignId(String teacherID) {
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public Map<String, String> getVMap() { public Map<String, String> getVMap() {
return vMap; return vMap;
} }
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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;
}
} }
@ -91,8 +52,3 @@ public class C_ReviewerFillReview extends C_FillInformation {

@ -2,39 +2,33 @@ package core.process;
import core.operation.FillInformation; import core.operation.FillInformation;
import error.GExcptInit; 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; String graduationDesignId;
Map<String,String> vMap; 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{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("school_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
@ -47,46 +41,10 @@ public class C_SchoolFillScoreOpinion extends C_FillInformation {
public void setGraduationDesignId(String graduationDesignId) { public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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 core.operation.FillInformation;
import error.GExcptInit; 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; String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_reply_opinion_record_score";
private static String field ="reply_secretary_record_status";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs Init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs Init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("secretary_record_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
@ -47,44 +42,10 @@ public class C_SecretaryFillReplyRecord extends C_FillInformation{
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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 core.operation.FillInformation;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_StudentFillGraduationDesignInformation extends C_FillSbjMsg { public class C_StudentFillGraduationDesignInformation extends TempProcess{
String graduationDesignId; String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_opening_report_opinion_record";
private static String field ="student_fill_graduation_design_information_status";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); 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<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
@ -45,37 +39,9 @@ public class C_StudentFillGraduationDesignInformation extends C_FillSbjMsg {
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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; package core.process;
import core.operation.Search;
import core.operation.Select; import core.operation.Select;
import dao.DBManagement;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_StudentSelectTeacher extends C_Select { public class C_StudentSelectTeacher extends TempProcess {
String studentId; String studentId;
String teacherId; 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{ public void select()throws Exception{
if(!check()) throw new GExcptInit("ID Attrs init error!"); 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("student_id",this.getStudentId());
select.addOptions("teacher_id",this.getTeacherId()); select.addOptions("teacher_id",this.getTeacherId());
Map<String,Object> options=select.execute(null); 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() { protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null) 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 core.operation.UploadFile;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_StudentUploadFinishedProduct extends C_UploadFile { public class C_StudentUploadFinishedProduct {
String finishedProductURL; File finishedProduct;
String graduationDesignId; 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"; static String file_type = "finished_product";
private static String field ="finished_product_status"; public void uploadOpeningReport() throws Exception{
static String file_type = "graduation_design_finished_product";
public void uploadFinishedProduct() throws Exception{
if(!check()) throw new GExcptInit("Upload FinishedProduct Attrs init error!"); if(!check()) throw new GExcptInit("Upload FinishedProduct Attrs init error!");
UploadFile uploadFile=new UploadFile(); UploadFile uploadFile=new UploadFile();
uploadFile.setOptions(new HashMap<>()); uploadFile.setOptions(new HashMap<>());
uploadFile.addOptions("file_url",this.getFinishedProductURL()); uploadFile.addOptions("file",this.getFinishedProduct());
uploadFile.addOptions("file_type",file_type); uploadFile.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
uploadFile.addOptions("limits",limits); uploadFile.addOptions("limits",limits);
uploadFile.execute(null); uploadFile.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getFinishedProductURL()==null||this.getGraduationDesignId()==null) if(this.getFinishedProduct()==null||this.getGraduationDesignId()==null)
return false; return false;
return true; return true;
} }
public String getFinishedProductURL() { public File getFinishedProduct() {
return finishedProductURL; return finishedProduct;
} }
public void setFinishedProductURL(String finishedProductURL) { public void setFinishedProduct(File finishedProduct) {
this.finishedProductURL = finishedProductURL; this.finishedProduct = finishedProduct;
} }
public String getGraduationDesignId() { public String getGraduationDesignId() {
return graduationDesignId; return graduationDesignId;
@ -53,33 +45,4 @@ public class C_StudentUploadFinishedProduct extends C_UploadFile {
this.graduationDesignId = 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 "上传定稿";
}
} }

@ -2,49 +2,41 @@ package core.process;
import core.operation.UploadFile; import core.operation.UploadFile;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class C_StudentUploadOpeningReport extends C_UploadFile{ public class C_StudentUploadOpeningReport extends TempProcess{
String openingReportURL; File openingReport;
String graduationDesignId; 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"; static String file_type = "opening_report";
private static String field ="opening_report_status";
public void uploadOpeningReport() throws Exception{ public void uploadOpeningReport() throws Exception{
if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!"); if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!");
UploadFile uploadFileOperation=new UploadFile(); UploadFile uploadFileOperation=new UploadFile();
uploadFileOperation.setOptions(new HashMap<>()); uploadFileOperation.setOptions(new HashMap<>());
uploadFileOperation.addOptions("file_url",this.getOpeningReportURL()); uploadFileOperation.addOptions("file",this.getOpeningReport());
uploadFileOperation.addOptions("file_type",file_type); uploadFileOperation.addOptions("file_type",file_type);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
uploadFileOperation.addOptions("limits",limits); uploadFileOperation.addOptions("limits",limits);
uploadFileOperation.execute(null); uploadFileOperation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getOpeningReportURL()==null) if(this.getGraduationDesignId()==null||this.getOpeningReport()==null)
return false; return false;
return true; return true;
} }
public String getOpeningReportURL() { public File getOpeningReport() {
return openingReportURL; return openingReport;
} }
public void setOpeningReportURL(String openingReportURL) { public void setOpeningReport(File openingReport) {
this.openingReportURL = openingReportURL; this.openingReport = openingReport;
} }
public String getGraduationDesignId() { public String getGraduationDesignId() {
@ -54,34 +46,4 @@ public class C_StudentUploadOpeningReport extends C_UploadFile{
public void setGraduationDesignId(String graduationDesignId) { public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = 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; package core.process;
import core.operation.Search;
import core.operation.Select; import core.operation.Select;
import dao.DBManagement;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class C_TeacherSelectStudent extends C_Select { public class C_TeacherSelectStudent extends TempProcess {
String studentId; String studentId;
String teacherId; 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{ public void select()throws Exception{
if(!check()) throw new GExcptInit("ID Attrs init error!"); 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("teacher_id",this.getTeacherId());
select.addOptions("student_id",this.getStudentId()); select.addOptions("student_id",this.getStudentId());
Map<String,Object> options=select.execute(null); 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() { protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null) if(this.getStudentId()==null||this.getTeacherId()==null)
@ -74,28 +41,6 @@ public class C_TeacherSelectStudent extends C_Select {
this.studentId = studentId; 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 core.operation.FillInformation;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL; import java.text.SimpleDateFormat;
import gdms.Configuration; import java.util.Date;
import java.util.HashMap;
import java.util.*; import java.util.Map;
//开题报告会小组组长提交开题报告会纪要意见
public class C_TeacherTeamFillOpeningReportOpinion extends C_FillInformation{ public class C_TeacherTeamFillOpeningReportOpinion extends TempProcess{
String graduationDesignId; String graduationDesignId;
Map<String,String> vMap; 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"; static String table="graduation_design_opening_report_opinion_record";
private static String table="graduation_design_opening_report_opinion_record";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("report_teacher_team_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null||this.getVMap()==null)
return false; return false;
return true; return true;
} }
@Override
public String getGraduationDesignId() {
return graduationDesignId;
}
@Override @Override
public void setGraduationDesignId(String graduationDesignId) { public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override @Override
public void updateStatus() throws GExcptSQL { public String getGraduationDesignId() {
core.process.Utils.updateStatus(graduationDesignId,table, field); return graduationDesignId;
} }
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = vMap; this.vMap = vMap;
} }
public Map<String, String> getVMap(){return 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;
}
} }

@ -2,65 +2,37 @@ package core.process;
import core.operation.FillInformation; import core.operation.FillInformation;
import error.GExcptInit; 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; String graduationDesignId;
Map<String,String> vMap; Map<String,String> vMap;
private static String buttonName = "答辩小组评分"; static String table="graduation_design_reply_opinion_record_score";
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";
public void fillInformation() throws Exception{ public void fillInformation() throws Exception{
if(!check()) throw new GExcptInit("FillInformation Attrs init error!"); if(!check()) throw new GExcptInit("FillInformation Attrs init error!");
FillInformation fillInformation=new FillInformation(); FillInformation fillInformation=new FillInformation();
fillInformation.setOptions(new HashMap<>()); fillInformation.setOptions(new HashMap<>());
fillInformation.addOptions("table",table); 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); vMap.put("teacher_team_opinion_date",date);
Map<String, String>limits = new HashMap<>(); Map<String, String>limits = new HashMap<>();
limits.put("id",this.getGraduationDesignId()); limits.put("id",this.getGraduationDesignId());
fillInformation.addOptions("limits",limits); fillInformation.addOptions("limits",limits);
fillInformation.addOptions("vMap",vMap);
fillInformation.execute(null); fillInformation.execute(null);
updateStatus();
} }
protected boolean check() { protected boolean check() {
if(this.getGraduationDesignId()==null||this.getVMap()==null) if(this.getGraduationDesignId()==null)
return false; return false;
return true; 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 @Override
public String getGraduationDesignId() { public String getGraduationDesignId() {
return graduationDesignId; return graduationDesignId;
@ -70,23 +42,8 @@ public class C_TeacherTeamFillScoreOpinion extends C_FillInformation {
public void setGraduationDesignId(String graduationDesignId) { public void setGraduationDesignId(String graduationDesignId) {
this.graduationDesignId = graduationDesignId; this.graduationDesignId = graduationDesignId;
} }
@Override
public void updateStatus() throws GExcptSQL {
core.process.Utils.updateStatus(graduationDesignId,table, field);
}
public void setVMap(Map<String, String> vMap) { public void setVMap(Map<String, String> vMap) {
this.vMap = 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.ArrayList;
import java.util.List; import java.util.List;
public class Condition { public class Condition {//条件
public List<Process> getProcesses() { public List<Process> getProcesses() {
return processes; return processes;
} }

@ -8,9 +8,10 @@ public abstract class Process{
private String permission; private String permission;
private Operation operation; private Operation operation;
private String info;
public abstract String getJspURL(); private static String buttonName;
protected static String targetURL;
protected static String iconURL;
protected abstract boolean check(); protected abstract boolean check();
public String getPermission() { public String getPermission() {
@ -29,6 +30,18 @@ public abstract class Process{
this.operation = operation; this.operation = operation;
} }
public String getButtonName() {
return buttonName;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public String getStatus() { public String getStatus() {
return status; return status;
} }
@ -37,11 +50,11 @@ public abstract class Process{
this.status = status; this.status = status;
} }
public abstract String getInfo(); public static String getTargetURL() {
return targetURL;
public abstract String getTargetURL(); }
public abstract String getIconURL();
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){ public static Condition getCondition(User user, Map<String, String> status){
Condition condition = new Condition(); Condition condition = new Condition();
for(Map.Entry<String,String> entry:status.entrySet()){ 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 tempProcess = (TempProcess) getProcess(s[1]);
tempProcess.setGraduationDesignId(s[0]); tempProcess.setGraduationDesignId(s[0]);
tempProcess.setStatus(entry.getValue()); tempProcess.setStatus(entry.getValue());
@ -26,18 +26,17 @@ public class ProcessManagement {
} }
private static List<Process> getLastProcesses(User user) { private static List<Process> getLastProcesses(User user) {
List<Process> lp = new ArrayList<>(); return null;
return lp;
} }
//Map<graduation_design_id.x_status,status> //Map<graduation_design_id.x_status,status>
public static Map<String,String> getStatus(User user) throws Exception { public static Map<String,String> getStatus(User user) throws Exception {
Map<String, String> status = new HashMap<>(); Map<String, String> status = new HashMap<>();
String[][] userTables = DBManagement.getUserStatusTables(user.getType()); Map<String,String> userTables = DBManagement.getUserStatusTables(user.getType());
String graduationDesignId = null; String graduationDesignId = null;
for(String[] s:userTables){ for(Map.Entry<String,String> entry:userTables.entrySet()){
String[] ti = s[0].split("\\."); String[] ti = entry.getKey().split(".");
String[] ts = s[1].split("\\."); String[] ts = entry.getValue().split(".");
List<String> ls = new ArrayList<>(); List<String> ls = new ArrayList<>();
ls.add("id"); ls.add("id");
Map<String,String> limits = new HashMap<>(); Map<String,String> limits = new HashMap<>();
@ -56,39 +55,6 @@ public class ProcessManagement {
return status; return status;
} }
public static Process getProcess(String process){ public static Process getProcess(String process){
switch (process) { return null;
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; package core.process;
import error.GExcptSQL;
public abstract class TempProcess extends Process { public abstract class TempProcess extends Process {
private static String process; private static String process;
private static String nextProcess; private static String nextProcess;
protected String graduationDesignId; private String graduationDesignId;
protected static String table;
protected static String field;
public String getGraduationDesignId() { public String getGraduationDesignId() {
return graduationDesignId; return graduationDesignId;
@ -32,6 +28,4 @@ public abstract class TempProcess extends Process {
public static void setNextProcess(String nextProcess) { public static void setNextProcess(String nextProcess) {
TempProcess.nextProcess = 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; package core.user;
import core.process.Condition; import core.process.Condition;
import core.process.ProcessManagement;
import core.user.userFun.AccountManageable; import core.user.userFun.AccountManageable;
import core.user.userFun.ProcessConfigurable; import core.user.userFun.ProcessConfigurable;
@ -93,11 +92,11 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
public abstract String getType(); public abstract String getType();
public void destroy(){ public void destroy(){
AccountManagement.destroy(this); core.user.utils.AccountManagement.destroy(this);
} }
public void logout(){ public void logout(){
AccountManagement.logout(this); core.user.utils.AccountManagement.logout(this);
} }
@Override @Override
@ -116,9 +115,4 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
this.setE_mail_location(vMap.get("e_mail_location")); this.setE_mail_location(vMap.get("e_mail_location"));
this.setPhone_number(vMap.get("phone_number")); 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.user.User;
import core.utils.GetObjectByName; import core.utils.GetObjectByName;
import dao.DBManagement; import dao.DBManagement;
@ -50,11 +49,7 @@ public interface AccountManagement {
} }
static User register(String userType, Map<String, String> vMap) throws Exception { static User register(String userType, Map<String, String> vMap) throws Exception {
DBManagement.insert(userType,vMap); DBManagement.insert(userType,vMap);
if(userType.equals("student")){ return createUser(userType, vMap);
initAllStatus(vMap.get("id"));
}
User user = createUser(userType, vMap);
return user;
} }
static void logout(User user){ static void logout(User user){
//todo //todo
@ -65,28 +60,6 @@ public interface AccountManagement {
static User createUser(String userType, Map<String, String> vMap) throws Exception { static User createUser(String userType, Map<String, String> vMap) throws Exception {
User user = GetObjectByName.getUserByName(userType); User user = GetObjectByName.getUserByName(userType);
user.setAttr(vMap); user.setAttr(vMap);
user.initCondition();
return user; 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.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import error.GExcptSQL; import error.GExcptSQL;
@ -55,49 +56,36 @@ public class DBManagement {
"phone_number" "phone_number"
}; };
//<table1.x_id,table2.x_status> //<table1.x_id,table2.x_status>
public static String[][] graduationDesignStudentTables ={ public static Map<String,String> graduationDesignStudentTables = new HashMap<>(){
{"graduation_design.student_id","graduation_design.student_choose_teacher_status"}, {
{"graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status"}, put("graduation_design.student_id","graduation_design.student_chooser_teacher_status");
{"graduation_design.student_id","graduation_design_opening_report.opening_report_status"}, put("graduation_design.student_id","graduation_design_information.student_fill_graduation_design_information_status");
{"graduation_design_opening_report_view.leader_student_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"}, put("graduation_design.student_id","graduation_design_opening_report.opening_report_status");
{"graduation_design_opening_report_view.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status"}, put("opening_report_secretary_team.leader_student_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"}, put("opening_report_secretary_team.student1_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
{"graduation_design.student_id","graduation_design_finished_product.finished_product_status"}, put("opening_report_secretary_team.student2_id","graduation_design_opening_report_opinion_record.opening_report_secretary_record_status");
{"graduation_design_reply_view.leader_student_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"}, put("graduation_design.student_id","graduation_design_finished_product.finished_product_status");
{"graduation_design_reply_view.teacher1_id","graduation_design_reply_opinion_record_score.reply_secretary_record_status"}, put("reply_secretary_team.leader_student_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"} 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[][] graduationDesignTeacherTables = { }
{"graduation_design.teacher_id","graduation_design.teacher_choose_student_status"},
{"graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status"},
{"graduation_design_opening_report_view.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_view.teacher1_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_view.teacher2_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status"},
{"graduation_design_opening_report_opinion_record.opening_report_college_teacher_id","graduation_design_opening_report_opinion_record.opening_report_college_opinion_status"},
{"graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status"},
{"graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status"},
{"graduation_design_reply_view.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_view.teacher1_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_view.teacher2_id","graduation_design_reply_opinion_record_score.reply_teacher_team_score_status"},
{"graduation_design_reply_opinion_record_score.reply_college_teacher_id","graduation_design_reply_opinion_record_score.reply_college_score_status"},
{"graduation_design_reply_opinion_record_score.reply_school_teacher_id","graduation_design_reply_opinion_record_score.reply_school_score_status"}
}; };
public static String[][] allStatus = { public static Map<String,String> graduationDesignTeacherTables = new HashMap<>(){
{"graduation_design","teacher_choose_student_status"}, {
{"graduation_design","student_choose_teacher_status"}, put("graduation_design.teacher_id","graduation_design.teacher_choose_student_status");
{"graduation_design_information","student_fill_graduation_design_information_status"}, put("graduation_design.teacher_id","graduation_design_opening_report_opinion_record.opening_report_mentor_opinion_status");
{"graduation_design_opening_report","opening_report_status"}, put("opening_report_teacher_team.leader_teacher_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
{"graduation_design_opening_report_opinion_record","opening_report_mentor_opinion_status"}, put("opening_report_teacher_team.teacher1_id","graduation_design_opening_report_opinion_record.opening_report_teacher_team_opinion_status");
{"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");
{"graduation_design_opening_report_opinion_record","opening_report_college_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");
{"graduation_design_opening_report_opinion_record","opening_report_secretary_record_status"}, put("graduation_design.teacher_id","graduation_design_finished_product_mentor_score.finished_product_mentor_score_status");
{"graduation_design_finished_product","finished_product_status"}, put("graduation_design_finished_product_reviewer_score.reviewer_teacher_id","graduation_design_finished_product_reviewer_score.finished_product_reviewer_score_status");
{"graduation_design_finished_product_mentor_score","finished_product_mentor_score_status"}, put("reply_teacher_team.leader_teacher_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
{"graduation_design_finished_product_reviewer_score","finished_product_reviewer_score_status"}, put("reply_teacher_team. teacher1_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
{"graduation_design_reply_opinion_record_score","reply_secretary_record_status"}, put("reply_teacher_team. teacher2_id","graduation_design_reply_opinion_record_score.reply_ teacher_team_score_status");
{"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");
{"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");
{"graduation_design_reply_opinion_record_score","reply_school_score_status"} }
}; };
public static String driverClassName="org.mariadb.jdbc.Driver"; public static String driverClassName="org.mariadb.jdbc.Driver";
@ -130,7 +118,7 @@ public class DBManagement {
} }
return null; return null;
} }
public static String[][] getUserStatusTables(String userType){ public static Map<String,String> getUserStatusTables(String userType){
if(userType.equals("student")){ if(userType.equals("student")){
return graduationDesignStudentTables; return graduationDesignStudentTables;
} }
@ -166,26 +154,11 @@ public class DBManagement {
String sql = select.getSQL(); String sql = select.getSQL();
return query(sql); 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 { public static void update(String table, Map<String,String> vMap, Map<String,String> limits) throws GExcptSQL {
Update update = new Update(table,vMap,limits); Update update = new Update(table,vMap,limits);
String sql = update.getSQL(); String sql = update.getSQL();
update(sql); 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 { public static List<String[]> query(String sql) throws Exception {
if(!ifInit) return null; if(!ifInit) return null;
List<String[]> ls; List<String[]> ls;
@ -205,7 +178,7 @@ public class DBManagement {
ls.add(s); ls.add(s);
} }
} catch (SQLException e) { } catch (SQLException e) {
throw new GExcptSQL("Connect Failure\n"+sql); throw new GExcptSQL("Connect Failure");
}finally { }finally {
if(con!=null) { if(con!=null) {
try { try {
@ -225,7 +198,7 @@ public class DBManagement {
Statement stmt = con.createStatement(); Statement stmt = con.createStatement();
stmt.executeUpdate(sql); stmt.executeUpdate(sql);
} catch (SQLException e) { } catch (SQLException e) {
throw new GExcptSQL("Connect Failure\n"+sql); throw new GExcptSQL("Connect Failure");
}finally { }finally {
if(con!=null) { if(con!=null) {
try { 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 javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home/*") @WebFilter(filterName = "OnlineCheck",urlPatterns = "/home.jsp")
public class OnlineCheck implements Filter { public class OnlineCheck implements Filter {
public void destroy() { public void destroy() {
} }

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

@ -1,238 +1,34 @@
package gdms; package gdms;
import dao.DBManagement;
import error.GExcptFileIO;
import error.GExcptFormat;
import error.GExcptInit; import error.GExcptInit;
import error.GExcptSQL;
import net.sf.json.JSONObject;
import utils.Utils;
import java.text.ParseException;
import java.util.*; import java.util.*;
public class GDMS { public class GDMS {
static Map<String, Date> schedules; static Map<String, Date> schedules;
static String scheduleName = "GlobalTimePoint.json"; static String schedulePath = "";
public static void init() throws GExcptInit, GExcptFormat { public static void init() throws GExcptInit {
initSchedule(); initSchedule();
Timer timer = new Timer(true); Timer timer = new Timer(true);
for(Map.Entry<String, Date> schedule:schedules.entrySet()){ for(Map.Entry<String, Date> schedule:schedules.entrySet()){
timer.schedule(getTimerTask(schedule.getKey()),schedule.getValue()); timer.schedule(getTimerTask(schedule.getKey()),schedule.getValue());
} }
System.out.println("GDMS init finished");
} }
private static TimerTask getTimerTask(String s) throws GExcptInit { private static TimerTask getTimerTask(String s) throws GExcptInit {
switch (s){ if(s==""){
case "teacher_choose_student_start_date": return new TimerTask() {
return new TimerTask() { @Override
@Override public void run() {
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":
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);
}
}
};
} }
throw new GExcptInit("GlobalTimePoint.json error"); throw new GExcptInit("GlobalTimePoint.json error");
} }
private static void initSchedule() throws GExcptFormat { private static void initSchedule() {
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");
}
}
} }
} }

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

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

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

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

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

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_MentorFillReview;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/mentor-fill-review") @WebServlet("mentor-fill-review")
public class S_MentorFillReview extends HttpServlet { public class S_MentorFillReview extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"total_grade", "total_grade",

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_ReviewerFillReview;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/reviewer-fill-review") @WebServlet("reviewer-fill-review")
public class S_ReviewerFillReview extends HttpServlet { public class S_ReviewerFillReview extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"score", "score",

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_SchoolFillScoreOpinion;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/school-fill-score-opinion") @WebServlet("school-fill-score-opinion")
public class S_SchoolFillScoreOpinion extends HttpServlet { public class S_SchoolFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"school_opinion", "school_opinion",

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_SecretaryFillOpeningReportRecord;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/secretary-fill-opening-report-record") @WebServlet("secretary-fill-opening-report-record")
public class S_SecretaryFillOpeningReportRecord extends HttpServlet { public class S_SecretaryFillOpeningReportRecord extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"secretary_record" "secretary_record"

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_SecretaryFillReplyRecord;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/secretary-fill-reply-record") @WebServlet("secretary-fill-reply-record")
public class S_SecretaryFillReplyRecord extends HttpServlet { public class S_SecretaryFillReplyRecord extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"secretary_record" "secretary_record"

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_StudentFillGraduationDesignInformation;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,23 +8,13 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/student-fill-graduation-design-information") @WebServlet("/student-fill-graduation-design-information")
public class S_StudentFillGraduationDesignInformation extends HttpServlet { public class S_StudentFillGraduationDesignInformation extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"chinese_name", "chinese_name",

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

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_StudentUploadFinishedProduct;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
@ -10,29 +8,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
@WebServlet("/home/student-upload-finished-product") @WebServlet("/student-upload-finished-product")
@MultipartConfig @MultipartConfig
public class S_StudentUploadFinishedProduct extends HttpServlet { public class S_StudentUploadFinishedProduct extends HttpServlet {
static String fileType = "graduation_design_finished_product"; static String fileType = "graduation_design_finished_product";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
String fileURL = null; String fileURL = servlet.Utils.saveFile(request, fileType);
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("提交成功");
} }
} }

@ -1,6 +1,6 @@
package servlet; package servlet;
import core.process.C_StudentUploadOpeningReport; import core.user.User;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
@ -8,31 +8,16 @@ import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import java.io.IOException; import java.io.IOException;
import java.util.UUID;
@WebServlet("/home/student-upload-opening-report") @WebServlet("/student-upload-opening-report")
@MultipartConfig @MultipartConfig
public class S_StudentUploadOpeningReport extends HttpServlet { public class S_StudentUploadOpeningReport extends HttpServlet {
static String fileType = "graduation_design_opening_report"; static String fileType = "graduation_design_opening_report";
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
String fileURL = null; String fileURL = servlet.Utils.saveFile(request, fileType);
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("提交成功");
} }
} }

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

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_TeacherTeamFillOpeningReportOpinion;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; 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 { public class S_TeacherTeamFillOpeningReportOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"report_teacher_team_opinion" "report_teacher_team_opinion"

@ -1,7 +1,5 @@
package servlet; package servlet;
import core.process.C_TeacherTeamFillScoreOpinion;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
@ -10,22 +8,12 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@WebServlet("/home/teacher-team-fill-score-opinion") @WebServlet("teacher-team-fill-score-opinion")
public class S_TeacherTeamFillScoreOpinion extends HttpServlet { public class S_TeacherTeamFillScoreOpinion extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id"); String id = request.getParameter("id");
Map<String,String> vMap = servlet.Utils.getVMap(vName,request); 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 = { static String[] vName = {
"teacher_team_opinion", "teacher_team_opinion",

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

@ -3,13 +3,15 @@ package servlet.account;
import java.io.IOException; import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import core.user.Student;
import core.user.User; import core.user.User;
import core.user.AccountManagement; import core.user.utils.AccountManagement;
import error.GExcptAccount; import error.GExcptAccount;
import error.GExcptSQL; import error.GExcptSQL;
@ -36,7 +38,7 @@ public class S_Login extends HttpServlet {
return; return;
} }
request.getSession().setAttribute("user",user); request.getSession().setAttribute("user",user);
response.sendRedirect("/home/home.jsp"); response.sendRedirect("/home.jsp");
return; return;
} }
} }

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

@ -1,11 +1,5 @@
package utils; 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.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -40,29 +34,4 @@ public interface Utils {
return ""; 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" 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" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"> version="4.0">
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<servlet> <servlet>
<servlet-name>Init</servlet-name> <servlet-name>Init</servlet-name>
<servlet-class>init.Init</servlet-class> <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