From e5f76c397b14d4a5885e2b88f69a168af7ca5ca8 Mon Sep 17 00:00:00 2001 From: zhai_lw Date: Wed, 9 Jan 2019 22:08:40 +0800 Subject: [PATCH] =?UTF-8?q?1,=20process=20=E8=B0=83=E6=95=B4=E4=B8=BA3?= =?UTF-8?q?=E7=B1=BB=202=EF=BC=8C=E5=AE=8C=E5=96=84Exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- GDMS.iml | 4 ++-- src/core/operation/Operation.java | 3 ++- src/core/operation/Select.java | 3 ++- src/core/process/AtomProcess.java | 28 ------------------------- src/core/process/Condition.java | 4 ++++ src/core/process/LastProcess.java | 4 ++-- src/core/process/ProcessManagement.java | 14 ++++++------- src/core/user/User.java | 9 ++++++++ src/servlet/login.java | 22 ------------------- web/WEB-INF/web.xml | 8 +++++++ web/webPage/jsFile/login.js | 1 - 12 files changed, 37 insertions(+), 65 deletions(-) delete mode 100644 src/core/process/AtomProcess.java delete mode 100644 src/servlet/login.java diff --git a/.idea/misc.xml b/.idea/misc.xml index 35bdbab..11bca97 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/GDMS.iml b/GDMS.iml index 9457690..0ccb429 100644 --- a/GDMS.iml +++ b/GDMS.iml @@ -19,11 +19,11 @@ - + - + diff --git a/src/core/operation/Operation.java b/src/core/operation/Operation.java index 74984bc..195dbfa 100644 --- a/src/core/operation/Operation.java +++ b/src/core/operation/Operation.java @@ -2,6 +2,7 @@ package core.operation; import core.user.User; +import error.GExcptSQL; import gdms.Mode; import java.util.Map; @@ -37,6 +38,6 @@ public abstract class Operation { } this.options.put(key,value); } - public abstract void execute(User subject); + public abstract void execute(User subject) throws GExcptSQL; } diff --git a/src/core/operation/Select.java b/src/core/operation/Select.java index 838308a..3ea81dd 100644 --- a/src/core/operation/Select.java +++ b/src/core/operation/Select.java @@ -2,6 +2,7 @@ package core.operation; import core.user.User; import dao.DBManagement; +import error.GExcptSQL; import java.util.Map; @@ -10,7 +11,7 @@ public class Select extends Operation { private Map options; private User subject; @Override - public void execute(User subject) { + public void execute(User subject) throws GExcptSQL { this.setSubject(subject); DBManagement.update("update stu "); } diff --git a/src/core/process/AtomProcess.java b/src/core/process/AtomProcess.java deleted file mode 100644 index 777dfe1..0000000 --- a/src/core/process/AtomProcess.java +++ /dev/null @@ -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); - } -} diff --git a/src/core/process/Condition.java b/src/core/process/Condition.java index 4d62665..9365dbb 100644 --- a/src/core/process/Condition.java +++ b/src/core/process/Condition.java @@ -4,6 +4,10 @@ import java.util.ArrayList; import java.util.List; public class Condition { + public List getProcesses() { + return processes; + } + private List processes; public Process get(int index){ return processes.get(index); diff --git a/src/core/process/LastProcess.java b/src/core/process/LastProcess.java index 316e405..4c48117 100644 --- a/src/core/process/LastProcess.java +++ b/src/core/process/LastProcess.java @@ -2,7 +2,7 @@ package core.process; public class LastProcess extends Process{ - public LastProcess(String info) { - super(info); + public LastProcess(String permission, String operationName, String processOptions, String info) throws Exception { + super(permission, operationName, processOptions, info); } } diff --git a/src/core/process/ProcessManagement.java b/src/core/process/ProcessManagement.java index dbffd13..7223a47 100644 --- a/src/core/process/ProcessManagement.java +++ b/src/core/process/ProcessManagement.java @@ -1,23 +1,23 @@ package core.process; import java.io.File; -import java.util.ArrayList; import java.util.List; import java.util.Map; public class ProcessManagement { - private List processes; - private Map> lastProcesses; + private List temporaryProcesses; + private Map> lastProcesses; + private List auxiliaryProcesses; public void setProcessesByJson(File file){ //todo } - public Process getAtomProcess(int index){ - return processes.get(index); + public Process getTemporaryProcess(int index){ + return temporaryProcesses.get(index); } public Condition getCondition(String userType, List index){ - Condition condition = new Condition(lastProcesses.get(userType)); + Condition condition = new Condition(this.lastProcesses.get(userType)); for(int i:index){ - condition.add(getAtomProcess(i)); + condition.add(getTemporaryProcess(i)); } return condition; } diff --git a/src/core/user/User.java b/src/core/user/User.java index 0f81d10..8048293 100644 --- a/src/core/user/User.java +++ b/src/core/user/User.java @@ -11,6 +11,15 @@ public abstract class User implements AccountManageable, ProcessConfigurable{ private String id; private String password; private List permissions = null; + + public Condition getCondition() { + return condition; + } + + public void setCondition(Condition condition) { + this.condition = condition; + } + private Condition condition; public void addPermission(String permission){ if(!permissions.contains(permission)) diff --git a/src/servlet/login.java b/src/servlet/login.java deleted file mode 100644 index 11650f2..0000000 --- a/src/servlet/login.java +++ /dev/null @@ -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 { - - } -} diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 95ec93c..37a5f89 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -16,4 +16,12 @@ default *.jpg + + default + *.css + + + default + *.js + \ No newline at end of file diff --git a/web/webPage/jsFile/login.js b/web/webPage/jsFile/login.js index 79982cf..ed3803f 100644 --- a/web/webPage/jsFile/login.js +++ b/web/webPage/jsFile/login.js @@ -23,6 +23,5 @@ $(document).ready( function () { $('.to-register').on('click', showRegister); $('.to-login').on('click', showlogin); - $('.submit-style').on('click',) })