计算机毕业设计-基于Java+SSM架构的仓库管理系统项目开发实战(附源码+论文)
大家好!我是程序员一帆,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
- 开发语言采用Java
- 框架选择为SSM技术架构
- 运行环境基于JDK1.8官方版本
- 服务器采用Tomcat7软件服务端
- MySQL数据库采用5.7版特性优化方案
- MySQL工具有Navicat12组件辅助操作界面设计
- 开发环境支持Eclipse/MyEclipse/Idea集成开发平台配置管理功能模块
- Maven版本为3.3.9稳定发布版本配置管理需求
- 浏览器设置为Google Chrome(或其他主流浏览器)
源码下载地址:
<>
论文目录
【如需全文请按文末获取联系】


一、项目简介
该系统承担的功能包含仓库管理系统、出入库管理系统、物资调度与管理系统、人员配置与管理系统等。该系统基于MySQL数据库、Java语言以及SSM开发框架进行编程实现。
二、系统设计
2.1软件功能模块设计
图4.1即是所设计的管理员功能结构图示,在管理员权限操作中会涵盖员工数据、物料数据、存储场所数据以及收发存数据等核心业务要素的信息管理功能

图4.2即是设计的员工功能结构图示,在该系统中涉及员工权限操作的功能模块主要负责处理物资出入库相关的各种事务。具体来说包括完成物资的入库与出库操作,并能实现对物资出入库记录的查询与追踪。

2.2数据库设计
(1)图4.4即为物资这个实体所拥有的属性值。

(2)图4.5即为管理员这个实体所拥有的属性值。

(3)图4.6即为仓库这个实体所拥有的属性值。

(5)图4.8即为上面介绍的实体中存在的联系。

三、系统项目部分截图
3.1管理员功能实现
图5.1 即为该系统实现的仓库存疑信息界面,在线工作人员可在此界面中更新仓库存疑所属区域信息,并对仓库存疑名称进行修改操作;该系统支持对仓库存疑信息进行删除操作,并允许新增仓库存疑信息。

图5.2展示了采用编码技术实现的员工管理界面,在该界面上管理员能够为员工账户重置密码并更新其头像信息、邮箱地址等资料。同时该界面还支持新增、删除以及员工信息查询功能。

物资信息化管理系统的图形界面设计中(如图5.3所示),通过基于编码技术实现了物资信息管理的核心功能模块。该模块赋予操作人员完成物资信息录入、修改物资价格、调整物资单位设置、管理供应商资料等基础数据项的权利配置,并提供数据删除、信息查询等功能入口。

3.2员工功能实现
如图5.4所示,则是基于编码技术实现的物资入库存管界面。操作流程如下:员工首先根据需求选择需入库的物资项,在系统中输入所需数量即可完成入库存款操作。具体来说,在该界面中点击“添加”按钮后,在当前页面上会展示待处理的物资基本信息;随后仅需对系统中的库存数量进行调整即可完成整个入库流程的操作步骤。

图5.5 即为通过编码实现的物资离场界面,在界面上可选择需离场的具体物资;操作流程如下:员工首先在界面上选择所需离场的物资类型并填写相关参数;随后点击"添加"按钮,在当前页面上会展示等待处理的所有离场信息;最后员工只需在表格中输入具体离场数量即可完成整个操作流程

入库存储与出库管理功能已通过编码技术实现
如图5.6所示,在线展示的是通过编码技术开发完成的物资进出库管理界面
员工可以在该界面通过输入出入口名称或筛选物资编号等方式快速获取相关物资进出库的具体信息
点击"详情"按钮后系统将自动生成相应的出入口信息记录

