🍅 作者主页:Selina .a
🍅 简介:Java领域优质创作者🏆、专注于Java技术领域和学生毕业项目实战,高校老师/讲师/同行交流合作。
主要内容:SpringBoot、Vue、SSM、HLMT、Jsp、PHP、Nodejs、Python、爬虫、数据可视化、小程序、安卓app、大数据、物联网、机器学习等设计与开发。
🍅文末获取源码联系🍅
目录
课题的提出
如今社会上各行各业,都喜欢用自己行业的专属软件工作,互联网发展到这个时候,人们已经发现离不开了互联网。新技术的产生,往往能解决一些老技术的弊端问题。因为传统私房菜定制上门服务系统信息管理难度大,容错率低,管理人员处理数据费工费时,所以专门为解决这个难题开发了一个私房菜定制上门服务系统管理系统,可以解决许多问题。
私房菜定制上门服务系统管理系统按照操作主体分为管理员和用户。管理员的功能包括管理员工,管理私房菜定制上门服务系统信息,包括菜品管理,厨师管理,公告管理。用户的功能包括管理菜品信息,厨师信息,等。该系统采用了Mysql数据库,Java语言,Spring Boot框架等技术进行编程实现。
私房菜定制上门服务系统管理系统可以提高私房菜定制上门服务系统信息管理问题的解决效率,优化私房菜定制上门服务系统信息处理流程,保证私房菜定制上门服务系统信息数据的安全,它是一个非常可靠,非常安全的应用程序。
数据库设计
私房菜定制上门服务系统管理系统运行中产生的数据需要按照提前设置的存储规则进行保存,设计出一个符合项目的最优数据存储格式,因为它能减少用户的等待时间,还可以对系统的请求在最短时间内进行响应。所以,对数据库设计时,需要对功能需求进行详细的拆分,以及对业务状态的细分,然后设计具体的存储规则,保证数据库能正常运作,缩短数据处理时间,并在一定程度上降低数据冗余,节省存储空间。
本小节主要任务即是根据上述内容进行数据存储结构的设计,实体的属性就用来表示字段名称,不同的字段表示的数据类型以及取值都不相同,以及该表各个字段是否能够保持空等进行说明,设计完成一张数据表的结构之后,在保存时同样要命名,尽量选择英文名称进行命名并保存,还不容易导致系统出错。接下来就对设计的表进行简单说明。
序号 | 列名 | 数据类型 | 说明 | 允许空 |
1 | Id | Int | id | 否 |
2 | chushi_id | Integer | 厨师信息 | 是 |
3 | caipin_name | String | 菜品名称 | 是 |
4 | caipin_uuid_number | String | 菜品编号 | 是 |
5 | caipin_photo | String | 菜品照片 | 是 |
6 | caipin_types | Integer | 菜品类型 | 是 |
7 | caipin_kouwe_types | Integer | 菜品口味 | 是 |
8 | caipin_content | String | 菜品介绍 | 是 |
9 | caipin_delete | Integer | 逻辑删除 | 是 |
10 | insert_time | Date | 录入时间 | 是 |
11 | create_time | Date | 创建时间 | 是 |
序号 | 列名 | 数据类型 | 说明 | 允许空 |
1 | Id | Int | id | 否 |
2 | chushi_uuid_number | String | 厨师信息编号 | 是 |
3 | chushi_name | String | 厨师姓名 | 是 |
4 | chushi_phone | String | 厨师手机号 | 是 |
5 | chushi_id_number | String | 厨师身份证号 | 是 |
6 | chushi_photo | String | 厨师头像 | 是 |
7 | chushi_email | String | 电子邮箱 | 是 |
8 | chushi_file | String | 健康认证 | 是 |
9 | chushi_video | String | 厨艺视频 | 是 |
10 | chushi_content | String | 厨师信息介绍 | 是 |
11 | chushi_delete | Integer | 逻辑删除 | 是 |
12 | insert_time | Date | 录入时间 | 是 |
13 | create_time | Date | 创建时间 | 是 |
系统功能设计
图5.1 即为编码实现的菜品管理界面,管理员在菜品管理界面中可以对界面中显示的所有数据进行导出,可以对菜品信息的菜品状态进行查看,可以添加新的菜品信息等。
图5.2 即为编码实现的公告管理界面,管理员在公告管理界面中查看奖罚种类信息,奖罚描述信息,可以导出公告信息,新增公告信息等。
图5.3 即为编码实现的厨师管理界面,管理员在厨师管理界面中新增厨师,并设置厨师的角色,可以删除厨师。
图5.5 即为编码实现的菜品界面,用户在菜品界面中。
图5.6 即为编码实现的厨师管理界面。
图5.7 即为编码实现的公告管理界面。
关键代码
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.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
* 登录相关
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private 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);
UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
专栏推荐
Spring Boot+Vue+CSS+JavaScript+HTML等技术项目专栏推荐
推荐项目
基于Node.js+Vue+MySQL的小型企业工资管理系统
基于Spring Boot+Android+MySQL的记录生活管理系统
源码获取
大家点赞、收藏、关注、评论啦 、查看👇🏻获取联系方式👇🏻