项目介绍
现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本食品安全追溯系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此食品安全追溯系统利用当下成熟完善的JSP技术,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发。食品安全追溯系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。
4.2 系统功能结构设计
在分析并得出使用者对程序的功能要求时,就可以进行程序设计了。如图4.2展示的就是管理员功能结构图,管理员功能有个人中心,用户管理,公司信息管理,食品材料管理,材料类型管理,加工工艺管理,留言板管理,系统管理。用户可以注册登录,查看各种食品安全追溯过程中展示的加工工艺等记录。
开发环境
编程语言:Java
数据库 :Mysql
系统架构:B/S
后端框架:SSM
编译工具:idea或者eclipse,jdk1.8,maven
支持定做:java/php/python/android/小程序/vue/爬虫/c#/asp.net
系统实现
5.1 管理后台功能介绍
5.1.1 用户信息管理
如图5.1显示的就是用户信息管理页面,此页面提供给管理员的功能有:对用户信息进行添加,修改,查询,删除操作。
图5.1 用户信息管理页面
5.1.2 公司信息管理
如图5.2显示的就是公司信息管理页面,此页面提供给管理员的功能有:对公司信息进行添加,修改,查询,删除操作。
图5.2 公司信息管理页面
5.1.3 材料类型管理
如图5.3显示的就是材料类型管理页面,此页面提供给管理员的功能有:对材料类型信息进行添加,修改,查询,删除操作。
图5.3 材料类型管理页面
5.1.4 加工工艺管理
如图5.4显示的就是加工工艺管理页面,此页面提供给管理员的功能有:对加工工艺信息进行添加,修改,查询,删除操作。
图5.4 加工工艺管理页面
5.1.5 食品材料管理
如图5.5显示的就是食品材料管理页面,此页面提供给管理员的功能有:对食品材料信息进行添加,修改,查询,删除操作。
图5.5 食品材料信息页面
5.2 前台功能介绍
5.2.1 首页
如图5.6显示的就是首页页面,此页面主要提供给用户进行访问,有软件名称和导航栏,点击导航可以跳转到对应的界面。
图5.6 首页页面
5.2.2 加工工艺
如图5.7显示的就是加工工艺页面,此页面主要展示工艺名称,工艺流程,工艺详情,用户不仅可以查看,还可以收藏和评论,并且可以赞和踩,表达自己的观点。
图5.7 加工工艺页面
5.2.3 个人中心
如图5.8显示的就是个人中心页面,此页面提供给用户的功能有:用户只有注册登录后,才可以点击个人中心进行下面的界面,在个人中心可以对个人信息进行修改,也可以查看自己的收藏,点击我的收藏就可以跳转到自己的所有收藏信息。
图5.8 个人中心页面
核心代码
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.JiagonggongyiEntity;
import com.entity.view.JiagonggongyiView;
import com.service.JiagonggongyiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 加工工艺
* 后端接口
* @author
* @email
* @date
*/
@RestController
@RequestMapping("/jiagonggongyi")
public class JiagonggongyiController {
@Autowired
private JiagonggongyiService jiagonggongyiService;
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiagonggongyiEntity jiagonggongyi,
HttpServletRequest request){
EntityWrapper<JiagonggongyiEntity> ew = new EntityWrapper<JiagonggongyiEntity>();
PageUtils page = jiagonggongyiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiagonggongyi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("st")
public R list(@RequestParam Map<String, Object> params,JiagonggongyiEntity jiagonggongyi,
HttpServletRequest request){
EntityWrapper<JiagonggongyiEntity> ew = new EntityWrapper<JiagonggongyiEntity>();
PageUtils page = jiagonggongyiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiagonggongyi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("sts")
public R list( JiagonggongyiEntity jiagonggongyi){
EntityWrapper<JiagonggongyiEntity> ew = new EntityWrapper<JiagonggongyiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiagonggongyi, "jiagonggongyi"));
return R.ok().put("data", jiagonggongyiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiagonggongyiEntity jiagonggongyi){
EntityWrapper< JiagonggongyiEntity> ew = new EntityWrapper< JiagonggongyiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiagonggongyi, "jiagonggongyi"));
JiagonggongyiView jiagonggongyiView = jiagonggongyiService.selectView(ew);
return R.ok("查询加工工艺成功").put("data", jiagonggongyiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiagonggongyiEntity jiagonggongyi = jiagonggongyiService.selectById(id);
jiagonggongyi.setClicknum(jiagonggongyi.getClicknum()+1);
jiagonggongyi.setClicktime(new Date());
jiagonggongyiService.updateById(jiagonggongyi);
return R.ok().put("data", jiagonggongyi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiagonggongyiEntity jiagonggongyi = jiagonggongyiService.selectById(id);
jiagonggongyi.setClicknum(jiagonggongyi.getClicknum()+1);
jiagonggongyi.setClicktime(new Date());
jiagonggongyiService.updateById(jiagonggongyi);
return R.ok().put("data", jiagonggongyi);
}
/**
* 赞或踩
*/
@RequestMapping("/thumbsup/{id}")
public R vote(@PathVariable("id") String id,String type){
JiagonggongyiEntity jiagonggongyi = jiagonggongyiService.selectById(id);
if(type.equals("1")) {
jiagonggongyi.setThumbsupnum(jiagonggongyi.getThumbsupnum()+1);
} else {
jiagonggongyi.setCrazilynum(jiagonggongyi.getCrazilynum()+1);
}
jiagonggongyiService.updateById(jiagonggongyi);
return R.ok("投票成功");
}
/**
* 后端保存
*/
@RequestMapping("ve")
public R save(@RequestBody JiagonggongyiEntity jiagonggongyi, HttpServletRequest request){
jiagonggongyi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiagonggongyi);
jiagonggongyiService.insert(jiagonggongyi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiagonggongyiEntity jiagonggongyi, HttpServletRequest request){
jiagonggongyi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiagonggongyi);
jiagonggongyiService.insert(jiagonggongyi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiagonggongyiEntity jiagonggongyi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiagonggongyi);
jiagonggongyiService.updateById(jiagonggongyi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiagonggongyiService.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<JiagonggongyiEntity> wrapper = new EntityWrapper<JiagonggongyiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = jiagonggongyiService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,JiagonggongyiEntity jiagonggongyi, HttpServletRequest request,String pre){
EntityWrapper<JiagonggongyiEntity> ew = new EntityWrapper<JiagonggongyiEntity>();
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 = jiagonggongyiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiagonggongyi), params), params));
return R.ok().put("data", page);
}
}
论文参考
目 录
目 录 III
1 绪论 1
1.1 研究背景 1
1.2 目的和意义 1
1.3 论文结构安排 2
2 相关技术 3
2.1 JSP技术介绍 3
2.2 B/S结构介绍 5
2.3 Mysql数据库介绍 5
2.4 SSM框架 6
3 系统分析 7
3.1 系统可行性分析 7
3.1.1 技术可行性分析 7
3.1.2 经济可行性分析 7
3.1.3 运行可行性分析 7
3.2 系统性能分析 8
3.2.1 易用性指标 8
3.2.2 可扩展性指标 8
3.2.3 健壮性指标 8
3.2.4 安全性指标 9
3.3 系统流程分析 9
3.3.1 操作流程分析 9
3.3.2 登录流程分析 10
3.3.3 信息添加流程分析 11
3.3.4 信息删除流程分析 12
4 系统设计 13
4.1 系统概要设计 13
4.2 系统功能结构设计 13
4.3 数据库设计 14
4.3.1 数据库E-R图设计 14
4.3.2 数据库表结构设计 16
5 系统实现 20
5.1 管理后台功能介绍 20
5.1.1 用户信息管理 20
5.1.2 公司信息管理 21
5.1.3 材料类型管理 21
5.1.4 加工工艺管理 22
5.1.5 食品材料管理 23
5.2 前台功能介绍 23
5.2.1 首页 23
5.2.2 加工工艺 24
5.2.3 个人中心 25
6 系统测试 26
6.1 系统测试的特点 26
6.2 测试结果分析 26
结 论 28
致 谢 29
参考文献 30