基于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.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库: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.
方法二: 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下运行)
账户:admin 密码:123123
/**
* //获取电影票数据,请求参数: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());
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 request({
* url:"getCardByCardId",
* method:'post',
* params:query
* });
* };
*/
@RequestMapping("getCardByCardId")
public CinemaResult getCardByCardId(String cardId) {
return CinemaResult.ok(cardService.getCardByCardId(cardId));
}
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class MemberController {
@Resource
MemberService memberService;
/**
* //查询会员列表,参数pageIndex、pageSize、name、birtydayQuery,
* // 返回key为list 的数组和key为pageTotal的整型,birtydayQuery:空表示无限制,0示当天过生日,7表示7天内过生日
*
* export const memberData = query=>{
* return request({
* url:'memberData',
url:'modifyMovie',
method:'get',
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
* });
* };
*/
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=>{
* @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());
pageResult.setPageTotal(pageInfo.getTotal());
return CinemaResult.ok(pageResult);
}
/**
* //删除电影数据,请求参数:movieId
* export const delMovie = query=>{
* return request({
* url:'delMovie',
* method:'get',
* params:query
* });
* };
}
/**
* //获取消费充值等金额数据,请求参数无
* 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:'get',
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);
}
/**
* 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
* });
* };
*/
@RequestMapping("loginMember")
public CinemaResult loginMember(Member member){
if(memberService.loginMember(member)!=null){
return CinemaResult.ok();
}else{
return CinemaResult.build(500,"无此账号");
}
}
}
* }
*/
@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);
}
}
/**
* @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")
@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
/**
*/
@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',
* 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',
/**
* //会员删除,参数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
* });
* };
*/
@RequestMapping("loginMember")
public CinemaResult loginMember(Member member){
if(memberService.loginMember(member)!=null){
return CinemaResult.ok();
}else{
return CinemaResult.build(500,"无此账号");
}
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class MemberController {
@Resource
MemberService memberService;
/**
* //查询会员列表,参数pageIndex、pageSize、name、birtydayQuery,
* // 返回key为list 的数组和key为pageTotal的整型,birtydayQuery:空表示无限制,0示当天过生日,7表示7天内过生日
*
* export const memberData = query=>{
* return request({
* url:'memberData',
* method:'get',
* params:query
* });
* };
* @param pageIndex
* @param pageSize
* @param name
* @param birthdayQuery
* @return
*/
@RequestMapping("memberData")
public CinemaResult getMemberData(String pageIndex, String pageSize, String name, String birthdayQuery){
MemberQuery query = new MemberQuery();
/**
* @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);
}
}
* 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());
}
}
/**
* @version 1.0
*/
@CrossOrigin
@RestController
public class RecordController {
@Resource
* 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();
}
/**
* //积分兑换,请求参数:会员id,积分
* //由于是总积分兑换,所以需要将消耗积分分散到所有卡上面
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
});
};
//修改电影数据,请求参数:movieId、name、price、time
export const modifyMovie = query=>{
return request({
url:'modifyMovie',
method:'get',
params:query