项目描述
临近学期结束,还是毕业设计,你还在做java程序网络编程,期末作业,老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里,你想解决的问题,今天给在家介绍一篇基于springboot的物品回收系统。
需求目标
该系统也具有重要的设计目标有如下几个:
(1)数据共享
推进物品回收的数据校验和数据共享规范化和制度化建设,对物品回收系统数据查询的精度和效率进行提升。
(2)实现物品回收功能模块
系统主要实现了用户管理、物品回收各种配置信息管理、单据草稿管理、销量排行查看、收支统计明细信息等功能模块。
(3)实行现代化的管理手段
该系统应该有清晰的界面,容易操作;对于不同系统的用户,对应的操作权限应该不同,系统应该有一个备份的数据库和功能的恢复系统,目的是为了提高数据的安全性。该系统为基于网络的系统,仅要一台有网络连接的设备就可实现登录系统进行物品回收操作管理。
系统功能模块框架图
部分效果图
登录界面:
系统首页
客户列表管理
物品种类管理
物品称重管理
回收订单管理
销量排行界面
数据库设计
系统中用到了12张表,针对每个表都进行了设计,下面对部分核心表进行汇总罗列展示。
(1)用户信息表
(2)客户信息表
(3)等级折扣表
(4)物品类型表
(5)回收单据表
部分代码
// 分页查询所有订单数据@RequestMapping("/selectOrderAll")@ResponseBodypublic Map<String, Object> selectAll(@RequestParam(name = "rows", required = false) Integer rows,@RequestParam(name = "page", required = false) Integer page,@RequestParam(name = "cusname", required = false) String cusname,@RequestParam(name = "productname", required = false) String productname,@RequestParam(name = "bigindatetime", required = false) String bigindatetime,@RequestParam(name = "lastdatetime", required = false) String lastdatetime) throws ParseException {CustomerAndOrder cao =new CustomerAndOrder();cao.setName(cusname);cao.setProductname(productname);SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");if(bigindatetime!=null){Date str = sdf.parse(String.valueOf(bigindatetime));cao.setBigindatetime(sdf2.format(str));}if(lastdatetime!=null){Date str2 = sdf.parse(String.valueOf(lastdatetime));cao.setLastdatetime(sdf2.format(str2));}if (null == rows) {rows = 10;}if (null == page) {page = 1;}PageInfo<TOrderAndCusAndPro> pagelist = orderService.selectAll(page, rows,cao);Map<String, Object> resultMap = new HashMap<String, Object>();resultMap.put("total", pagelist.getTotal());resultMap.put("rows", pagelist.getList());return resultMap;}// 分页查询数据@RequestMapping("/selectproductsum")@ResponseBodypublic Map<String, Object> selectproductsum(@RequestParam(name = "rows", required = false) Integer rows,@RequestParam(name = "page", required = false) Integer page,@RequestParam(name = "type", required = false) String type) throws ParseException {if (null == rows) {rows = 10;}if (null == page) {page = 1;}PageInfo<CustomerAndSum> pagelist=null;if(type==null||type.equals("")){pagelist = orderService.selectProductSum(page, rows);}else if(type.equals("年")){pagelist = orderService.selectProductSum(page, rows);}else if(type.equals("月")){pagelist = orderService.selectProductSumM(page, rows);}else if(type.equals("周")){pagelist = orderService.selectProductSumW(page, rows);}else if(type.equals("日")){pagelist = orderService.selectProductSumD(page, rows);}Map<String, Object> resultMap = new HashMap<String, Object>();resultMap.put("total", pagelist.getTotal());resultMap.put("rows", pagelist.getList());return resultMap;}@RequestMapping("/orderAdd")public Object customerAdd() {return "orderAddView";}@RequestMapping("/getCus")@ResponseBodypublic JsonResult getCus() {JsonResult result = new JsonResult();List<Customer> list = customerService.selectAllList();JSONArray jsonArray = new JSONArray(list);result.setData(jsonArray.toString());result.success();return result;}@RequestMapping("/getProd")@ResponseBodypublic JsonResult getProd() {JsonResult result = new JsonResult();List<Product> list = prodService.selectAllList();JSONArray jsonArray = new JSONArray(list);result.setData(jsonArray.toString());result.success();return result;}@RequestMapping("/getProdById")@ResponseBodypublic JsonResult getProdById(@RequestParam(name = "prodname", required = false) String prodname,@RequestParam(name = "maozhong", required = false) String maozhong,@RequestParam(name = "pizhong", required = false) String pizhong,@RequestParam(name = "kouzanum", required = false) String kouzanum,@RequestParam(name = "cusname", required = false) String cusname) {JsonResult result = new JsonResult();if (prodname.equals("") || maozhong.equals("") || pizhong.equals("") || kouzanum.equals("")||cusname.equals("")) {result.error("请填写上面全部信息");} else {Customer cus = customerService.selectById(Long.valueOf(cusname));Discount discount = discountService.selectByDengji(cus.getDj());if(null != discount){Product product = productService.selectById(Long.valueOf(prodname));BigDecimal productprice=new BigDecimal(product.getProductprice());BigDecimal zhekou=new BigDecimal(discount.getZhekou());double newproductprice = productprice.multiply(zhekou).doubleValue();product.setProductprice(String.valueOf(newproductprice));result.setData(product);}else{Product product = productService.selectById(Long.valueOf(prodname));result.setData(product);}result.success();}return result;}@RequestMapping("/orderdo_Add")public Object orderdo_Add(TOrder order) {// 校验OrderValidator orderValidator = new OrderValidator();Map<String, String> map = orderValidator.valitator(order);if (!map.isEmpty()) {ModelAndView mv = new ModelAndView();mv.setViewName("orderAddView");for (String key : map.keySet()) {mv.addObject(key, map.get(key));}return mv;}// 插入操作
/* SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );String str = sdf.format(new Date());*/order.setCreatedate(new Date());order.setStatus("1");orderService.Do_Add(order);return "orderView";}// 跳转修改页面@RequestMapping("/updateOrder")public Object update(@RequestParam(name = "id", required = false) Long id) {ModelAndView mode = new ModelAndView();TOrder order = orderService.selectById(id);mode.addObject("uid", order.getId().toString());mode.addObject("order", order);mode.setViewName("orderUpdateView");return mode;}@RequestMapping("/orderdo_update")public Object orderdo_update(TOrder order) {// 校验OrderValidator orderValidator = new OrderValidator();Map<String, String> map = orderValidator.valitator(order);if (!map.isEmpty()) {ModelAndView mv = new ModelAndView();mv.setViewName("orderUpdateView");for (String key : map.keySet()) {mv.addObject(key, map.get(key));}return mv;}order.setCreatedate(new Date());orderService.Do_Update(order);return "orderView";}//删除@RequestMapping("/deleteOrder")@ResponseBodypublic JsonResult deleteOrder(@RequestParam(name = "id", required = false) Long id){JsonResult result = new JsonResult();orderService.deleteById(id);result.success();return result;}@RequestMapping("/showXiaoLiang")public Object showXiaoLiang() {return "/showXiaoLiang";}@RequestMapping("/shouhuotongji")public Object shouhuotongji() {return "/shouhuotongji";}@RequestMapping("/shouhuomingxi")public Object shouhuomingxi() {return "/shouhuomingxi";}@RequestMapping("/checkOrder")public Object checkOrder(@RequestParam(name = "id", required = false) Long id) {ModelAndView mode = new ModelAndView();TOrderAndCusAndPro order = orderService.selectcheckById(id);mode.addObject("order", order);mode.setViewName("checkorderView");return mode;}
安装部署需求
利用IDEA直接启动运行
总体设计
本系统是一个基于springboot的微服务架构,前端使用熟知的JavaScript脚本实现系统页面,在后期的发布通过Tomcat服务器部署,也可以通过nginx进行服务代理或者集成负载。
这个系统的设计采用MVC模式,按照视图、控制、数据处理、持久层划分实现。简化了大量的配置和程序代码的耦合性。数据库采用免费开源的MySQL数据库,即节约了成本能够支撑起真个系统业务数据和信息化数据的存储。
本项目用到的技术和框架
1.开发语言:Java
2.开发模式:B/S
3.数据库:MySQL
4.框架:springboot+mybatis+bootstrap+HTML
本项目中的关键点
此系统的开发采用java语言开发,基于B/S结构,这些开发环境使系统更加完善。使用到的工具和技术都是开源免费的。
环境工具
开发工具 Eclipse/IDEA
语言 JDK1.8 、bootstrap、springboot、mybatis
硬件:笔记本电脑;
软件:Tomcat8.0 Web服务器、Navicat数据库客户端、MySQL;
操作系统:Windows 10;
其它软件:截图工具、常用浏览器;