大家好!我是程序猿老A,感谢您阅读本文,欢迎一键三连哦。
💞当前专栏:Java毕业设计
精彩专栏推荐👇🏻👇🏻👇🏻
开发环境
开发语言:Java
框架:Springboot+Vue
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7
数据库工具:Navicat12
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
演示视频
springboot265库存管理系统录像
原版高清演示视频-编号:265
https://pan.quark.cn/s/5cda95b17ee0
源码下载地址:
https://download.csdn.net/download/2301_76953549/89100190
LW目录
【如需全文请按文末获取联系】
目录
一、项目简介
库存管理系统运用的工具包括IDEA,Tomcat,Spring Boot框架以及MySQL等。该系统可以实现对公告信息,员工,供应商类型,供应商信用等级,商品类型,公告类型,供应商,商品,商品预定,采购入库,采购入库详情,客户等信息进行管理。
二、系统设计
2.1软件功能模块设计
管理员具备的详细功能将参照最终的设计结果,即图4.1所示的管理员功能结构图。其中管理员查看商品库存统计报表,对商品,商品预定信息,供应商信息,商品采购入库信息,客户信息,公告信息,员工信息等进行管理。
员工具备的详细功能将参照最终的设计结果,即图4.2所示的员工功能结构图。其中员工查询商品,添加商品预定信息,添加商品采购入库信息,添加客户信息,查看公告等。
2.2数据库设计
(1)把出入库信息具备的属性通过属性图进行展示,绘制的属性图见图4.4。
(2)把商品具备的属性通过属性图进行展示,绘制的属性图见图4.5。
(3)把员工具备的属性通过属性图进行展示,绘制的属性图见图4.6。
(4)把管理员具备的属性通过属性图进行展示,绘制的属性图见图4.7。
(5)上述实体间关系见图4.8。
三、系统项目部分截图
3.1管理员功能实现
供应商管理
实现供应商管理功能,其界面运行的效果图见图5.1。供应商信息有供应商类型,供应商信用等级名称,供应商名称等信息,管理员需要新增供应商,发现登记错误数据的供应商信息可以使用修改功能及时更改,需要删除的供应商信息可以使用删除功能删除。
商品统计报表
实现商品统计报表功能,其界面运行的效果图见图5.3。管理员通过柱形图可以查看各个商品的库存数据,管理员可以切换柱形图统计报表为折线图,可以下载商品库存的统计报表图片。
采购入库管理
实现采购入库管理功能,其界面运行的效果图见图5.5。采购入库信息包括采购入库名称,采购入库流水号等信息,采购入库信息也允许管理员新增,需要删除的采购入库信息也能够使用删除功能删除。管理员查询采购入库信息需要提供的查询条件是采购入库名称。
客户管理
实现客户管理功能,其界面运行的效果图见图5.7。客户信息有客户姓名,客户联系方式,客户性别等信息,管理员也能新增客户信息,客户信息存在数据登记错误的情况,管理员可以使用修改功能更改,需要删除的客户信息可以使用删除功能删除。对于客户信息的查询,需要管理员提供客户姓名,提供客户联系方式等。## 3.2公告信息功能
3.3员工功能实现
商品管理
实现商品管理功能,其界面运行的效果图见图5.8。员工查看商品存储仓库,查看商品库存,查看商品单价等信息,员工查询商品有很多种方式,可以根据商品名字,商品类型,存储仓库,单价,供应商名称等信息来查询商品。
采购入库
实现采购入库功能,其界面运行的效果图见图5.11。员工对商品采购入库时,需要选择采购入库的商品,然后对该商品的入库数量进行编辑,包括增加商品采购入库的数量,减少商品采购入库的数量,查看商品库存,最后提交商品采购入库信息。
采购入库详情管理
实现采购入库详情管理功能,其界面运行的效果图见图5.12。员工主要是查看采购入库的商品的操作数量信息,操作时间信息,采购入库名称以及采购入库类型等信息。查询采购入库详情需要员工提供商品名字,单价,采购入库名称才能查询。
四、部分核心代码
4.1 用户部分
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("/gongyinghsang")
public class GongyinghsangController {
private static final Logger logger = LoggerFactory.getLogger(GongyinghsangController.class);
@Autowired
private GongyinghsangService gongyinghsangService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@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(false)
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 = gongyinghsangService.queryPage(params);
//字典表数据转换
List<GongyinghsangView> list =(List<GongyinghsangView>)page.getList();
for(GongyinghsangView 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);
GongyinghsangEntity gongyinghsang = gongyinghsangService.selectById(id);
if(gongyinghsang !=null){
//entity转view
GongyinghsangView view = new GongyinghsangView();
BeanUtils.copyProperties( gongyinghsang , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongyinghsangEntity gongyinghsang, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,gongyinghsang:{}",this.getClass().getName(),gongyinghsang.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
Wrapper<GongyinghsangEntity> queryWrapper = new EntityWrapper<GongyinghsangEntity>()
.eq("gongyinghsang_name", gongyinghsang.getGongyinghsangName())
.eq("gongyinghsang_types", gongyinghsang.getGongyinghsangTypes())
.eq("gongyinghsang_xinyong_types", gongyinghsang.getGongyinghsangXinyongTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GongyinghsangEntity gongyinghsangEntity = gongyinghsangService.selectOne(queryWrapper);
if(gongyinghsangEntity==null){
gongyinghsang.setInsertTime(new Date());
gongyinghsang.setCreateTime(new Date());
gongyinghsangService.insert(gongyinghsang);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody GongyinghsangEntity gongyinghsang, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,gongyinghsang:{}",this.getClass().getName(),gongyinghsang.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
//根据字段查询是否有相同数据
Wrapper<GongyinghsangEntity> queryWrapper = new EntityWrapper<GongyinghsangEntity>()
.notIn("id",gongyinghsang.getId())
.andNew()
.eq("gongyinghsang_name", gongyinghsang.getGongyinghsangName())
.eq("gongyinghsang_types", gongyinghsang.getGongyinghsangTypes())
.eq("gongyinghsang_xinyong_types", gongyinghsang.getGongyinghsangXinyongTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GongyinghsangEntity gongyinghsangEntity = gongyinghsangService.selectOne(queryWrapper);
if(gongyinghsangEntity==null){
gongyinghsangService.updateById(gongyinghsang);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
gongyinghsangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<GongyinghsangEntity> gongyinghsangList = 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){
//循环
GongyinghsangEntity gongyinghsangEntity = new GongyinghsangEntity();
// gongyinghsangEntity.setGongyinghsangName(data.get(0)); //供应商名称 要改的
// gongyinghsangEntity.setGongyinghsangTypes(Integer.valueOf(data.get(0))); //供应商类型 要改的
// gongyinghsangEntity.setGongyinghsangXinyongTypes(Integer.valueOf(data.get(0))); //供应商信用等级名称 要改的
// gongyinghsangEntity.setInsertTime(date);//时间
// gongyinghsangEntity.setGongyinghsangContent("");//详情和图片
// gongyinghsangEntity.setCreateTime(date);//时间
gongyinghsangList.add(gongyinghsangEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
gongyinghsangService.insertBatch(gongyinghsangList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
获取源码或论文
如需对应的LW或源码,以及其他定制需求,也可以点我头像查看个人简介联系。