基于javaweb+mysql的springboot电影院会员管理系统(java+springboot+vue+element-ui+maven+mysql)
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot电影院会员管理系统(java+springboot+vue+element-ui+maven+mysql)
项目介绍
本项目代码架构设计简单,注释齐全,结构清晰,适合同为java初学者参考。 项目是一套电影院会员管理系统,使用前后端分离架构开发,前端基于Vue.js+Element UI技术,后端使用springboot+mybatis实现,包含管理员、会员管理、会员卡管理、电影票、消费记录、数据统计等模块
环境需要
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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本;
技术栈
-
后端:springboot+mybatis
-
前端:vue.js+element-ui
使用说明
-
数据库文件cinema.sql已整合到项目中,使用mysql导入即可生成数据库
-
本项目已经整合了前后端,前端文件经过webpack构建后,生成了static文件夹和index.html放入了webapp下。 * 要对前端页面进行修改,修改完成后同样将生成的文件放到本项目的webapp下。
-
程序设计文档可参考目录下:电影院会员管理系统说明文档.docx
运行项目
- 方法一: cinema项目中已经整合了vue打包的静态资源,直接启动项目,并在浏览器上输入http://localhost:8081/cinema 即可运行。 1. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,下载所需jar包; 2. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置 4. 配置tomcat,然后运行项目,输入http://localhost:8081/cinema 登录 5. 账户:admin 密码:123123 * 方法二: cinema-web项目是cinema项目的vue单页面前端项目,可以在文件夹目录下命令行输入:
npm run install
npm run dev
后,修改utils/request.js下baseURL=”/api”,开启node反向代理服务器,解决跨域问题,然后启动cinema后端项目,在浏览器上输入 http://localhost:8080 即可以前后端分离方式运行(也可以npm run build后将dist文件夹放到nginx下运行)
/**
* //解挂会员卡,请求参数卡号,返回状态
* export const cancelCard = query=>{
* return request({
* url:"cancelCard",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("cancelCard")
public CinemaResult cancelCard(String cardId) {
cardService.cancelCard(cardId);
return CinemaResult.ok();
}
/**
* //充值会员卡,请求卡号、参数金额,返回状态
* export const rechargeCard = query=>{
* return request({
* url:"rechargeCard",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("rechargeCard")
public CinemaResult rechargeCard(String cardId, String value) {
cardService.rechargeCard(cardId, Integer.parseInt(value));
return CinemaResult.ok();
}
/**
* //消费,请求参数卡号、金额、消费类型,返回状态
* export const consumeCard = query=>{
* return request({
* url:"consumeCard",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("consumeCard")
public CinemaResult consumeCard(String cardId, String price, String integral) {
cardService.consumeCard(cardId, Integer.parseInt(price), Integer.parseInt(integral));
return CinemaResult.ok();
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class CardController {
@Resource
CardService cardService;
@RequestMapping("getCardData")
public CinemaResult getCardData(String memberId, String pageIndex, String pageSize) {
//这里使用分页插件pagehelper
PageResult pageResult = new PageResult();
PageHelper.startPage(Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
List lists = cardService.getCardData(memberId);
PageInfo<Card> pageInfo = new PageInfo<>(lists);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
/**
* //注册会员卡,请求参数无,返回状态
* export const registerCard = query=>{
* return request({
* url:"registerCard",
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("registerCard")
public CinemaResult registerCard(String memberId) {
* });
* };
*/
@RequestMapping("exchangeIntegral")
public CinemaResult exchangeIntegral(String memberId, String integral) {
cardService.exchangeIntegral(memberId, Integer.parseInt(integral));
return CinemaResult.ok();
}
/**
* //通过模糊条件查询到cardId,请求参数memberId,CardId,返回CardId列表
* export const getCardIdByFuzzyQuery = query=>{
* return request({
* url:"getCardIdByFuzzyQuery",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("getCardIdByFuzzyQuery")
public CinemaResult getCardIdByFuzzyQuery(String memberId,String cardId) {
return CinemaResult.ok(cardService.getCardIdByFuzzyQuery(memberId,cardId));
}
/**
* //通过完整cardid来查询card数据,返回Card对象
* export const getCardByCardId = query=>{
* return request({
* url:"getCardByCardId",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("getCardByCardId")
public CinemaResult getCardByCardId(String cardId) {
return CinemaResult.ok(cardService.getCardByCardId(cardId));
}
}
/**
* * //修改电影数据,请求参数:movieId、name、price、time
* * export const modifyMovie = query=>{
* * return request({
* * url:'modifyMovie',
* * method:'get',
* * params:query
* * });
* * };
*/
@RequestMapping("modifyMovie")
public CinemaResult modifyMovie(Movie movie){
return movieService.modifyMovie(movie);
}
}
/*
*
* //删除电影数据,请求参数:movieId
export const delMovie = query=>{
return request({
url:'delMovie',
method:'get',
params:query
});
};
//修改电影数据,请求参数:movieId、name、price、time
export const modifyMovie = query=>{
return request({
url:'modifyMovie',
method:'get',
params:query
});
};*/
/**
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class MovieController {
@Resource
MovieService movieService;
/**
* //添加电影票数据,需要返回电影票全部数据,因为电影票id需要服务端生成
* export const insertMovie = query=>{
* return request({
* url:'insertMovie',
* method:'post',
* params:query
* })
* };
*/
@RequestMapping("insertMovie")
public CinemaResult insertMovie(Movie movie){
return movieService.insertMovie(movie);
}
/**
* //获取电影票数据,请求参数:pageIndex,pageSize,返回电影列表和总记录数
* export const movieData = query =>{
* return request({
* url:'getMovie',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("getMovie")
public CinemaResult getMovie(String pageIndex,String pageSize){
//这里使用分页插件pagehelper
PageResult pageResult = new PageResult();
PageHelper.startPage(Integer.parseInt(pageIndex),Integer.parseInt(pageSize));
List lists = movieService.getMovieData();
PageInfo<Card> pageInfo = new PageInfo<>(lists);
pageResult.setList(pageInfo.getList());
@RequestMapping("getMovie")
public CinemaResult getMovie(String pageIndex,String pageSize){
//这里使用分页插件pagehelper
PageResult pageResult = new PageResult();
PageHelper.startPage(Integer.parseInt(pageIndex),Integer.parseInt(pageSize));
List lists = movieService.getMovieData();
PageInfo<Card> pageInfo = new PageInfo<>(lists);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
/**
* //删除电影数据,请求参数:movieId
* export const delMovie = query=>{
* return request({
* url:'delMovie',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("delMovie")
public CinemaResult delMovie(String movieId){
movieService.delMovie(movieId);
return CinemaResult.ok();
}
/**
* * //修改电影数据,请求参数:movieId、name、price、time
* * export const modifyMovie = query=>{
* * return request({
* * url:'modifyMovie',
* * method:'get',
* * params:query
* * });
* * };
*/
@RequestMapping("modifyMovie")
public CinemaResult modifyMovie(Movie movie){
return movieService.modifyMovie(movie);
}
}
/*
*
* //删除电影数据,请求参数:movieId
export const delMovie = query=>{
return request({
url:'delMovie',
method:'get',
params:query
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class RecordController {
@Resource
RecordService recordService;
/**
* //交易记录查询,请求参数会员id,pageIndex,pageSize
* export const queryRecord = query=>{
* return request({
* url:"queryRecord",
* method:'post',
* params:query
* })
* }
*/
@RequestMapping("queryRecord")
public CinemaResult queryRecord(String memberId, String pageIndex, String pageSize) {
PageResult pageResult = new PageResult();
PageHelper.startPage(Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
List<Record> records = recordService.selectRecordByMemberId(memberId);
PageInfo<Record> pageInfo = new PageInfo<>(records);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
}
if(StringUtils.isNotBlank(name)){
query.setName(name);
}
if(StringUtils.isNotBlank(birthdayQuery)){
query.setBirthdayQuery(birthdayQuery);
}
return memberService.getMemberData(query);
}
@RequestMapping("memberRegister")
public CinemaResult memberRegister(Member member){
return memberService.memberRegister(member);
}
/**
* //会员删除,参数MemberId,返回Result
* export const delMember = query=>{
* return request({
* url:'delMember',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("delMember")
public CinemaResult delMember(Member member){
System.out.println(member);
return memberService.delMember(member.getmemberId());
}
/**
* //修改会员信息,参数Member,返回Result
* export const modifyMember = query=>{
* return request({
* url:'modifyMember',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("modifyMember")
public CinemaResult modifyMember(Member member){
return memberService.modifyMember(member);
}
/**
* //会员登录,参数memberId,返回200
* export const loginMember = query=>{
* return request({
* url:'loginMember',
* method:'get',
* params:query
* });
* };
*/
PageHelper.startPage(Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
List<Record> records = recordService.selectRecordByMemberId(memberId);
PageInfo<Record> pageInfo = new PageInfo<>(records);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class ManagerController {
@Resource
ManagerService managerService;
/**
* //获取管理员数据,请求参数managerId
* export const managerData = query=>{
* return request({
* url:'getManagerData',
* method:'get',
* params:query
* });
* };
* @param managerId
* @return
*/
@RequestMapping("getManagerData")
public CinemaResult getManagerData(String managerId){
PageInfo<Record> pageInfo = new PageInfo<>(records);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class ManagerController {
@Resource
ManagerService managerService;
/**
* //获取管理员数据,请求参数managerId
* export const managerData = query=>{
* return request({
* url:'getManagerData',
* method:'get',
* params:query
* });
* };
* @param managerId
* @return
*/
@RequestMapping("getManagerData")
public CinemaResult getManagerData(String managerId){
return CinemaResult.ok(managerService.selectByManagerId(managerId));
}
@RequestMapping("managerLogin")
public CinemaResult managerLogin(String managerId, String password){
if (managerService.managerLogin(managerId, password) == null) {
* //获取统计数字数据,请求参数无
* export const statisticData = query=>{
* return request({
* url:'getStatisticData',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("getStatisticData")
public CinemaResult getStatisticData(){
StatisticData s = new StatisticData();
s.setMemberNum(memberService.getMemberNum());
s.setCardNum(cardService.getCardNum());
s.setMovieNum(recordService.getMovieNum());
return CinemaResult.ok(s);
}
/**
* //获取消费充值等金额数据,请求参数无
* export const requestDealData = query=>{
* return request({
* url:'requestDealData',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("requestDealData")
public CinemaResult requestDealData(){
DealData dealData = new DealData();
dealData.setConsume(recordService.getConsumeCount()*-1);
dealData.setIntegral(recordService.getIntegralExchangeCount()*-1);
dealData.setRecharge(recordService.getRechargeCount());
return CinemaResult.ok(dealData);
}
/**
* //获取充值消费数据的图标数据,请求参数无,返回包含三个整型数组的对象
* export const getSchart1Data = query=>{
* return request({
* url:"getSchart1Data",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("getSchart1Data")
public CinemaResult getSchart1Data(){
return CinemaResult.ok(recordService.getSchart1Data());
}
}
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("rechargeCard")
public CinemaResult rechargeCard(String cardId, String value) {
cardService.rechargeCard(cardId, Integer.parseInt(value));
return CinemaResult.ok();
}
/**
* //消费,请求参数卡号、金额、消费类型,返回状态
* export const consumeCard = query=>{
* return request({
* url:"consumeCard",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("consumeCard")
public CinemaResult consumeCard(String cardId, String price, String integral) {
cardService.consumeCard(cardId, Integer.parseInt(price), Integer.parseInt(integral));
return CinemaResult.ok();
}
/**
* //积分兑换,请求参数:会员id,积分
* //由于是总积分兑换,所以需要将消耗积分分散到所有卡上面
* export const exchangeIntegral = query=>{
* return request({
* url:"exchangeIntegral",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("exchangeIntegral")
public CinemaResult exchangeIntegral(String memberId, String integral) {
cardService.exchangeIntegral(memberId, Integer.parseInt(integral));
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class MovieController {
@Resource
MovieService movieService;
/**
* //添加电影票数据,需要返回电影票全部数据,因为电影票id需要服务端生成
* export const insertMovie = query=>{
* return request({
* url:'insertMovie',
* method:'post',
* params:query
* })
* };
*/
@RequestMapping("insertMovie")
public CinemaResult insertMovie(Movie movie){
return movieService.insertMovie(movie);
}
/**
* //获取电影票数据,请求参数:pageIndex,pageSize,返回电影列表和总记录数
* export const movieData = query =>{
* return request({
public CinemaResult requestDealData(){
DealData dealData = new DealData();
dealData.setConsume(recordService.getConsumeCount()*-1);
dealData.setIntegral(recordService.getIntegralExchangeCount()*-1);
dealData.setRecharge(recordService.getRechargeCount());
return CinemaResult.ok(dealData);
}
/**
* //获取充值消费数据的图标数据,请求参数无,返回包含三个整型数组的对象
* export const getSchart1Data = query=>{
* return request({
* url:"getSchart1Data",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("getSchart1Data")
public CinemaResult getSchart1Data(){
return CinemaResult.ok(recordService.getSchart1Data());
}
}
/**
* @version 1.0
*/
@CrossOrigin
* export const delMovie = query=>{
* return request({
* url:'delMovie',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("delMovie")
public CinemaResult delMovie(String movieId){
movieService.delMovie(movieId);
return CinemaResult.ok();
}
/**
* * //修改电影数据,请求参数:movieId、name、price、time
* * export const modifyMovie = query=>{
* * return request({
* * url:'modifyMovie',
* * method:'get',
* * params:query
* * });
* * };
*/
@RequestMapping("modifyMovie")
public CinemaResult modifyMovie(Movie movie){
return movieService.modifyMovie(movie);
}
}
/*
*
* //删除电影数据,请求参数:movieId
export const delMovie = query=>{
return request({
url:'delMovie',
method:'get',
params:query
});
};
//修改电影数据,请求参数:movieId、name、price、time
export const modifyMovie = query=>{
return request({
url:'modifyMovie',
method:'get',
params:query
});
};*/
* @version 1.0
*/
@CrossOrigin
@RestController
public class CardController {
@Resource
CardService cardService;
@RequestMapping("getCardData")
public CinemaResult getCardData(String memberId, String pageIndex, String pageSize) {
//这里使用分页插件pagehelper
PageResult pageResult = new PageResult();
PageHelper.startPage(Integer.parseInt(pageIndex), Integer.parseInt(pageSize));
List lists = cardService.getCardData(memberId);
PageInfo<Card> pageInfo = new PageInfo<>(lists);
pageResult.setList(pageInfo.getList());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
/**
* //注册会员卡,请求参数无,返回状态
* export const registerCard = query=>{
* return request({
* url:"registerCard",
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("registerCard")
public CinemaResult registerCard(String memberId) {
cardService.registerCard(memberId);
return CinemaResult.ok();
}
/**
* //补卡,请求参数卡号id,返回新卡id号,并提示会员
* export const reissueCard = query=>{
* return request({
* url:"reissueCard",
* method:'post',
* params:query
/**
*/
@CrossOrigin
@RestController
public class StatisticController {
@Resource
MemberService memberService;
@Resource
CardService cardService;
@Resource
RecordService recordService;
/**
* //获取统计数字数据,请求参数无
* export const statisticData = query=>{
* return request({
* url:'getStatisticData',
* method:'get',
* params:query
* });
* };
*/
@RequestMapping("getStatisticData")
public CinemaResult getStatisticData(){
StatisticData s = new StatisticData();
s.setMemberNum(memberService.getMemberNum());
s.setCardNum(cardService.getCardNum());
s.setMovieNum(recordService.getMovieNum());
return CinemaResult.ok(s);
}
/**
* //获取消费充值等金额数据,请求参数无
* export const requestDealData = query=>{
* return request({
* url:'requestDealData',