Java项目:157SpringBoot Vue的网吧管理系统

 作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

基于SpringBoot Vue的网吧管理系统

角色:管理员、网管、会员

管理员:管理员登录进入系统可以查看首页,个人中心,会员管理,网管管理,商品类型管理,商品信息管理,购买商品管理,呼叫网管管理,电脑信息管理,用户上机管理,用户下机管理等功能,并进行详细操作

网管:网管登录进入系统可以查看首页,个人中心,会员管理,商品信息管理,购买商品管理,呼叫网管管理,电脑信息管理,用户上机管理,用户下机管理等功能,并进行详细操作

会员:会员登录进入系统可以查看首页,个人中心,商品信息管理,购买商品管理,呼叫网管管理,电脑信息管理,用户上机管理,用户下机管理等功能,并进行详细操作

使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端: SpringBoot+Mybaits

前端:Vue +ElementUI +Layui +HTML+CSS+JS

使用说明

项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;

3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

运行截图

论文

功能截图

 

相关代码

 account

package controller;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.Manager;
import service.user.service;
import tools.md5test;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

@Controller
public class account {
	@Resource
	private service ser;

	// 验证登录账号和密码
	@RequestMapping(value = "/loginServlet", method = RequestMethod.POST)
	@ResponseBody
	public String doLogin(@RequestParam String name, @RequestParam String pwd, HttpServletRequest request,
			HttpSession session) throws Exception {
		Manager manager = new Manager();
		manager.setAccount(name);
		manager.setPassword(md5test.getMD5(pwd));
		Manager man = ser.getNamePwd(manager);
		Map map = new HashMap();
		if (man != null) {
			// 查询结果存在,则跳转回本页面
			session.setAttribute("info", man.getAccount());
			map.put("result", "you");
			return JSON.toJSONString(map);
		} else {
			// 页面跳转(index.jsp)带出提示信息--转发
			map.put("result", "wu");
			return JSON.toJSONString(map);
		}
	}

	// 验证用户名是否可用
	@RequestMapping(value = "/zhuServlet", method = RequestMethod.POST)
	@ResponseBody
	public String doName(@RequestParam String name) throws Exception {
		Manager manager = new Manager();
		manager.setAccount(name);
		Manager man = ser.selectName(manager);
		Map map = new HashMap();
		if (man != null) {
			map.put("result", "you");
		} else {
			map.put("result", "wu");
		}
		return JSON.toJSONString(map);
	}

