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

# Conflicts:
#	GDMS.iml
hechu1
zhai_lw 6 years ago
parent a0c88902e5
commit ea7a6c6537

@ -1,16 +0,0 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="gdms:Web exploded">
<output-path>$PROJECT_DIR$/out/artifacts/gdms_Web_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>
</element>
</root>
</artifact>
</component>

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

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

@ -53,7 +53,7 @@ public interface AccountManagement {
User user = createUser(userType, vMap);
if(userType=="student"){
//initAllStatus((Student) user);
initAllStatus(user.getId());
}
return user;
}
@ -70,9 +70,12 @@ public interface AccountManagement {
return user;
}
String defaultStatus = "1";
static void initAllStatus(String id){
static void initAllStatus(String id) throws GExcptSQL {
for(Map.Entry<String,String> entry:DBManagement.allStatus.entrySet()){
Map<String,String> vMap = new HashMap<>();
vMap.put("id",id);
vMap.put(entry.getValue(),defaultStatus);
DBManagement.insert(entry.getKey(),vMap);
}
}
}

Loading…
Cancel
Save