完善gdms,

完成用户流程
zgl
zhai_lw 6 years ago
parent 51b73e3813
commit 0dff0df466

@ -4,7 +4,7 @@
name="jdbc/gdms" name="jdbc/gdms"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mariadb://localhost:3306/gdms" targetURL="jdbc:mariadb://localhost:3306/gdms"
username="gdms" username="gdms"
password="GDMS"/> password="GDMS"/>
</Context> </Context>

@ -3,7 +3,7 @@ password char 256
name varchar 50 name varchar 50
e_mail_location varchar 50 e_mail_location varchar 50
phonenumber varchar 30 phonenumber varchar 30
url varchar 256 targetURL varchar 256
administrator administrator
id id

@ -3,7 +3,7 @@ password char 255//用户密码
name char 30//用户姓名 name char 30//用户姓名
e_mail_location char 40//邮箱 e_mail_location char 40//邮箱
phone_number char 20//电话号码 phone_number char 20//电话号码
url varchar 255//......路径 targetURL varchar 255//......路径
administrator//管理员 administrator//管理员
id//管理员ID id//管理员ID

@ -11,7 +11,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class UploadFileOperation extends Operation { public class UploadFile extends Operation {
@Override @Override
public Map<String, Object> execute(User subject) throws Exception { public Map<String, Object> execute(User subject) throws Exception {
File file = (File) this.getOptions().get("file"); File file = (File) this.getOptions().get("file");

@ -4,12 +4,14 @@ import core.operation.Operation;
public abstract class Process{ public abstract class Process{
private char status; private String status;
private String permission; private String permission;
private Operation operation; private Operation operation;
private String buttonName;
private String info; private String info;
private static String buttonName;
protected static String targetURL;
protected static String iconURL;
public String getPermission() { public String getPermission() {
return permission; return permission;
@ -31,10 +33,6 @@ public abstract class Process{
return buttonName; return buttonName;
} }
public void setButtonName(String buttonName) {
this.buttonName = buttonName;
}
public String getInfo() { public String getInfo() {
return info; return info;
} }
@ -43,11 +41,19 @@ public abstract class Process{
this.info = info; this.info = info;
} }
public char getStatus() { public String getStatus() {
return status; return status;
} }
public void setStatus(char status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
public static String getTargetURL() {
return targetURL;
}
public static String getIconURL() {
return iconURL;
}
} }

@ -2,17 +2,19 @@ package core.process;
import core.user.User; import core.user.User;
import dao.DBManagement; import dao.DBManagement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class ProcessManagement { public class ProcessManagement {
public static Condition getCondition(User user) { public static Condition getCondition(User user) throws Exception {
Map<String,Character> status = getStatus(user); Map<String,String> status = getStatus(user);
return getCondition(user,status); return getCondition(user,status);
} }
public static Condition getCondition(User user, Map<String,Character> status){ public static Condition getCondition(User user, Map<String, String> status){
Condition condition = new Condition(); Condition condition = new Condition();
for(Map.Entry<String,Character> entry:status.entrySet()){ for(Map.Entry<String,String> entry:status.entrySet()){
String[] s = entry.getKey().split("."); String[] s = entry.getKey().split(".");
TempProcess tempProcess = (TempProcess) getProcess(s[1]); TempProcess tempProcess = (TempProcess) getProcess(s[1]);
tempProcess.setGraduationDesignId(s[0]); tempProcess.setGraduationDesignId(s[0]);
@ -28,17 +30,29 @@ public class ProcessManagement {
} }
//Map<graduation_design_id.x_status,status> //Map<graduation_design_id.x_status,status>
public static Map<String,Character> getStatus(User user){ public static Map<String,String> getStatus(User user) throws Exception {
Map<String, String> status = new HashMap<>();
Map<String,String> userTables = DBManagement.getUserStatusTables(user.getType()); Map<String,String> userTables = DBManagement.getUserStatusTables(user.getType());
String graduationDesignId = null; String graduationDesignId = null;
for(Map.Entry<String,String> entry:userTables.entrySet()){ for(Map.Entry<String,String> entry:userTables.entrySet()){
String[] ti = entry.getKey().split("."); String[] ti = entry.getKey().split(".");
String[] ts = entry.getValue().split("."); String[] ts = entry.getValue().split(".");
List<String> ls = new ArrayList<>();
ls.add("id");
Map<String,String> limits = new HashMap<>();
limits.put(ti[1],user.getId());
List<String[]> resultLs = DBManagement.select(ls,ti[0],limits,0,1);
if(resultLs.size()==0) continue;
graduationDesignId = resultLs.get(0)[0];
ls = new ArrayList<>();
ls.add(ts[1]);
limits = new HashMap<>();
limits.put("id",graduationDesignId);
resultLs = DBManagement.select(ls,ts[0],limits,0,1);
status.put(graduationDesignId+"."+ts[1],resultLs.get(0)[0]);
} }
return status;
return null;
} }
public static Process getProcess(String process){ public static Process getProcess(String process){
return null; return null;

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

@ -0,0 +1,34 @@
package gdms;
import error.GExcptInit;
import java.util.*;
public class GDMS {
static Map<String, Date> schedules;
static String schedulePath = "";
public static void init() throws GExcptInit {
initSchedule();
Timer timer = new Timer(true);
for(Map.Entry<String, Date> schedule:schedules.entrySet()){
timer.schedule(getTimerTask(schedule.getKey()),schedule.getValue());
}
}
private static TimerTask getTimerTask(String s) throws GExcptInit {
if(s==""){
return new TimerTask() {
@Override
public void run() {
;
}
};
}
throw new GExcptInit("GlobalTimePoint.json error");
}
private static void initSchedule() {
}
}

@ -1,18 +0,0 @@
package gdms;
public class main {
public static void check()throws Exception{
checkJson();
}
private static void checkJson() throws Exception{
//todo
}
public static void init(){
}
public static void run() throws Exception {
check();
init();
}
}

@ -82,7 +82,7 @@
to either the page, a String in 'var', or a Reader in 'varReader'. to either the page, a String in 'var', or a Reader in 'varReader'.
</description> </description>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -281,7 +281,7 @@
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -346,7 +346,7 @@
</tag> </tag>
<tag> <tag>
<name>url</name> <name>targetURL</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>

@ -21,7 +21,7 @@
out:default out:default
out:escapeXml out:escapeXml
if:test if:test
import:url import:targetURL
import:context import:context
import:charEncoding import:charEncoding
forEach:items forEach:items
@ -36,12 +36,12 @@
param:name param:name
param:value param:value
redirect:context redirect:context
redirect:url redirect:targetURL
set:property set:property
set:target set:target
set:value set:value
url:context targetURL:context
url:value targetURL:value
when:test when:test
</param-value> </param-value>
<description> <description>
@ -139,7 +139,7 @@
to either the page, a String in 'var', or a Reader in 'varReader'. to either the page, a String in 'var', or a Reader in 'varReader'.
</description> </description>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -304,7 +304,7 @@
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>true</required> <required>true</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
@ -369,7 +369,7 @@
</tag> </tag>
<tag> <tag>
<name>url</name> <name>targetURL</name>
<tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<description> <description>

@ -103,7 +103,7 @@ Scope for var.
<description> <description>
The URL of the resource to import. The URL of the resource to import.
</description> </description>
<name>url</name> <name>targetURL</name>
<required>true</required> <required>true</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -403,7 +403,7 @@ Value of the parameter.
<description> <description>
The URL of the resource to redirect to. The URL of the resource to redirect to.
</description> </description>
<name>url</name> <name>targetURL</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
@ -500,13 +500,13 @@ Scope for var.
<description> <description>
Creates a URL with optional query parameters. Creates a URL with optional query parameters.
</description> </description>
<name>url</name> <name>targetURL</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class> <tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<attribute> <attribute>
<description> <description>
Name of the exported scoped variable for the Name of the exported scoped variable for the
processed url. The type of the scoped variable is processed targetURL. The type of the scoped variable is
String. String.
</description> </description>
<name>var</name> <name>var</name>

@ -170,7 +170,7 @@
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>

@ -30,7 +30,7 @@
dateParam:type dateParam:type
setDataSource:dataSource setDataSource:dataSource
setDataSource:driver setDataSource:driver
setDataSource:url setDataSource:targetURL
setDataSource:user setDataSource:user
setDataSource:password setDataSource:password
</param-value> </param-value>
@ -195,7 +195,7 @@ ue.
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>
<attribute> <attribute>
<name>url</name> <name>targetURL</name>
<required>false</required> <required>false</required>
<rtexprvalue>false</rtexprvalue> <rtexprvalue>false</rtexprvalue>
</attribute> </attribute>

@ -263,7 +263,7 @@ JDBC parameter: driver class name.
JDBC parameter: URL associated with JDBC parameter: URL associated with
the database. the database.
</description> </description>
<name>url</name> <name>targetURL</name>
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>

Loading…
Cancel
Save