基于javaweb的JSP+Servlet大学实验室设备管理系统(java+jsp+easyui+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

340023422402

350023422402

360023422402

370023422402

380023422402

390023422402

基于javaweb的JSP+Servlet大学实验室设备管理系统(java+jsp+easyui+mysql)

项目介绍

本项目为后台管理系统,主要功能如下: 管理员登录,管理数据字典,设备信息管理,进购管理,报损管理,查看库存,账号管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;  5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

HTML+CSS+JavaScript+JSP+jquery+easyui+mysql

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dbpool.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入http://localhost:8080/jsp_dxsys_sys/ 登录 管理员账号密码:admin/admin

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
		try {
pstm = conn.prepareStatement(sql);
pstm.setString(1, username);
rs = pstm.executeQuery();
if(!rs.next()) {
flag = true;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
dbUtil.close(conn, pstm, rs);
}
return flag;
}

public boolean checkUser (User user) {
boolean flag = false;
Connection conn = dbUtil.getConnection();
String sql = "select * from t_user where username = ? and id != ? ";
PreparedStatement pstm = null;
try {
pstm = conn.prepareStatement(sql);
pstm.setString(1, user.getUsername());
pstm.setInt(2, user.getId());
rs = pstm.executeQuery();
if(!rs.next()) {
flag = true;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
dbUtil.close(conn, pstm, rs);
}
return flag;
}

}

package com.wbstar.jxc.action;



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
												<td width="44%" height="20">&nbsp;</td>
</tr>
</table>
</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#a2d962">&nbsp;</td>
</tr>
</table>
</body>
</html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
a:link {text-decoration:none; color:black;} /* 未被访问的链接 */
a:visited {text-decoration:none; color:black;} /* 已被访问的链接 */
a:hover {text-decoration:none; color:red;} /* 鼠标指针移动到链接上 */
a:active {text-decoration:none; color:red;} /* 正在被点击的链接 */
</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>大学固定资产管理系统</title>

<%
//权限验证
if(session.getAttribute("currentuser") == null){
response.sendRedirect("/jsp_dxsys_sys/dynamic/server/view/login.jsp");
return;
}
%>

<jsp:include page="/dynamic/link/base.jsp"></jsp:include>

<script type="text/javascript">
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
		return typeId;
}

public void setTypeId(int typeId) {
this.typeId = typeId;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}
}
package com.wbstar.jxc.model;


/**
* 库存信息实体类
* @email 840446169@qq.com
*/
public class Kucun {

private int id; // 库存编号

private int goodsid; // 商品ID

private int inventory; // 库存量

private Date endDate; // 日期

private String goodsname; // 商品名称



/**
*
*/
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
		int id = Integer.parseInt(dictionaryId);
pstm.setInt(1, id);
pstm.setInt(2, id);
ResultSet rs = pstm.executeQuery();
if(rs.next()) {
return true;
} else {
return false;
}
}
}
package com.wbstar.jxc.action;





@SuppressWarnings("serial")
public class GoodsAction extends ActionSupport{

private String page; // 第几页
private String rows; // 每页记录数
private String s_goodsname = ""; // 搜索商品名
private String s_supplier = ""; // 搜索供应商
private String s_type = ""; // 搜索商品类型
private Goods goods; // 商品
private String delIds; // 批量删除ID号
private String goodsid; // 商品ID
DBUtil dbUtil = new DBUtil();
GoodsService goodsService = new GoodsService();

public String execute() throws Exception{
PageBean pageBean = new PageBean(Integer.parseInt(page), Integer.parseInt(rows));
Connection conn = dbUtil.getConnection();
if (goods == null) {
goods = new Goods();
}
if(StringUtil.isNotEmpty(s_goodsname)){
goods.setGoodsname(s_goodsname);
}
if(StringUtil.isNotEmpty(s_supplier)){
goods.setSupplier(s_supplier);
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
 * 管理员记录数
* @param currentuser
* @return
*/
public int getTotal(User currentuser, String s_username) {
int total = 0;
Connection conn = dbUtil.getConnection();
StringBuffer sb = new StringBuffer("SELECT COUNT(*) AS total FROM t_user");
if(currentuser != null && StringUtil.isNotEmpty(s_username)) {
sb.append(" AND username LIKE '%"+ s_username +"%'");
}
sb.append(" WHERE id != ?");
String sql = sb.toString().replaceFirst("AND", "WHERE");
PreparedStatement pstm = null;
try {
pstm = conn.prepareStatement(sql);
pstm.setInt(1, currentuser.getId());
rs = pstm.executeQuery();
while (rs.next()) {
total = rs.getInt(1);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.close(conn, pstm, rs);
}
return total;
}

/**
* 保存
*
* @param user
*/
public int insert(User user) {
int num = 0;
Connection conn = dbUtil.getConnection();
String sql = "insert into t_user (username, password) values (?,?)";
PreparedStatement pstm = null;
try {
pstm = conn.prepareStatement(sql);
pstm.setString(1, user.getUsername());
pstm.setString(2, user.getPassword());
num = pstm.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
dbUtil.close(conn, pstm, rs);
}
return num;
}


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