rewrite Process

hechu1
zhai_lw 6 years ago
parent e2b0fcc128
commit 4a41175a0d

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="com.hynnet:json-lib:2.4" type="repository">
<properties maven-id="com.hynnet:json-lib:2.4" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/json-lib-2.4.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-beanutils-1.8.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-collections-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-lang-2.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-logging-1.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/ezmorph-1.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -29,5 +29,6 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="com.hynnet:json-lib:2.4" level="project" />
</component>
</module>

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

@ -1,8 +1,11 @@
package gdms;
import dao.DBManagement;
import error.GExcptFileIO;
import error.GExcptInit;
import error.GExcptSQL;
import net.sf.json.JSONObject;
import utils.Utils;
import java.util.*;
@ -39,7 +42,7 @@ public class GDMS {
@Override
public void run() {
List<String> fields = new ArrayList<>();
fields.add("teacher_choose_student_status");
fields.add("student_choose_teacher_status");
try {
DBManagement.updateAll("graduation_design",fields,"1");
} catch (GExcptSQL gExcptSQL) {
@ -52,35 +55,148 @@ public class GDMS {
return new TimerTask() {
@Override
public void run() {
;
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() {
;
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() {
;
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() {
;
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() {
;
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);
}
}
};
}
@ -89,6 +205,19 @@ public class GDMS {
}
private static void initSchedule() {
schedules = new HashMap<>();
String sets= null;
try {
sets = Utils.readFile(schedulePath);
} 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);
schedules.put(key, new utils.Utils.dateFormat((String) value));
}
}
}

@ -1,5 +1,5 @@
{
"teacher_choose_student_start_date":"",
"teacher_choose_student_start_date":"2018-12-23 00:00:00",
"student_choose_teacher_start_date": "",
"choose_end_date": "",
"opening_report_opinion_deadline_date": "",

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

Loading…
Cancel
Save