IDEA+springboot+mybatis+shiro+bootstrap+Mysql WMS仓库管理系统

本文介绍了一个基于IDEA、SpringBoot、Mybatis和Shiro等技术实现的WMS仓库管理系统,涵盖了管理员登录、密码修改、库存查询、出入库记录等功能,并提供了部分关键代码如CustomerMapper和CustomerManageHandler。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


一、系统介绍

本系统实现了WMS仓库管理系统,管理端实现了管理员登录、修改密码、更改密码、 系统日志、 登陆日志、库存查询、 出入库记录、货物入库、货物出库、仓库管理员管理、供应商信息管理 、客户信息管理、 货物信息管理、 仓库信息管理

1.环境配置

JDK版本:1.8
Mysql:5.7

二、系统展示

1. 管理员登录

在这里插入图片描述

账号:1001 密码:123456

2.修改密码

在这里插入图片描述

3.系统日志

在这里插入图片描述

4. 登陆日志

在这里插入图片描述

5. 库存查询

在这里插入图片描述

6. 出入库记录

在这里插入图片描述

7.货物入库

在这里插入图片描述

8.货物出库

在这里插入图片描述

9.仓库管理员管理

在这里插入图片描述

10.供应商信息管理

在这里插入图片描述

11.客户信息管理

在这里插入图片描述

12.货物信息管理

在这里插入图片描述

13. 仓库信息管理

在这里插入图片描述

三、部分代码

CustomerMapper.java

package com.ken.wms.dao;

import com.ken.wms.domain.Customer;

import java.util.List;

/**
 * 客户信息 Customer 映射器
 *
 */
public interface CustomerMapper {

	/**
	 * 选择所有的 Customer
	 * @return 返回所有的 Customer
	 */
	List<Customer> selectAll();
	
	/**
	 * 选择指定 id 的 Supplier
	 * @param id Customer的ID
	 * @return 返回指定ID对应的Customer
	 */
	Customer selectById(Integer id);
	
	/**
	 * 选择指定 Customer name 的 customer
	 * @param customerName 客户的名称
	 * @return 返回指定CustomerName对应的Customer
	 */
	Customer selectByName(String customerName);
	
	/**
	 * 选择指定 customer name 的 Customer
	 * 与 selectByName 方法的区别在于本方法将返回相似匹配的结果
	 * @param customerName Customer 供应商名
	 * @return 返回模糊匹配指定customerName 对应的Customer
	 */
	List<Customer> selectApproximateByName(String customerName);
	
	/**
	 * 插入 Customer 到数据库中
	 * 不需要指定 Customer 的主键,采用的数据库 AI 方式
	 * @param customer Customer 实例
	 */
	void insert(Customer customer);
	
	/**
	 * 批量插入 Customer 到数据库中
	 * @param customers 存放 Customer 实例的 List
	 */
	void insertBatch(List<Customer> customers);
	
	/**
	 * 更新 Customer 到数据库
	 * 该 Customer 必须已经存在于数据库中,即已经分配主键,否则将更新失败
	 * @param customer customer 实例
	 */
	void update(Customer customer);
	
	/**
	 * 删除指定 id 的 customer
	 * @param id customer ID
	 */
	void deleteById(Integer id);
	
	/**
	 * 删除指定 customerName 的 customer
	 * @param customerName 客户名称
	 */
	void deleteByName(String customerName);
}



CustomerManageHandler.java

package com.ken.wms.common.controller;

import com.ken.wms.common.service.Interface.CustomerManageService;
import com.ken.wms.common.util.Response;
import com.ken.wms.common.util.ResponseUtil;
import com.ken.wms.domain.Customer;
import com.ken.wms.domain.Supplier;
import com.ken.wms.exception.CustomerManageServiceException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;

/**
 * 客户信息管理请求 Handler
 */
@RequestMapping(value = "/**/customerManage")
@Controller
public class CustomerManageHandler {

    @Autowired
    private CustomerManageService customerManageService;
    @Autowired
    private ResponseUtil responseUtil;

    private static final String SEARCH_BY_ID = "searchByID";
    private static final String SEARCH_BY_NAME = "searchByName";
    private static final String SEARCH_ALL = "searchAll";

