基于SSM+MySql实现的仓库管理系统

Posted believe code2life

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了基于SSM+MySql实现的仓库管理系统相关的知识,希望对你有一定的参考价值。

基于SSM的仓库管理系统

系统介绍

该系统为SSM实现在仓库管理系统,实现了供应商管理、经销商管理、商品管理、出库管理、收货单管理等等仓库系统所需在基本功能。系统实现上分层比较明确,操作比较简单。

功能模块

相关技术点

前端:系统前端采用jsp + javascript + css的组合开发
后端:SSM框架
数据库:mysql
开发运行环境:IDEA/Eclipse等开发工具,Tomcat7/8容器、JDK1.8/1.7、Mysql数据库。

功能截图

    系统目前主要实现了供应商管理模块、经销商管理模块、商品管理模块、库存管理模块、订货单管理模块。由于篇幅有限,只贴出部分功能的运行截图。
  1. 供应商管理
  2. 经销商管理
  3. 商品管理
  4. 添加商品信息
  5. 库存管理
  6. 订货单管理

部分源码

  1. Controller
package com.synnex.wms.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.synnex.wms.pojo.Buyer;
import com.synnex.wms.pojo.Storer;
import com.synnex.wms.service.BuyerService;

@Controller
@RequestMapping(value = "/buyer")
public class BuyerController 
   
   @Autowired
   BuyerService buyerService ;
   
   @RequestMapping(value = "/findAll")
   public void findAll(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException 
      
      List<Buyer> list_buyer = buyerService.findAll();
      System.out.println("------list_buyer:"+list_buyer);
      request.setAttribute("list_buyer", list_buyer);
      
      request.getRequestDispatcher("/jsp/buyer/buyer.jsp").forward(request,response);
   
   
   @RequestMapping("/toUpdateBuyerPage/buyer_id")
   public void toUpdateStorerPage(@PathVariable Integer buyer_id,
         HttpServletResponse response, HttpServletRequest request)
         throws ServletException, IOException 
      
      
      System.out.println("=-=-=-=-=------------------------------");
      Buyer buyer = buyerService.findBuyerByBuyer_id(buyer_id);
      System.out.println("===========================buyer"+buyer);
      request.setAttribute("buyer", buyer);
      
      request.getRequestDispatcher("/jsp/buyer/updateBuyer.jsp").forward(
            request, response);
   
   
   @RequestMapping(value = "/update")
   public String update(Buyer buyer) 
      buyerService.update(buyer);
      return "redirect:/buyer/findAll";
   
   
   @RequestMapping(value = "/delete/buyer_id")
   public String delete(@PathVariable Integer buyer_id) 
      buyerService.delete(buyer_id);
      return "redirect:/buyer/findAll";
   
   
   @RequestMapping(value = "/insert")
   public String insert(Buyer buyer) 
      buyerService.insert(buyer);
      return "redirect:/buyer/findAll";
   


  1. Service
package com.synnex.wms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.synnex.wms.mapper.BuyerMapper;
import com.synnex.wms.pojo.Buyer;

@Service
@Transactional
public class BuyerService 
   @Autowired
   BuyerMapper buyermapper;
   
   public List<Buyer> findAll()
      return buyermapper.findAll();
   

   public void update(Buyer buyer) 
      // TODO Auto-generated method stub
      buyermapper.update(buyer);
   

   public void delete(Integer buyer_id) 
      // TODO Auto-generated method stub
      buyermapper.delete(buyer_id);
   

   public Buyer findBuyerByBuyer_id(Integer buyer_id) 
      // TODO Auto-generated method stub
      return buyermapper.findBuyerByBuyer_id(buyer_id);
   

   public void insert(Buyer buyer) 
      // TODO Auto-generated method stub
      buyermapper.insert(buyer);
   
  1. Mapper
package com.synnex.wms.mapper;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.synnex.wms.pojo.Buyer;

public interface BuyerMapper 

   List<Buyer> findAll();

   void update(Buyer buyer);

   void delete(Integer buyer_id);

   Buyer findBuyerByBuyer_id(Integer buyer_id);

   void insert(Buyer buyer);


  1. MyBatis映射文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.synnex.wms.mapper.BuyerMapper">
   
   <select id="findAll" resultType="com.synnex.wms.pojo.Buyer">
      <!-- List<Buyer> findALl(); -->
      select * from buyer
   </select>
   
   <!-- Buyer findBuyerByBuyer_id(Integer buyer_id); -->
   <select id="findBuyerByBuyer_id" resultType="com.synnex.wms.pojo.Buyer">
      select * from buyer where buyer_id = #buyer_id
   </select>
   
   <!-- void update(Buyer buyer); -->
   <update id="update">
      update buyer SET 
      company = #company,
      phone = #phone,
      address = #address,
      email = #email,
      comment = #comment
      where buyer_id = #buyer_id
   </update>
   
   <!-- void delete(Integer buyer_id); -->
   <delete id="delete" >
      delete from buyer where buyer_id = #buyer_id
   </delete>
   
   <!-- void insert(Buyer record); -->
   <insert id="insert">
      insert into buyer(buyer_id,company,phone,address,email,comment) 
      value(#buyer_id,#company,#phone,#address,#email,#comment)
   </insert>
</mapper>

最后

如果想要进一步了解实现思路或者需要全部源码和报告(仅供自学、课设、毕设等学习使用),可加博主V:(Code2Life2)交流、获取。

以上是关于基于SSM+MySql实现的仓库管理系统的主要内容,如果未能解决你的问题,请参考以下文章

基于SSM的仓库管理系统

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

基于SSM开发java仓库库存管理系统源码

SSM个人财务管理系统

基于 ElementUIVue 和 SSM 的美年健康体检中心后台管理系统

ssm基于微信小程序的高校课堂教学管理系统--(ssm+uinapp+Mysql)