文章目录
- 仓库管理系统
- 一、项目演示
- 二、项目介绍
- 三、万字项目文档
- 四、部分功能截图
- 五、部分代码展示
- 六、底部获取项目源码带万字文档(9.9¥带走)
仓库管理系统
一、项目演示
仓库管理系统
二、项目介绍
基于spingboot和vue的前后端分离仓库管理系统
语言: Java 数据库:MySQL 前后端分离
前端技术 : Vue2 + ElementUl
后端技术 : SpringBoot2 + MyBatisPlus
系统角色:系统管理员、仓库管理员、员工
1.系统管理员:登录,个人中心、管理员信息管理、用户信息管理、仓库信息管理、物品分类管理、物品信息管理、操作日志
2.仓库管理员:登录、个人中心、用户信息管理、仓库信息管理、物品分类管理、物品信息管理、操作日志
3.员工:首页、个人中心、物品信息管理、操作日志
三、万字项目文档
四、部分功能截图
五、部分代码展示
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-06
*/
@ApiModel(value="Goods对象", description="")
public class Goods implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "货名")
private String name;
@ApiModelProperty(value = "仓库")
private Integer storage;
@ApiModelProperty(value = "分类")
@TableField("goodsType")
private Integer goodstype;
@ApiModelProperty(value = "数量")
private Integer count;
@ApiModelProperty(value = "备注")
private String remark;
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 Integer getStorage() {
return storage;
}
public void setStorage(Integer storage) {
this.storage = storage;
}
public Integer getGoodstype() {
return goodstype;
}
public void setGoodstype(Integer goodstype) {
this.goodstype = goodstype;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return "Goods{" +
"id=" + id +
", name='" + name + '\'' +
", storage=" + storage +
", goodstype=" + goodstype +
", count=" + count +
", remark='" + remark + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Goods goods = (Goods) o;
return Objects.equals(id, goods.id) && Objects.equals(name, goods.name) && Objects.equals(storage, goods.storage) && Objects.equals(goodstype, goods.goodstype) && Objects.equals(count, goods.count) && Objects.equals(remark, goods.remark);
}
@Override
public int hashCode() {
return Objects.hash(id, name, storage, goodstype, count, remark);
}
}
package com.rabbiter.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
*
* </p>
*
* @author rabbiter
* @since 2023-01-03
*/
@ApiModel(value="Menu对象", description="")
public class Menu implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
@ApiModelProperty(value = "菜单编码")
@TableField("menuCode")
private String menucode;
@ApiModelProperty(value = "菜单名字")
@TableField("menuName")
private String menuname;
@ApiModelProperty(value = "菜单级别")
@TableField("menuLevel")
private String menulevel;
@ApiModelProperty(value = "菜单的父code")
@TableField("menuParentCode")
private String menuparentcode;
@ApiModelProperty(value = "点击触发的函数")
@TableField("menuClick")
private String menuclick;
@ApiModelProperty(value = "权限 0超级管理员,1表示管理员,2表示普通用户,可以用逗号组合使用")
@TableField("menuRight")
private String menuright;
@TableField("menuComponent")
private String menucomponent;
@TableField("menuIcon")
private String menuicon;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getMenucode() {
return menucode;
}
public void setMenucode(String menucode) {
this.menucode = menucode;
}
public String getMenuname() {
return menuname;
}
public void setMenuname(String menuname) {
this.menuname = menuname;
}
public String getMenulevel() {
return menulevel;
}
public void setMenulevel(String menulevel) {
this.menulevel = menulevel;
}
public String getMenuparentcode() {
return menuparentcode;
}
public void setMenuparentcode(String menuparentcode) {
this.menuparentcode = menuparentcode;
}
public String getMenuclick() {
return menuclick;
}
public void setMenuclick(String menuclick) {
this.menuclick = menuclick;
}
public String getMenuright() {
return menuright;
}
public void setMenuright(String menuright) {
this.menuright = menuright;
}
public String getMenucomponent() {
return menucomponent;
}
public void setMenucomponent(String menucomponent) {
this.menucomponent = menucomponent;
}
public String getMenuicon() {
return menuicon;
}
public void setMenuicon(String menuicon) {
this.menuicon = menuicon;
}
@Override
public String toString() {
return "Menu{" +
"id=" + id +
", menucode='" + menucode + '\'' +
", menuname='" + menuname + '\'' +
", menulevel='" + menulevel + '\'' +
", menuparentcode='" + menuparentcode + '\'' +
", menuclick='" + menuclick + '\'' +
", menuright='" + menuright + '\'' +
", menucomponent='" + menucomponent + '\'' +
", menuicon='" + menuicon + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Menu menu = (Menu) o;
return Objects.equals(id, menu.id) && Objects.equals(menucode, menu.menucode) && Objects.equals(menuname, menu.menuname) && Objects.equals(menulevel, menu.menulevel) && Objects.equals(menuparentcode, menu.menuparentcode) && Objects.equals(menuclick, menu.menuclick) && Objects.equals(menuright, menu.menuright) && Objects.equals(menucomponent, menu.menucomponent) && Objects.equals(menuicon, menu.menuicon);
}
@Override
public int hashCode() {
return Objects.hash(id, menucode, menuname, menulevel, menuparentcode, menuclick, menuright, menucomponent, menuicon);
}
}
package com.rabbiter.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.common.QueryPageParam;
import com.rabbiter.common.Result;
import com.rabbiter.entity.Menu;
import com.rabbiter.entity.User;
import com.rabbiter.service.MenuService;
import com.rabbiter.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 前端控制器:用户管理和管理员管理模块
* </p>
*
* @author rabbiter
* @since 2023-01-02
*/
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
@Autowired
private MenuService menuService;
/*
* 查询全部用户
* @author rabbiter
* @date 2023/1/2 19:26
*/
@GetMapping("/list")
public List<User> list(){
return userService.list();
}
/*
* 根据账号查找用户
* @author rabbiter
* @date 2023/1/4 14:53
*/
@GetMapping("/findByNo")
public Result findByNo(@RequestParam String no){
List list = userService.lambdaQuery()
.eq(User::getNo,no)
.list();
return list.size()>0?Result.success(list):Result.fail();
}
/*
* 新增用户
* @author rabbiter
* @date 2023/1/2 19:11
*/
@PostMapping("/save")
public Result save(@RequestBody User user){
return userService.save(user)?Result.success():Result.fail();
}
/*
* 更新用户
* @author rabbiter
* @date 2023/1/2 19:11
*/
@PostMapping("/update")
public Result update(@RequestBody User user){
return userService.updateById(user)?Result.success():Result.fail();
}
/*
* 用户登录:登录的时候一并将菜单信息也查询出来
* @author rabbiter
* @date 2023/1/3 14:08
*/
@PostMapping("/login")
public Result login(@RequestBody User user){
//匹配账号和密码
List list = userService.lambdaQuery()
.eq(User::getNo,user.getNo())
.eq(User::getPassword,user.getPassword())
.list();
if(list.size()>0){
User user1 = (User)list.get(0);
List<Menu> menuList = menuService.lambdaQuery()
.like(Menu::getMenuright,user1.getRoleId())
.list();
HashMap res = new HashMap();
res.put("user",user1);
res.put("menu",menuList);
return Result.success(res);
}
return Result.fail();
}
/*
* 修改用户
* @author rabbiter
* @date 2023/1/4 15:02
*/
@PostMapping("/mod")
public boolean mod(@RequestBody User user){
return userService.updateById(user);
}
/*
* 新增或修改:存在用户则修改,否则新增用户
* @author rabbiter
* @date 2023/1/2 19:12
*/
@PostMapping("/saveOrUpdate")
public Result saveOrUpdate(@RequestBody User user){
return userService.saveOrUpdate(user)?Result.success():Result.fail();
}
/*
* 删除用户
* @author rabbiter
* @date 2023/1/2 19:15
*/
@GetMapping("/del")
public Result delete(Integer id){
return userService.removeById(id)?Result.success():Result.fail();
}
/*
* 模糊查询
* @author rabbiter
* @date 2023/1/2 19:36
*/
@PostMapping("/listP")
public Result query(@RequestBody User user){
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(user.getName())){
wrapper.like(User::getName,user.getName());
}
return Result.success(userService.list(wrapper));
}
/*
* 分页查询
* @author rabbiter
* @date 2023/1/2 19:48
*/
// @PostMapping("/listPage")
// public Result page(@RequestBody QueryPageParam query){
// HashMap param = query.getParam();
// String name = (String)param.get("name");
//
// Page<User> page = new Page();
// page.setCurrent(query.getPageNum());
// page.setSize(query.getPageSize());
//
// LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
// wrapper.like(User::getName,name);
//
// IPage result = userService.page(page,wrapper);
// return Result.success(result.getRecords(),result.getTotal());
// }
@PostMapping("/listPage")
public List<User> listPage(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
System.out.println("name=>"+(String)param.get("name"));
Page<User> page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.like(User::getName,name);
IPage result = userService.page(page,lambdaQueryWrapper);
System.out.println("total=>"+result.getTotal());
return result.getRecords();
}
/*
* 查询功能:根据前端表单输入的信息或者下拉框选择查询用户,并以分页的形式返回前端
* @author rabbiter
* @date 2023/1/4 20:28
*/
@PostMapping("/listPageC1")
public Result listPageC1(@RequestBody QueryPageParam query){
HashMap param = query.getParam();
String name = (String)param.get("name");
String sex = (String)param.get("sex");
String roleId = (String)param.get("roleId");
Page<User> page = new Page();
page.setCurrent(query.getPageNum());
page.setSize(query.getPageSize());
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
lambdaQueryWrapper.like(User::getName,name);
}
if(StringUtils.isNotBlank(sex)){
lambdaQueryWrapper.eq(User::getSex,sex);
}
if(StringUtils.isNotBlank(roleId)){
lambdaQueryWrapper.eq(User::getRoleId,roleId);
}
IPage result = userService.pageCC(page,lambdaQueryWrapper);
System.out.println("total=>"+result.getTotal());
return Result.success(result.getRecords(),result.getTotal());
}
}
六、底部获取项目源码带万字文档(9.9¥带走)
有问题,或者需要协助调试运行项目的也可以