基于javaweb和mysql的springboot仓库管理系统(java+springbootelementui+vue+nodejs+mysql)
私信源码获取及调试交流
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot仓库管理系统(java+springbootelementui+vue+nodejs+mysql)
项目介绍
本项目为前后端分离的项目;
系统分为用户、管理员和超级管理员三个角色
本系统包含登录、主页、个人中心、用户信息管理、仓库信息管理(出库、入库)、物品分类管理、物品信息管理、操作日志等功能
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 前端推荐使用vscode;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
6.是否为前后端分离项目:是;
技术栈
后端框架:Springboot
前端技术:ElementUI、Vue、nodejs
使用说明
后端项目运行:
-
使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
-
使用IDEA/Eclipse/MyEclipse导入源码中的WarehouseManager项目,导入成功后请执行maven clean;maven install命令,然后运行;
-
将项目中application.yml配置文件中的数据库配置改为自己的配置;
-
运行项目,控制台提示运行成功后再去运行前端项目;
前端项目运行:
1.打开运行中的cmd;
2.cd到WarehouseManagerVue文件夹目录;
3.执行命令:npm run serve
- 运行成功后,在浏览器中输入地址:http://localhost:9132/
超级管理员:superadmin/123456
管理员:admin/123456
用户:user/123456
登录页面展示:
后台管理页面:
个人中心展示页面:
操作日志页面:
物品信息管理页面:
仓库信息管理页面:
物品分类管理页面:
用户信息管理页面:
系统操作日志请求:
default:
// do other thing
break;
return queryResult;
/**
* 搜索客户信息
* @param searchType 搜索类型
* @param offset 如有多条记录时分页的偏移值
* @param limit 如有多条记录时分页的大小
* @param keyWord 搜索的关键字
* @return 返回查询的结果,其中键值为 rows 的代表查询到的每一记录,若有分页则为分页大小的记录;键值为 total 代表查询到的符合要求的记录总条数
responseContent.setCustomerInfo("available", available);
return responseContent.generateResponse();
/**
* 导出货物信息
* @param searchType 查找类型
* @param keyWord 查找关键字
* @param response HttpServletResponse
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "exportGoods", method = RequestMethod.GET)
public void exportGoods(@RequestParam("searchType") String searchType, @RequestParam("keyWord") String keyWord,
HttpServletResponse response) throws GoodsManageServiceException, IOException {
String fileName = "goodsInfo.xlsx";
* @param a***essType 记录类型(登入、登出或全部)
* @param startDateStr 记录的起始日期
* @param endDateStr 记录的结束日期
* @param offset 分页的偏移值
* @param limit 分页的大小
* @return 返回 JSON 数据 其中:Key为rows的值代表所有记录数据,Key为total的值代表记录的总条数
* @throws SystemLogServiceException SystemLogServiceException
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "getA***essRecords", method = RequestMethod.GET)
public @ResponseBody
Map<String, Object> getA***essRecords(@RequestParam("userID") String userIDStr,
if (queryResult != null) {
customers = (List<Customer>) queryResult.get("data");
// 获取生成的文件
File file = customerManageService.exportCustomer(customers);
// 写出文件
if (file != null) {
// 设置响应头
response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
FileInputStream inputStream = new FileInputStream(file);
OutputStream outputStream = response.getOutputStream();
byte[] buffer = new byte[8192];
int len;
* @param customer 客户信息
* @return 返回一个map,其中:key 为 result表示操作的结果,包括:su***ess 与 error
*/
@RequestMapping(value = "addCustomer", method = RequestMethod.POST)
public
@ResponseBody
Map<String, Object> addCustomer(@RequestBody Customer customer) throws CustomerManageServiceException {
// 初始化 Response
Response responseContent = ResponseFactory.newInstance();
// 添加记录
String result = customerManageService.addCustomer(customer) ? Response.RESPONSE_RESULT_SU***ESS : Response.RESPONSE_RESULT_ERROR;
responseContent.setResponseResult(result);
return responseContent.generateResponse();
default:
// do other thing
break;
return queryResult;
/**
* 搜索货物信息
* @param searchType 搜索类型
* @param offset 如有多条记录时分页的偏移值
* @param limit 如有多条记录时分页的大小
* @param keyWord 搜索的关键字
* @return 返回所有符合要求的记录
/**
* 查询指定 goods ID 货物的信息
* @param goodsID 货物ID
* @return 返回一个map,其中:key 为 result 的值为操作的结果,包括:su***ess 与 error;key 为 data
* 的值为货物信息
*/
@RequestMapping(value = "getGoodsInfo", method = RequestMethod.GET)
public
@ResponseBody
Map<String, Object> getGoodsInfo(@RequestParam("goodsID") Integer goodsID) throws GoodsManageServiceException {
// 初始化 Response
Response responseContent = ResponseFactory.newInstance();
String result = Response.RESPONSE_RESULT_ERROR;
// 获取货物信息
if (queryResult != null) {
rows = (List<A***essRecordDO>) queryResult.get("data");
total = (long) queryResult.get("total");
} else
response.setResponseMsg("Request Argument Error");
if (rows == null)
rows = new ArrayList<>(0);
// 返回 Response
response.setCustomerInfo("rows", rows);
response.setResponseTotal(total);
/**
* 通用的结果查询方法
* @param searchType 查询方式
* @param keyWord 查询关键字
* @param offset 分页偏移值
* @param limit 分页大小
* @return 返回指定条件查询的结果
*/
private Map<String, Object> query(String searchType, String keyWord, int offset, int limit) throws CustomerManageServiceException {
Map<String, Object> queryResult = null;
switch (searchType) {
Response responseContent = ResponseFactory.newInstance();
List<Supplier> rows = null;
long total = 0;
Map<String, Object> queryResult = query(searchType, keyWord, offset, limit);
if (queryResult != null) {
rows = (List<Supplier>) queryResult.get("data");
total = (long) queryResult.get("total");
// 设置 Response
responseContent.setCustomerInfo("rows", rows);
responseContent.setResponseTotal(total);
responseContent.setResponseResult(Response.RESPONSE_RESULT_SU***ESS);
return responseContent.generateResponse();
@RequestParam("limit") int limit) throws SystemLogServiceException {
// 创建 Response
Response response = ResponseFactory.newInstance();
List<UserOperationRecordDTO> rows = null;
long total = 0;
// 检查参数
String regex = "([0-9]{4})-([0-9]{2})-([0-9]{2})";
boolean startDateFormatCheck = (StringUtils.isEmpty(startDateStr) || startDateStr.matches(regex));
boolean endDateFormatCheck = (StringUtils.isEmpty(endDateStr) || endDateStr.matches(regex));
boolean userIDCheck = (StringUtils.isEmpty(userIDStr) || StringUtils.isNumeric(userIDStr));
total = (long) queryResult.get("total");
// 设置 Response
responseContent.setCustomerInfo("rows", rows);
responseContent.setResponseTotal(total);
return responseContent.generateResponse();
/**
* 添加一条货物信息
* @param goods 货物信息
* @return 返回一个map,其中:key 为 result表示操作的结果,包括:su***ess 与 error
*/
@RequestMapping(value = "addGoods", method = RequestMethod.POST)
public
@ResponseBody
// 设置 Response
responseContent.setResponseResult(result);
responseContent.setResponseData(goods);
return responseContent.generateResponse();
/**
* 更新货物信息
* @param goods 货物信息
* @return 返回一个map,其中:key 为 result表示操作的结果,包括:su***ess 与 error
*/
@RequestMapping(value = "updateGoods", method = RequestMethod.POST)
public
Map<String, Object> queryResult = query(searchType, keyWord, offset, limit);
if (queryResult != null) {
rows = (List<Supplier>) queryResult.get("data");
total = (long) queryResult.get("total");
// 设置 Response
responseContent.setCustomerInfo("rows", rows);
responseContent.setResponseTotal(total);
return responseContent.generateResponse();
/**
* 添加一条货物信息
* @param goods 货物信息
* @return 返回一个map,其中:key 为 result表示操作的结果,包括:su***ess 与 error
String result = goodsManageService.addGoods(goods) ? Response.RESPONSE_RESULT_SU***ESS : Response.RESPONSE_RESULT_ERROR;
// 设置 Response
responseContent.setResponseResult(result);
return responseContent.generateResponse();
/**
* 查询指定 goods ID 货物的信息
* @param goodsID 货物ID
* @return 返回一个map,其中:key 为 result 的值为操作的结果,包括:su***ess 与 error;key 为 data
* 的值为货物信息
*/
@RequestMapping(value = "getGoodsInfo", method = RequestMethod.GET)
@RequestParam("keyWord") String keyWord) throws GoodsManageServiceException {
// 初始化 Response
Response responseContent = ResponseFactory.newInstance();
List<Supplier> rows = null;
long total = 0;
// 查询
Map<String, Object> queryResult = query(searchType, keyWord, offset, limit);
if (queryResult != null) {
rows = (List<Supplier>) queryResult.get("data");
total = (long) queryResult.get("total");
Map<String, Object> importInfo = goodsManageService.importGoods(file);
if (importInfo != null) {
total = (int) importInfo.get("total");
available = (int) importInfo.get("available");
result = Response.RESPONSE_RESULT_SU***ESS;
// 设置 Response
responseContent.setResponseResult(result);
responseContent.setResponseTotal(total);
responseContent.setCustomerInfo("available", available);
return responseContent.generateResponse();
/**
* 导出货物信息
* @param searchType 查找类型
* 导出客户信息
* @param searchType 查找类型
* @param keyWord 查找关键字
* @param response HttpServletResponse
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "exportCustomer", method = RequestMethod.GET)
public void exportCustomer(@RequestParam("searchType") String searchType, @RequestParam("keyWord") String keyWord,
HttpServletResponse response) throws CustomerManageServiceException, IOException {
String fileName = "customerInfo.xlsx";
List<Customer> customers = null;
Map<String, Object> queryResult = query(searchType, keyWord, -1, -1);
if (queryResult != null) {