• 基于SSM的高校餐厅防疫管理系统


    博主主页猫头鹰源码

    博主简介:Java领域优质创作者、CSDN博客专家、公司架构师、全网粉丝5万+、专注Java技术领域和毕业设计项目实战

    主要内容:毕业设计(Javaweb项目|小程序等)、简历模板、学习资料、面试题库、技术咨询

    文末联系获取

    项目介绍:

    本系统采用SSM框架,数据层采用mybatis,数据库使用mysql,适合选题:高校防疫、大学餐厅、餐厅防疫、防疫、疫情等,下面是大概的功能。

    项目功能:

    用户:登录注册,查看餐桌、菜品、公告、收藏评论菜品,预定餐桌、下单、订单管理、个人中心
    管理员:登录、用户管理、餐桌管理、预订管理、菜品类型管理、下单信息管理、订单信息管理、系统管理

    系统包含技术:

    后端:SSM整合
    前端:bootstrap、js、css等
    开发工具:eclipse
    数据库:mysql 5.7
    JDK版本:jdk1.8
    服务器:tomcat8

    部分截图说明:

    下面是前台登录和注册

    登陆后可以进入系统首页

     

     用户可以查看餐桌信息

    选择某个餐桌可以查看详情,并可以预订

     

     用户也可以点餐,可以收藏,评论

    详情部分

     用户可以查看个人信息,或者更新信息

    后台管理端登录

     下面是管理员功能,用户管理

     下面是公告管理

    餐桌管理

     

    菜品管理

     

    部分代码展示: 

    菜品相关操作

    1. /**
    2. * 后端列表
    3. */
    4. @RequestMapping("/page")
    5. public R page(@RequestParam Map<String, Object> params,CaipinleixingEntity caipinleixing,
    6. HttpServletRequest request){
    7. EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>();
    8. PageUtils page = caipinleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinleixing), params), params));
    9. request.setAttribute("data", page);
    10. return R.ok().put("data", page);
    11. }
    12. /**
    13. * 前端列表
    14. */
    15. @IgnoreAuth
    16. @RequestMapping("/list")
    17. public R list(@RequestParam Map<String, Object> params,CaipinleixingEntity caipinleixing,
    18. HttpServletRequest request){
    19. EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>();
    20. PageUtils page = caipinleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinleixing), params), params));
    21. request.setAttribute("data", page);
    22. return R.ok().put("data", page);
    23. }
    24. /**
    25. * 列表
    26. */
    27. @RequestMapping("/lists")
    28. public R list( CaipinleixingEntity caipinleixing){
    29. EntityWrapper<CaipinleixingEntity> ew = new EntityWrapper<CaipinleixingEntity>();
    30. ew.allEq(MPUtil.allEQMapPre( caipinleixing, "caipinleixing"));
    31. return R.ok().put("data", caipinleixingService.selectListView(ew));
    32. }
    33. /**
    34. * 查询
    35. */
    36. @RequestMapping("/query")
    37. public R query(CaipinleixingEntity caipinleixing){
    38. EntityWrapper< CaipinleixingEntity> ew = new EntityWrapper< CaipinleixingEntity>();
    39. ew.allEq(MPUtil.allEQMapPre( caipinleixing, "caipinleixing"));
    40. CaipinleixingView caipinleixingView = caipinleixingService.selectView(ew);
    41. return R.ok("查询菜品类型成功").put("data", caipinleixingView);
    42. }
    43. /**
    44. * 后端详情
    45. */
    46. @RequestMapping("/info/{id}")
    47. public R info(@PathVariable("id") Long id){
    48. CaipinleixingEntity caipinleixing = caipinleixingService.selectById(id);
    49. return R.ok().put("data", caipinleixing);
    50. }
    51. /**
    52. * 前端详情
    53. */
    54. @IgnoreAuth
    55. @RequestMapping("/detail/{id}")
    56. public R detail(@PathVariable("id") Long id){
    57. CaipinleixingEntity caipinleixing = caipinleixingService.selectById(id);
    58. return R.ok().put("data", caipinleixing);
    59. }
    60. /**
    61. * 后端保存
    62. */
    63. @RequestMapping("/save")
    64. public R save(@RequestBody CaipinleixingEntity caipinleixing, HttpServletRequest request){
    65. caipinleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    66. //ValidatorUtils.validateEntity(caipinleixing);
    67. caipinleixingService.insert(caipinleixing);
    68. return R.ok();
    69. }
    70. /**
    71. * 前端保存
    72. */
    73. @RequestMapping("/add")
    74. public R add(@RequestBody CaipinleixingEntity caipinleixing, HttpServletRequest request){
    75. caipinleixing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    76. //ValidatorUtils.validateEntity(caipinleixing);
    77. caipinleixingService.insert(caipinleixing);
    78. return R.ok();
    79. }

    拦截器部分

    1. @Override
    2. public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    3. //支持跨域请求
    4. response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
    5. response.setHeader("Access-Control-Max-Age", "3600");
    6. response.setHeader("Access-Control-Allow-Credentials", "true");
    7. response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
    8. response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
    9. IgnoreAuth annotation;
    10. if (handler instanceof HandlerMethod) {
    11. annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
    12. } else {
    13. return true;
    14. }
    15. //从header中获取token
    16. String token = request.getHeader(LOGIN_TOKEN_KEY);
    17. /**
    18. * 不需要验证权限的方法直接放过
    19. */
    20. if(annotation!=null) {
    21. return true;
    22. }
    23. TokenEntity tokenEntity = null;
    24. if(StringUtils.isNotBlank(token)) {
    25. tokenEntity = tokenService.getTokenEntity(token);
    26. }
    27. if(tokenEntity != null) {
    28. request.getSession().setAttribute("userId", tokenEntity.getUserid());
    29. request.getSession().setAttribute("role", tokenEntity.getRole());
    30. request.getSession().setAttribute("tableName", tokenEntity.getTablename());
    31. request.getSession().setAttribute("username", tokenEntity.getUsername());
    32. return true;
    33. }
    34. PrintWriter writer = null;
    35. response.setCharacterEncoding("UTF-8");
    36. response.setContentType("application/json; charset=utf-8");
    37. try {
    38. writer = response.getWriter();
    39. writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
    40. } finally {
    41. if(writer != null){
    42. writer.close();
    43. }
    44. }
    45. // throw new EIException("请先登录", 401);
    46. return false;
    47. }

    以上就是部分功能展示,从整体上来看,本系统功能是十分完整的,界面设计简洁大方,交互友好,数据库设计也很合理,规模适中,代码工整,清晰,适合学习使用。

    好了,今天就到这儿吧,小伙伴们点赞、收藏、评论,一键三连走起呀,下期见~~

  • 相关阅读:
    第11章Linux实操篇-Linux磁盘分区、挂载
    Open3D官方文档学习笔记
    运动耳机推荐:哪些蓝牙耳机最适合运动?
    【C++】继承 ⑪ ( 多继承 | 多继承语法 | 多继承案例 )
    【C++11】lambda匿名函数和包装器
    JMeter--逻辑控制器--IF 控制器
    【sklearn】fit()、transform()和fit_transform()的区别
    LVS-DR模式
    Python判断对象是否包含对应的属性hasattr()
    opencv中边缘检测的方法
  • 原文地址:https://blog.csdn.net/mtyedu/article/details/126611953