项目背景
随着互联网和电子商务的快速发展,开发一个电影院订票系统来帮助电影院对电影信息,售票信息进行统一化的信息管理;
项目简短介绍
项目首先分为俩个用户端,一个是管理员后台,手机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>
项目展示
管理后台
-
登录
-
数据显示
-
用户管理
-
电影管理
-
影院管理
-
影厅管理
-
电影排片
-
评论管理
-
订单管理
APP端
-
登录
-
个人详情页
-
修改信息
-
首页
-
电影详情页面
-
正在热映和即将上映
-
影院查看
-
我的订单
系统完整
原文链接:https://www.cnblogs.com/projecthelp/p/17376512.html
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:26基于java的电影院售票管理系统设计 - Python技术站