3.5

AI训练 自然语言描述
一、数据库设计
仓库表:用于记录各个仓库的基本信息,包括唯一编码、名称、地址等。
物资台账明细表:包含物资编码、物资名称、规格、材质、供应商、品牌、物资分类等信息。每条记录还包括一个唯一的台账编号(格式为年月日+顺序号)、操作类别(入库或出库)、数量、计量单位及存放地点(仓库号)。
物资类别表:保证不同的物资名称、规格、材质不能设置相同的物资编码,确保物资类别的唯一性。
二、系统架构设计
前端使用HTML技术实现页面展示,后端使用Java语言实现业务逻辑,数据库使用MySQ数据库。
三、前端开发
登录页面:设计一个统一的登录界面,管理员和仓库管理人员共用一个界面登录,登录后根据角色显示不同的菜单项。
管理员页面:
仓库管理:实现仓库的新增、删除、修改功能。
物资类别管理:实现物资类别的新增、删除、修改功能。
仓库管理人员页面:
入库操作:选择物资类别,输入数量,生成入库单。
出库操作:选择物资类别,输入出库数量,生成出库单。
统计查询:输入物资编码,查询库存信息,查看入库单和出库单详情
四、后端开发
1.登录:实现用户登录功能,根据用户角色返回不同的菜单项和操作权限。
2.仓库管理:
新增仓库:验证仓库编号唯一性,新增仓库信息。
删除仓库:验证仓库是否有物资存储,若无则删除。
修改仓库:验证仓库编号唯一性,且无物资存储时允许修改。
3.物资类别管理
新增物资类别:验证物资分类编码唯一性,且物资名称、规格、材质组合唯一。
删除物资类别:验证物资台账明细表中是否存在该类物资,若无则删除。
修改物资类别:验证物资台账明细表中是否存在该类物资,若无则允许修改。
3.入库、出库、统计查询
入库:生成入库单,更新物资台账明细表和库存信息。
出库:生成出库单,更新物资台账明细表和库存信息。
统计查询:根据物资编码查询库存信息,显示入库单和出库单详情
代码:
数据库
CREATE DATABASE warehouse_management;

USE warehouse_management;

CREATE TABLE users (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
role ENUM('ADMIN', 'MANAGER') NOT NULL
);

CREATE TABLE warehouses (
warehouse_id INT AUTO_INCREMENT PRIMARY KEY,
unique_code VARCHAR(50) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL,
address VARCHAR(255)
);

CREATE TABLE material_categories (
category_id INT AUTO_INCREMENT PRIMARY KEY,
material_code VARCHAR(50) NOT NULL UNIQUE,
material_name VARCHAR(100) NOT NULL,
specification VARCHAR(100),
material_type VARCHAR(100),
supplier VARCHAR(100),
brand VARCHAR(100),
category_name VARCHAR(100) NOT NULL
);

CREATE TABLE inventory_details (
detail_id INT AUTO_INCREMENT PRIMARY KEY,
transaction_number VARCHAR(50) NOT NULL UNIQUE,
operation_type ENUM('IN', 'OUT') NOT NULL,
quantity DECIMAL(10, 2) NOT NULL,
unit_of_measurement VARCHAR(50),
storage_location INT,
material_code VARCHAR(50),
FOREIGN KEY (storage_location) REFERENCES warehouses(warehouse_id),
FOREIGN KEY (material_code) REFERENCES material_categories(material_code)
);
项目结构目录
WarehouseManagementSystem/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── example/
│ │ │ └── warehouse/
│ │ │ ├── controller/
│ │ │ ├── dao/
│ │ │ ├── model/
│ │ │ └── service/
│ │ └── resources/
│ │ └── application.properties
└── pom.xml
model类
User.java
package com.example.warehouse.model;

public class User {
private int userId;
private String username;
private String password;
private String role;

// Getters and Setters

}
Warehouse.java
package com.example.warehouse.model;

