基于SSM的點餐系統的設計與實現

末尾獲取源碼
開發語言:Java
Java開發工具:JDK1.8
后端框架:SSM
前端:Vue
數據庫:MySQL5.7和Navicat管理工具結合
服務器:Tomcat8.5
開發軟件:IDEA / Eclipse
是否Maven項目:是


目錄

一、項目簡介

二、系統功能

三、系統項目截圖

個人中心

用戶管理

菜品管理

菜品評價管理

菜品收藏管理

菜品訂單管理

餐桌管理

基礎數據管理

輪播圖管理

四、核心代碼

登錄相關

文件上傳

封裝


一、項目簡介

當下,正處于信息化的時代,許多行業順應時代的變化,結合使用計算機技術向數字化、信息化建設邁進。傳統的點餐信息管理模式,采用人工登記的方式保存相關數據,這種以人力為主的管理模式已然落后。本人結合使用主流的程序開發技術,設計了一款基于vue框架的點餐系統,可以較大地減少人力、財力的損耗,方便相關人員及時更新和保存信息。本系統主要使用B/S開發模式,在idea集成開發環境下,采用Java語言編碼設計系統功能,MySQL數據庫管理相關的系統數據信息,vue框架設計和開發系統功能界面,最后通過使用Tomcat服務器,在瀏覽器中發布設計的系統,并且完成系統與數據庫的交互工作。本文對系統的需求分析、可行性分析、技術支持、功能設計、數據庫設計、功能測試等內容做了較為詳細的介紹,并且在本文中也展示了系統主要的功能模塊設計界面和操作界面,并對其做出了必要的解釋說明,方便用戶對系統進行操作和使用,以及后期的相關人員對系統進行更新和維護。通過設計基于vue框架的點餐系統,可以極大地提高餐館行業的工作效率,提升用戶的使用體驗。


二、系統功能

通過結合系統分析階段的相關內容,對系統的整體功能設計進行規劃。由此可知,本系統的使用者主要可以被分為管理員角色和用戶角色兩類。其中,管理員角色主要的功能需求有用戶信息管理、菜品信息管理、訂單信息管理等模塊,用戶角色主要的功能需求有系統登錄、查詢菜品信息、查詢訂單信息等模塊

?



三、系統項目截圖

個人中心

通過設計的個人中心管理功能模塊,管理用戶可以對相關的個人信息進行管理,比如管理用戶可以更新個人賬號的密碼信息,修改個人賬號的用戶名信息等

?

用戶管理

通過設計的用戶管理功能模塊,管理用戶可以對相關的用戶信息進行管理,比如管理用戶可以查看用戶頭像信息,更新用戶手機號碼,刪除已經注銷的用戶信息記錄等?

?

菜品管理

通過設計的菜品管理功能模塊,管理用戶可以對相關的菜品信息進行管理,比如管理用戶可以添加新菜品信息記錄,更新菜品名稱,刪除失效的菜品信息記錄等

?

菜品評價管理

通過設計的菜品評價管理功能模塊,管理用戶可以對相關的菜品評價信息進行管理,比如管理用戶可以查看詳細的菜品評價信息,刪除失效的菜品評價信息記錄等

?

菜品收藏管理

通過設計的菜品收藏管理功能模塊,管理用戶可以對相關的菜品收藏信息進行管理,比如管理用戶可以查看詳細的菜品收藏信息,刪除失效的菜品收藏信息記錄等

?

菜品訂單管理

通過設計的菜品訂單管理功能模塊,管理用戶可以對相關的菜品訂單信息進行管理,比如管理用戶可以查看詳細的菜品訂單信息,刪除失效的菜品訂單信息記錄等

?

餐桌管理

通過設計的餐桌管理功能模塊,管理用戶可以對相關的餐桌、餐桌占用信息進行管理,比如管理用戶可以查看詳細的餐桌占用信息,刪除失效的餐桌占用信息記錄等

?

基礎數據管理

通過設計的基礎數據管理功能模塊,管理用戶可以對相關的菜品類型、會員等級類型信息進行管理,比如管理用戶可以查看詳細的菜品類型、會員等級類型信息,刪除失效的菜品類型、會員等級類型信息記錄等?

?

輪播圖管理

