基于javaweb+mysql的仓库管理系统(java+SSM+Maven+Bootstrap+mysql)

本文档详细介绍了基于SSM(Spring、SpringMVC、MyBatis)框架实现的仓库管理系统,包括系统权限管理、基础数据信息管理、仓库管理员管理、库存信息管理和事务操作等功能。系统采用角色权限控制,支持URL鉴权,具备日志查询功能。此外,还涉及了文件导入导出、数据CRUD操作及多条件查询。代码示例展示了货物信息的增删改查操作。
摘要由CSDN通过智能技术生成

基于SSM框架的仓库管理系统
功能:

  • 系统操作权限管理。系统提供基本的登入登出功能,同时系统包含两个角色:系统超级管理员和普通管理员,超级管理员具有最高的操作权限,而普通管理员仅具有最基本的操作权限,而且仅能操作自己被指派的仓库。
  • 请求URL鉴权。对于系统使用者登陆后进行操作发送请求的URL,后台会根据当前用户的角色判断是否拥有请求该URL的权限。
  • 基础数据信息管理。对包括:货物信息、供应商信息、客户信息、仓库信息在内的基础数据信息进行管理,提供的操作有:添加、删除、修改、条件查询、导出为Excel和到从Excel导入。
  • 仓库管理员管理。对仓库管理员信息CRUD操作,或者为指定的仓库管理员指派所管理的仓库。上述中的仓库管理员可以以普通管理员身份登陆到系统。
  • 库存信息管理。对库存信息的CRUD操作,导入导出操作,同时查询的时候可以根据仓库以及商品ID等信息进行多条件查询。
  • 基本仓库事务操作。执行货物的入库与出库操作。
  • 系统登陆日志查询。超级管理员可以查询某一用户在特定时间段内的系统登陆日志。
  • 系统操作日志查询。超级管理员可以查询某一用户在特定时间段内对系统进行操作的操作记录。、
  • 密码修改。