public class Warehouse {
private int warehouseId;
private String uniqueCode;
private String name;
private String address;

// Getters and Setters

}
MaterialCategory.java
package com.example.warehouse.model;

public class MaterialCategory {
private int categoryId;
private String materialCode;
private String materialName;
private String specification;
private String materialType;
private String supplier;
private String brand;
private String categoryName;

// Getters and Setters

}
InventoryDetail.java
package com.example.warehouse.model;

import java.math.BigDecimal;

public class InventoryDetail {
private int detailId;
private String transactionNumber;
private String operationType;
private BigDecimal quantity;
private String unitOfMeasurement;
private Integer storageLocation;
private String materialCode;

// Getters and Setters

}
DAO层
UserDao.java
package com.example.warehouse.dao;

import com.example.warehouse.model.User;

public interface UserDao {
User getUserByUsername(String username);
}

UserDaoImpl.java
package com.example.warehouse.dao;

import com.example.warehouse.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDaoImpl implements UserDao {

@Autowired
private JdbcTemplate jdbcTemplate;

@Override
public User getUserByUsername(String username) {
    String sql = "SELECT * FROM users WHERE username = ?";
    return jdbcTemplate.queryForObject(sql, new Object[]{username}, (rs, rowNum) -> {
        User user = new User();
        user.setUserId(rs.getInt("user_id"));
        user.setUsername(rs.getString("username"));
        user.setPassword(rs.getString("password"));
        user.setRole(rs.getString("role"));
        return user;
    });
}

}

WarehouseDao.java

package com.example.warehouse.dao;

import com.example.warehouse.model.Warehouse;

import java.util.List;

public interface WarehouseDao {
List getAllWarehouses();
Warehouse getWarehouseById(int id);
void addWarehouse(Warehouse warehouse);
void updateWarehouse(Warehouse warehouse);
void deleteWarehouse(int id);
}

WarehouseDaoImpl.java
java
深色版本
package com.example.warehouse.dao;

import com.example.warehouse.model.Warehouse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class WarehouseDaoImpl implements WarehouseDao {

@Autowired
private JdbcTemplate jdbcTemplate;

@Override
public List<Warehouse> getAllWarehouses() {
    String sql = "SELECT * FROM warehouses";
    return jdbcTemplate.query(sql, (rs, rowNum) -> {
        Warehouse warehouse = new Warehouse();
        warehouse.setWarehouseId(rs.getInt("warehouse_id"));
        warehouse.setUniqueCode(rs.getString("unique_code"));
        warehouse.setName(rs.getString("name"));
        warehouse.setAddress(rs.getString("address"));
        return warehouse;
    });
}

@Override
public Warehouse getWarehouseById(int id) {
    String sql = "SELECT * FROM warehouses WHERE warehouse_id = ?";
    return jdbcTemplate.queryForObject(sql, new Object[]{id}, (rs, rowNum) -> {
        Warehouse warehouse = new Warehouse();
        warehouse.setWarehouseId(rs.getInt("warehouse_id"));
        warehouse.setUniqueCode(rs.getString("unique_code"));
        warehouse.setName(rs.getString("name"));
        warehouse.setAddress(rs.getString("address"));
        return warehouse;
    });
}

@Override
public void addWarehouse(Warehouse warehouse) {
    String sql = "INSERT INTO warehouses(unique_code, name, address) VALUES (?, ?, ?)";
    jdbcTemplate.update(sql, warehouse.getUniqueCode(), warehouse.getName(), warehouse.getAddress());
}

@Override
public void updateWarehouse(Warehouse warehouse) {
    String sql = "UPDATE warehouses SET unique_code = ?, name = ?, address = ? WHERE warehouse_id = ?";
    jdbcTemplate.update(sql, warehouse.getUniqueCode(), warehouse.getName(), warehouse.getAddress(), warehouse.getWarehouseId());
}

@Override
public void deleteWarehouse(int id) {
    String sql = "DELETE FROM warehouses WHERE warehouse_id = ?";
    jdbcTemplate.update(sql, id);
}

}
MaterialCategoryDao.java
java
深色版本
package com.example.warehouse.dao;

