当前位置:   article > 正文

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

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

  1. package controller;
  2. import com.alibaba.fastjson.JSON;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import pojo.Manager;
  9. import service.user.service;
  10. import tools.md5test;
  11. import javax.annotation.Resource;
  12. import javax.servlet.http.HttpServletRequest;
  13. import javax.servlet.http.HttpServletResponse;
  14. import javax.servlet.http.HttpSession;
  15. import java.util.HashMap;
  16. import java.util.Map;
  17. @Controller
  18. public class account {
  19. @Resource
  20. private service ser;
  21. // 验证登录账号和密码
  22. @RequestMapping(value = "/loginServlet", method = RequestMethod.POST)
  23. @ResponseBody
  24. public String doLogin(@RequestParam String name, @RequestParam String pwd, HttpServletRequest request,
  25. HttpSession session) throws Exception {
  26. Manager manager = new Manager();
  27. manager.setAccount(name);
  28. manager.setPassword(md5test.getMD5(pwd));
  29. Manager man = ser.getNamePwd(manager);
  30. Map map = new HashMap();
  31. if (man != null) {
  32. // 查询结果存在,则跳转回本页面
  33. session.setAttribute("info", man.getAccount());
  34. map.put("result", "you");
  35. return JSON.toJSONString(map);
  36. } else {
  37. // 页面跳转(index.jsp)带出提示信息--转发
  38. map.put("result", "wu");
  39. return JSON.toJSONString(map);
  40. }
  41. }
  42. // 验证用户名是否可用
  43. @RequestMapping(value = "/zhuServlet", method = RequestMethod.POST)
  44. @ResponseBody
  45. public String doName(@RequestParam String name) throws Exception {
  46. Manager manager = new Manager();
  47. manager.setAccount(name);
  48. Manager man = ser.selectName(manager);
  49. Map map = new HashMap();
  50. if (man != null) {
  51. map.put("result", "you");
  52. } else {
  53. map.put("result", "wu");
  54. }
  55. return JSON.toJSONString(map);
  56. }
  57. // 注册用户
  58. @RequestMapping(value = "/updateServlet", method = RequestMethod.POST)
  59. public String doRegister(@RequestParam String name, @RequestParam String pwd, @RequestParam String quanXian)
  60. throws Exception {
  61. if (quanXian == null || !quanXian.equals("mana")) {
  62. quanXian = "Service";
  63. } else {
  64. quanXian = "Manager";
  65. }
  66. Manager manager = new Manager();
  67. manager.setAccount(name);
  68. manager.setPassword(md5test.getMD5(pwd));
  69. manager.setRank(quanXian);
  70. try {
  71. int a = ser.doRegister(manager);
  72. } catch (Exception e) {
  73. // TODO Auto-generated catch block
  74. e.printStackTrace();
  75. }
  76. return "index";
  77. }
  78. // 注销登录
  79. @RequestMapping(value = "/guanbiServlet", method = RequestMethod.POST)
  80. public String guanBi(@RequestParam String dayang, HttpServletRequest req, HttpServletResponse resp)
  81. throws Exception {
  82. req.getSession().removeAttribute("info");
  83. String path = req.getContextPath();
  84. String basePath = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort() + path + "/";
  85. if (dayang.equals("tui")) {
  86. resp.sendRedirect(basePath + "index.jsp");
  87. }
  88. return null;
  89. }
  90. // 退出登录
  91. @RequestMapping(value = "/tuichuServlet", method = RequestMethod.GET)
  92. public String tuichu(HttpServletRequest req) throws Exception {
  93. req.getSession().removeAttribute("info");
  94. return "index";
  95. }
  96. }

