——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven台球室计费管理系统(java+ssm+jsp+javascript+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 } @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) { 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" ;
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 45 46 47 48 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 { 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) {
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 45 46 47 48 49 50 51 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); } } 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 } package controller;@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 { map.put("result" , "wu" ); return JSON.toJSONString(map); } } @RequestMapping(value = "/zhuServlet", method = RequestMethod.POST)
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 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); } } 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 pageModel pm = new pageModel(); pm.setPageNo((pageNo-1 )*pageSize); pm.setPageSize(pageSize); List list = new ArrayList(); list = turn.chaYingServlet(pm); return JSON.toJSONString(list); } @RequestMapping(value = "/dayangServlet", method = RequestMethod.POST) @ResponseBody public String daYang () throws Exception { Map map = turn.daYang(); String json=JSON.toJSONString(map); return json; } } package controller;@Controller public class water { @Resource private salwaterService sw; @RequestMapping(value = "/jiushuiServlet", method = RequestMethod.POST) public String getMemInfo (@RequestParam int taihao, @RequestParam double zongji,HttpServletRequest req) throws Exception { String man=(String)req.getSession().getAttribute("info" ); if (taihao == 6 ) { turnover t=new turnover(); t.setLaiyuan("外卖" ); t.setMan(man); t.setPrice(zongji);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=222122102205200lr https://javayms.pages.dev?id=222122102205200lr