import com.example.warehouse.model.MaterialCategory;

import java.util.List;

public interface MaterialCategoryDao {
List getAllMaterialCategories();
MaterialCategory getMaterialCategoryById(int id);
void addMaterialCategory(MaterialCategory category);
void updateMaterialCategory(MaterialCategory category);
void deleteMaterialCategory(int id);
}
MaterialCategoryDaoImpl.java
java
深色版本
package com.example.warehouse.dao;

import com.example.warehouse.model.MaterialCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class MaterialCategoryDaoImpl implements MaterialCategoryDao {

@Autowired
private JdbcTemplate jdbcTemplate;

@Override
public List<MaterialCategory> getAllMaterialCategories() {
    String sql = "SELECT * FROM material_categories";
    return jdbcTemplate.query(sql, (rs, rowNum) -> {
        MaterialCategory category = new MaterialCategory();
        category.setCategoryId(rs.getInt("category_id"));
        category.setMaterialCode(rs.getString("material_code"));
        category.setMaterialName(rs.getString("material_name"));
        category.setSpecification(rs.getString("specification"));
        category.setMaterialType(rs.getString("material_type"));
        category.setSupplier(rs.getString("supplier"));
        category.setBrand(rs.getString("brand"));
        category.setCategoryName(rs.getString("category_name"));
        return category;
    });
}

@Override
public MaterialCategory getMaterialCategoryById(int id) {
    String sql = "SELECT * FROM material_categories WHERE category_id = ?";
    return jdbcTemplate.queryForObject(sql, new Object[]{id}, (rs, rowNum) -> {
        MaterialCategory category = new MaterialCategory();
        category.setCategoryId(rs.getInt("category_id"));
        category.setMaterialCode(rs.getString("material_code"));
        category.setMaterialName(rs.getString("material_name"));
        category.setSpecification(rs.getString("specification"));
        category.setMaterialType(rs.getString("material_type"));
        category.setSupplier(rs.getString("supplier"));
        category.setBrand(rs.getString("brand"));
        category.setCategoryName(rs.getString("category_name"));
        return category;
    });
}

@Override
public void addMaterialCategory(MaterialCategory category) {
    String sql = "INSERT INTO material_categories(material_code, material_name, specification, material_type, supplier, brand, category_name) VALUES (?, ?, ?, ?, ?, ?, ?)";
    jdbcTemplate.update(sql, category.getMaterialCode(), category.getMaterialName(), category.getSpecification(), category.getMaterialType(), category.getSupplier(), category.getBrand(), category.getCategoryName());
}

@Override
public void updateMaterialCategory(MaterialCategory category) {
    String sql = "UPDATE material_categories SET material_code = ?, material_name = ?, specification = ?, material_type = ?, supplier = ?, brand = ?, category_name = ? WHERE category_id = ?";
    jdbcTemplate.update(sql, category.getMaterialCode(), category.getMaterialName(), category.getSpecification(), category.getMaterialType(), category.getSupplier(), category.getBrand(), category.getCategoryName(), category.getCategoryId());
}

@Override
public void deleteMaterialCategory(int id) {
    String sql = "DELETE FROM material_categories WHERE category_id = ?";
    jdbcTemplate.update(sql, id);
}

}

InventoryDetailDao.java

package com.example.warehouse.dao;

import com.example.warehouse.model.InventoryDetail;

import java.util.List;

public interface InventoryDetailDao {
List getAllInventoryDetails();
InventoryDetail getInventoryDetailById(int id);
void addInventoryDetail(InventoryDetail detail);
void updateInventoryDetail(InventoryDetail detail);
void deleteInventoryDetail(int id);
}

InventoryDetailDaoImpl.java

package com.example.warehouse.dao;