member

  1. package controller;
  2. import com.alibaba.fastjson.JSON;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import pojo.Member;
  9. import pojo.pageModel;
  10. import pojo.turnover;
  11. import service.user.memberService;
  12. import service.user.turnoverService;
  13. import javax.annotation.Resource;
  14. import javax.servlet.http.HttpServletRequest;
  15. import java.util.ArrayList;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. @Controller
  20. public class member {
  21. @Resource
  22. private memberService mem;
  23. @Resource
  24. private turnoverService turn;
  25. // 查询卡号是否存在,存在则返回相应的会员信息
  26. @RequestMapping(value = "/shukaServlet", method = RequestMethod.POST)
  27. @ResponseBody
  28. public String getMemInfo(@RequestParam int kahao) throws Exception {
  29. Member member = new Member();
  30. member.setMemid(kahao);
  31. Member m = new Member();
  32. m = mem.getMemberInfo(member);
  33. if (m != null) {
  34. return JSON.toJSONString(m);
  35. } else {
  36. Map map = new HashMap();
  37. map.put("mname", "wu");
  38. return JSON.toJSONString(map);
  39. }
  40. }
  41. // 获取信息总数量
  42. @RequestMapping(value = "/getPageCount", method = RequestMethod.POST)
  43. @ResponseBody
  44. public String getPageCount(@RequestParam int pageSize) throws Exception {
  45. Map map = new HashMap();
  46. map.put("count",mem.getPageCount());
  47. return JSON.toJSONString(map);
  48. }
  49. // 查询会员信息
  50. @RequestMapping(value = "/chaVIPServlet", method = RequestMethod.POST)
  51. @ResponseBody
  52. public String chaVIPServlet(@RequestParam int pageNo, @RequestParam int pageSize) throws Exception {
  53. pageModel pm = new pageModel();
  54. pm.setPageNo((pageNo-1)*pageSize);
  55. pm.setPageSize(pageSize);
  56. return JSON.toJSONString(mem.chaVIPServlet(pm));
  57. }
  58. // 会员充值
  59. @RequestMapping(value = "/chongServlet", method = RequestMethod.POST)
  60. @ResponseBody
  61. public String chongServlet(@RequestParam int kahao, @RequestParam double jine,HttpServletRequest req) throws Exception {
  62. Member me = new Member();
  63. me.setMemid(kahao);
  64. me.setYue(jine);
  65. mem.chongZhi(me);
  66. String name=(String)req.getSession().getAttribute("info");
  67. turnover t=new turnover();
  68. t.setLaiyuan("会员充值");
  69. t.setMan(name);
  70. t.setPrice(jine);
  71. t.setTaihao(kahao);
  72. turn.chongVip(t);
  73. return null;
  74. }
  75. // 删除会员
  76. @RequestMapping(value = "/shanServlet", method = RequestMethod.POST)
  77. @ResponseBody
  78. public String shanServlet(@RequestParam int kahao) throws Exception {
  79. Member me = new Member();
  80. me.setMemid(kahao);
  81. mem.shanChu(me);
  82. return null;
  83. }
  84. // 新办会员查询卡号是否可用
  85. @RequestMapping(value = "/kahaoServlet", method = RequestMethod.POST)
  86. @ResponseBody
  87. public String kahaoServlet(@RequestParam int num) throws Exception {
  88. Member me = new Member();
  89. me.setMemid(num);
  90. Member a = new Member();
  91. a = mem.chaKaHao(me);
  92. if (a != null) {
  93. return JSON.toJSONString(a);
  94. } else {
  95. Map map = new HashMap();
  96. map.put("memid", "0");
  97. return JSON.toJSONString(map);
  98. }
  99. }
  100. // 添加会员
  101. @RequestMapping(value = "/addvipServlet", method = RequestMethod.POST)
  102. @ResponseBody
  103. public String addvipServlet(@RequestParam int num, @RequestParam String pwd, @RequestParam String name,
  104. @RequestParam double jine, @RequestParam String tel,HttpServletRequest req) throws Exception {
  105. Member me = new Member();
  106. me.setMemid(num);
  107. me.setMname(name);
  108. me.setMpsw(pwd);
  109. me.setMtel(tel);
  110. me.setYue(jine);
  111. mem.addVip(me);
  112. String aname=(String)req.getSession().getAttribute("info");
  113. turnover t=new turnover();
  114. t.setLaiyuan("新办会员");
  115. t.setMan(aname);
  116. t.setPrice(jine);
  117. t.setTaihao(num);
  118. turn.addVip(t);
  119. return null;
  120. }
  121. }