    /**
     * 通用的结果查询方法
     *
     * @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) {
            case SEARCH_BY_ID:
                if (StringUtils.isNumeric(keyWord))
                    queryResult = customerManageService.selectById(Integer.valueOf(keyWord));
                break;
            case SEARCH_BY_NAME:
                queryResult = customerManageService.selectByName(offset, limit, keyWord);
                break;
            case SEARCH_ALL:
                queryResult = customerManageService.selectAll(offset, limit);
                break;
            default:
                // do other thing
                break;
        }
        return queryResult;
    }

    /**
     * 搜索客户信息
     *
     * @param searchType 搜索类型
     * @param offset     如有多条记录时分页的偏移值
     * @param limit      如有多条记录时分页的大小
     * @param keyWord    搜索的关键字
     * @return 返回查询的结果,其中键值为 rows 的代表查询到的每一记录,若有分页则为分页大小的记录;键值为 total 代表查询到的符合要求的记录总条数
     */
    @SuppressWarnings("unchecked")
    @RequestMapping(value = "getCustomerList", method = RequestMethod.GET)
    public
    @ResponseBody
    Map<String, Object> getCustomerList(@RequestParam("searchType") String searchType,
                                        @RequestParam("offset") int offset,
                                        @RequestParam("limit") int limit,
                                        @RequestParam("keyWord") String keyWord) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();

        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_SUCCESS);
        return responseContent.generateResponse();
    }

    /**
     * 添加一条客户信息
     *
     * @param customer 客户信息
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与 error
     */
    @RequestMapping(value = "addCustomer", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> addCustomer(@RequestBody Customer customer) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();

        // 添加记录
        String result = customerManageService.addCustomer(customer) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;

        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }

    /**
     * 查询指定 customer ID 客户的信息
     *
     * @param customerID 客户ID
     * @return 返回一个map,其中:key 为 result 的值为操作的结果,包括:success 与 error;key 为 data
     * 的值为客户信息
     */
    @RequestMapping(value = "getCustomerInfo", method = RequestMethod.GET)
    public
    @ResponseBody
    Map<String, Object> getCustomerInfo(@RequestParam("customerID") String customerID) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();
        String result = Response.RESPONSE_RESULT_ERROR;

        // 获取客户信息
        Customer customer = null;
        Map<String, Object> queryResult = query(SEARCH_BY_ID, customerID, -1, -1);
        if (queryResult != null) {
            customer = (Customer) queryResult.get("data");
            if (customer != null) {
                result = Response.RESPONSE_RESULT_SUCCESS;
            }
        }

        // 设置 Response
        responseContent.setResponseResult(result);
        responseContent.setResponseData(customer);

        return responseContent.generateResponse();
    }

    /**
     * 更新客户信息
     *
     * @param customer 客户信息
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与 error
     */
    @RequestMapping(value = "updateCustomer", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> updateCustomer(@RequestBody Customer customer) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();

        // 更新
        String result = customerManageService.updateCustomer(customer) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;

        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }

    /**
     * 删除客户记录
     *
     * @param customerIDStr 客户ID
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与 error
     */
    @RequestMapping(value = "deleteCustomer", method = RequestMethod.GET)
    public
    @ResponseBody
    Map<String, Object> deleteCustomer(@RequestParam("customerID") String customerIDStr) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();

        // 参数检查
        if (StringUtils.isNumeric(customerIDStr)) {
            // 转换为 Integer
            Integer customerID = Integer.valueOf(customerIDStr);

            // 刪除
            String result = customerManageService.deleteCustomer(customerID) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
            responseContent.setResponseResult(result);
        } else
            responseContent.setResponseResult(Response.RESPONSE_RESULT_ERROR);

        return responseContent.generateResponse();
    }

    /**
     * 导入客户信息
     *
     * @param file 保存有客户信息的文件
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与
     * error;key为total表示导入的总条数;key为available表示有效的条数
     */
    @RequestMapping(value = "importCustomer", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> importCustomer(@RequestParam("file") MultipartFile file) throws CustomerManageServiceException {
        // 初始化 Response
        Response responseContent = responseUtil.newResponseInstance();
        String result = Response.RESPONSE_RESULT_SUCCESS;

        // 读取文件内容
        int total = 0;
        int available = 0;
        if (file == null)
            result = Response.RESPONSE_RESULT_ERROR;
        Map<String, Object> importInfo = customerManageService.importCustomer(file);
        if (importInfo != null) {
            total = (int) importInfo.get("total");
            available = (int) importInfo.get("available");
        }

        responseContent.setResponseResult(result);
        responseContent.setResponseTotal(total);
        responseContent.setCustomerInfo("available", available);
        return responseContent.generateResponse();
    }

    /**
     * 导出客户信息
     *
     * @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) {
            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;
            while ((len = inputStream.read(buffer, 0, buffer.length)) > 0) {
                outputStream.write(buffer, 0, len);
                outputStream.flush();
            }

            inputStream.close();
            outputStream.close();

        }
    }
}


Customer.java

package com.ken.wms.domain;

/**
 * 客户信息
 *
 */
public class Customer {

	private Integer id;// 客户ID
	private String name;// 客户名
	private String personInCharge;// 负责人
	private String tel;// 联系电话
	private String email;// 电子邮件
	private String address;// 地址

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPersonInCharge() {
		return personInCharge;
	}

	public void setPersonInCharge(String personInCharge) {
		this.personInCharge = personInCharge;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return "Customer [id=" + id + ", name=" + name + ", personInCharge=" + personInCharge + ", tel=" + tel
				+ ", email=" + email + ", address=" + address + "]";
	}

}


四、其他

获取源码

点击以下链接获取源码。
IDEA+springboot+mybatis+shiro+bootstrap+Mysql WMS仓库管理系统
IDEA+spring+spring mvc+mybatis+bootstrap+jquery+Mysql运动会管理系统源码
IDEA+SpringBoot+mybatis+bootstrap+jquery+Mysql车险理赔管理系统源码
IDEA+Spring Boot + MyBatis + Layui+Mysql垃圾回收管理系统源码
IDEA+SpringBoot+mybatis+SSM+layui+Mysql学生就业信息管理系统源码
IDEA+springboot+jpa+Layui+Mysql销售考评系统源码
IDEA+Spring + Spring MVC + MyBatis+Bootstrap+Mysql酒店管理系统源码
IDEA+spring boot+mybatis+spring mvc+bootstrap+Mysql停车位管理系统源码

Java+Swing+Mysql实现学生宿舍管理系统

Java+Swing+Txt实现自助款机系统

Java+Swing+Mysql自助存取款机系统

Java+Swing+mysql5实现学生成绩管理系统(带分页)

Java+Swing+Mysql实现超市商品管理系统源码

Java+Swing+Mysql实现通讯录管理系统源码

Java+Swing+Mysql实现图书管理系统源码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

reg183

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值