基于javaweb+mysql的jsp+servlet停车位预定管理系统(java+jsp+javascript+mysql)

基于javaweb+mysql的jsp+servlet停车位预定管理系统(java+jsp+javascript+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

基于javaweb+mysql的JSP+Servlet停车位预定管理系统(java+jsp+javascript+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版本;

技术栈

HTML+CSS+JavaScript+jsp+mysql

使用说明

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

public class yuding_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
		
		
		if(type.endsWith("yudingAdd"))
		{
			yudingAdd(req, res);
		}
		if(type.endsWith("yudingMine"))
		{
			yudingMine(req, res);
		}	
		if(type.endsWith("yudingDel"))
		{
			yudingDel(req, res);
		}
		
		if(type.endsWith("yudingMana"))
		{
			yudingMana(req, res);
		}
		
		if(type.endsWith("yudingShouli"))
		{
			yudingShouli(req, res);
		}
		
	}
	
	
	public void yudingAdd(HttpServletRequest req,HttpServletResponse res)
	{
		HttpSession session=req.getSession();
		Tuser user=(Tuser)session.getAttribute("user");
		
		String id=String.valueOf(new Date().getTime());
		String xingming=req.getParameter("xingming");
		String dianhua=req.getParameter("dianhua");
		String daodashi=req.getParameter("daodashi");
		
		int chewei_id=Integer.parseInt(req.getParameter("chewei_id"));
		String user_id=user.getId();
		String zt="待受理";
		
		String neirong=req.getParameter("neirong");
		String liuyanshi=new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date());
		String user_id=user.getId();
		String huifu="";
		
		String huifushi="";
		
		String sql="insert into t_liuyan(neirong,liuyanshi,user_id,huifu,huifushi) values(?,?,?,?,?)";
		Object[] params={neirong,liuyanshi,user_id,huifu,huifushi};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("msg", "留言完毕");
        String targetURL = "/common/msg.jsp";
		dispatch(targetURL, req, res);
	}
	
	public void liuyanMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		List liuyanList=new ArrayList();
		String sql="select * from t_liuyan order by liuyanshi";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				TLiuyan liuyan=new TLiuyan();
				
				liuyan.setId(rs.getInt("id"));
				liuyan.setNeirong(rs.getString("neirong"));
				liuyan.setLiuyanshi(rs.getString("liuyanshi"));
				liuyan.setUser_id(rs.getString("user_id"));
				
				liuyan.setHuifu(rs.getString("huifu"));
				liuyan.setHuifushi(rs.getString("huifushi"));
			
				liuyanList.add(liuyan);
		    }
			rs.close();
		}
		catch(Exception e)
		{
				}
				else
				{
					 result="yes";
					 TAdmin admin=new TAdmin();
					 admin.setUserId(rs.getInt("userId"));
					 admin.setUserName(rs.getString("userName"));
					 admin.setUserPw(rs.getString("userPw"));
					 
					 session.setAttribute("userType", 0);
		             session.setAttribute("admin", admin);
				}
				rs.close();
			} 
			catch (SQLException e)
			{
				System.out.println("登录失败!");
				e.printStackTrace();
			}
			finally
			{
				mydb.closed();
			}
			
		}
		
		
		if(userType==1)
		{
			String sql="select * from t_user where loginname=? and loginpw=? and del='no'";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			try
			{
				mydb.doPstm(sql, params);
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					result="no";
				}
				if(mark==true)
				{
					 result="yes";
	
	public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response) 
	{
		RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
		try 
		{
		    dispatch.forward(request, response);
		    return;
		} 
		catch (ServletException e) 
		{
                    e.printStackTrace();
		} 
		catch (IOException e) 
		{
			
		    e.printStackTrace();
		}
	}
	public void init(ServletConfig config) throws ServletException 
	{
		super.init(config);
	}
	
	public void destroy() 
	{
		
	}
}

