26基于java的电影院售票管理系统设计
项目背景随着互联网和电子商务的快速发展,开发一个电影院订票系统来帮助电影院对电影信息,售票信息进行统一化的信息管理;
项目简短介绍
项目首先分为俩个用户端,一个是管理员后台,手机APP端,管理后端负责对系统功能上面的管理;app端负责查询影片,然后评论,购买影片等等;
项目环境
前端:html, css, js, vue, jquery,h5等;
后端:java, spring,maven等
开发工具:mysql,
支持eclipse或idea
更多内容可查看:项目帮
部分核心代码
import org.springframework.stereotype.Service;
import xyz.shiguangliang.mybatis.dao.UserMapper;
import xyz.shiguangliang.mybatis.domain.User;
import xyz.shiguangliang.service.UserService;
import xyz.shiguangliang.util.query.QueryInfo;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service
public class UserServiceImpl implements UserService {
@Resource
private UserMapper userMapper;
//登录
@Override
public User login(String username, String password) {
User user = userMapper.selectLogin(username,password);
if (user != null) {
//登录次数加一
if (user.getIntimes() !=null) {
user.setIntimes(user.getIntimes() + 1);
}else {
user.setIntimes(1);
}
//更新登录时间
user.setLastlogin(new Date());
return user;
}
return null;
}
//注册
@Override
public boolean register(User user) {
int i = 0;
//检测用户是否存在
User user1 = userMapper.selectUsername(user.getUsername());
if (user1 == null) {
i = userMapper.insert(user);
}
return i > 0;
}
//用户列表
@Override
public QueryInfo getUserList(String query, Integer pagenum,Integer pagesize) {
QueryInfo queryInfo = new QueryInfo();
int start;
int end;
if (pagenum == null||pagesize == null){
pagenum =0;
pagesize = 3;
}
start = (pagenum-1)*pagesize;
end = pagesize;
int userSize = userMapper.selectUserListLimitSize(query,start,end);
List<User> users = userMapper.selectUserListLimit(query,start,end);
queryInfo.setList(users);
queryInfo.setTotal(userSize);
return queryInfo;
}
//删除用户
@Override
public int deleteUser(Integer tid) {
return userMapper.deleteByPrimaryKey(tid);
}
//通过id查找用户
@Override
public User findById(Integer tid) {
return userMapper.selectByPrimaryKey(tid);
}
//更新用户
@Override
public int updateUser(User user) {
if (user.getPassword()==null|| Objects.equals(user.getPassword(), "")){
user.setPassword(userMapper.selectByPrimaryKey(user.getTid()).getPassword());
}
return userMapper.updateByPrimaryKey(user);
}
//通过用户名查找用户
@Override
public User findByUsername(String username) {
return userMapper.selectUsername(username);
}
//获取用户权限
@Override
public int getPower(String username) {
return userMapper.selectUsername(username).getPower();
}
}useMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.shiguangliang.mybatis.dao.UserMapper">
<resultMap id="BaseResultMap" type="xyz.shiguangliang.mybatis.domain.User">
<id column="tid" jdbcType="INTEGER" property="tid" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="teachername" jdbcType="VARCHAR" property="teachername" />
<result column="dno" jdbcType="INTEGER" property="dno" />
<result column="power" jdbcType="INTEGER" property="power" />
<result column="intimes" jdbcType="INTEGER" property="intimes" />
<result column="lastlogin" jdbcType="TIMESTAMP" property="lastlogin" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from teacher
where tid = #{tid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="xyz.shiguangliang.mybatis.domain.User">
insert into teacher (tid, username, password,
teachername, dno, power,
intimes, lastlogin)
values (#{tid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{teachername,jdbcType=VARCHAR}, #{dno,jdbcType=INTEGER}, #{power,jdbcType=INTEGER},
#{intimes,jdbcType=INTEGER}, #{lastlogin,jdbcType=TIMESTAMP})
</insert>
<update id="updateByPrimaryKey" parameterType="xyz.shiguangliang.mybatis.domain.User">
update teacher
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
teachername = #{teachername,jdbcType=VARCHAR},
dno = #{dno,jdbcType=INTEGER},
power = #{power,jdbcType=INTEGER},
intimes = #{intimes,jdbcType=INTEGER},
lastlogin = #{lastlogin,jdbcType=TIMESTAMP}
where tid = #{tid,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where tid = #{tid,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
</select>
<select id="selectLogin" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where username = #{username} and password = #{password}
</select>
<select id="selectUsername" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where username = #{username}
</select>
<select id="selectUserListLimit" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where
/*条件判断*/
<if test="#{query} != null and #{query} != ''">
/*模糊查询*/
<bind name="query2" value="'%' + query + '%'"/>
username like #{query2}
</if>
LIMIT #{start},#{end}
</select>
<select id="selectUserListLimitSize" resultType="java.lang.Integer">
select count(*)
from teacher
where
/*条件判断*/
<if test="#{query} != null and #{query} != ''">
/*模糊查询*/
<bind name="query2" value="'%' + query + '%'"/>
username like #{query2}
</if>
</select>
</mapper>项目展示
管理后台
[*]登录
https://img-blog.csdnimg.cn/dc26365f1da047aa8eca8937964450a4.png#pic_center
[*]数据显示
https://img-blog.csdnimg.cn/717cd39fd93a49dcbfb71bd38ee34b27.png
[*]用户管理
https://img-blog.csdnimg.cn/1dc146669cd942fa81933ff46cb8c3e4.png
[*]电影管理
https://img-blog.csdnimg.cn/59cabfb3e9824ca6a97155cad7a99ef2.png
[*]影院管理
https://img-blog.csdnimg.cn/c52540d767c44fafa9af0927c6b717bf.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]影厅管理
https://img-blog.csdnimg.cn/e4a38e4b685c40a88c23c60e63caea49.png
[*]电影排片
https://img-blog.csdnimg.cn/85e94d1ad75d4b1aa3d8fd3e6c3ca53f.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]评论管理
https://img-blog.csdnimg.cn/0a1a36e7ae3b4658b57fe0048e02655f.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]订单管理
https://img-blog.csdnimg.cn/1f879c0c213d47978d97cec01e6d0947.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center
APP端
[*]登录
https://img-blog.csdnimg.cn/8430cfcae44d4f33944f903a6d0a62a2.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]个人详情页
https://img-blog.csdnimg.cn/7d7236fcca8b491ba849c3cb6b7f9eaa.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]修改信息
https://img-blog.csdnimg.cn/ead8bd56db48483f8a1a33fb31d3c223.png
[*]首页
https://img-blog.csdnimg.cn/f04ae070ba5144e9a5687ea16c451d0e.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]电影详情页面
https://img-blog.csdnimg.cn/853c88382d8e4b5e9558382e85c0d1d0.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]正在热映和即将上映
https://img-blog.csdnimg.cn/7de65767d41343bfac7144a2cf121c8e.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]影院查看
https://img-blog.csdnimg.cn/d7033c903c2247ed97ae7e6c623d99d1.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
[*]我的订单
https://img-blog.csdnimg.cn/e1a221c6331c42c68a024c39b3481459.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAcXFfMTgwODYxNDMwNA==,size_10,color_FFFFFF,t_70,g_se,x_16#pic_center
系统完整
https://img-blog.csdnimg.cn/8a1de04584074d74becfa03da8760296.png#pic_center
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]