1, process 调整为3类

2,完善Exception
wlf
zhai_lw 6 years ago
parent 2973d5c48a
commit e5f76c397b

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

@ -19,11 +19,11 @@
</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 8.5" level="application_server_libraries" /> <orderEntry type="library" scope="PROVIDED" name="Tomcat 8.5.37" level="application_server_libraries" />
<orderEntry type="module-library"> <orderEntry type="module-library">
<library> <library>
<CLASSES> <CLASSES>
<root url="jar://E:/tomcat8/apache-tomcat-8.5.37/lib/tomcat-jdbc.jar!/" /> <root url="jar://C:/Program Files/Apache Software Foundation/Tomcat 8.5/lib/tomcat-jdbc.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

@ -2,6 +2,7 @@ package core.operation;
import core.user.User; import core.user.User;
import error.GExcptSQL;
import gdms.Mode; import gdms.Mode;
import java.util.Map; import java.util.Map;
@ -37,6 +38,6 @@ public abstract class Operation {
} }
this.options.put(key,value); this.options.put(key,value);
} }
public abstract void execute(User subject); public abstract void execute(User subject) throws GExcptSQL;
} }

@ -2,6 +2,7 @@ package core.operation;
import core.user.User; import core.user.User;
import dao.DBManagement; import dao.DBManagement;
import error.GExcptSQL;
import java.util.Map; import java.util.Map;
@ -10,7 +11,7 @@ public class Select extends Operation {
private Map<String, Object> options; private Map<String, Object> options;
private User subject; private User subject;
@Override @Override
public void execute(User subject) { public void execute(User subject) throws GExcptSQL {
this.setSubject(subject); this.setSubject(subject);
DBManagement.update("update stu "); DBManagement.update("update stu ");
} }

@ -1,28 +0,0 @@
package core.process;
import core.operation.Operation;
import core.user.User;
public class AtomProcess extends Process {
private String permission;
private Operation operation;
private String ButtonName;
private String info;
private String processOptions;
public AtomProcess(String permission, String operationName, String processOptions, String info) throws Exception {
super(info);
this.permission = permission;
this.operation = (Operation) core.utils.GetObjectByName.getOperationByName(operationName);
this.info = info;
this.processOptions = processOptions;
operation.setProcessOperations(processOptions);
}
public void setUserOperations(String key,Object value){
this.operation.addUserOperations(key,value);
}
public void execute(User subject){
this.operation.execute(subject);
}
}

@ -4,6 +4,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class Condition { public class Condition {
public List<Process> getProcesses() {
return processes;
}
private List<Process> processes; private List<Process> processes;
public Process get(int index){ public Process get(int index){
return processes.get(index); return processes.get(index);

@ -2,7 +2,7 @@ package core.process;
public class LastProcess extends Process{ public class LastProcess extends Process{
public LastProcess(String info) { public LastProcess(String permission, String operationName, String processOptions, String info) throws Exception {
super(info); super(permission, operationName, processOptions, info);
} }
} }

@ -1,23 +1,23 @@
package core.process; package core.process;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class ProcessManagement { public class ProcessManagement {
private List<AtomProcess> processes; private List<TemporaryProcess> temporaryProcesses;
private Map<String,List<Process>> lastProcesses; private Map<String, List<Process>> lastProcesses;
private List<AuxiliaryProcess> auxiliaryProcesses;
public void setProcessesByJson(File file){ public void setProcessesByJson(File file){
//todo //todo
} }
public Process getAtomProcess(int index){ public Process getTemporaryProcess(int index){
return processes.get(index); return temporaryProcesses.get(index);
} }
public Condition getCondition(String userType, List<Integer> index){ public Condition getCondition(String userType, List<Integer> index){
Condition condition = new Condition(lastProcesses.get(userType)); Condition condition = new Condition(this.lastProcesses.get(userType));
for(int i:index){ for(int i:index){
condition.add(getAtomProcess(i)); condition.add(getTemporaryProcess(i));
} }
return condition; return condition;
} }

@ -11,6 +11,15 @@ public abstract class User implements AccountManageable, ProcessConfigurable{
private String id; private String id;
private String password; private String password;
private List<String> permissions = null; private List<String> permissions = null;
public Condition getCondition() {
return condition;
}
public void setCondition(Condition condition) {
this.condition = condition;
}
private Condition condition; private Condition condition;
public void addPermission(String permission){ public void addPermission(String permission){
if(!permissions.contains(permission)) if(!permissions.contains(permission))

@ -1,22 +0,0 @@
package servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(name = "login")
public class login extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
}

@ -16,4 +16,12 @@
<servlet-name>default</servlet-name> <servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern> <url-pattern>*.jpg</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
</web-app> </web-app>

@ -23,6 +23,5 @@ $(document).ready(
function () { function () {
$('.to-register').on('click', showRegister); $('.to-register').on('click', showRegister);
$('.to-login').on('click', showlogin); $('.to-login').on('click', showlogin);
$('.submit-style').on('click',)
}) })

Loading…
Cancel
Save