大家好!我是职场程序猿,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发运行环境
- 框架:ssm
- JDK版本:JDK1.8
- 服务器:tomcat7
- 数据库:mysql 5.7
- 数据库工具:Navicat12
- 开发软件:eclipse/myeclipse/idea
- Maven包:Maven3.3.9
- 浏览器:谷歌浏览器
论文目录
❤️【如需源码或全文请按文末获取联系】
一、项目简介
家庭食谱管理系统的主要使用者分为管理员和用户,实现功能包括管理员:首页、个人中心、用户管理、食谱分类管理、食谱信息管理、一周食谱健康安排管理、材料信息管理、美食论坛、系统管理,用户:首页、个人中心、我的收藏管理、美食论坛,前台首页;首页、食谱信息、一周食谱健康安排、材料信息、美食论坛、公告信息、个人中心、后台管理等功能。
二、系统设计
2.1软件功能模块设计
本家庭食谱管理系统结构图如图4-2所示。
2.2数据库设计
1、用户管理实体图如图4-5所示:
2、食谱信息管理实体图如图4-6所示:
3、一周食谱健康安排管理实体图如图4-7所示:
三、系统项目部分截图
3.1前台首页功能模块
家庭食谱管理系统 ,在前台首页可以查看首页、食谱信息、一周食谱健康安排、材料信息、美食论坛、公告信息、个人中心、后台管理等内容,如图5-1所示。
登录,在用户页面可以填写用户名、密码、信息进行登录,如图5-2所示。
食谱信息,在食谱信息页面通过填写食谱名称、图片、食谱分类、烹饪方式、做法、功效、时长、原材料、搭配禁忌、点击次数等信息进行添加我的收藏。如图5-3所示。在材料信息页面通过填写食物功效、食物搭配、食物禁忌等信息进行操作,如图5-4所示。
3.2管理员功能模块
管理员登录,通过填写注册时输入的用户名、密码、角色进行登录,如图5-5所示。
管理员登录进入家庭食谱管理系统可以查看首页、个人中心、用户管理、食谱分类管理、食谱信息管理、一周食谱健康安排管理、材料信息管理、美食论坛、系统管理等信息。
用户管理,在用户管理页面中可以通过填写用户名、密码、用户姓名、头像、性别、手机号码、邮箱等内容进行修改、删除,如图5-6所示。还可以根据需要对食谱分类管理进行详情,修改或删除等详细操作,如图5-7所示。
一周食谱健康安排管理,在一周食谱健康安排管理页面中可以填写标题名称、图片、星期一、星期二、星期三、星期四、星期五、星期六、星期天等信息,并可根据需要对已有一周食谱健康安排管理进行修改或删除等操作,如图5-8所示。
3.3用户功能模块
用户登录进入家庭食谱管理系统可以查看首页、个人中心、我的收藏管理、美食论坛等内容。我的收藏管理,在我的收藏管理页面中通过填写收藏名称、收藏图片等信息,还可以根据需要对我的收藏管理进行修改、删除如图5-12所示。
四、部分核心代码
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.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.ShipuxinxiEntity;
import com.entity.view.ShipuxinxiView;
import com.service.ShipuxinxiService;
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-02 11:34:49
*/
@RestController
@RequestMapping("/shipuxinxi")
public class ShipuxinxiController {
@Autowired
private ShipuxinxiService shipuxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ShipuxinxiEntity shipuxinxi, HttpServletRequest request){
EntityWrapper<ShipuxinxiEntity> ew = new EntityWrapper<ShipuxinxiEntity>();
PageUtils page = shipuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shipuxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ShipuxinxiEntity shipuxinxi, HttpServletRequest request){
EntityWrapper<ShipuxinxiEntity> ew = new EntityWrapper<ShipuxinxiEntity>();
PageUtils page = shipuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shipuxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ShipuxinxiEntity shipuxinxi){
EntityWrapper<ShipuxinxiEntity> ew = new EntityWrapper<ShipuxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( shipuxinxi, "shipuxinxi"));
return R.ok().put("data", shipuxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ShipuxinxiEntity shipuxinxi){
EntityWrapper< ShipuxinxiEntity> ew = new EntityWrapper< ShipuxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( shipuxinxi, "shipuxinxi"));
ShipuxinxiView shipuxinxiView = shipuxinxiService.selectView(ew);
return R.ok("查询食谱信息成功").put("data", shipuxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ShipuxinxiEntity shipuxinxi = shipuxinxiService.selectById(id);
shipuxinxi.setClicknum(shipuxinxi.getClicknum()+1);
shipuxinxi.setClicktime(new Date());
shipuxinxiService.updateById(shipuxinxi);
return R.ok().put("data", shipuxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ShipuxinxiEntity shipuxinxi = shipuxinxiService.selectById(id);
shipuxinxi.setClicknum(shipuxinxi.getClicknum()+1);
shipuxinxi.setClicktime(new Date());
shipuxinxiService.updateById(shipuxinxi);
return R.ok().put("data", shipuxinxi);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R thumbsup(@PathVariable("id") String id,String type){
ShipuxinxiEntity shipuxinxi = shipuxinxiService.selectById(id);
if(type.equals("1")) {
shipuxinxi.setThumbsupnum(shipuxinxi.getThumbsupnum()+1);
} else {
shipuxinxi.setCrazilynum(shipuxinxi.getCrazilynum()+1);
}
shipuxinxiService.updateById(shipuxinxi);
return R.ok();
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShipuxinxiEntity shipuxinxi, HttpServletRequest request){
shipuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shipuxinxi);
shipuxinxiService.insert(shipuxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShipuxinxiEntity shipuxinxi, HttpServletRequest request){
shipuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shipuxinxi);
shipuxinxiService.insert(shipuxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShipuxinxiEntity shipuxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(shipuxinxi);
shipuxinxiService.updateById(shipuxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shipuxinxiService.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<String, Object> 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<ShipuxinxiEntity> wrapper = new EntityWrapper<ShipuxinxiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = shipuxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,ShipuxinxiEntity shipuxinxi, HttpServletRequest request,String pre){
EntityWrapper<ShipuxinxiEntity> ew = new EntityWrapper<ShipuxinxiEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = shipuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shipuxinxi), params), params));
return R.ok().put("data", page);
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,可以下方微信联系我。