四、部分核心代码
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/** * 出入库
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/wuziChuruInout")
public class WuziChuruInoutController {
private static final Logger logger = LoggerFactory.getLogger(WuziChuruInoutController.class);
@Autowired
private WuziChuruInoutService wuziChuruInoutService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
// 列表详情的表级联service
@Autowired
private WuziChuruInoutListService wuziChuruInoutListService;
// @Autowired
// private YonghuService yonghuService;
@Autowired
private WuziService wuziService;
@Autowired
private YonghuService yonghuService;
/** * 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isEmpty(role))
return R.error(511,"权限为空");
else if("员工".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
if(params.get("orderBy")==null || params.get("orderBy")==""){
params.put("orderBy","id");
}
PageUtils page = wuziChuruInoutService.queryPage(params);
//字典表数据转换
List<WuziChuruInoutView> list =(List<WuziChuruInoutView>)page.getList();
for(WuziChuruInoutView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/** * 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
WuziChuruInoutEntity wuziChuruInout = wuziChuruInoutService.selectById(id);
if(wuziChuruInout !=null){
//entity转view
WuziChuruInoutView view = new WuziChuruInoutView();
BeanUtils.copyProperties( wuziChuruInout , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/** * 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody WuziChuruInoutEntity wuziChuruInout, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,wuziChuruInout:{}",this.getClass().getName(),wuziChuruInout.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isEmpty(role))
return R.error(511,"权限为空");
Wrapper<WuziChuruInoutEntity> queryWrapper = new EntityWrapper<WuziChuruInoutEntity>()
.eq("wuzi_churu_inout_uuid_number", wuziChuruInout.getWuziChuruInoutUuidNumber())
.eq("wuzi_churu_inout_name", wuziChuruInout.getWuziChuruInoutName())
.eq("wuzi_churu_inout_types", wuziChuruInout.getWuziChuruInoutTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
WuziChuruInoutEntity wuziChuruInoutEntity = wuziChuruInoutService.selectOne(queryWrapper);
if(wuziChuruInoutEntity==null){
wuziChuruInout.setInsertTime(new Date());
wuziChuruInout.setCreateTime(new Date());
wuziChuruInoutService.insert(wuziChuruInout);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/** * 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody WuziChuruInoutEntity wuziChuruInout, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,wuziChuruInout:{}",this.getClass().getName(),wuziChuruInout.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(StringUtil.isEmpty(role))
// return R.error(511,"权限为空");
//根据字段查询是否有相同数据
Wrapper<WuziChuruInoutEntity> queryWrapper = new EntityWrapper<WuziChuruInoutEntity>()
.notIn("id",wuziChuruInout.getId())
.andNew()
.eq("wuzi_churu_inout_uuid_number", wuziChuruInout.getWuziChuruInoutUuidNumber())
.eq("wuzi_churu_inout_name", wuziChuruInout.getWuziChuruInoutName())
.eq("wuzi_churu_inout_types", wuziChuruInout.getWuziChuruInoutTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
WuziChuruInoutEntity wuziChuruInoutEntity = wuziChuruInoutService.selectOne(queryWrapper);
if(wuziChuruInoutEntity==null){
wuziChuruInoutService.updateById(wuziChuruInout);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/** * 出库
*/
@RequestMapping("/outWuziChuruInoutList")
public R outWuziChuruInoutList(@RequestBody Map<String, Object> params,HttpServletRequest request){
logger.debug("outWuziChuruInoutList方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isEmpty(role))
return R.error(511,"权限为空");
//取出入库名称并判断是否存在
String wuziChuruInoutName = String.valueOf(params.get("wuziChuruInoutName"));
Wrapper<WuziChuruInoutEntity> queryWrapper = new EntityWrapper<WuziChuruInoutEntity>()
.eq("wuzi_churu_inout_name", wuziChuruInoutName)
;
WuziChuruInoutEntity wuziChuruInoutSelectOne = wuziChuruInoutService.selectOne(queryWrapper);
if(wuziChuruInoutSelectOne != null)
return R.error(511,"出入库名称已被使用");
//取当前表的级联表并判断是否前台传入
Map<String, Integer> map = (Map<String, Integer>) params.get("map");
if(map == null || map.size() == 0)
return R.error(511,"列表内容不能为空");
Set<String> ids = map.keySet();
List<WuziEntity> wuziList = wuziService.selectBatchIds(ids);
if(wuziList == null || wuziList.size() == 0){
return R.error(511,"查数据库查不到数据");
}else{
for(WuziEntity w:wuziList){
Integer value = w.getWuziKucunNumber()-map.get(String.valueOf(w.getId()));
if(value <0){
return R.error(511,"出库数量大于库存数量");
}
w.setWuziKucunNumber(value);
}
}
//当前表
WuziChuruInoutEntity wuziChuruInoutEntity = new WuziChuruInoutEntity<>();
wuziChuruInoutEntity.setWuziChuruInoutUuidNumber(String.valueOf(new Date().getTime()));
wuziChuruInoutEntity.setWuziChuruInoutName(wuziChuruInoutName);
wuziChuruInoutEntity.setWuziChuruInoutTypes(1);
wuziChuruInoutEntity.setWuziChuruInoutContent("");
wuziChuruInoutEntity.setInsertTime(new Date());
wuziChuruInoutEntity.setCreateTime(new Date());
boolean insertWuziChuruInout = wuziChuruInoutService.insert(wuziChuruInoutEntity);
if(insertWuziChuruInout){
//级联表
ArrayList<WuziChuruInoutListEntity> wuziChuruInoutLists = new ArrayList<>();
for(String id:ids){
WuziChuruInoutListEntity wuziChuruInoutListEntity = new WuziChuruInoutListEntity();
wuziChuruInoutListEntity.setWuziChuruInoutId(wuziChuruInoutEntity.getId());
wuziChuruInoutListEntity.setWuziId(Integer.valueOf(id));
wuziChuruInoutListEntity.setWuziChuruInoutListNumber(map.get(id));
wuziChuruInoutListEntity.setInsertTime(new Date());
wuziChuruInoutListEntity.setCreateTime(new Date());
wuziChuruInoutLists.add(wuziChuruInoutListEntity);
wuziService.updateBatchById(wuziList);
}
wuziChuruInoutListService.insertBatch(wuziChuruInoutLists);
}
return R.ok();
}
/** *入库
*/
@RequestMapping("/inWuziChuruInoutList")
public R inWuziChuruInoutList(@RequestBody Map<String, Object> params,HttpServletRequest request){
logger.debug("inWuziChuruInoutList方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
//params:{"map":{"1":2,"2":3},"wuziOutinName":"订单1"}
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isEmpty(role))
return R.error(511,"权限为空");
//取当前表名称并判断
String wuziChuruInoutName = String.valueOf(params.get("wuziChuruInoutName"));
Wrapper<WuziChuruInoutEntity> queryWrapper = new EntityWrapper<WuziChuruInoutEntity>()
.eq("wuzi_churu_inout_name", wuziChuruInoutName)
;
WuziChuruInoutEntity wuziChuruInoutSelectOne = wuziChuruInoutService.selectOne(queryWrapper);
if(wuziChuruInoutSelectOne != null)
return R.error(511,"出入库名称已被使用");
//取当前表的级联表并判断是否前台传入
Map<String, Integer> map = (Map<String, Integer>) params.get("map");
if(map == null || map.size() == 0)
return R.error(511,"列表内容不能为空");
Set<String> ids = map.keySet();
List<WuziEntity> wuziList = wuziService.selectBatchIds(ids);
if(wuziList == null || wuziList.size() == 0){
return R.error(511,"查数据库查不到数据");
}else{
for(WuziEntity w:wuziList){
w.setWuziKucunNumber(w.getWuziKucunNumber()+map.get(String.valueOf(w.getId())));
}
}
//当前表
WuziChuruInoutEntity wuziChuruInoutEntity = new WuziChuruInoutEntity<>();
wuziChuruInoutEntity.setWuziChuruInoutUuidNumber(String.valueOf(new Date().getTime()));
wuziChuruInoutEntity.setWuziChuruInoutName(wuziChuruInoutName);
wuziChuruInoutEntity.setWuziChuruInoutTypes(2);
wuziChuruInoutEntity.setWuziChuruInoutContent("");
wuziChuruInoutEntity.setInsertTime(new Date());
wuziChuruInoutEntity.setCreateTime(new Date());
boolean insertWuziChuruInout = wuziChuruInoutService.insert(wuziChuruInoutEntity);
if(insertWuziChuruInout){
//级联表
ArrayList<WuziChuruInoutListEntity> wuziChuruInoutLists = new ArrayList<>();
for(String id:ids){
WuziChuruInoutListEntity wuziChuruInoutListEntity = new WuziChuruInoutListEntity();
wuziChuruInoutListEntity.setWuziChuruInoutId(wuziChuruInoutEntity.getId());
wuziChuruInoutListEntity.setWuziId(Integer.valueOf(id));
wuziChuruInoutListEntity.setWuziChuruInoutListNumber(map.get(id));
wuziChuruInoutListEntity.setInsertTime(new Date());
wuziChuruInoutListEntity.setCreateTime(new Date());
wuziChuruInoutLists.add(wuziChuruInoutListEntity);
wuziService.updateBatchById(wuziList);
}
wuziChuruInoutListService.insertBatch(wuziChuruInoutLists);
}
return R.ok();
}
/** * 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
wuziChuruInoutService.deleteBatchIds(Arrays.asList(ids));
wuziChuruInoutListService.delete(new EntityWrapper<WuziChuruInoutListEntity>().in("wuzi_churu_inout_id",ids));
return R.ok();
}
/** * 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
try {
List<WuziChuruInoutEntity> wuziChuruInoutList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
WuziChuruInoutEntity wuziChuruInoutEntity = new WuziChuruInoutEntity();
// wuziChuruInoutEntity.setWuziChuruInoutUuidNumber(data.get(0)); //出入库流水号 要改的
// wuziChuruInoutEntity.setWuziChuruInoutName(data.get(0)); //出入库名称 要改的
// wuziChuruInoutEntity.setWuziChuruInoutTypes(Integer.valueOf(data.get(0))); //出入库类型 要改的
// wuziChuruInoutEntity.setWuziChuruInoutContent("");//照片
// wuziChuruInoutEntity.setInsertTime(date);//时间
// wuziChuruInoutEntity.setCreateTime(date);//时间
wuziChuruInoutList.add(wuziChuruInoutEntity);
//把要查询是否重复的字段放入map中
//出入库流水号
if(seachFields.containsKey("wuziChuruInoutUuidNumber")){
List<String> wuziChuruInoutUuidNumber = seachFields.get("wuziChuruInoutUuidNumber");
wuziChuruInoutUuidNumber.add(data.get(0));//要改的
}else{
List<String> wuziChuruInoutUuidNumber = new ArrayList<>();
wuziChuruInoutUuidNumber.add(data.get(0));//要改的
seachFields.put("wuziChuruInoutUuidNumber",wuziChuruInoutUuidNumber);
}
}
//查询是否重复
//出入库流水号
List<WuziChuruInoutEntity> wuziChuruInoutEntities_wuziChuruInoutUuidNumber = wuziChuruInoutService.selectList(new EntityWrapper<WuziChuruInoutEntity>().in("wuzi_churu_inout_uuid_number", seachFields.get("wuziChuruInoutUuidNumber")));
if(wuziChuruInoutEntities_wuziChuruInoutUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(WuziChuruInoutEntity s:wuziChuruInoutEntities_wuziChuruInoutUuidNumber){
repeatFields.add(s.getWuziChuruInoutUuidNumber());
}
return R.error(511,"数据库的该表中的 [出入库流水号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
wuziChuruInoutService.insertBatch(wuziChuruInoutList);
return R.ok();
}
}
}
}catch (Exception e){
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
获取源码或论文
如需对应的论文或源码,以及其他定制需求,也可以下方微❤联系。
