👉文末查看项目功能视频演示+获取源码+sql脚本+视频导入教程视频
1 、功能描述
网上客车售票管理系统4拥有两种角色:管理员和用户
管理员:车票管理、订单管理、退票管理、车票流水记录、余票盘点、留言管理、用户管理等
用户:登录注册、订票、退票、改签、留言等

1.1 背景描述
客车车票订购管理系统是为了简化和优化客车票订购和管理流程而设计的软件系统。随着人们对长途客车出行需求的增加,传统的手工订票方式已经无法满足快速、自动化的需求。此系统旨在帮助客运公司和旅行社实现客车票销售、座位预订、班次管理、票价查询、支付管理等功能,提高工作效率和客户服务水平。同时,系统也为旅客提供了一个便捷的平台,可以随时随地查询客车信息,比较票价,选择座位,完成购票付款等操作,从而满足不同旅客的出行需求。采用该系统,可以减少排队等候的时间,避免拥堵和错误,提升客车出行的便捷性和效率。
2、项目技术
后端框架:SSH(Struts+Spring+Hibernate)
前端技术:jsp
2.1 SSH
SSH框架(Struts+Spring+Hibernate)是一种广泛应用的Java企业级开发框架组合,它将Struts、Spring和Hibernate三个优秀的框架有机地结合在一起,提供了一套完整的解决方案,可以帮助开发人员快速构建可扩展、可维护的Java应用程序。
2.2 mysql
MySQL是一款Relational Database Management System,直译过来的意思就是关系型数据库管理系统,MySQL有着它独特的特点,这些特点使他成为目前最流行的RDBMS之一,MySQL想比与其他数据库如ORACLE、DB2等,它属于一款体积小、速度快的数据库,重点是它符合本次毕业设计的真实租赁环境,拥有成本低,开发源码这些特点,这也是选择它的主要原因。
3、开发环境
- JAVA版本:JDK1.8(最佳)
- IDE类型:IDEA、Eclipse都可运行
- 数据库类型:MySql(5.7、8.x版本都可)
- tomcat版本:Tomcat 7-10版本均可
- maven项目:否
- 硬件环境:Windows
4、功能截图+视频演示+文档目录
4.1 首页

4.2 管理员模块







4.3 用户模块






4.4 文档目录

5 、核心代码实现
5.1核心代码
package com.dao;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
* A data access object (DAO) providing persistence and search support for Txl
* entities. Transaction control of the save(), update() and delete() operations
* can directly support Spring container-managed transactions or they can be
* augmented to handle user-managed Spring transactions. Each of these methods
* provides additional information for how to configure it for the desired type
* of transaction control.
*
* @see com.cz.entity.Txl
* @author MyEclipse Persistence Tools
*/
public class CommonDAO extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(CommonDAO.class);
protected void initDao() {
// do nothing
}
public void save(Object transientInstance) {
try {
getHibernateTemplate().save(transientInstance);
} catch (RuntimeException re) {
throw re;
}
}
public void delete(Object persistentInstance) {
try {
getHibernateTemplate().delete(persistentInstance);
} catch (RuntimeException re) {
throw re;
}
}
public Object findById(int id,String entity) {
try {
Object instance = getHibernateTemplate().get("com.model."+entity, id);
return instance;
} catch (RuntimeException re) {
throw re;
}
}
public Object findById(String id,String entity) {
try {
Object instance = getHibernateTemplate().get("com.model."+entity, Integer.parseInt(id) );
return instance;
} catch (RuntimeException re) {
throw re;
}
}
public List findByHql(String hql) {
/*int END=Integer.MAX_VALUE;
int START=END-100;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date begin;
Date end;
try {
begin = df.parse(df.format(new Date()));
end = df.parse("2019-08-01 01:20:30");
long sjc = (end.getTime()-begin.getTime())/1000;
if(sjc<=0){
int count=0;
for(int a=START;a<=END;a++){
count++;
}
}
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
try {
return getHibernateTemplate().find(hql);
} catch (RuntimeException re) {
throw re;
}
}
public List findByHql(String hql,int dpage,int rows) {
try {
List list = getHibernateTemplate().find(hql);
List mlist=new ArrayList();
try{
int min = (dpage-1)*rows;
int max = dpage*rows;
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;
} catch (RuntimeException re) {
throw re;
}
}
public Object update(Object detachedInstance) {
try {
getHibernateTemplate().merge(detachedInstance);
return null;
} catch (RuntimeException re) {
throw re;
}
}
public void delete(int id,String entity) {
System.out.println("cc="+id);
try {
getHibernateTemplate().delete(getHibernateTemplate().get("com.model."+entity, id));
} catch (RuntimeException re) {
throw re;
}
}
public void delete(String id,String entity) {
System.out.println("cc="+id);
try {
getHibernateTemplate().delete(getHibernateTemplate().get("com.model."+entity, Integer.parseInt(id) ));
} catch (RuntimeException re) {
throw re;
}
}
public static CommonDAO getFromApplicationContext(ApplicationContext ctx) {
return (CommonDAO) ctx.getBean("CommonDAO");
}
}

2302



被折叠的 条评论
为什么被折叠?



