基于javaweb的JSP+Servlet应急救援管理系统(java+servlet+jsp+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

492123562309

502123562309

512123562309

522123562309

532123562309

542123562309

562123562309

572123562309

582123562309

592123562309

基于javaweb的JSP+Servlet应急救援管理系统(java+servlet+jsp+mysql)

首页:
http://localhost:8080/login.jsp

管理员(allusers表):
admin 123456

应急人员(yingjirenyuan表):
emp1 123456
emp2 123456

用户(yonghuxinxi表):
user1 123456
user2 123456

主流程:
用户:
紧急呼救-紧急呼救

管理员:
紧急呼救查询-审核通过
指挥调度管理-指挥调度添加

应急人员:
现场情况管理-现场情况添加

管理员:
应急评估管理-应急评估添加

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35







public class PageManager {
private PageManager() {

}


// 默认一页最大记录数
public static final int DEFAULTPAGESIZE = 20;

// 分页段
public static final int segment = 10;

// 当前页数
protected int currentPage;

// 一页长度
protected int pageSize;

// 总页数
protected long pageNumber;

// 总记录数
protected long count;

// 数据
protected Collection collection;

// 数据查询对象
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
                    if (str.equals("null")) str = "";
list2.add(str);
} else
list2.add(rs.getString(j));
}
list.add(list2);
}
rs.close();
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}


public void close() {

}

/**
* 执行一条查询sql,以 List<hashmap> 的形式返回查询的记录,记录条数,和从第几条开始,由参数决定,主要用于翻页
* pageno 页码 rowsize 每页的条数
*/
public List<HashMap> select(String sql, int pageno, int rowsize) {
List<HashMap> list = new ArrayList<HashMap>();
List<HashMap> mlist = new ArrayList<HashMap>();
try {
list = this.select(sql);
int min = (pageno - 1) * rowsize;
int max = pageno * rowsize;

for (int i = 0; i < list.size(); i++) {

if (!(i < min || i > (max - 1))) {
mlist.add(list.get(i));
}
}
} catch (RuntimeException re) {
re.printStackTrace();
throw re;
}


return mlist;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
buf.append("第").append(this.currentPage).append("/").append(
this.pageNumber).append("页");
buf.append("&nbsp;&nbsp;&nbsp;&nbsp;");
if (this.currentPage == 1)
buf.append("首页");
else
buf.append("<a href='").append(this.path).append("&currentPage=1")
.append(parameter)
.append("' class='ls'>").append("首页")
.append("</a>");
// ////////////////////////#1157B7
buf.append("&nbsp;&nbsp;&nbsp;&nbsp;");

if (this.currentPage > 1) {
buf.append("<a href='").append(this.path).append("&currentPage=")
.append(currentPage - 1).append(parameter).append(
"' class='ls'>").append("上页")
.append("</a>");
} else {
buf.append("上页");

}
buf.append("&nbsp;&nbsp;");

int currentSegment = this.currentPage % segment == 0 ? this.currentPage
/ segment : this.currentPage / segment + 1;

/*for (int i = 1; i <= this.pageNumber; i++) {
if (this.currentPage == i)
buf.append("<font color='red'>").append(i).append("</font>");

else
buf.append("<a href='").append(this.path).append(
"&currentPage=").append(i).append(parameter).append(
"' class='ls'>[").append(i).append(
"]</a>");
}*/

buf.append("&nbsp;&nbsp;");
if (this.currentPage < this.pageNumber) {
buf.append("<a href='").append(this.path).append("&currentPage=")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
                if (request.getParameter(vstr) != null && !"".equals(request.getParameter(vstr)) && request.getParameter("dk-" + rsmd.getColumnName(j) + "-value") != null) {
String dkv = request.getParameter(vstr);
String dknamevalue = request.getParameter("dk-" + rsmd.getColumnName(j) + "-value");
vstr += " - " + dknamevalue + ":" + dkv;
System.out.println(vstr);
}
//if(vstr.length()<)
value += vstr + " ~ ";
}
if (value == null) value = "";
if (value.equals("null")) value = "";
if (value.length() > 0) value = value.substring(0, value.length() - 3);

if (rsmd.getColumnTypeName(j).equals("int")) {
sql += rsmd.getColumnName(j) + "=" + value + ",";
} else {
sql += rsmd.getColumnName(j) + "='" + value + "',";
}
} else {
if (extmap.get(rsmd.getColumnName(j)) != null) {
if (rsmd.getColumnTypeName(j).equals("int")) {
sql += rsmd.getColumnName(j) + "=" + extmap.get(rsmd.getColumnName(j)) + ",";
} else {
sql += rsmd.getColumnName(j) + "='" + extmap.get(rsmd.getColumnName(j)) + "',";
}
}
}
}
sql = sql.substring(0, sql.length() - 1);
sql += " where id=" + request.getParameter("id");
System.out.println(sql);
Statement st1 = conn.createStatement();
st1.execute(sql);
st1.close();
rs.close();
st.close();

} catch (SQLException e) {
e.printStackTrace();
}
String str = "";
if (!reflush)
str += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
str += "<script language=javascript>\n";
if (alert) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
}


public synchronized static String ensubStr(Object source, int length) {
String msource = Info.filterStrIgnoreCase(source.toString(), "<", ">");
if (msource.length() > length) {
msource = msource.substring(0, length) + "...";
}
return msource;
}


public static String getDateStr() {
String dateString = "";
try {//yyyyMMddHHmmss
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date currentTime_1 = new java.util.Date();
dateString = formatter.format(currentTime_1);
} catch (Exception e) {
}
return dateString;
}


public static String getUTFStr(String str) {
if (str == null) {
return "";
}

try {
str = new String(str.getBytes("UTF-8"), "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}

public static String getGBKStr(String str) throws UnsupportedEncodingException {
if (str == null) {
return "";
}
return new String(str.getBytes("UTF-8"), "UTF-8");
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    }
return dateString;
}


public static String getUTFStr(String str) {
if (str == null) {
return "";
}

try {
str = new String(str.getBytes("UTF-8"), "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}

public static String getGBKStr(String str) throws UnsupportedEncodingException {
if (str == null) {
return "";
}
return new String(str.getBytes("UTF-8"), "UTF-8");
}

public static String getGB2312Str(String str) throws UnsupportedEncodingException {
if (str == null) {
return "";
}
return new String(str.getBytes("UTF-8"), "UTF-8");
}


/**
* 得到多少天之后之前的日期??
*
* @param String date
* @param int day
* @return
*/
public static String getDay(String date, int day) {
String b = date.substring(0, 10);
String c = b.substring(0, 4);
String d = b.substring(5, 7);
String f = b.substring(8, 10);
String aa = c + "/" + d + "/" + f;
String a = "";
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM);
GregorianCalendar grc = new GregorianCalendar();
grc.setTime(new Date(aa));


项目链接:
https://javayms.github.io?id=482123562309201fj
https://javayms.pages.dev?id=482123562309201fj