项目介绍:
本系统采用SSM框架,数据层采用mybatis,数据库使用mysql,适合选题:高校防疫、大学餐厅、餐厅防疫、防疫、疫情等,下面是大概的功能。
项目功能:
用户:登录注册,查看餐桌、菜品、公告、收藏评论菜品,预定餐桌、下单、订单管理、个人中心
管理员:登录、用户管理、餐桌管理、预订管理、菜品类型管理、下单信息管理、订单信息管理、系统管理
系统包含技术:
后端:SSM整合
前端:bootstrap、js、css等
开发工具:eclipse
数据库:mysql 5.7
JDK版本:jdk1.8
服务器:tomcat8
部分截图说明:
下面是前台登录和注册
登陆后可以进入系统首页
用户可以查看餐桌信息
选择某个餐桌可以查看详情,并可以预订
用户也可以点餐,可以收藏,评论
详情部分
用户可以查看个人信息,或者更新信息
后台管理端登录
下面是管理员功能,用户管理
下面是公告管理
餐桌管理
菜品管理
部分代码展示:
菜品相关操作
/** * 后端列表 */ @RequestMapping("/page") public R page(@RequestParam Map<String, Object> params,CaipinleixingEntity caipinleixing, HttpServletRequest request){ EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>(); PageUtils page = caipinleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinleixing), params), params)); request.setAttribute("data", page); return R.ok().put("data", page); } /** * 前端列表 */ @IgnoreAuth @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params,CaipinleixingEntity caipinleixing, HttpServletRequest request){ EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>(); PageUtils page = caipinleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinleixing), params), params)); request.setAttribute("data", page); return R.ok().put("data", page); } /** * 列表 */ @RequestMapping("/lists") public R list( CaipinleixingEntity caipinleixing){ EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>(); ew.allEq(MPUtil.allEQMapPre( caipinleixing, "caipinleixing")); return R.ok().put("data", caipinleixingService.selectListView(ew)); } /** * 查询 */ @RequestMapping("/query") public R query(CaipinleixingEntity caipinleixing){ EntityWrapper< CaipinleixingEntity> ew = new EntityWrapper< CaipinleixingEntity>(); ew.allEq(MPUtil.allEQMapPre( caipinleixing, "caipinleixing")); CaipinleixingView caipinleixingView = caipinleixingService.selectView(ew); return R.ok("查询菜品类型成功").put("data", caipinleixingView); } /** * 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ CaipinleixingEntity caipinleixing = caipinleixingService.selectById(id); return R.ok().put("data", caipinleixing); } /** * 前端详情 */ @IgnoreAuth @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ CaipinleixingEntity caipinleixing = caipinleixingService.selectById(id); return R.ok().put("data", caipinleixing); } /** * 后端保存 */ @RequestMapping("/save") public R save(@RequestBody CaipinleixingEntity caipinleixing, HttpServletRequest request){ caipinleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(caipinleixing); caipinleixingService.insert(caipinleixing); return R.ok(); } /** * 前端保存 */ @RequestMapping("/add") public R add(@RequestBody CaipinleixingEntity caipinleixing, HttpServletRequest request){ caipinleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(caipinleixing); caipinleixingService.insert(caipinleixing); return R.ok(); }
拦截器部分
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //支持跨域请求 response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Credentials", "true"); response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); IgnoreAuth annotation; if (handler instanceof HandlerMethod) { annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); } else { return true; } //从header中获取token String token = request.getHeader(LOGIN_TOKEN_KEY); /** * 不需要验证权限的方法直接放过 */ if(annotation!=null) { return true; } TokenEntity tokenEntity = null; if(StringUtils.isNotBlank(token)) { tokenEntity = tokenService.getTokenEntity(token); } if(tokenEntity != null) { request.getSession().setAttribute("userId", tokenEntity.getUserid()); request.getSession().setAttribute("role", tokenEntity.getRole()); request.getSession().setAttribute("tableName", tokenEntity.getTablename()); request.getSession().setAttribute("username", tokenEntity.getUsername()); return true; } PrintWriter writer = null; response.setCharacterEncoding("UTF-8"); response.setContentType("application/json; charset=utf-8"); try { writer = response.getWriter(); writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); } finally { if(writer != null){ writer.close(); } } // throw new EIException("请先登录", 401); return false; }
以上就是部分功能展示,从整体上来看,本系统功能是十分完整的,界面设计简洁大方,交互友好,数据库设计也很合理,规模适中,代码工整,清晰,适合学习使用。
好了,今天就到这儿吧,小伙伴们点赞、收藏、评论,一键三连走起呀,下期见~~