warehouse Warehouse Management System

repository·master·Indexed 21 days ago

https://github.com/yeqifu/warehouse

A Warehouse Management System (WMS) designed for business operations and system administration. Business modules cover customer, supplier, and product management, including inbound, sales, and returns. System modules provide user authentication, role-based access control, menu, and department management. Built with Java, SpringBoot, Shiro, MybatisPlus, and MySQL 5.0, with a frontend utilizing LayUI and DTree.

Tokens
2.2K
Snippets
6
Records
10
Agent score
77%

What's inside warehouse

  1. Overview of the Warehouse Management System

    master

    The warehouse system is a comprehensive management platform divided into two primary modules: Business Modules and System Modules.

    Business Modules

    Focuses on core warehouse operations:

    • Customer Management: List, pagination, fuzzy search, and CRUD operations (including batch deletion).
    • Supplier Management: List, pagination, fuzzy search, and CRUD operations (including batch deletion).
    • Product Management: List, pagination, fuzzy search, and CRUD operations (including image uploads).
    • Product Inbound Management: List, pagination, fuzzy search, and CRUD operations (including product returns).
    • Product Return Management: List, pagination, fuzzy search, and deletion.
    • Product Sales Management: List, pagination, fuzzy search, and CRUD operations (including sales returns).
    • Product Sales Return Management: List, pagination, fuzzy search, and deletion.

    System Modules

    Focuses on administrative and security functions:

    • User Login: Username/password/captcha validation, login logging, and unauthorized access interception.
    • Menu Management: Full menu queries, tree-based queries, and CRUD operations.
    • Role Management: Role queries, CRUD operations, and permission assignment.
    • User Management: User queries, CRUD operations, password resets, and role assignment.
    • Department Management: Department queries, tree-based queries, and CRUD operations.
  2. Configure the development environment for warehouse

    master

    To run the warehouse project locally, ensure your environment meets the following requirements:

    Backend Requirements

    • Language: Java
    • Frameworks: SpringBoot, Shiro, MybatisPlus
    • Build Tool: Maven 3.5.2
    • Server: Tomcat 8.5
    • Database: MySQL 5.0

    Frontend Requirements

    • Libraries: LayUI, DTree

    Tools

    • OS: Windows 10 (recommended)
    • IDE: IntelliJ IDEA
    • Database Client: Navicat
    • Version Control: Git
    • Hosting: GitHub
  3. Restore tabs after page refresh

    master

    The application includes logic to restore the user's previous session (open tabs and current active tab) after a page refresh, provided that cacheStr == "true".

    It utilizes window.sessionStorage to store:

    • menu: A JSON string representing the list of open tabs (including title, icon, href, and layId).
    • curmenu: The ID of the currently active tab.

    The restoration process uses element.tabAdd to recreate the tabs via iframes and element.tabChange to switch to the previously active tab.

  4. Initialize the application interface with Layui and bodyTab

    master

    The application uses layui and a custom bodyTab module to manage the dashboard interface, including top-level menus, sidebars, and tabbed content. The initialization configures the base path for modules and extends the bodyTab functionality.

    Key components initialized:

    • tab: An instance of layui.bodyTab used for managing open windows/tabs. It is configured with a maximum of 50 tabs (openTabNum: "50") and fetches menu data from json/navs.json.
    • layer: A reference to the layer component, prioritized to use the parent or top-level layer to ensure consistent dialog behavior across iframes.
    • getData(json): A function used to fetch and re-render the sidebar menu based on the selected top-level menu category (e.g., contentManagement, memberCenter, systemeSttings, or seraphApi).
    layui.config({
    	base : "js/"
    }).extend({
    	"bodyTab" : "bodyTab"
    });
    
    layui.use(['bodyTab','form','element','layer','jquery'],function({
        // ... initialization logic
    }));
  5. Initialize system parameters from session storage or JSON

    master

    The application attempts to load system configuration parameters (such as version, author, and server environment) by checking window.sessionStorage for a key named systemParameter. If not found in storage, it performs an AJAX GET request to ../json/systemParameter.json.

    Once the data is retrieved, it is processed by the fillParameter(data) function which populates specific UI elements using the following mapping:

    UI SelectorData FieldDescription
    .versiondata.versionCurrent version
    .authordata.authorDeveloper/Author
    .homePagedata.homePageWebsite homepage URL
    .serverdata.serverServer environment
    .dataBasedata.dataBaseDatabase version
    .maxUploaddata.maxUploadMaximum upload limit
    .userRightsdata.userRightsCurrent user permissions

    If a field is empty or undefined, the UI displays "未定义" (Undefined).

    // The application logic follows this pattern:
    if(window.sessionStorage.getItem("systemParameter")){
        var systemParameter = JSON.parse(window.sessionStorage.getItem("systemParameter"));
        fillParameter(systemParameter);
    } else {
        $.ajax({
            url : "../json/systemParameter.json",
            type : "get",
            dataType : "json",
            success : function(data){
                fillParameter(data);
            }
        });
    }
  6. Fetch and display news and user statistics

    master

    The dashboard fetches several datasets via AJAX to populate statistics and lists:

    1. Latest News List: Fetches ../json/newsList.json. It iterates through the first 5 items in the data array and builds a table rows (<tr>) containing the newsName and a truncated newsTime (first 10 characters). The result is injected into .hot_news.
    2. User Count: Fetches ../json/userList.json. It uses the count property from the returned object to update the text in .userAll span.
    3. External Icons: Fetches from iconUrl (a global variable) and counts the number of icon occurrences by splitting the string by .icon- to update .outIcons span.
  7. Clear application cache

    master

    The application provides a mechanism to clear all local and session storage. This is triggered by clicking an element with the .clearCache class. It clears both window.sessionStorage and window.localStorage and displays a notification using layer.msg.

    $(".clearCache").click(function(){
        window.sessionStorage.clear();
        window.localStorage.clear();
        // ... notification logic
    })
  8. Display donation and image management dialogs

    master

    The interface includes two utility functions for displaying popups:

    1. donation(): Opens a layer.tab dialog containing two tabs for '微信' (WeChat) and '支付宝' (Alipay), displaying respective payment images.
    2. showImg(): Fetches image data from json/images.json and opens a layer.photos gallery with an animation effect.
    function donation(){
    	layer.tab({
    		area : ['260px', '367px'],
    		tab : [
    			{ title : "微信", content : "..." },
    			{ title : "支付宝", content : "..." }
    		]
    	})
    }
    
    function showImg(){
        $.getJSON('json/images.json', function(json){
            layer.photos({
                photos: json,
                anim: 5
            });
        });
    }
  9. Display real-time system clock

    master

    The application uses getLangDate() to continuously update a clock display in the UI. It calculates the current year, month, day, week, and time (hour, minute, second), formats them with leading zeros where necessary via dateFilter(), and injects the resulting string into the HTML element with ID nowTime.

    The function uses setTimeout("getLangDate()", 1000) to refresh the time every second.

    The output format is: 亲爱的[User], [TimeOfDay]好! 欢迎使用layuiCMS 2.0模版。当前时间为: [YYYY年MM月DD日 HH:mm:ss] [Weekday].

    // The clock updates an element with id='nowTime'
    // Example output format:
    // 亲爱的驊驊龔頾,下午好! 欢迎使用layuiCMS 2.0模版。当前时间为: 2023年10月27日 14:30:05 星期五
  10. Manage application tabs with addTab()

    master

    To open a new tab in the dashboard, use the addTab(_this) function. This function wraps the tab.tabAdd method from the bodyTab module. It is typically triggered when a user clicks a navigation link that does not have sub-menu items.

    Note: When using this in a mobile context, the application automatically removes the site-mobile class from the body to close the mobile menu layer.

    function addTab(_this){
    	tab.tabAdd(_this);
    }