开发工具:IDEA
服务器:Tomcat9.0, jdk1.8
项目构建:maven
数据库:mysql5.7
系统分前后台,非前后端分离
前端技术:vue.js+elementUI等框架实现
服务端技术:springboot+mybatis-plus
项目功能描述:
用户前台:登录、注册、个人中心、消息留言管理、我的收藏管理、订单管理、菜品信息、菜品资讯
管理员后台:登录、个人中心、用户管理、食堂管理、食堂菜单管理、菜系分类管理、消息留言管理、留言板管理、系统管理、订单管理等功能
目 录
1 概述
1.1课题背景及意义
1.2 国内外研究现状
1.3 本课题主要工作
2 系统开发环境
2.1 java简介
2.2 Mysql数据库
2.3 B/S结构
2.4 JSP技术介绍
3 系统分析
3.1 可行性分析
3.1.1 技术可行性
3.1.2操作可行性
3.1.3 经济可行性
3.1.4 法律可行性
3.2系统流程分析
3.2.1系统开发流程
3.2.2 用户登录流程
3.2.3 系统操作流程
3.2.4 添加信息流程
3.2.5 修改信息流程
3.2.6 删除信息流程
3.3系统用例分析
3.3.1管理员用例图
3.3.2用户用例图
4 系统设计
4.1 系统概述
4.2 系统结构设计
4.3数据库设计
4.3.1 数据库设计原则
4.3.2 数据库实体
4.3.3 数据库表设计
5统详细设计
5.1前台首页功能模块
5.2管理员功能模块
5.3食堂功能模块
5.4用户功能模块
6系统测试
6.1系统测试的意义
6.2 测试方法
6.3测试分析
结 论
致 谢
参考文献
前台截图:
后台截图:
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.CaipinfenleiEntity;
import com.entity.view.CaipinfenleiView;
import com.service.CaipinfenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 菜品分类
* 后端接口
* @author
* @email
* @date 2021-03-20 21:35:40
*/
@RestController
@RequestMapping("/caipinfenlei")
public class CaipinfenleiController {
@Autowired
private CaipinfenleiService caipinfenleiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,CaipinfenleiEntity caipinfenlei,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map params,CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = caipinfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( CaipinfenleiEntity caipinfenlei){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei"));
return R.ok().put("data", caipinfenleiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(CaipinfenleiEntity caipinfenlei){
EntityWrapper< CaipinfenleiEntity> ew = new EntityWrapper< CaipinfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( caipinfenlei, "caipinfenlei"));
CaipinfenleiView caipinfenleiView = caipinfenleiService.selectView(ew);
return R.ok("查询菜品分类成功").put("data", caipinfenleiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
return R.ok().put("data", caipinfenlei);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
CaipinfenleiEntity caipinfenlei = caipinfenleiService.selectById(id);
return R.ok().put("data", caipinfenlei);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caipinfenlei);
caipinfenleiService.insert(caipinfenlei);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
caipinfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(caipinfenlei);
caipinfenleiService.insert(caipinfenlei);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody CaipinfenleiEntity caipinfenlei, HttpServletRequest request){
//ValidatorUtils.validateEntity(caipinfenlei);
caipinfenleiService.updateById(caipinfenlei);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
caipinfenleiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = caipinfenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
package com.controller; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Map; import java.util.HashMap; import java.util.Iterator; import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletRequest; import com.utils.ValidatorUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; 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 com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.annotation.IgnoreAuth; import com.entity.CaipinpingjiaEntity; import com.entity.view.CaipinpingjiaView; import com.service.CaipinpingjiaService; import com.service.TokenService; import com.utils.PageUtils; import com.utils.R; import com.utils.MD5Util; import com.utils.MPUtil; import com.utils.CommonUtil; /** * 菜品评价 * 后端接口 * @author * @email * @date 2021-03-20 21:35:40 */ @RestController @RequestMapping("/caipinpingjia") public class CaipinpingjiaController { @Autowired private CaipinpingjiaService caipinpingjiaService; /** * 后端列表 */ @RequestMapping("/page") public R page(@RequestParam Mapparams,CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){ String tableName = request.getSession().getAttribute("tableName").toString(); if(tableName.equals("yonghu")) { caipinpingjia.setYonghuming((String)request.getSession().getAttribute("username")); } EntityWrapper ew = new EntityWrapper (); PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params)); return R.ok().put("data", page); } /** * 前端列表 */ @RequestMapping("/list") public R list(@RequestParam Map params,CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){ EntityWrapper ew = new EntityWrapper (); PageUtils page = caipinpingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, caipinpingjia), params), params)); return R.ok().put("data", page); } /** * 列表 */ @RequestMapping("/lists") public R list( CaipinpingjiaEntity caipinpingjia){ EntityWrapper ew = new EntityWrapper (); ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia")); return R.ok().put("data", caipinpingjiaService.selectListView(ew)); } /** * 查询 */ @RequestMapping("/query") public R query(CaipinpingjiaEntity caipinpingjia){ EntityWrapper< CaipinpingjiaEntity> ew = new EntityWrapper< CaipinpingjiaEntity>(); ew.allEq(MPUtil.allEQMapPre( caipinpingjia, "caipinpingjia")); CaipinpingjiaView caipinpingjiaView = caipinpingjiaService.selectView(ew); return R.ok("查询菜品评价成功").put("data", caipinpingjiaView); } /** * 后端详情 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id); return R.ok().put("data", caipinpingjia); } /** * 前端详情 */ @RequestMapping("/detail/{id}") public R detail(@PathVariable("id") Long id){ CaipinpingjiaEntity caipinpingjia = caipinpingjiaService.selectById(id); return R.ok().put("data", caipinpingjia); } /** * 后端保存 */ @RequestMapping("/save") public R save(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){ caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(caipinpingjia); caipinpingjiaService.insert(caipinpingjia); return R.ok(); } /** * 前端保存 */ @RequestMapping("/add") public R add(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){ caipinpingjia.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); //ValidatorUtils.validateEntity(caipinpingjia); caipinpingjiaService.insert(caipinpingjia); return R.ok(); } /** * 修改 */ @RequestMapping("/update") public R update(@RequestBody CaipinpingjiaEntity caipinpingjia, HttpServletRequest request){ //ValidatorUtils.validateEntity(caipinpingjia); caipinpingjiaService.updateById(caipinpingjia);//全部更新 return R.ok(); } /** * 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ caipinpingjiaService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } /** * 提醒接口 */ @RequestMapping("/remind/{columnName}/{type}") public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map map) { map.put("column", columnName); map.put("type", type); if(type.equals("2")) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar c = Calendar.getInstance(); Date remindStartDate = null; Date remindEndDate = null; if(map.get("remindstart")!=null) { Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart); remindStartDate = c.getTime(); map.put("remindstart", sdf.format(remindStartDate)); } if(map.get("remindend")!=null) { Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindEnd); remindEndDate = c.getTime(); map.put("remindend", sdf.format(remindEndDate)); } } Wrapper wrapper = new EntityWrapper (); if(map.get("remindstart")!=null) { wrapper.ge(columnName, map.get("remindstart")); } if(map.get("remindend")!=null) { wrapper.le(columnName, map.get("remindend")); } String tableName = request.getSession().getAttribute("tableName").toString(); if(tableName.equals("yonghu")) { wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username")); } int count = caipinpingjiaService.selectCount(wrapper); return R.ok().put("count", count); } }