table

  1. package controller;
  2. import com.alibaba.fastjson.JSON;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import pojo.Member;
  9. import pojo.ballinfo;
  10. import pojo.salwater;
  11. import pojo.turnover;
  12. import service.user.memberService;
  13. import service.user.salwaterService;
  14. import service.user.tableService;
  15. import service.user.turnoverService;
  16. import javax.annotation.Resource;
  17. import javax.servlet.http.HttpServletRequest;
  18. import java.util.HashMap;
  19. import java.util.List;
  20. import java.util.Map;
  21. @Controller
  22. public class table {
  23. @Resource
  24. private tableService t;
  25. @Resource
  26. private turnoverService turn;
  27. @Resource
  28. private salwaterService sal;
  29. @Resource
  30. private memberService mm;
  31. // 初始化机位计费信息
  32. @RequestMapping(value = "/initServlet", method = RequestMethod.POST)
  33. @ResponseBody
  34. public String doInit() throws Exception {
  35. int[] list = { 1, 2, 3, 4, 5 };
  36. String[] arr = t.getInit(list);
  37. Map map = new HashMap();
  38. map.put("yi", arr[0]);
  39. map.put("er", arr[1]);
  40. map.put("san", arr[2]);
  41. map.put("si", arr[3]);
  42. map.put("wu", arr[4]);
  43. String json = JSON.toJSONString(map);
  44. return json;
  45. }
  46. // 开机操作
  47. @RequestMapping(value = "/open", method = RequestMethod.POST)
  48. @ResponseBody
  49. public String openTable(@RequestParam int taihao) throws Exception {
  50. ballinfo ball = new ballinfo();
  51. ball.setTableid(taihao);
  52. int count = t.doOpen(ball);
  53. Map map = new HashMap();
  54. map.put("xin", count);
  55. return JSON.toJSONString(map);
  56. }
  57. // 结账数据查询
  58. @RequestMapping(value = "/jieZhangServlet", method = RequestMethod.POST)
  59. @ResponseBody
  60. public String tableInfo(@RequestParam int taihao) throws Exception {
  61. List list = t.tableInfo(taihao);
  62. Map map = new HashMap();
  63. map.put("openTime", list.get(0));
  64. map.put("usedTime", list.get(1));
  65. map.put("taifei", list.get(2));
  66. map.put("water", list.get(3));
  67. map.put("zongJi", list.get(4));
  68. return JSON.toJSONString(map);
  69. }
  70. // 刷卡结账后操作
  71. @RequestMapping(value = "/afterJieServlet", method = RequestMethod.POST)
  72. @ResponseBody
  73. public String shuaka(@RequestParam int kahao, @RequestParam double zongji, @RequestParam int taihao,
  74. HttpServletRequest req) throws Exception {
  75. // 消费信息计入营业额
  76. String man = (String) req.getSession().getAttribute("info");
  77. turnover tur = new turnover();
  78. tur.setTaihao(taihao);
  79. tur.setPrice(zongji);
  80. tur.setMan(man);
  81. turn.shuaka(tur);
  82. // 对会员卡内余额扣除操作
  83. Member mem = new Member();
  84. mem.setMemid(kahao);
  85. mem.setYue(zongji);
  86. mm.updateYue(mem);
  87. // 清除该机位的烟饮料消费记录
  88. salwater s = new salwater();
  89. s.setTaihao(taihao);
  90. sal.deleteInfo(s);
  91. // 对机位状态初始化
  92. ballinfo ball = new ballinfo();
  93. ball.setTableid(taihao);
  94. t.doCloseTable(ball);
  95. Map map = new HashMap();
  96. map.put("rs", "yeah");
  97. return JSON.toJSONString(map);
  98. }
  99. // 现金结账后操作
  100. @RequestMapping(value = "/xianjin", method = RequestMethod.POST)
  101. @ResponseBody
  102. public String xianJin(@RequestParam double zongji, @RequestParam int taihao, HttpServletRequest req)
  103. throws Exception {
  104. // 消费信息计入营业额
  105. String man = (String) req.getSession().getAttribute("info");
  106. turnover tur = new turnover();
  107. tur.setTaihao(taihao);
  108. tur.setPrice(zongji);
  109. tur.setMan(man);
  110. turn.shuaka(tur);
  111. // 清除该机位的烟饮料消费记录
  112. salwater s = new salwater();
  113. s.setTaihao(taihao);
  114. sal.deleteInfo(s);
  115. // 对机位状态初始化
  116. ballinfo ball = new ballinfo();
  117. ball.setTableid(taihao);
  118. int a = t.doCloseTable(ball);
  119. Map map = new HashMap();
  120. map.put("fan", a);
  121. return JSON.toJSONString(map);
  122. }
  123. }

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/763740
推荐阅读
相关标签
  

闽ICP备14008679号