一、源码特点
ssm 网上订餐管理系统是一套完善的信息系统,结合springMVC框架完成本系统,对理解JSP java编程开发语言有帮助系统采用SSM框架(MVC模式开发),系统具有完整的源代码和数据库,系统主要采用B/S模式开发。系统采用线性算法预算交易订单量
前段主要技术 html.css jquery
后端主要技术 SSM
数据库 mysql
开发工具 eclipse JDK1.8 TOMCAT 8.5
ssm 网上订餐系统1
二、功能介绍
前台功能:
系统首页浏览
公告浏览
菜品浏览、加入购物车,提交订单,查看订单
菜品评论、查看评论信息
用户注册、登录
后台功能:
(1)用户管理:对用户信息进行添加、删除、修改和查看
(2)菜品分类管理:对菜品分类信息进行添加、删除、修改和查看
(3)菜品管理:对菜品信息进行添加、删除、修改和查看
(4)菜品评论管理:对菜品评论信息进行添加、删除、修改和查看
(5)订单管理:对订单信息进行添加、删除、修改和查看
(6)个人信息修改
(7)公告管理:对公告信息进行添加、删除、修改和查看
(8)订单量管理:对订单量信息进行添加、删除、修改和查看 采用线性算法预测未来订单量\\
数据库设计
CREATE TABLE `yonghu` (
`yhid` int(11) NOT NULL auto_increment,
`yhm` VARCHAR(40) default NULL COMMENT '用户名',
`mm` VARCHAR(40) default NULL COMMENT '密码',
`xm` VARCHAR(40) default NULL COMMENT '姓名',
`qx` VARCHAR(40) default NULL COMMENT '权限',
`lxdh` VARCHAR(40) default NULL COMMENT '联系电话',
`lxdz` VARCHAR(40) default NULL COMMENT '联系地址',
`yx` VARCHAR(40) default NULL COMMENT '邮箱',
`xb` VARCHAR(40) default NULL COMMENT '性别', PRIMARY KEY (`yhid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `cpfl` (
`cpflid` int(11) NOT NULL auto_increment,
`fl` VARCHAR(40) default NULL COMMENT '分类', PRIMARY KEY (`cpflid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `caipin` (
`cpid` int(11) NOT NULL auto_increment,
`cpmc` VARCHAR(40) default NULL COMMENT '菜品名称',
`fl` VARCHAR(40) default NULL COMMENT '分类',
`js` VARCHAR(40) default NULL COMMENT '介绍',
`tp` VARCHAR(40) default NULL COMMENT '图片',
`ts` VARCHAR(40) default NULL COMMENT '特色',
`dj` VARCHAR(40) default NULL COMMENT '单价',
`pz` VARCHAR(40) default NULL COMMENT '品质',
`mj` VARCHAR(40) default NULL COMMENT '卖家', PRIMARY KEY (`cpid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `cppl` (
`cpplid` int(11) NOT NULL auto_increment,
`cp` VARCHAR(40) default NULL COMMENT '菜品',
`pl` VARCHAR(40) default NULL COMMENT '评论',
`yh` VARCHAR(40) default NULL COMMENT '用户',
`sj` VARCHAR(40) default NULL COMMENT '时间', PRIMARY KEY (`cpplid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `dingdan` (
`ddid` int(11) NOT NULL auto_increment,
`ddmc` VARCHAR(40) default NULL COMMENT '订单名称',
`xdsj` VARCHAR(40) default NULL COMMENT '下单时间',
`yh` VARCHAR(40) default NULL COMMENT '用户',
`zj` VARCHAR(40) default NULL COMMENT '总价',
`shr` VARCHAR(40) default NULL COMMENT '收货人',
`lxdh` VARCHAR(40) default NULL COMMENT '联系电话',
`shdz` VARCHAR(40) default NULL COMMENT '收货地址',
`zt` VARCHAR(40) default NULL COMMENT '状态',
`mj` VARCHAR(40) default NULL COMMENT '卖家', PRIMARY KEY (`ddid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `ddmx` (
`ddmxid` int(11) NOT NULL auto_increment,
`dd` VARCHAR(40) default NULL COMMENT '订单',
`cp` VARCHAR(40) default NULL COMMENT '菜品',
`sl` VARCHAR(40) default NULL COMMENT '数量',
`jg` VARCHAR(40) default NULL COMMENT '价格',
`sj` VARCHAR(40) default NULL COMMENT '时间',
`zt` VARCHAR(40) default NULL COMMENT '状态',
`yh` VARCHAR(40) default NULL COMMENT '用户', PRIMARY KEY (`ddmxid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
CREATE TABLE `gonggao` (
`ggid` int(11) NOT NULL auto_increment,
`bt` VARCHAR(40) default NULL COMMENT '标题',
`nr` VARCHAR(40) default NULL COMMENT '内容',
`fbsj` VARCHAR(40) default NULL COMMENT '发布时间', PRIMARY KEY (`ggid`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;
代码设计
@RequestMapping(value="/add")public String add(caipin caipin,HttpServletRequest request){Map<String,Object> map= new HashMap<String,Object>();//String name=(String)request.getParameter("name");map.put("cpid", caipin.getCpid());//菜品编号map.put("cpmc", caipin.getCpmc());//菜品名称map.put("fl", caipin.getFl());//分类map.put("js", caipin.getJs());//介绍map.put("tp", caipin.getTp());//图片map.put("ts", caipin.getTs());//特色map.put("dj", caipin.getDj());//单价map.put("pz", caipin.getPz());//品质map.put("mj", caipin.getMj());//卖家String cpid=(String)caipin.getCpid();//菜品编号String cpmc=(String)caipin.getCpmc();//菜品名称String fl=(String)caipin.getFl();//分类String js=(String)caipin.getJs();//介绍String tp=(String)caipin.getTp();//图片String ts=(String)caipin.getTs();//特色String dj=(String)caipin.getDj();//单价String pz=(String)caipin.getPz();//品质String mj=(String)caipin.getMj();//卖家caipindao.save(map);request.setAttribute("msg", "<script>alert('添加成功');</script>");System.out.println("addok");return "caipin/caipinadd";}/**删除 * */@RequestMapping(value="/del")public String del(Integer id,HttpServletRequest request,Map<String,Object> map){// Map<String,Object> map= new HashMap<String,Object>();String a=(String)request.getParameter("keyid");id=Integer.parseInt(a);request.setAttribute("msg", "<script>alert('删除成功');</script>");caipindao.del(id);return selectall(null,map,request);}/*** 修改caipin信息*/@RequestMapping(value="/update")public String update(caipin caipin,HttpServletRequest request,Map<String,Object> map1){Map<String,Object> map= new HashMap<String,Object>();map.put("cpid", caipin.getCpid());//菜品编号map.put("cpmc", caipin.getCpmc());//菜品名称map.put("fl", caipin.getFl());//分类map.put("js", caipin.getJs());//介绍map.put("tp", caipin.getTp());//图片map.put("ts", caipin.getTs());//特色map.put("dj", caipin.getDj());//单价map.put("pz", caipin.getPz());//品质map.put("mj", caipin.getMj());//卖家String cpid=(String)caipin.getCpid();//菜品编号String cpmc=(String)caipin.getCpmc();//菜品名称String fl=(String)caipin.getFl();//分类String js=(String)caipin.getJs();//介绍String tp=(String)caipin.getTp();//图片String ts=(String)caipin.getTs();//特色String dj=(String)caipin.getDj();//单价String pz=(String)caipin.getPz();//品质String mj=(String)caipin.getMj();//卖家request.setAttribute("msg", "<script>alert('修改成功');</script>");caipindao.update(map);return selectall(null,map1,request);}
核心算法设计
private int XMin, XMax, YMin, YMax;/** line coefficient a0 */private float a0;/** line coefficient a1 */private float a1;/** number of data points */private int pn;/** true if coefficients valid */private boolean coefsValid;/*** Constructor.*/public RegressionLine() {XMax = 0;YMax = 0;pn = 0;xy = new String[2];listX = new ArrayList();listY = new ArrayList();}/*** Constructor.* * @param data* the array of data points*/public RegressionLine(DataPoint data[]) {pn = 0;xy = new String[2];listX = new ArrayList();listY = new ArrayList();for (int i = 0; i < data.length; ++i) {addDataPoint(data[i]);}}/*** Return the current number of data points.* * @return the count*/public int getDataPointCount() {return pn;}/*** Return the coefficient a0.* * @return the value of a0*/public float getA0() {validateCoefficients();return a0;}/*** Return the coefficient a1.* * @return the value of a1*/public float getA1() {validateCoefficients();return a1;}/*** Return the sum of the x values.* * @return the sum*/public double getSumX() {return sumX;}/*** Return the sum of the y values.* * @return the sum*/public double getSumY() {return sumY;}/*** Return the sum of the x*x values.* * @return the sum*/public double getSumXX() {return sumXX;}/*** Return the sum of the x*y values.* * @return the sum*/public double getSumXY() {return sumXY;}public double getSumYY() {return sumYY;}public int getXMin() {return XMin;}public int getXMax() {return XMax;}public int getYMin() {return YMin;}public int getYMax() {return YMax;}/*** Add a new data point: Update the sums.* * @param dataPoint* the new data point*/public void addDataPoint(DataPoint dataPoint) {sumX += dataPoint.x;sumY += dataPoint.y;sumXX += dataPoint.x * dataPoint.x;sumXY += dataPoint.x * dataPoint.y;sumYY += dataPoint.y * dataPoint.y;if (dataPoint.x > XMax) {XMax = (int) dataPoint.x;}if (dataPoint.y > YMax) {YMax = (int) dataPoint.y;}// 把每个点的具体坐标存入ArrayList中,备用xy[0] = (int) dataPoint.x + "";xy[1] = (int) dataPoint.y + "";if (dataPoint.x != 0 && dataPoint.y != 0) {System.out.print(xy[0] + ",");System.out.println(xy[1]);try {// System.out.println("n:"+n);listX.add(pn, xy[0]);listY.add(pn, xy[1]);} catch (Exception e) {e.printStackTrace();}/** System.out.println("N:" + n); System.out.println("ArrayList* listX:"+ listX.get(n)); System.out.println("ArrayList listY:"+* listY.get(n));*/}++pn;coefsValid = false;}/*** Return the value of the regression line function at x. (Implementation of* Evaluatable.)* * @param x* the value of x* @return the value of the function at x*/public float at(int x) {if (pn < 2)return Float.NaN;validateCoefficients();return a0 + a1 * x;}/*** Reset.*/public void reset() {pn = 0;sumX = sumY = sumXX = sumXY = 0;coefsValid = false;}
三、注意事项
1、管理员账号:admin密码:admin 数据库配置文件datasource.properties
2、开发环境为eclipse开发,数据库为mysql,使用java语言开发。
3、数据库文件名是jspssmfoodshop.sql 系统名称ssmfoodshop
4、地址:http://127.0.0.1:8080/ssmfoodshop/qt/index.jsp
四系统实现
代码下载
https://download.csdn.net/download/qq_41221322/89038678
需要源码 其他的服务 下方联系卡片↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