一、系统介绍
该系统包含数据库,论文,任务书,开题报告,请在下载源码中下载!!!
走过路过不要错过,点赞加关注的脱单暴富,走上人生巅峰!!!
1.开发环境
开发工具:IDEA2018.2
JDK版本:jdk1.8
Mysql版本:8.0.13
2.技术选型
后端:Java+Servlet进行开发。
前端:JSP+HTML+CSS。
3.系统功能
基于Web停车场管理系统主要用于实现停车场相关信息管理,基本功能包括:系统信息管理模块、车位信息管理模块、IC卡信息管理模块、固定车主停车管理模块、临时车辆信息管理模块、系统功能操模块等。本系统结构如下:
(1)系统信息管理模块:角色的增加、删除、修改和查询;用户的增加、删除、修改和查询。
(2)车位信息管理模块:车位信息的增加、删除、修改和查询。
(3)IC卡信息管理模块:IC卡信息的增加、删除、修改和查询。
(4)固定车主停车管理模块:对固定车主的停车信息进行增加、删除、修改和查询
(5)临时车辆信息管理模块:对临时车辆的停车信息进行增加、删除、修改、查询和打印
(6)系统功能操模块:退出登陆、修改密码。
4.数据库
/* Navicat Premium Data Transfer Source Server : MySQL Source Server Type : MySQL Source Server Version : 80013 Source Host : 127.0.0.1:3306 Source Schema : servlet_parking Target Server Type : MySQL Target Server Version : 80013 File Encoding : 65001 Date: 12/08/2021 20:37:52 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for card -- ---------------------------- DROP TABLE IF EXISTS `card`; CREATE TABLE `card` ( `card_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `seat_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_gender` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_addr` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `car_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (`card_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of card -- ---------------------------- INSERT INTO `card` VALUES ('20150521190631', '20150521182303', '李小龙', '男', '香语区A栋3-105', '川A12345'); INSERT INTO `card` VALUES ('20150521192828', '20150521182304', '黎明', '男', '香语区A栋3-106', '川A12346'); INSERT INTO `card` VALUES ('20150521192854', '20150521182305', '王林', '女', '香语区A栋3-107', '川A12348'); INSERT INTO `card` VALUES ('20150521192915', '20150521182306', '龙飞', '男', '香语区A栋3-108', '川A12349'); -- ---------------------------- -- Table structure for fixed -- ---------------------------- DROP TABLE IF EXISTS `fixed`; CREATE TABLE `fixed` ( `fixed_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `card_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `entry_date` date NOT NULL, `entry_time` time(0) NOT NULL, `out_date` date NULL DEFAULT NULL, `out_time` time(0) NULL DEFAULT NULL, PRIMARY KEY (`fixed_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of fixed -- ---------------------------- INSERT INTO `fixed` VALUES ('20150522104145', '20150521192915', '2015-05-22', '10:41:45', '2015-09-25', '10:23:34'); INSERT INTO `fixed` VALUES ('20150925102400', '20150521192828', '2015-09-25', '10:24:00', '2015-09-25', '10:24:07'); INSERT INTO `fixed` VALUES ('20150925104659', '20150521192854', '2015-09-25', '10:46:59', '2015-09-25', '17:29:04'); INSERT INTO `fixed` VALUES ('20150925180626', '20150521190631', '2015-09-25', '18:06:26', '2015-12-01', '19:04:56'); INSERT INTO `fixed` VALUES ('20210812203257', '20150521190631', '2021-08-12', '20:32:57', '2021-08-12', '20:33:30'); INSERT INTO `fixed` VALUES ('20210812203323', '20150521190631', '2021-08-12', '20:33:23', '2021-08-12', '20:33:38'); -- ---------------------------- -- Table structure for role -- ---------------------------- DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `role_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `role_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (`role_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of role -- ---------------------------- INSERT INTO `role` VALUES ('r001', '超级管理员'); INSERT INTO `role` VALUES ('r002', '普通管理员'); -- ---------------------------- -- Table structure for seat -- ---------------------------- DROP TABLE IF EXISTS `seat`; CREATE TABLE `seat` ( `seat_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `seat_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `seat_section` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `seat_state` int(11) NOT NULL, `seat_tag` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`seat_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of seat -- ---------------------------- INSERT INTO `seat` VALUES ('20150521182303', 'A1001', 'A区', 1, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182304', 'A1002', 'A区', 1, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182305', 'A1003', 'A区', 1, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182306', 'A1004', 'A区', 1, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182307', 'A1005', 'A区', 1, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182308', 'A1006', 'A区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182309', 'A1007', 'A区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182310', 'A1008', 'A区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182311', 'VIP1001', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182312', 'VIP1002', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182313', 'VIP1003', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182314', 'VIP1004', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182315', 'VIP1005', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182316', 'VIP1007', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182318', 'VIP10010', 'B区', 0, '固定车主车位'); INSERT INTO `seat` VALUES ('20150521182319', 'VIP10012', 'B区', 0, '固定车主车位'); -- ---------------------------- -- Table structure for temp -- ---------------------------- DROP TABLE IF EXISTS `temp`; CREATE TABLE `temp` ( `temp_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `card_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `car_num` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `entry_date` date NOT NULL, `entry_time` time(0) NOT NULL, `out_date` date NULL DEFAULT NULL, `out_time` time(0) NULL DEFAULT NULL, `temp_money` float NULL DEFAULT NULL, PRIMARY KEY (`temp_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of temp -- ---------------------------- INSERT INTO `temp` VALUES ('20150925173007', '川B23333', '川B23333', '2015-09-25', '17:30:07', '2015-11-28', '21:29:26', 20); INSERT INTO `temp` VALUES ('20150925203021', '川B23333', '川B23333', '2015-09-25', '20:30:21', '2015-11-28', '21:29:26', 15); INSERT INTO `temp` VALUES ('20151201190239', '川B11111', '川B11111', '2015-12-01', '19:02:39', '2015-12-01', '19:04:24', 3); INSERT INTO `temp` VALUES ('20151201190418', '川F22222', '川F22222', '2015-12-01', '19:04:18', '2015-12-01', '19:04:28', 3); -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `user_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `role_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `real_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_pwd` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `user_phone` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`user_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('admin_01', 'r002', 'Lulu', '鲁露', '123456', '13900000002'); INSERT INTO `user` VALUES ('admin_02', 'r002', 'Ilin', '依琳', '123456', '13900000003'); INSERT INTO `user` VALUES ('SAdmin', 'r001', 'Jimi', '吉米', '123456', '13900000001'); -- ---------------------------- -- View structure for v_card -- ---------------------------- DROP VIEW IF EXISTS `v_card`; CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_card` AS select `card`.`card_id` AS `card_id`,`card`.`seat_id` AS `seat_id`,`card`.`user_name` AS `user_name`,`card`.`user_gender` AS `user_gender`,`card`.`user_addr` AS `user_addr`,`card`.`car_num` AS `car_num`,`seat`.`seat_num` AS `seat_num` from (`card` join `seat` on((`card`.`seat_id` = `seat`.`seat_id`))); -- ---------------------------- -- View structure for v_fixed -- ---------------------------- DROP VIEW IF EXISTS `v_fixed`; CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_fixed` AS select `fixed`.`fixed_id` AS `fixed_id`,`fixed`.`card_id` AS `card_id`,`fixed`.`entry_date` AS `entry_date`,`fixed`.`entry_time` AS `entry_time`,`fixed`.`out_date` AS `out_date`,`fixed`.`out_time` AS `out_time`,`card`.`car_num` AS `car_num`,`card`.`user_name` AS `user_name` from (`fixed` join `card` on((`fixed`.`card_id` = `card`.`card_id`))); -- ---------------------------- -- View structure for v_user -- ---------------------------- DROP VIEW IF EXISTS `v_user`; CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_user` AS select `user`.`user_id` AS `user_id`,`user`.`role_id` AS `role_id`,`user`.`user_name` AS `user_name`,`user`.`real_name` AS `real_name`,`user`.`user_pwd` AS `user_pwd`,`user`.`user_phone` AS `user_phone`,`role`.`role_name` AS `role_name` from (`user` join `role` on((`user`.`role_id` = `role`.`role_id`))); SET FOREIGN_KEY_CHECKS = 1;
5.工程截图
二、系统展示
1.登录界面
2.主页面
3.系统信息管理-添加角色信息
4.系统信息管理-管理角色信息
5.系统信息管理-添加用户信息
6.系统信息管理-管理用户信息
7.车位信息管理-添加车位信息
8.车位信息管理-管理车位信息
9.IC卡信息管理-添加IC卡类型
10.IC卡信息管理-管理IC卡类型
11.固定车主停车管理-出入场设置
12.固定车主停车管理-停车信息管理
13.临时车辆停车管理-车主入场信息
14.临时车辆停车管理-车主出场信息
15.系统功能操作-修改密码
三、部分代码
CardHandle
package ServletHandle; import java.io.IOException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; import java.util.*; public class CardHandle extends HttpServlet { HttpServletRequest request; HttpServletResponse response; DAL.Card card = new DAL.Card(); //通过表单get方式传值 将进入doGet函数(method="get") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.response = response; this.request = request; int handleType = Integer.parseInt(request.getParameter("type").toString()); switch (handleType) { case 1://类型1代表删除表中的数据 deleteEntity(); break; case 4://类型4代表获取表中信息 getEntity(); break; case 5://类型5代表根据查询条件获取表中信息 getEntityByWhere(); break; default: break; } } //通过表单post方式传值 将进入doPost函数(method="post") public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { this.request = request; this.response = response; int handleType = Integer.parseInt(request.getParameter("type").toString());//将前台页面传过来的type类型转化成整型 switch (handleType) { case 2://类型2代表更新表中的数据 updateEntity(); break; case 3://类型3代表向表中添加数据 insertEntity(); break; default: break; } } //删除数据操作 private void deleteEntity() throws IOException { String card_id = request.getParameter("card_id");//获取前台通过get方式传过来的JId card.deleteEntity(card_id);//执行删除操作 response.sendRedirect("/Parking/CardHandle?type=4");//删除成功后跳转至管理页面 } //更新数据操作 private void updateEntity() throws UnsupportedEncodingException { String card_id = new String(request.getParameter("card_id").getBytes("ISO8859_1"), "UTF-8"); String seat_id = new String(request.getParameter("seat_id").getBytes("ISO8859_1"), "UTF-8"); String user_name = new String(request.getParameter("user_name").getBytes("ISO8859_1"), "UTF-8"); String user_gender = new String(request.getParameter("user_gender").getBytes("ISO8859_1"), "UTF-8"); String user_addr = new String(request.getParameter("user_addr").getBytes("ISO8859_1"), "UTF-8"); String car_num = new String(request.getParameter("car_num").getBytes("ISO8859_1"), "UTF-8"); if (card.updateEntity(card_id, seat_id, user_name, user_gender, user_addr, car_num) == 1) { try { response.sendRedirect("/Parking/CardHandle?type=4");//成功更新数据后跳转至CardMsg.jsp页面 } catch (IOException e) { e.printStackTrace();//异常处理 } } } //插入数据操作 private void insertEntity() throws UnsupportedEncodingException, IOException { response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); String card_id = dateFormat.format(new Date()); String seat_id = new String(request.getParameter("seat_id").getBytes("ISO8859_1"), "UTF-8"); String user_name = new String(request.getParameter("user_name").getBytes("ISO8859_1"), "UTF-8"); String user_gender = new String(request.getParameter("user_gender").getBytes("ISO8859_1"), "UTF-8"); String user_addr = new String(request.getParameter("user_addr").getBytes("ISO8859_1"), "UTF-8"); String car_num = new String(request.getParameter("car_num").getBytes("ISO8859_1"), "UTF-8"); if (!card.checkExist(card_id)) { if (card.insertEntity(card_id, seat_id, user_name, user_gender, user_addr, car_num) == 1) { out.write("<script>alert('数据添加成功!'); location.href = '/Parking/CardHandle?type=4';</script>"); } else { out.write("<script>alert('数据添失败!'); location.href = '/Parking/CardHandle?type=4';</script>"); } } else { out.write("<script>alert('主键重复,数据添加失败!'); location.href = '/Parking/CardHandle?type=4';</script>"); } } //获取对象所有数据列表 private void getEntity() throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page").toString());//获取跳转的页面号 int totalPage = Integer.parseInt(card.getPageCount().toString());//获取分页总数 List<Object> list = card.getEntity(page);//获取数据列表 request.setAttribute("list", list);//将数据存放到request对象中,用于转发给前台页面使用 request.setAttribute("totalPage", totalPage);//将totalPage存放到request对象中,用于转发给前台页面使用 request.getRequestDispatcher("/Admin/CardMsg.jsp").forward(request, response);//请求转发 } //根据查询条件获取对象所有数据列表 private void getEntityByWhere() throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); String condition = request.getParameter("condition");//获取查询字段的名称 //String value=new String(request.getParameter("value").getBytes("ISO8859_1"),"UTF-8");//获取查询的值 String value = request.getParameter("value"); String where = condition + "=\"" + value + "\"";//拼接查询字符串 int page = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));//获取要跳转的页面号 int wherePage = Integer.parseInt(card.getPageCountByWhere(where).toString());//获取查询后的分页总数 List<Object> list = card.getEntityByWhere(where, page);//获取查询后的数据列表 request.setAttribute("list", list);//将数据存放到request对象中,用于转发给前台页面使用 request.setAttribute("wherePage", wherePage); request.setAttribute("condition", condition); request.setAttribute("value", value); request.getRequestDispatcher("/Admin/CardMsg.jsp").forward(request, response); } }