import com.example.warehouse.model.InventoryDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public class InventoryDetailDaoImpl implements InventoryDetailDao {

@Autowired
private JdbcTemplate jdbcTemplate;

@Override
public List<InventoryDetail> getAllInventoryDetails() {
    String sql = "SELECT * FROM inventory_details";
    return jdbcTemplate.query(sql, (rs, rowNum) -> {
        InventoryDetail detail = new InventoryDetail();
        detail.setDetailId(rs.getInt("detail_id"));
        detail.setTransactionNumber(rs.getString("transaction_number"));
        detail.setOperationType(rs.getString("operation_type"));
        detail.setQuantity(rs.getBigDecimal("quantity"));
        detail.setUnitOfMeasurement(rs.getString("unit_of_measurement"));
        detail.setStorageLocation(rs.getInt("storage_location"));
        detail.setMaterialCode(rs.getString("material_code"));
        return detail;
    });
}

@Override
public InventoryDetail getInventoryDetailById(int id) {
    String sql = "SELECT * FROM inventory_details WHERE detail_id = ?";
    return jdbcTemplate.queryForObject(sql, new Object[]{id}, (rs, rowNum) -> {
        InventoryDetail detail = new InventoryDetail();
        detail.setDetailId(rs.getInt("detail_id"));
        detail.setTransactionNumber(rs.getString("transaction_number"));
        detail.setOperationType(rs.getString("operation_type"));
        detail.setQuantity(rs.getBigDecimal("quantity"));
        detail.setUnitOfMeasurement(rs.getString("unit_of_measurement"));
        detail.setStorageLocation(rs.getInt("storage_location"));
        detail.setMaterialCode(rs.getString("material_code"));
        return detail;
    });
}

@Override
public void addInventoryDetail(InventoryDetail detail) {
    String sql = "INSERT INTO inventory_details(transaction_number, operation_type, quantity, unit_of_measurement, storage_location, material_code) VALUES (?, ?, ?, ?, ?, ?)";
    jdbcTemplate.update(sql, detail.getTransactionNumber(), detail.getOperationType(), detail.getQuantity(), detail.getUnitOfMeasurement(), detail.getStorageLocation(), detail.getMaterialCode());
}

@Override
public void updateInventoryDetail(InventoryDetail detail) {
    String sql = "UPDATE inventory_details SET transaction_number = ?, operation_type = ?, quantity = ?, unit_of_measurement = ?, storage_location = ?, material_code = ? WHERE detail_id = ?";
    jdbcTemplate.update(sql, detail.getTransactionNumber(), detail.getOperationType(), detail.getQuantity(), detail.getUnitOfMeasurement(), detail.getStorageLocation(), detail.getMaterialCode(), detail.getDetailId());
}

@Override
public void deleteInventoryDetail(int id) {
    String sql = "DELETE FROM inventory_details WHERE detail_id = ?";
    jdbcTemplate.update(sql, id);
}

}
Service层
UserService.java

package com.example.warehouse.service;

import com.example.warehouse.model.User;

public interface UserService {
User authenticateUser(String username, String password);
}

UserServiceImpl.java
package com.example.warehouse.service;

import com.example.warehouse.dao.UserDao;
import com.example.warehouse.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

@Autowired
private UserDao userDao;

@Autowired
private BCryptPasswordEncoder bCryptPasswordEncoder;

@Override
public User authenticateUser(String username, String password) {
    User user = userDao.getUserByUsername(username);
    if (user != null && bCryptPasswordEncoder.matches(password, user.getPassword())) {
        return user;
    }
    return null;
}

}

WarehouseService.java

package com.example.warehouse.service;

import com.example.warehouse.model.Warehouse;

import java.util.List;

public interface WarehouseService {
List getAllWarehouses();
Warehouse getWarehouseById(int id);
void addWarehouse(Warehouse warehouse);
void updateWarehouse(Warehouse warehouse);
void deleteWarehouse(int id);
}

WarehouseServiceImpl.java
package com.example.warehouse.service;