	// 注册用户
	@RequestMapping(value = "/updateServlet", method = RequestMethod.POST)
	public String doRegister(@RequestParam String name, @RequestParam String pwd, @RequestParam String quanXian)
			throws Exception {
		if (quanXian == null || !quanXian.equals("mana")) {
			quanXian = "Service";
		} else {
			quanXian = "Manager";
		}
		Manager manager = new Manager();
		manager.setAccount(name);
		manager.setPassword(md5test.getMD5(pwd));
		manager.setRank(quanXian);
		try {
			int a = ser.doRegister(manager);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "index";
	}

	// 注销登录
	@RequestMapping(value = "/guanbiServlet", method = RequestMethod.POST)
	public String guanBi(@RequestParam String dayang, HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		req.getSession().removeAttribute("info");
		String path = req.getContextPath();
		String basePath = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + path + "/";
		if (dayang.equals("tui")) {
			resp.sendRedirect(basePath + "index.jsp");
		}
		return null;
	}

	// 退出登录
	@RequestMapping(value = "/tuichuServlet", method = RequestMethod.GET)
	public String tuichu(HttpServletRequest req) throws Exception {
		req.getSession().removeAttribute("info");
		return "index";
	}

}

member

package controller;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.Member;
import pojo.pageModel;
import pojo.turnover;
import service.user.memberService;
import service.user.turnoverService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class member {
	@Resource
	private memberService mem;
	@Resource
	private turnoverService turn;

	// 查询卡号是否存在,存在则返回相应的会员信息
	@RequestMapping(value = "/shukaServlet", method = RequestMethod.POST)
	@ResponseBody
	public String getMemInfo(@RequestParam int kahao) throws Exception {
		Member member = new Member();
		member.setMemid(kahao);
		Member m = new Member();
		m = mem.getMemberInfo(member);
		if (m != null) {
			return JSON.toJSONString(m);
		} else {
			Map map = new HashMap();
			map.put("mname", "wu");
			return JSON.toJSONString(map);
		}
	}

	// 获取信息总数量
	@RequestMapping(value = "/getPageCount", method = RequestMethod.POST)
	@ResponseBody
	public String getPageCount(@RequestParam int pageSize) throws Exception {
		Map map = new HashMap();
		map.put("count",mem.getPageCount());
		return JSON.toJSONString(map);
	}

	// 查询会员信息
	@RequestMapping(value = "/chaVIPServlet", method = RequestMethod.POST)
	@ResponseBody
	public String chaVIPServlet(@RequestParam int pageNo, @RequestParam int pageSize) throws Exception {
		pageModel pm = new pageModel();
		pm.setPageNo((pageNo-1)*pageSize);
		pm.setPageSize(pageSize);
		return JSON.toJSONString(mem.chaVIPServlet(pm));
	}

	// 会员充值
	@RequestMapping(value = "/chongServlet", method = RequestMethod.POST)
	@ResponseBody
	public String chongServlet(@RequestParam int kahao, @RequestParam double jine,HttpServletRequest req) throws Exception {
		Member me = new Member();
		me.setMemid(kahao);
		me.setYue(jine);
		mem.chongZhi(me);
		String name=(String)req.getSession().getAttribute("info");
		turnover t=new turnover();
		t.setLaiyuan("会员充值");
		t.setMan(name);
		t.setPrice(jine);
		t.setTaihao(kahao);
		turn.chongVip(t);
		return null;
	}

	// 删除会员
	@RequestMapping(value = "/shanServlet", method = RequestMethod.POST)
	@ResponseBody
	public String shanServlet(@RequestParam int kahao) throws Exception {
		Member me = new Member();
		me.setMemid(kahao);
		mem.shanChu(me);
		return null;
	}

	// 新办会员查询卡号是否可用
	@RequestMapping(value = "/kahaoServlet", method = RequestMethod.POST)
	@ResponseBody
	public String kahaoServlet(@RequestParam int num) throws Exception {
		Member me = new Member();
		me.setMemid(num);
		Member a = new Member();
		a = mem.chaKaHao(me);
		if (a != null) {
			return JSON.toJSONString(a);
		} else {
			Map map = new HashMap();
			map.put("memid", "0");
			return JSON.toJSONString(map);
		}
	}

	// 添加会员
	@RequestMapping(value = "/addvipServlet", method = RequestMethod.POST)
	@ResponseBody
	public String addvipServlet(@RequestParam int num, @RequestParam String pwd, @RequestParam String name,
			@RequestParam double jine, @RequestParam String tel,HttpServletRequest req) throws Exception {
		Member me = new Member();
		me.setMemid(num);
		me.setMname(name);
		me.setMpsw(pwd);
		me.setMtel(tel);
		me.setYue(jine);
		mem.addVip(me);
		String aname=(String)req.getSession().getAttribute("info");
		turnover t=new turnover();
		t.setLaiyuan("新办会员");
		t.setMan(aname);
		t.setPrice(jine);
		t.setTaihao(num);
		turn.addVip(t);
		return null;
	}

}

table

package controller;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.Member;
import pojo.ballinfo;
import pojo.salwater;
import pojo.turnover;
import service.user.memberService;
import service.user.salwaterService;
import service.user.tableService;
import service.user.turnoverService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class table {
	@Resource
	private tableService t;
	@Resource
	private turnoverService turn;
	@Resource
	private salwaterService sal;
	@Resource
	private memberService mm;

	// 初始化机位计费信息
	@RequestMapping(value = "/initServlet", method = RequestMethod.POST)
	@ResponseBody
	public String doInit() throws Exception {
		int[] list = { 1, 2, 3, 4, 5 };
		String[] arr = t.getInit(list);
		Map map = new HashMap();
		map.put("yi", arr[0]);
		map.put("er", arr[1]);
		map.put("san", arr[2]);
		map.put("si", arr[3]);
		map.put("wu", arr[4]);
		String json = JSON.toJSONString(map);
		return json;
	}

	// 开机操作
	@RequestMapping(value = "/open", method = RequestMethod.POST)
	@ResponseBody
	public String openTable(@RequestParam int taihao) throws Exception {
		ballinfo ball = new ballinfo();
		ball.setTableid(taihao);
		int count = t.doOpen(ball);
		Map map = new HashMap();
		map.put("xin", count);
		return JSON.toJSONString(map);
	}

	// 结账数据查询
	@RequestMapping(value = "/jieZhangServlet", method = RequestMethod.POST)
	@ResponseBody
	public String tableInfo(@RequestParam int taihao) throws Exception {
		List list = t.tableInfo(taihao);
		Map map = new HashMap();
		map.put("openTime", list.get(0));
		map.put("usedTime", list.get(1));
		map.put("taifei", list.get(2));
		map.put("water", list.get(3));
		map.put("zongJi", list.get(4));
		return JSON.toJSONString(map);
	}

	// 刷卡结账后操作
	@RequestMapping(value = "/afterJieServlet", method = RequestMethod.POST)
	@ResponseBody
	public String shuaka(@RequestParam int kahao, @RequestParam double zongji, @RequestParam int taihao,
			HttpServletRequest req) throws Exception {
		// 消费信息计入营业额
		String man = (String) req.getSession().getAttribute("info");
		turnover tur = new turnover();
		tur.setTaihao(taihao);
		tur.setPrice(zongji);
		tur.setMan(man);
		turn.shuaka(tur);
		// 对会员卡内余额扣除操作
		Member mem = new Member();
		mem.setMemid(kahao);
		mem.setYue(zongji);
		mm.updateYue(mem);
		// 清除该机位的烟饮料消费记录
		salwater s = new salwater();
		s.setTaihao(taihao);
		sal.deleteInfo(s);
		// 对机位状态初始化
		ballinfo ball = new ballinfo();
		ball.setTableid(taihao);
		t.doCloseTable(ball);
		Map map = new HashMap();
		map.put("rs", "yeah");
		return JSON.toJSONString(map);
	}

	// 现金结账后操作
	@RequestMapping(value = "/xianjin", method = RequestMethod.POST)
	@ResponseBody
	public String xianJin(@RequestParam double zongji, @RequestParam int taihao, HttpServletRequest req)
			throws Exception {
		// 消费信息计入营业额
		String man = (String) req.getSession().getAttribute("info");
		turnover tur = new turnover();
		tur.setTaihao(taihao);
		tur.setPrice(zongji);
		tur.setMan(man);
		turn.shuaka(tur);
		// 清除该机位的烟饮料消费记录
		salwater s = new salwater();
		s.setTaihao(taihao);
		sal.deleteInfo(s);
		// 对机位状态初始化
		ballinfo ball = new ballinfo();
		ball.setTableid(taihao);
		int a = t.doCloseTable(ball);
		Map map = new HashMap();
		map.put("fan", a);
		return JSON.toJSONString(map);
	}
}

如果也想学习本系统,下面领取。关注并回复:157springboot

  • 24
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值