使用到的框架和库:

  • Apache POI
  • MyBatis
  • Spring Framework
  • Spring MVC
  • Apache Shiro
  • Ehcache
  • Apache Commons
  • Log4j
  • Slf4j
  • Jackson
  • C3P0
  • Junit
  • MySQL-Connector
  • jQuery
  • Bootstrap

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

        responseContent.setResponseData(goods);
        return responseContent.generateResponse();
    }
    /**
     * 更新货物信息
     *
     * @param goods 货物信息
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与 error
     */
    @RequestMapping(value = "updateGoods", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> updateGoods(@RequestBody Goods goods) throws GoodsManageServiceException {
        // 初始化 Response
        Response responseContent = ResponseFactory.newInstance();
        // 更新
        String result = goodsManageService.updateGoods(goods) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
        // 设置 Response
        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }
    /**
     * 删除货物记录
    }
    /**
     * 更新货物信息
     *
     * @param goods 货物信息
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与 error
     */
    @RequestMapping(value = "updateGoods", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> updateGoods(@RequestBody Goods goods) throws GoodsManageServiceException {
        // 初始化 Response
        Response responseContent = ResponseFactory.newInstance();
        // 更新
        String result = goodsManageService.updateGoods(goods) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
        // 设置 Response
        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }
    /**
     * 删除货物记录
            while ((len = inputStream.read(buffer, 0, buffer.length)) > 0) {
                outputStream.write(buffer, 0, len);
                outputStream.flush();
            }
            inputStream.close();
            outputStream.close();
        }
    }
}
客户信息管理请求:
/**
 * 客户信息管理请求 
 *
 * @author yy
 */
@RequestMapping(value = "/**/customerManage")
@Controller
public class CustomerManageHandler {
    @Autowired
    private CustomerManageService customerManageService;
    private static final String SEARCH_BY_ID = "searchByID";
    private static final String SEARCH_BY_NAME = "searchByName";
    private static final String SEARCH_ALL = "searchAll";
    /**
     * 通用的结果查询方法
     *
    @RequestMapping(value = "addGoods", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> addGoods(@RequestBody Goods goods) throws GoodsManageServiceException {
        // 初始化 Response
        Response responseContent = ResponseFactory.newInstance();
        // 添加记录
        String result = goodsManageService.addGoods(goods) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
        // 设置 Response
        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }
    /**
            default:
                // do other thing
                break;
        }
        return queryResult;
    }
    /**
     * 搜索货物信息
     *
     * @param searchType 搜索类型
     * @param offset     如有多条记录时分页的偏移值
     * @param limit      如有多条记录时分页的大小
     * @param keyWord    搜索的关键字
     * @return 返回所有符合要求的记录
     */
    @Autowired
    private CustomerManageService customerManageService;
    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) {
        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 = ResponseFactory.newInstance();
    public
    @ResponseBody
    Map<String, Object> getRepositoryAdminInfo(Integer repositoryAdminID) throws RepositoryAdminManageServiceException {
        // 初始化 Response
        Response responseContent = ResponseFactory.newInstance();
        String result = Response.RESPONSE_RESULT_ERROR;
        // 查询
        RepositoryAdmin repositoryAdmin = null;
        Map<String, Object> queryResult = repositoryAdminManageService.selectByID(repositoryAdminID);
        if (queryResult != null) {
            if ((repositoryAdmin = (RepositoryAdmin) queryResult.get("data")) != null)
                result = Response.RESPONSE_RESULT_SUCCESS;
        }
        // 设置 Response
        responseContent.setResponseResult(result);
        responseContent.setResponseData(repositoryAdmin);
        return responseContent.generateResponse();
    }
    /**
        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 = ResponseFactory.newInstance();
        // 参数检查
        if (StringUtils.isNumeric(customerIDStr)) {
            // 转换为 Integer
            Integer customerID = Integer.valueOf(customerIDStr);
    /**
     * 通用的记录查询
     *
     * @param searchType 查询类型
     * @param keyWord    查询关键字
     * @param offset     分页偏移值
     * @param limit      分页大小
     * @return 返回一个 Map ,包含所有符合要求的查询结果,以及记录的条数
     */
    private Map<String, Object> query(String searchType, String keyWord, int offset, int limit) throws GoodsManageServiceException {
        Map<String, Object> queryResult = null;
        switch (searchType) {
            case SEARCH_BY_ID:
        responseContent.setResponseResult(result);
        return responseContent.generateResponse();
    }
    /**
     * 导入货物信息
     *
     * @param file 保存有货物信息的文件
     * @return 返回一个map,其中:key 为 result表示操作的结果,包括:success 与
     * error;key为total表示导入的总条数;key为available表示有效的条数
     */
    @RequestMapping(value = "importGoods", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> importGoods(@RequestParam("file") MultipartFile file) throws GoodsManageServiceException {
        //  初始化 Response
        Response responseContent = ResponseFactory.newInstance();
        String result = Response.RESPONSE_RESULT_ERROR;

该程序主要实现了仓库管理的基本操作,包括进货,出货,利润,库存,商品信息,供货商信息等内容,代码格式较为规范,可以自行删除或添加功能。本压缩包包含数据库sql文件,配置好环境之后可以直接导入。 关于数据库的链接:java链接数据库的方式为JDBC链接,内包含所用jar包,自行导入,修改src目录下的jdbc.properties文件即可。 具体逻辑如下: 添加商品:添加该仓库中所存储的各种商品,可以直接从数据库中查询并显示出来,如果该仓库中没有此商品的信息,则无法订购该货物。 添加供货商:添加商品的供货商家,为了保证商品的质量,在订货时,如果该商家没有被记录,则无法订货成功。 订货:在有相关产品信息和供货商信息之后,才可以正常订购。在订货时需要同时检查库存表和利润表,如果库存之前没有该商品的记录,则添加该商品;如果之前有记录,则在之前的数量中增加上此次订货的数量。在利润表中也是如此,如果没有记录,则添加,如果有记录,则与之前的利润进行相减。 销售:为确保销售正常,如果销售的数量大于库存数量,则提示订货。当销售成功之后,库存表跟利润表也会随之更新。 库存:即显示各类商品的剩余数量,可以实现动态更新 利润:即显示各类商品的盈亏情况,可以实现动态更新 如有问题,欢迎留言。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值