——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven网吧计费管理系统(java+ssm+js+jsp+mysql)
项目介绍
管理员角色包含以下功能: 登录与注册,会员管理,会员充值,烟饮料外卖,营业额信息统计,今日营业信息查看等功能。
环境需要
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.数据库:MySql 5.7版本;
技术栈
后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 @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);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 @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 ]);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 @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); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 @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 ; } } package controller;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 } return null ; } @RequestMapping(value = "/tuichuServlet", method = RequestMethod.GET) public String tuichu (HttpServletRequest req) throws Exception { req.getSession().removeAttribute("info" ); return "index" ; } } package controller;@Controller public class turnover { @Resource private turnoverService turn; @RequestMapping(value = "/getTPageCount", method = RequestMethod.POST) @ResponseBody public String getPageCount (@RequestParam int pageSize) throws Exception { Map map = new HashMap(); map.put("count" , turn.getPageCount()); return JSON.toJSONString(map); }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=031122542008200rt https://javayms.pages.dev?id=031122542008200rt