——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明








基于javaweb的SpringBoot进销存管理系统(java+springboot+jpa+maven+jquery+mysql+jsp)
项目介绍
本系统基本完成了一个基于spring boot + JPA的进销存管理系统,包括manager管理员与employee雇员两种角色。 主要实现采购管理、库存管理、销售管理、查询统计、资料管理和系统管理功能。 本系统的实现使用了很多计算机技术,包括Java语言、Spring boot框架、 JPA持久层框架和MySQL数据库。带文档
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7版本; 5.是否Maven项目:是;
技术栈
springboot+jpa+mysql+maven+jquery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,项目运行成功后在浏览器中访问: 管理员登录地址:http://localhost:8080/ manager管理员账号密码:admin/123456 employee雇员账号密码:test/123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| @Controller @RequestMapping("/stock") @SessionAttributes(value={"outList","coun","totPage","curPage","sock"}) public class StockController { private Logger logger = LoggerFactory.getLogger(this.getClass()); private Long coun; private Long totPage; private Long curPage; private Stock stock; private Goods goods; private List<Stock> outList; @Resource private StockService stockService;
@RequestMapping("/add") public String addStock(HttpServletRequest request){ logger.info("库存添加开始"); String name = request.getParameter("name"); String unit = request.getParameter("unit"); String space = request.getParameter("space"); Long supplierId = Long.parseLong(request.getParameter("supplierId")); String approveId = request.getParameter("approveId"); String batchId = request.getParameter("batchId"); Long count = Long.parseLong(request.getParameter("count")); Double price = Double.parseDouble(request.getParameter("price")); String area = request.getParameter("area"); goods = new Goods(); stock = new Stock(); goods.setName(name); goods.setApproveId(approveId); goods.setBatchId(batchId); goods.setSpace(space); goods.setSupplierId(supplierId); goods.setUnit(unit); stock.setArea(area);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| e.printStackTrace(); } return "updateArea"; }
@RequestMapping("/allStock") public String getAllStock(Model model){ try { outList = stockService.findStockByPage(0); coun = stockService.findStockCount(); curPage = 1L; totPage = stockService.getTotalPage(); model.addAttribute("coun", coun); model.addAttribute("curPage", curPage); model.addAttribute("totPage", totPage); model.addAttribute("outList", outList); } catch (ServiceException e) { e.printStackTrace(); } return "stock"; }
@RequestMapping("/multipage") public String getPurchase(HttpServletRequest request,Model model){ Long pageNum =Long.parseLong(request.getParameter("curPage")); try { outList = stockService.findStockByPage((int)(pageNum-1)); } catch (ServiceException e) { e.printStackTrace(); } curPage = pageNum; model.addAttribute("curPage", curPage); model.addAttribute("outList", outList); return "outStock"; }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| e.printStackTrace(); } if(employee!=null){ logger.info(name+"登录成功!!!"); ServletContext app = req.getSession().getServletContext(); try { Long count = managerService.findMessageCount(); app.setAttribute("messageCount", count); app.setAttribute("user",employee); app.setAttribute("role",Role.Employee.value()); req.getRequestDispatcher("/WEB-INF/jsp/index.jsp").forward(req, resp); } catch (ServiceException e) { e.printStackTrace(); } }else{ logger.info("登录失败,用户名或者密码错误"); HttpSession session = req.getSession(); session.setAttribute("msg","用户名或者密码错误"); req.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(req, resp); } }else{ logger.info("登录失败,没有选择用户类型"); HttpSession session = req.getSession(); session.setAttribute("msg","请选择用户类型"); req.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(req, resp); } }
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } } package com.xu.web;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| * @param model * @return */ @RequestMapping("/query") public String stockQuery(HttpServletRequest request,Model model){ logger.info("库存查询开始"); Long goodsId = Long.parseLong(request.getParameter("goodsId")); try { Stock stock = stockService.findStockByGoodsId(goodsId); model.addAttribute("sock", stock); logger.info("库存查询完成"); } catch (ServiceException e) { e.printStackTrace(); } return "queryStock"; }
@RequestMapping("/area") public String forwordStockArea(Model model){ try { outList = stockService.findStockByPage(0); coun = stockService.findStockCount(); curPage = 1L; totPage = stockService.getTotalPage(); model.addAttribute("coun", coun); model.addAttribute("curPage", curPage); model.addAttribute("totPage", totPage); model.addAttribute("outList", outList); } catch (ServiceException e) { e.printStackTrace(); } return "updateArea"; }
@RequestMapping("updateArea") public String upDateArea(HttpServletRequest request,Model model){ logger.info("存放仓库信息更新开始"); Long goodsId = Long.parseLong(request.getParameter("goodsId")); String area = request.getParameter("area"); try { stockService.updateStockAreaByGoodsId(area,goodsId);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| return "querySaleOrder"; }
@RequestMapping("/allgoodsOrder") public String gotoQueryAllGoodsOrder(){ return "queryAllSaleOrder"; }
@RequestMapping("/queryAllOrder") public String queryAllOrders(HttpServletRequest request,Model model){ String min = request.getParameter("logmin"); String max = request.getParameter("logmax"); try { Map<String,Long> map = queryService.findAllOrderCount(min,max); model.addAttribute("map", map); } catch (ServiceException e) { e.printStackTrace(); } return "queryAllSaleOrder"; }
@RequestMapping("/queryOrder")
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=131122542008200sc
https://javayms.pages.dev?id=131122542008200sc