import com.example.warehouse.dao.WarehouseDao;
import com.example.warehouse.model.Warehouse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WarehouseServiceImpl implements WarehouseService {

@Autowired
private WarehouseDao warehouseDao;

@Override
public List<Warehouse> getAllWarehouses() {
    return warehouseDao.getAllWarehouses();
}

@Override
public Warehouse getWarehouseById(int id) {
    return warehouseDao.getWarehouseById(id);
}

@Override
public void addWarehouse(Warehouse warehouse) {
    warehouseDao.addWarehouse(warehouse);
}

@Override
public void updateWarehouse(Warehouse warehouse) {
    warehouseDao.updateWarehouse(warehouse);
}

@Override
public void deleteWarehouse(int id) {
    warehouseDao.deleteWarehouse(id);
}

}
MaterialCategoryService.java
java
深色版本
package com.example.warehouse.service;

import com.example.warehouse.model.MaterialCategory;

import java.util.List;

public interface MaterialCategoryService {
List getAllMaterialCategories();
MaterialCategory getMaterialCategoryById(int id);
void addMaterialCategory(MaterialCategory category);
void updateMaterialCategory(MaterialCategory category);
void deleteMaterialCategory(int id);
}

MaterialCategoryServiceImpl.java
package com.example.warehouse.service;

import com.example.warehouse.dao.MaterialCategoryDao;
import com.example.warehouse.model.MaterialCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaterialCategoryServiceImpl implements MaterialCategoryService {

@Autowired
private MaterialCategoryDao materialCategoryDao;

@Override
public List<MaterialCategory> getAllMaterialCategories() {
    return materialCategoryDao.getAllMaterialCategories();
}

@Override
public MaterialCategory getMaterialCategoryById(int id) {
    return materialCategoryDao.getMaterialCategoryById(id);
}

@Override
public void addMaterialCategory(MaterialCategory category) {
    materialCategoryDao.addMaterialCategory(category);
}

@Override
public void updateMaterialCategory(MaterialCategory category) {
    materialCategoryDao.updateMaterialCategory(category);
}

@Override
public void deleteMaterialCategory(int id) {
    materialCategoryDao.deleteMaterialCategory(id);
}

}

InventoryDetailService.java
package com.example.warehouse.service;

import com.example.warehouse.model.InventoryDetail;

import java.util.List;

public interface InventoryDetailService {
List getAllInventoryDetails();
InventoryDetail getInventoryDetailById(int id);
void addInventoryDetail(InventoryDetail detail);
void updateInventoryDetail(InventoryDetail detail);
void deleteInventoryDetail(int id);
}

InventoryDetailServiceImpl.java
package com.example.warehouse.service;

import com.example.warehouse.dao.InventoryDetailDao;
import com.example.warehouse.model.InventoryDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InventoryDetailServiceImpl implements InventoryDetailService {

@Autowired
private InventoryDetailDao inventoryDetailDao;

@Override
public List<InventoryDetail> getAllInventoryDetails() {
    return inventoryDetailDao.getAllInventoryDetails();
}

@Override
public InventoryDetail getInventoryDetailById(int id) {
    return inventoryDetailDao.getInventoryDetailById(id);
}

@Override
public void addInventoryDetail(InventoryDetail detail) {
    inventoryDetailDao.addInventoryDetail(detail);
}

@Override
public void updateInventoryDetail(InventoryDetail detail) {
    inventoryDetailDao.updateInventoryDetail(detail);
}

@Override
public void deleteInventoryDetail(int id) {
    inventoryDetailDao.deleteInventoryDetail(id);
}

}
Controller层
UserController.java
package com.example.warehouse.controller;

import com.example.warehouse.model.User;
import com.example.warehouse.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class UserController {

@Autowired
private UserService userService;

@PostMapping("/login")
public User login(@RequestBody User user) {
    return userService.authenticateUser(user.getUsername(), user.getPassword());
}

}

