SSM-based movie ticket purchase system

The system adopts the SSM framework, and the front end uses css, js, etc. The main functions include: query special movies or the latest movies, as well as category viewing, viewing sales rankings, announcements, booking tickets, placing orders, comments, etc., and administrator management related functions

**

  • Homepage is as follows

**The
Insert picture description here
system backend is the SSM framework, and the main configuration is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-4.3.xsd 
http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd 
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd 
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">

	<!-- 启用自动扫描 -->
	<context:component-scan base-package="com"></context:component-scan>
	<!-- 启用springmvc相关Annotation的处理器 -->
	<mvc:annotation-driven />

	<!-- 采用注释的方式配置bean -->
	<context:annotation-config />
	<!--proxy-target-class="true"强制使用cglib代理 如果为false则spring会自动选择 -->
	<aop:aspectj-autoproxy proxy-target-class="true" />

	<!-- 配置dbcp数据源 -->
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="org.gjt.mm.mysql.Driver" />
		<property name="url"
			value="jdbc:mysql://localhost:3306/movie?useUnicode=true&amp;characterEncoding=UTF-8" />
		<property name="username" value="root" />
		<property name="password" value="root" />
		<!-- 队列中的最小等待数 -->
		<property name="minIdle" value="1"></property>
		<!-- 队列中的最大等待数 -->
		<property name="maxIdle" value="5"></property>
		<!-- 最长等待时间,单位毫秒 -->
		<property name="maxWait" value="3000"></property>
		<!-- 最大活跃数 -->
		<property name="maxActive" value="5"></property>
		<property name="initialSize" value="3"></property>
	</bean>

	<!-- 配置mybitasSqlSessionFactoryBean -->
	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="configLocation" value="classpath:mybatis.xml"></property>
		<!-- 扫描entity包 使用别名 -->
		<property name="typeAliasesPackage" value="com.entity" />
	</bean>

	<!-- 配置扫描DAO接口包,动态实现DAO接口,注入到spring容器中 -->
	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<!-- 注入sqlSessionFactory -->
		<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
		<!-- 给出需要扫描DAO接口包 -->
		<property name="basePackage" value="com.dao" />
	</bean>

	<!-- 配置SqlSessionTemplate -->
	<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
		<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory" />
	</bean>

	<!-- 事务配置 -->
	<bean id="transactionManager"
		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource" />
	</bean>
	
	<!-- 允许静态资源请求,否则css、js、图片等资源无法加载显示 -->
    <mvc:annotation-driven/>
	
	<!-- 扫描包,这样的话该包下带有@Controller的注解将作为Bean注册进Spring容器  -->
    <context:component-scan base-package="com.controller"/>

	<!-- 定义跳转的文件的前后缀 ,视图模式配置 -->
	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<!-- 这里的配置是自动给后面action的方法return的字符串加上前缀和后缀,变成一个 可用的url地址 -->
		<property name="prefix" value="/" />
		<property name="suffix" value=".jsp" />
	</bean>

	<!-- 支持上传文件 -->
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<property name="maxUploadSize" value="104857600" />
		<property name="maxInMemorySize" value="4096" />
		<property name="defaultEncoding" value="UTF-8"></property>
	</bean>

</beans>

The back-end uses the controller layer to accept front-end requests:

// 按条件查询数据 (模糊查询)
	@RequestMapping("queryFilmByCond.action")
	public String queryFilmByCond(String cond, String name, String number) {
    
    
		Film film = new Film();
		if (cond != null) {
    
    
			if ("filmname".equals(cond)) {
    
    
				film.setFilmname(name);
			}
			if ("image".equals(cond)) {
    
    
				film.setImage(name);
			}
			if ("cateid".equals(cond)) {
    
    
				film.setCateid(name);
			}
			if ("price".equals(cond)) {
    
    
				film.setPrice(name);
			}
			if ("recommend".equals(cond)) {
    
    
				film.setRecommend(name);
			}
			if ("thestart".equals(cond)) {
    
    
				film.setThestart(name);
			}
			if ("theend".equals(cond)) {
    
    
				film.setTheend(name);
			}
			if ("hits".equals(cond)) {
    
    
				film.setHits(name);
			}
			if ("sellnum".equals(cond)) {
    
    
				film.setSellnum(name);
			}
			if ("contents".equals(cond)) {
    
    
				film.setContents(name);
			}
		}

		List<String> nameList = new ArrayList<String>();
		List<String> valueList = new ArrayList<String>();
		nameList.add(cond);
		valueList.add(name);
		PageHelper.getPage(this.filmService.getFilmByLike(film), "film", nameList, valueList, 10, number, this.getRequest(), "query");
		name = null;
		cond = null;
		return "admin/queryfilm";
	}

**

  • Here are the special movies:

**
Insert picture description here
**

  • View movies by category:

**

Insert picture description here
**

  • Movie details:

**
Insert picture description here
**

  • You can view the movie's situation in the movie details, and you can set different levels of seats:

**
Insert picture description here
**

  • Backstage homepage

**
Insert picture description here
**

  • Other background functions

**
Insert picture description here
Insert picture description here
Insert picture description here
**

  • The following is the structure and database of the project:

**
Insert picture description here
Insert picture description here
Okay, the above is the implementation of the system. If you have any questions, you can communicate and learn privately.

Guess you like

Origin blog.csdn.net/mtyedu/article/details/113100440