网站的需求分析,网站怎么在百度做推广,佛山外贸网站建设价位,win7优化工具作者主页#xff1a;Java毕设网 简介#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 一、相关文档 系统中的核心用户是系统管理员#xff0c;管理员登录后#xff0c;通过管理员菜单来管理后台系统。主要功能有#xff1a;个人中心、用户管理… 作者主页Java毕设网 简介Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 一、相关文档 系统中的核心用户是系统管理员管理员登录后通过管理员菜单来管理后台系统。主要功能有个人中心、用户管理、食堂管理、食堂菜单管理、菜系分类管理、消息留言管理、留言板管理、系统管理、订单管理等功能。 用户进入系统可以进行个人中心、消息留言管理、我的收藏管理、订单管理等。
二、项目介绍
角色管理员、用户
前台用户可以实现商品浏览加入购物车加入收藏预定选座个人信息管理收货信息管理收藏管理评论功能我的订单等。 食堂个人中心、修改密码、个人信息、食堂菜单管理、菜系分类管理、消息留言管理、订单管理 系统管理员管理员登录后通过管理员菜单来管理后台系统。主要功能有个人中心、用户管理、食堂管理、食堂菜单管理、菜系分类管理、消息留言管理、留言板管理、系统管理、订单管理等功能。 由于本程序规模不大可供课程设计毕业设计学习演示之用
三、环境需要
1.运行环境最好是java jdk 1.8我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境IDEAEclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境Tomcat 7.x,8.x,9.x版本均可 4.硬件环境windows 7/8/10 1G内存以上或者 Mac OS 5.是否Maven项目: 是查看源码目录中是否包含pom.xml若包含则为maven项目否则为非maven项目 6.数据库MySql 5.7/8.0等版本均可
四、技术栈
后端SSM(SpringSpringMVCMybatis) 前端JSPCSSJSJQUERYLayui
五、使用说明
1. 使用Navicat或者其它工具在mysql中创建对应名称的数据库并导入项目的sql文件 2. 使用IDEA/Eclipse/MyEclipse导入项目修改配置运行项目 3. 将项目中db.xml配置文件中的数据库配置改为自己的配置然后运行 前台http://localhost:8080/jspmjy54g/front/index.jsp
后台http://localhost:8080/jspmjy54g/jsp/login.jsp
六、运行截图
前台界面
后台界面
七、相关代码
订单管理控制器
RestController
RequestMapping(/orders)
public class OrdersController {Autowiredprivate OrdersService ordersService;/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,OrdersEntity orders, HttpServletRequest request){if(!request.getSession().getAttribute(role).toString().equals(管理员)) {orders.setUserid((Long)request.getSession().getAttribute(userId));}EntityWrapperOrdersEntity ew new EntityWrapperOrdersEntity();PageUtils page ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));request.setAttribute(data, page);return R.ok().put(data, page);}/*** 前端列表*/RequestMapping(/list)public R list(RequestParam MapString, Object params,OrdersEntity orders, HttpServletRequest request){EntityWrapperOrdersEntity ew new EntityWrapperOrdersEntity();PageUtils page ordersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, orders), params), params));request.setAttribute(data, page);return R.ok().put(data, page);}/*** 列表*/RequestMapping(/lists)public R list( OrdersEntity orders){EntityWrapperOrdersEntity ew new EntityWrapperOrdersEntity();ew.allEq(MPUtil.allEQMapPre( orders, orders)); return R.ok().put(data, ordersService.selectListView(ew));}/*** 查询*/RequestMapping(/query)public R query(OrdersEntity orders){EntityWrapper OrdersEntity ew new EntityWrapper OrdersEntity();ew.allEq(MPUtil.allEQMapPre( orders, orders)); OrdersView ordersView ordersService.selectView(ew);return R.ok(查询订单成功).put(data, ordersView);}/*** 后端详情*/RequestMapping(/info/{id})public R info(PathVariable(id) Long id){OrdersEntity orders ordersService.selectById(id);return R.ok().put(data, orders);}/*** 前端详情*/RequestMapping(/detail/{id})public R detail(PathVariable(id) Long id){OrdersEntity orders ordersService.selectById(id);return R.ok().put(data, orders);}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody OrdersEntity orders, HttpServletRequest request){orders.setId(new Date().getTime()new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(orders);orders.setUserid((Long)request.getSession().getAttribute(userId));ordersService.insert(orders);return R.ok();}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody OrdersEntity orders, HttpServletRequest request){orders.setId(new Date().getTime()new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(orders);ordersService.insert(orders);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody OrdersEntity orders, HttpServletRequest request){//ValidatorUtils.validateEntity(orders);ordersService.updateById(orders);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){ordersService.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 MapString, 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));}}WrapperOrdersEntity wrapper new EntityWrapperOrdersEntity();if(map.get(remindstart)!null) {wrapper.ge(columnName, map.get(remindstart));}if(map.get(remindend)!null) {wrapper.le(columnName, map.get(remindend));}if(!request.getSession().getAttribute(role).toString().equals(管理员)) {wrapper.eq(userid, (Long)request.getSession().getAttribute(userId));}int count ordersService.selectCount(wrapper);return R.ok().put(count, count);}}食堂相关控制器
RestController
RequestMapping(/shitang)
public class ShitangController {Autowiredprivate ShitangService shitangService;Autowiredprivate TokenService tokenService;/*** 登录*/IgnoreAuthRequestMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {ShitangEntity user shitangService.selectOne(new EntityWrapperShitangEntity().eq(shitanghao, username));if(usernull || !user.getMima().equals(password)) {return R.error(账号或密码不正确);}String token tokenService.generateToken(user.getId(), username,shitang, 管理员 );return R.ok().put(token, token);}/*** 注册*/IgnoreAuthRequestMapping(/register)public R register(RequestBody ShitangEntity shitang){//ValidatorUtils.validateEntity(shitang);ShitangEntity user shitangService.selectOne(new EntityWrapperShitangEntity().eq(shitanghao, shitang.getShitanghao()));if(user!null) {return R.error(注册用户已存在);}Long uId new Date().getTime();shitang.setId(uId);shitangService.insert(shitang);return R.ok();}/*** 退出*/RequestMapping(/logout)public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok(退出成功);}/*** 获取用户的session用户信息*/RequestMapping(/session)public R getCurrUser(HttpServletRequest request){Long id (Long)request.getSession().getAttribute(userId);ShitangEntity user shitangService.selectById(id);return R.ok().put(data, user);}/*** 密码重置*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request){ShitangEntity user shitangService.selectOne(new EntityWrapperShitangEntity().eq(shitanghao, username));if(usernull) {return R.error(账号不存在);}user.setMima(123456);shitangService.updateById(user);return R.ok(密码已重置为123456);}/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,ShitangEntity shitang, HttpServletRequest request){EntityWrapperShitangEntity ew new EntityWrapperShitangEntity();PageUtils page shitangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shitang), params), params));request.setAttribute(data, page);return R.ok().put(data, page);}/*** 前端列表*/RequestMapping(/list)public R list(RequestParam MapString, Object params,ShitangEntity shitang, HttpServletRequest request){EntityWrapperShitangEntity ew new EntityWrapperShitangEntity();PageUtils page shitangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shitang), params), params));request.setAttribute(data, page);return R.ok().put(data, page);}/*** 列表*/RequestMapping(/lists)public R list( ShitangEntity shitang){EntityWrapperShitangEntity ew new EntityWrapperShitangEntity();ew.allEq(MPUtil.allEQMapPre( shitang, shitang)); return R.ok().put(data, shitangService.selectListView(ew));}/*** 查询*/RequestMapping(/query)public R query(ShitangEntity shitang){EntityWrapper ShitangEntity ew new EntityWrapper ShitangEntity();ew.allEq(MPUtil.allEQMapPre( shitang, shitang)); ShitangView shitangView shitangService.selectView(ew);return R.ok(查询食堂成功).put(data, shitangView);}/*** 后端详情*/RequestMapping(/info/{id})public R info(PathVariable(id) Long id){ShitangEntity shitang shitangService.selectById(id);return R.ok().put(data, shitang);}/*** 前端详情*/RequestMapping(/detail/{id})public R detail(PathVariable(id) Long id){ShitangEntity shitang shitangService.selectById(id);return R.ok().put(data, shitang);}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody ShitangEntity shitang, HttpServletRequest request){shitang.setId(new Date().getTime()new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(shitang);ShitangEntity user shitangService.selectOne(new EntityWrapperShitangEntity().eq(shitanghao, shitang.getShitanghao()));if(user!null) {return R.error(用户已存在);}shitang.setId(new Date().getTime());shitangService.insert(shitang);return R.ok();}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody ShitangEntity shitang, HttpServletRequest request){shitang.setId(new Date().getTime()new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(shitang);ShitangEntity user shitangService.selectOne(new EntityWrapperShitangEntity().eq(shitanghao, shitang.getShitanghao()));if(user!null) {return R.error(用户已存在);}shitang.setId(new Date().getTime());shitangService.insert(shitang);return R.ok();}/*** 修改*/RequestMapping(/update)public R update(RequestBody ShitangEntity shitang, HttpServletRequest request){//ValidatorUtils.validateEntity(shitang);shitangService.updateById(shitang);//全部更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Long[] ids){shitangService.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 MapString, 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));}}WrapperShitangEntity wrapper new EntityWrapperShitangEntity();if(map.get(remindstart)!null) {wrapper.ge(columnName, map.get(remindstart));}if(map.get(remindend)!null) {wrapper.le(columnName, map.get(remindend));}int count shitangService.selectCount(wrapper);return R.ok().put(count, count);}}八、如果也想学习本系统下面领取。关注并回复261ssm