通過設計的輪播圖管理功能模塊,管理用戶可以對相關的輪播圖信息進行管理,比如管理用戶可以查看菜品的輪播圖名稱,刪除失效的輪播圖信息記錄等?

?


四、核心代碼

登錄相關


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登錄相關*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登錄*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("賬號或密碼不正確");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注冊*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密碼重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("賬號不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密碼已重置為:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 獲取用戶的session用戶信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

文件上傳

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上傳文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上傳文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上傳文件不能為空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下載文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

封裝

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回數據*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知異常,請聯系管理員");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/212038.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/212038.shtml
英文地址,請注明出處:http://en.pswp.cn/news/212038.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

mysql設置為密碼登錄

要設置Ubuntu上的MySQL需要密碼登錄&#xff0c;你可以使用以下步驟&#xff1a; 打開終端。 輸入以下命令登錄到 MySQL 服務器&#xff1a; sudo mysql -u root -p按Enter后&#xff0c;系統會要求輸入密碼。如果是第一次登錄&#xff0c;你可能需要直接按Enter鍵&#xff08…

【已解決】解決UbuntuKali無法進行SSH遠程連接

目錄 Ubuntu20.04配置SSH遠程連接Kali Linux配置SSH遠程連接 Ubuntu20.04配置SSH遠程連接 首先更新安裝包 sudo apt-get update 下載SSH服務 sudo apt install openssh-server 查看SSH服務 service ssh status 打開 /etc/ssh/sshd_config文件修改配置文件 將PermitRootLog…

知識筆記(五十二)———MySQL 刪除數據表

MySQL中刪除數據表是非常容易操作的&#xff0c;但是你在進行刪除表操作時要非常小心&#xff0c;因為執行刪除命令后所有數據都會消失。 語法 以下為刪除 MySQL 數據表的通用語法&#xff1a; DROP TABLE table_name ; -- 直接刪除表&#xff0c;不檢查是否存在 或 DROP…

基于Debain安裝 Docker 和 Docker Compose

一、安裝Docker # 先升級一下系統 (Ubuntu / Debian 系) sudo apt-get update sudo apt-get upgrade# 如果你是 CentOS、紅帽系列則使用&#xff1a; yum update yum upgrade# 安裝 Docker curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh二、Dock…

LeetCode 0070. 爬樓梯:動態規劃(遞推)

【LetMeFly】70.爬樓梯&#xff1a;動態規劃&#xff08;遞推&#xff09; 力扣題目鏈接&#xff1a;https://leetcode.cn/problems/climbing-stairs/ 假設你正在爬樓梯。需要 n 階你才能到達樓頂。 每次你可以爬 1 或 2 個臺階。你有多少種不同的方法可以爬到樓頂呢&#x…

NVIDIA Jetson NX ubuntu20.04刪除多余版本沖突的Boost庫

參考Ubuntu16.04 卸載舊版本Boost庫并安裝新版本 卸載 刪除/usr/local/include/boost文件夾&#xff0c;刪除/usr/local/lib中和boost有關的文件,以及/usr/local/lib/cmake/中boost的cmake文件 cd /usr/local/lib/ ls | grep boost sudo rm -rf /usr/local/include/boost su…

藍橋杯 day01 奇怪的數列 特殊日期

奇怪的數列 題目描述 奇怪的數列 從 X 星截獲一份電碼&#xff0c;是一些數字&#xff0c;如下&#xff1a; 13 1113 3113 132113 1113122113 ?? YY 博士經徹夜研究&#xff0c;發現了規律&#xff1a; 第一行的數字隨便是什么&#xff0c;以后每一行都是對上一行…

redis+springsecurity+mybtais-plus+JWT

redisspringsecuritymybtais-plusJWT 01 引入依賴 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>com.mysql</groupId&g…

12.視圖

目錄 1.視圖的含義與作用 2.視圖的創建與查看 1.創建視圖的語法形式 2、查看視圖&#xff1a; 1.使用DESCRIBE語句查看視圖基本信息 2.使用SHOW TABLE STATUS語查看視圖基本信息查看視圖的信息 3.使用SHOW CREATE VIEW語查看視圖詳細信息 4.在views表中查看視圖詳細信息…

【DP】Yarik and Array—CF1899C

Yarik and Array—CF1899C 一道不難的DP&#xff0c;根據代碼就能看出思路。 C o d e Code Code #include <bits/stdc.h> #define int long long #define sz(a) ((int)a.size()) #define all(a) a.begin(), a.end() using namespace std; using PII pair<int, int&…

codeforces

分析 刪去 k k k 個之后要是回文串&#xff0c;不過題目會給字符串rearrange&#xff0c;所以對于奇數個數的字符最多留一個&#xff0c;偶數的不用管。 Think Twice, Code Once #include<bits/stdc.h> #define il inline #define get getchar #define put putchar #…

SAP-PP:PP模塊新手顧問入門尋找解決方案途徑

在學習PP模塊時我們可以參考一下部分資源: SAP Help SAP Help SAP 幫助門戶是了解任何功能基礎知識的起點。在這里&#xff0c;您將了解每個功能可以做什么&#xff0c;以及如何使用每個功能的一些基本示例 F1 Help 每個事務中的每個字段都有自己的文檔&#xff0c;您可以通過…

案例015:基于微信小程序的校園防疫系統

文末獲取源碼 開發語言&#xff1a;Java 框架&#xff1a;SSM JDK版本&#xff1a;JDK1.8 數據庫&#xff1a;mysql 5.7 開發軟件&#xff1a;eclipse/myeclipse/idea Maven包&#xff1a;Maven3.5.4 小程序框架&#xff1a;uniapp 小程序開發軟件&#xff1a;HBuilder X 小程序…

wangzherongyao milaidi

王者榮耀米萊狄&#xff0c; 1&#xff09;大多數人知道的是這個英雄很能拆塔&#xff0c; 2&#xff09;他也有個致命缺陷&#xff0c;當對面有前排&#xff0c;同樣拆塔的時候&#xff0c;他也清不動線&#xff0c;而且對于前排來說他的爆發力遠沒有安其拉等爆發型順傷秒傷…

論文閱讀_反思模型_Reflexion

英文名稱: Reflexion: Language Agents with Verbal Reinforcement Learning 中文名稱: 反思&#xff1a;具有言語強化學習的語言智能體 文章: http://arxiv.org/abs/2303.11366 代碼: https://github.com/noahshinn/reflexion 作者: Noah Shinn (Northeastern University) 日期…

docker 一鍵尋找容器在服務器存儲位置

docker ps -a找到容器id/容器名稱 docker inspect 容器id/容器名稱 | grep UpperDir找出該容器在物理機的位置 inspect作用:查看docker詳細信息 cd到UpperDir所指向的地址&#xff0c;找到配置文件并修改,到這后,這個位置和你用exec命令進入容器內看到文件是一致的

AtCoder Beginner Contest 328

A - Not Too Hard (atcoder.jp) AC代碼: #include<bits/stdc.h> #define endl \n //#define int long long using namespace std; const int N10; int s[N]; int n,x; void solve() {cin>>n>>x;for(int i1;i<n;i) cin>>s[i];int ans0;for(int i1;…

go-zero 開發之安裝 etcd

本文只涉及 Linux 上的安裝。 二進制安裝 下載二進制安裝包 #ETCD_VERv3.4.28 ETCD_VERv3.5.10 DOWNLOAD_URLhttps://github.com/etcd-io/etcd/releases/download INSTALL_DIR/tmprm -f ${INSTALL_DIR}/etcd-${ETCD_VER}-linux-amd64.tar.gz rm -rf ${INSTALL_DIR}/etcd-dow…

反匯編語言區分函數和運算符

在匯編語言中&#xff0c;函數和運算符可以通過一些特定的指令和約定來區分。 函數&#xff1a; 函數通常由一系列指令組成&#xff0c;用于執行特定的任務或操作。函數通常具有入口點和出口點&#xff0c;分別表示函數的開始和結束位置。函數通常包含參數傳遞、局部變量的分配…

windows錯誤事件 98、41、7000、55、153解決辦法

事件錯誤&#xff1a;98、55、153 疑難解答清單 在系統事件日志中&#xff0c;搜索新技術文件系統 (NTFS) 和磁盤相關的警告和錯誤。 例如&#xff0c;事件 ID 55、153 或 98。 管理員身份打開CMD&#xff0c;運行命令 chkdsk /scan 并檢查結果。 該 chkdsk /scan 命令是只讀…