public class chewei_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
		
		if(type.endsWith("cheweiMana"))
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("cheweiList", cheweiList);
		req.getRequestDispatcher("qiantai/chewei/cheweiRes.jsp").forward(req, res);
	}
	
	
	public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response) 
	{
		RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
		try 
		{
		    dispatch.forward(request, response);
		    return;
		} 
		catch (ServletException e) 
		{
                    e.printStackTrace();
		} 
		catch (IOException e) 
		{
			
		    e.printStackTrace();
		}
	}
	public void init(ServletConfig config) throws ServletException 
	{
		super.init(config);
	}
	
	public void destroy() 
	{
		
	}
}

		WebContext ctx = WebContextFactory.get(); 
		 HttpSession session=ctx.getSession(); 
		 
		 String result="no";
		 
		
		
		
		if(userType==0)//系统管理员登陆
		{
			String sql="select * from t_admin where userName=? and userPw=?";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			mydb.doPstm(sql, params);
			try 
			{
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					 result="no";
				}
				else
				{
					 result="yes";
					 TAdmin admin=new TAdmin();
					 admin.setUserId(rs.getInt("userId"));
					 admin.setUserName(rs.getString("userName"));
					 admin.setUserPw(rs.getString("userPw"));
					 
					 session.setAttribute("userType", 0);
		             session.setAttribute("admin", admin);
				}
				rs.close();
			} 
			catch (SQLException e)
			{
				System.out.println("登录失败!");
				e.printStackTrace();
			}
			finally
			{
				mydb.closed();
			}
			
		}
		
		
		if(userType==1)
		{
    	int beishu=1;
    	int zong=0;
    	if(chexing.equals("小型"))
    	{
    		beishu=1;
    	}
    	if(chexing.equals("中型"))
    	{
    		beishu=2;
    	}
    	if(chexing.equals("大型"))
    	{
    		beishu=3;
    	}
    	Date aa=Util.newDate1(kaishishijian);
    	Date bb=Util.newDate1(jieshushijian);
    	
    	long gg=bb.getTime()-aa.getTime();
    	long fenzhong=gg/1000/60;
    	
    	if(fenzhong<60)
    	{
    		zong=danjia * 1 * beishu;
    	}
    	if(fenzhong>60 && fenzhong<120)
    	{
    		zong=danjia * 2 * beishu;
    	}
    	if(fenzhong>120 && fenzhong<180)
    	{
    		zong=danjia * 3 * beishu;
    	}
    	if(fenzhong>180 && fenzhong<240)
    	{
    		zong=danjia * 4 * beishu;
    	}
    	if(fenzhong>240 && fenzhong<300)
    	{
    		zong=danjia * 5 * beishu;
    	}
    	if(fenzhong>300 && fenzhong<360)
    	{
    		zong=danjia * 6 * beishu;
    	}
    	if(fenzhong>360 && fenzhong<420)
    	{
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("zhengceList", zhengceList);
		req.getRequestDispatcher("admin/zhengce/zhengceMana.jsp").forward(req, res);
	}
	
	
	public void zhengceDel(HttpServletRequest req,HttpServletResponse res)
	{
		String id=req.getParameter("id");
		
		String sql="delete from t_zhengce where id=?";
		Object[] params={id};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		req.setAttribute("msg", "操作成功");
        String targetURL = "/common/msg.jsp";
		dispatch(targetURL, req, res);
	}
	
	public void zhengceDetailHou(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		String id=req.getParameter("id");
		TZhengce zhengce=new TZhengce();
		
		String sql="select * from t_zhengce where id=?";
		Object[] params={id};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			rs.next();
			
		return "yes";
    }
    
    
    
    public int jisuanfeiyong(String kaishishijian,String jieshushijian,String chexing) throws Exception
    {
    	String s="入场时间:"+kaishishijian+",出场时间:"+jieshushijian+",车型:"+chexing;
    	System.out.println(s);
    	//收费标准:小型1元/小时、中型2元/小时,大型3元/小时,不足一小时按照一小时计算
    	
    	int danjia=1;
    	int beishu=1;
    	int zong=0;
    	if(chexing.equals("小型"))
    	{
    		beishu=1;
    	}
    	if(chexing.equals("中型"))
    	{
    		beishu=2;
    	}
    	if(chexing.equals("大型"))
    	{
    		beishu=3;
    	}
    	Date aa=Util.newDate1(kaishishijian);
    	Date bb=Util.newDate1(jieshushijian);
    	
    	long gg=bb.getTime()-aa.getTime();
    	long fenzhong=gg/1000/60;
    	
    	if(fenzhong<60)
    	{
    		zong=danjia * 1 * beishu;
    	}
    	if(fenzhong>60 && fenzhong<120)
    	{
    		zong=danjia * 2 * beishu;
    	}
    	if(fenzhong>120 && fenzhong<180)
    	{
    		zong=danjia * 3 * beishu;
    	}
    	if(fenzhong>180 && fenzhong<240)
    	{
    		zong=danjia * 4 * beishu;
    	}
	}
	
	
    public String adminPwEdit(String userPwNew)
    {
		System.out.println("DDDD");
    	try 
		{
			Thread.sleep(700);
		} 
		catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		WebContext ctx = WebContextFactory.get(); 
		HttpSession session=ctx.getSession(); 
		TAdmin admin=(TAdmin)session.getAttribute("admin");
		
		String sql="update t_admin set userPw=? where userId=?";
		Object[] params={userPwNew,admin.getUserId()};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		
		return "yes";
    }
    
    
    
    public int jisuanfeiyong(String kaishishijian,String jieshushijian,String chexing) throws Exception
    {
    	String s="入场时间:"+kaishishijian+",出场时间:"+jieshushijian+",车型:"+chexing;
    	System.out.println(s);
    	//收费标准:小型1元/小时、中型2元/小时,大型3元/小时,不足一小时按照一小时计算
    	
    	int danjia=1;
    	int beishu=1;
    	int zong=0;
    	if(chexing.equals("小型"))
    	{
    		beishu=1;
    	}
    	if(chexing.equals("中型"))
    	{
    		beishu=2;
    	}
    	if(chexing.equals("大型"))
    	{
    		beishu=3;
		}
		
		
		if(userType==1)
		{
			String sql="select * from t_user where loginname=? and loginpw=? and del='no'";
			Object[] params={userName,userPw};
			DB mydb=new DB();
			try
			{
				mydb.doPstm(sql, params);
				ResultSet rs=mydb.getRs();
				boolean mark=(rs==null||!rs.next()?false:true);
				if(mark==false)
				{
					result="no";
				}
				if(mark==true)
				{
					 result="yes";
					 
				     Tuser user=new Tuser();
					
				     user.setId(rs.getString("id"));
					 user.setLoginname(rs.getString("loginname"));
					 user.setLoginpw(rs.getString("loginpw"));
					 user.setXingming(rs.getString("xingming"));
					 
					 user.setZhuzhi(rs.getString("zhuzhi"));
					 user.setDianhua(rs.getString("dianhua"));
					 user.setDengji(rs.getString("dengji"));
					 user.setDel(rs.getString("del"));
					
					 
					 session.setAttribute("userType", 1);
		             session.setAttribute("user", user);
		             
				}
				rs.close();
			}
	public void tingMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		List tingList=new ArrayList();
		String sql="select * from t_ting order by id desc";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				Tting ting=new Tting();
				
				ting.setId(rs.getInt("id"));
				ting.setChewei_id(rs.getInt("chewei_id"));
				ting.setChexing(rs.getString("chexing"));
				ting.setChepai(rs.getString("chepai"));
				
				ting.setKaishishijian(rs.getString("kaishishijian"));
				ting.setJieshushijian(rs.getString("jieshushijian"));
				ting.setFeiyong(rs.getInt("feiyong"));
				
				ting.setChewei(liuService.get_chewei(rs.getInt("chewei_id")));
				
				tingList.add(ting);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("tingList", tingList);
		req.getRequestDispatcher("admin/ting/tingMana.jsp").forward(req, res);
	}
	
	
	public void tingDel(HttpServletRequest req,HttpServletResponse res)
	{
		int chewei_id=Integer.parseInt(req.getParameter("chewei_id"));
		int id=Integer.parseInt(req.getParameter("id"));
		
		String sql="delete from t_ting where id=?";
		Object[] params={id};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		
		{
			
		    e.printStackTrace();
		}
	}
	public void init(ServletConfig config) throws ServletException 
	{
		super.init(config);
	}
	
	public void destroy() 
	{
		
	}
}

public class loginService
{
	public String login(String userName,String userPw,int userType)
	{
		System.out.println(userType+"UUU"); 
		
		WebContext ctx = WebContextFactory.get(); 
		 HttpSession session=ctx.getSession(); 

public class zhengce_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
		
		
		if(type.endsWith("zhengceAdd"))
		{
			zhengceAdd(req, res);
		}
		if(type.endsWith("zhengceMana"))
		{
			zhengceMana(req, res);
		}
		if(type.endsWith("zhengceDel"))
		{
			zhengceDel(req, res);
		}
		if(type.endsWith("zhengceDetailHou"))
		{
			zhengceDetailHou(req, res);
		}
		
		if(type.endsWith("zhengceAll"))
		{
			zhengceAll(req, res);
		}
		if(type.endsWith("zhengceDetailQian"))
		{
			zhengceDetailQian(req, res);
		}
	}
	
	
	public void zhengceAdd(HttpServletRequest req,HttpServletResponse res)
	{
		String id=String.valueOf(new Date().getTime());
		String biaoti=req.getParameter("biaoti");
		String neirong=req.getParameter("neirong");
		String fujian=req.getParameter("fujian");
		String sql="select * from t_zhengce";
		Object[] params={};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			while(rs.next())
			{
				TZhengce zhengce=new TZhengce();
				
				zhengce.setId(rs.getString("id"));
				zhengce.setBiaoti(rs.getString("biaoti"));
				zhengce.setNeirong(rs.getString("neirong"));
				zhengce.setFujian(rs.getString("fujian"));
				
				zhengce.setShijian(rs.getString("shijian"));
				
				zhengceList.add(zhengce);
		    }
			rs.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		mydb.closed();
		
		req.setAttribute("zhengceList", zhengceList);
		req.getRequestDispatcher("qiantai/zhengce/zhengceAll.jsp").forward(req, res);
	}
	
	public void zhengceDetailQian(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
	{
		String id=req.getParameter("id");
		TZhengce zhengce=new TZhengce();
		
		String sql="select * from t_zhengce where id=?";
		Object[] params={id};
		DB mydb=new DB();
		try
		{
			mydb.doPstm(sql, params);
			ResultSet rs=mydb.getRs();
			rs.next();
			
			zhengce.setId(rs.getString("id"));
			zhengce.setBiaoti(rs.getString("biaoti"));
					 user.setDianhua(rs.getString("dianhua"));
					 user.setDengji(rs.getString("dengji"));
					 user.setDel(rs.getString("del"));
					
					 
					 session.setAttribute("userType", 1);
		             session.setAttribute("user", user);
		             
				}
				rs.close();
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
			mydb.closed();
		return result;
	}
	
	
    public String adminPwEdit(String userPwNew)
    {
		System.out.println("DDDD");
    	try 
		{
			Thread.sleep(700);
		} 
		catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		WebContext ctx = WebContextFactory.get(); 
		HttpSession session=ctx.getSession(); 
		TAdmin admin=(TAdmin)session.getAttribute("admin");
		
		String sql="update t_admin set userPw=? where userId=?";
		Object[] params={userPwNew,admin.getUserId()};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		
		return "yes";
    }

public class yuding_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
		
		
		if(type.endsWith("yudingAdd"))
		{
			yudingAdd(req, res);
		}
		if(type.endsWith("yudingMine"))
		{
			yudingMine(req, res);
		}	
		if(type.endsWith("yudingDel"))
		{
			yudingDel(req, res);
		}
		
		if(type.endsWith("yudingMana"))
		{
			yudingMana(req, res);
		}
		
		if(type.endsWith("yudingShouli"))
		{
			yudingShouli(req, res);
		}
		
	}
	
	
	public void yudingAdd(HttpServletRequest req,HttpServletResponse res)
	{

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

要成功地进行Xilinx Zynq-7000 SoC的集成开发,你将需要熟悉TLZ7xH-EVM开发板的硬件特性以及相应的软件编程。在此,我们推荐参考以下资源《创龙TLZ7xH-EVM开发板:Xilinx Zynq-7000双核Cortex-A9+Kintex-7》,这将为你的项目提供详尽的支持。 参考资源链接:[创龙TLZ7xH-EVM开发板:Xilinx Zynq-7000双核Cortex-A9+Kintex-7](https://wenku.youkuaiyun.com/doc/80nyorov3y) 首先,在硬件编程方面,你需要了解开发板的硬件架构和资源。TLZ7xH-EVM开发板集成了双核ARM Cortex-A9处理器和Kintex-7 FPGA。你应该首先阅读Zynq-7000开发板规格书,了解各个硬件接口和信号引脚的详细信息。根据你的项目需求,进行硬件资源配置,包括配置处理器的时钟频率、电源管理、存储接口以及外设接口等。 其次,在软件编程方面,Xilinx提供了Vivado和SDK套件,用于硬件逻辑设计和软件应用开发。在Vivado中,你需要完成硬件平台的设计和生成,包括创建项目、综合、实现和生成比特流文件。完成硬件设计后,你可以通过Xilinx SDK进行软件编程,创建应用程序和驱动,以与硬件平台交互。编写代码时,你需要参考开发板提供的Demo程序,这些示例程序展示了如何加载和运行用户代码。 确保你具备相关的硬件编程经验,以及掌握至少一种用于嵌入式开发的编程语言,如C/C++。在软件开发过程中,你还需要了解操作系统的选择和配置,比如使用PetaLinux等。 集成开发成功的关键在于硬件和软件的紧密配合,这通常需要进行多次迭代和调试。使用TLZ7xH-EVM开发板上的调试接口,比如JTAG和串口,进行代码调试和性能分析。 在开发过程中,不妨利用创龙科技提供的技术支持和服务,及时解决开发中遇到的问题。此外,你可以利用公司提供的增值服务平台,如定制化开发、培训等,进一步提升开发效率和产品品。 综上所述,通过阅读相关规格书,使用Vivado和SDK进行硬件设计和软件编程,结合创龙科技的技术支持,你将能够高效地完成Zynq-7000 SoC的集成开发任务。对于那些希望深入学习和探索更多高级功能和技巧的读者,我们再次推荐《创龙TLZ7xH-EVM开发板:Xilinx Zynq-7000双核Cortex-A9+Kintex-7》,这份资料不仅帮助你入门,还将引导你掌握更深层次的知识。 参考资源链接:[创龙TLZ7xH-EVM开发板:Xilinx Zynq-7000双核Cortex-A9+Kintex-7](https://wenku.youkuaiyun.com/doc/80nyorov3y)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值