作者主页:Java毕设网
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
一、相关文档
1、关于雅博书城在线系统的基本要求
(1)功能要求:可以管理个人中心、用户管理、图书分类管理、图书信息管理、图书评价管理、系统管理、订单管理等功能模块。
(2)性能:在不同操作系统上均能无差错实现在不同类型的用户登入相应界面后能不出差错、方便地进行预期操作。
(3)安全与保密要求:用户都必须通过注册、登录才能进入系统。
(4)环境要求:支持Windows系列、Vista系统等多种操作系统使用。
2、开发目标
雅博书城在线系统的主要开发目标如下:
(1)实现管理系统信息关系的系统化、规范化和自动化;
(2)减少维护人员的工作量以及实现用户对信息的控制和管理;
(3)方便查询信息及管理信息等;
(4)通过网络操作,提高改善处理问题和操作人员工作的效率;
(5)考虑到用户多样性特点,要求界面和操作简便易懂。
3、设计原则
本雅博书城在线系统采用SSM框架,Mysql数据库开发,充分保证了系统稳定性、完整性。
雅博书城在线系统的设计与实现的设计思想如下:
1、操作简单方便、系统界面安全良好、简单明了的页面布局、方便查询相关信息。
2、即时可见:对雅博书城在线系统信息的处理将立马在对应地点可以查询到,从而实现“即时发布、即时见效”的系统功能。
二、项目介绍
系统分为用户和管理员
主要实现管理员;个人中心、用户管理、图书分类管理、图书信息管理、图书评价管理、系统管理、订单管理,
用户;个人中心、图书评价管理、我的收藏管理、订单管理、前台首页;首页、图书信息、图书资讯、我的、跳转到后台、购物车、在线客服等信息管理功能。
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
三、环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,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(Spring+SpringMVC+Mybatis)
前端:JSP+CSS+JS+JQUERY+Layui
五、使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
3. 将项目中config.properties配置文件中的数据库配置改为自己的配置,然后运行;
前台路径地址:http://localhost:8080/jspmc7679/front/index.jsp
后台路径地址:http://localhost:8080/jspmc7679/jsp/login.jsp
六、运行截图
前台界面
后台界面
七、相关代码
订单管理控制器
@RestController
@RequestMapping("/orders")
public class OrdersController {@Autowiredprivate OrdersService ordersService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,OrdersEntity orders, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {orders.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();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 Map<String, Object> params,OrdersEntity orders, HttpServletRequest request){EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();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){EntityWrapper<OrdersEntity> ew = new EntityWrapper<OrdersEntity>();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 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<OrdersEntity> wrapper = new EntityWrapper<OrdersEntity>();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("/tushufenlei")
public class TushufenleiController {@Autowiredprivate TushufenleiService tushufenleiService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,TushufenleiEntity tushufenlei, HttpServletRequest request){EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();PageUtils page = tushufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushufenlei), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,TushufenleiEntity tushufenlei, HttpServletRequest request){EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();PageUtils page = tushufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, tushufenlei), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( TushufenleiEntity tushufenlei){EntityWrapper<TushufenleiEntity> ew = new EntityWrapper<TushufenleiEntity>();ew.allEq(MPUtil.allEQMapPre( tushufenlei, "tushufenlei")); return R.ok().put("data", tushufenleiService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(TushufenleiEntity tushufenlei){EntityWrapper< TushufenleiEntity> ew = new EntityWrapper< TushufenleiEntity>();ew.allEq(MPUtil.allEQMapPre( tushufenlei, "tushufenlei")); TushufenleiView tushufenleiView = tushufenleiService.selectView(ew);return R.ok("查询图书分类成功").put("data", tushufenleiView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){TushufenleiEntity tushufenlei = tushufenleiService.selectById(id);return R.ok().put("data", tushufenlei);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){TushufenleiEntity tushufenlei = tushufenleiService.selectById(id);return R.ok().put("data", tushufenlei);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){tushufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(tushufenlei);tushufenleiService.insert(tushufenlei);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){tushufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(tushufenlei);tushufenleiService.insert(tushufenlei);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody TushufenleiEntity tushufenlei, HttpServletRequest request){//ValidatorUtils.validateEntity(tushufenlei);tushufenleiService.updateById(tushufenlei);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){tushufenleiService.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<TushufenleiEntity> wrapper = new EntityWrapper<TushufenleiEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = tushufenleiService.selectCount(wrapper);return R.ok().put("count", count);}}