WarehouseController.java

package com.example.warehouse.controller;

import com.example.warehouse.model.Warehouse;
import com.example.warehouse.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/warehouses")
public class WarehouseController {

@Autowired
private WarehouseService warehouseService;

@GetMapping
public List<Warehouse> getAllWarehouses() {
    return warehouseService.getAllWarehouses();
}

@GetMapping("/{id}")
public Warehouse getWarehouseById(@PathVariable int id) {
    return warehouseService.getWarehouseById(id);
}

@PostMapping
public void addWarehouse(@RequestBody Warehouse warehouse) {
    warehouseService.addWarehouse(warehouse);
}

@PutMapping("/{id}")
public void updateWarehouse(@PathVariable int id, @RequestBody Warehouse warehouse) {
    warehouse.setWarehouseId(id);
    warehouseService.updateWarehouse(warehouse);
}

@DeleteMapping("/{id}")
public void deleteWarehouse(@PathVariable int id) {
    warehouseService.deleteWarehouse(id);
}

}

MaterialCategoryController.java
package com.example.warehouse.controller;

import com.example.warehouse.model.MaterialCategory;
import com.example.warehouse.service.MaterialCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/material-categories")
public class MaterialCategoryController {

@Autowired
private MaterialCategoryService materialCategoryService;

@GetMapping
public List<MaterialCategory> getAllMaterialCategories() {
    return materialCategoryService.getAllMaterialCategories();
}

@GetMapping("/{id}")
public MaterialCategory getMaterialCategoryById(@PathVariable int id) {
    return materialCategoryService.getMaterialCategoryById(id);
}

@PostMapping
public void addMaterialCategory(@RequestBody MaterialCategory category) {
    materialCategoryService.addMaterialCategory(category);
}

@PutMapping("/{id}")
public void updateMaterialCategory(@PathVariable int id, @RequestBody MaterialCategory category) {
    category.setCategoryId(id);
    materialCategoryService.updateMaterialCategory(category);
}

@DeleteMapping("/{id}")
public void deleteMaterialCategory(@PathVariable int id) {
    materialCategoryService.deleteMaterialCategory(id);
}

}
InventoryDetailController.java
java
深色版本
package com.example.warehouse.controller;

import com.example.warehouse.model.InventoryDetail;
import com.example.warehouse.service.InventoryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/inventory-details")
public class InventoryDetailController {

@Autowired
private InventoryDetailService inventoryDetailService;

@GetMapping
public List<InventoryDetail> getAllInventoryDetails() {
    return inventoryDetailService.getAllInventoryDetails();
}

@GetMapping("/{id}")
public InventoryDetail getInventoryDetailById(@PathVariable int id) {
    return inventoryDetailService.getInventoryDetailById(id);
}

@PostMapping
public void addInventoryDetail(@RequestBody InventoryDetail detail) {
    inventoryDetailService.addInventoryDetail(detail);
}

@PutMapping("/{id}")
public void updateInventoryDetail(@PathVariable int id, @RequestBody InventoryDetail detail) {
    detail.setDetailId(id);
    inventoryDetailService.updateInventoryDetail(detail);
}

@DeleteMapping("/{id}")
public void deleteInventoryDetail(@PathVariable int id) {
    inventoryDetailService.deleteInventoryDetail(id);
}

}

配置文件

application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/warehouse_management?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.jackson.serialization.fail-on-empty-beans=false
security.basic.enabled=false
主启动类
WarehouseManagementApplication.java
package com.example.warehouse;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class WarehouseManagementApplication {
public static void main(String[] args) {
SpringApplication.run(WarehouseManagementApplication.class, args);
}
}
完整的Maven配置文件
pom.xml


4.0.0

<groupId>com.example</groupId>
<artifactId>warehouse-management-system</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.5</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <java.version>11</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

前端界面

仓库管理系统

登录

管理员菜单

仓库管理人员菜单

posted @   睡觉的时候不困,  阅读(2)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示