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

# Conflicts:
#	src/gdms/test.java
hechu1
何楚 6 years ago
commit e744f97b8c

@ -7,7 +7,7 @@ import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class C_StudentUploadFinishedProduct extends TempProcess {
public class C_StudentUploadFinishedProduct extends C_UploadFile {
File finishedProduct;
String graduationDesignId;

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

@ -171,6 +171,11 @@ public class DBManagement {
String sql = update.getSQL();
update(sql);
}
public static void updateAll(String table, List<String> fields, String increment) throws GExcptSQL {
UpdateAll updateAll = new UpdateAll(table,fields,increment);
String sql = updateAll.getSQL();
update(sql);
}
public static List<String[]> query(String sql) throws Exception {
if(!ifInit) return null;
List<String[]> ls;
@ -222,7 +227,5 @@ public class DBManagement {
}
}
public static void updateAll(String table, List<String> fields, String increment) {
}
}

@ -0,0 +1,48 @@
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;
}
}

@ -2,6 +2,7 @@ package gdms;
import dao.DBManagement;
import error.GExcptInit;
import error.GExcptSQL;
import java.util.*;
@ -25,14 +26,26 @@ public class GDMS {
public void run() {
List<String> fields = new ArrayList<>();
fields.add("teacher_choose_student_status");
DBManagement.updateAll("graduation_design",fields,"1");
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() {
;
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 "choose_end_date":

@ -2,7 +2,9 @@ package gdms;
import core.operation.utils.Utils;
import core.process.C_StudentSelectTeacher;
import dao.DBManagement;
import dao.Select;
import dao.UpdateAll;
import java.util.ArrayList;
import java.util.HashMap;
@ -11,13 +13,12 @@ import java.util.Map;
public class test {
public static void main(String[] args){
String s = "graduation_design_finished_product_reviewer_score.reviewer_teacher_id";
String[] ss = s.split("\\.");
System.out.println(ss[0]);
C_StudentSelectTeacher p = new C_StudentSelectTeacher();
System.out.println(p.getButtonName());
}
static void changeB(String a){
a="B";
List<String> ls = new ArrayList<>();
ls.add("teacher_choose_student_status");
ls.add("student_choose_teacher_status");
UpdateAll s = new UpdateAll("graduation_design",ls,"10");
System.out.println(s.getSQL());
}
}

Loading…
Cancel
Save