基于javaweb+mysql的springboot物资管理系统(java+springboot+vue+maven+mysql)
运行环境
Java≥8、MySQL≥5.7、Node.js≥10
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot物资管理系统(java+springboot+vue+maven+mysql)
一、项目运行 环境配置:
Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。
项目技术:
Spring + SpringBoot+ mybatis + Maven + Vue 等等组成,B/S模式 + Maven管理等等。
// 创建分页对象
PageInfo<Requisition> pageInfo = new PageInfo<>(list);
// 按接口要求返回数据
DataGridViewResult data = new DataGridViewResult(pageInfo.getTotal(), pageInfo.getList());
return data;
/**
* 审批申请
* @param rt
* @param request
* @return
*/
@ResponseBody
*/
@ResponseBody
@RequestMapping(value = "/info/delete")
public String deleteMaterialInfo(HttpServletRequest request) {
HashMap<String, Object> map = new HashMap<>();
String params = request.getParameter("params");
try {
if (!params.equals("") && params != "") {
// 获取mid数组
JSONArray jsonArray = JSONArray.parseArray(params);
List<String> list = new ArrayList<>();
* @param session
* @return 返回到登录界面
*/
@RequestMapping(value = "/logout.action")
public String logout(HttpSession session) {
// 清空session中的属性
session.removeAttribute("uid");
session.removeAttribute("uname");
session.removeAttribute("utype");
//让session无效
session.invalidate();
HashMap<String, Object> map = new HashMap<>();
// 获取领用人
String uname = (String) request.getSession().getAttribute("uname");
rt.setRtaker(uname);
// 生成时间戳,保证主键的唯一性
Date date = new Date();
String rid = String.valueOf(date.getTime());
rt.setRid(rid);
rt.setRstatus("申请中");
rt.setRtype("申请发放");
System.out.println(rt);
boolean result = requisitionService.add(rt);
if (result) {
map.put("success", true);
data.put("src", src + fileName);
map.put("code", 0);
map.put("msg", "上传成功!");
map.put("data", data);
return JSON.toJSONString(map);
} else {
map.put("code", -1);
map.put("msg", "请选择图片!");
return JSON.toJSONString(map);
} catch (Exception e) {
e.printStackTrace();
map.put("code", -1);
/**
* 查询待审核的领用申请
* @param rv
* @return
*/
@RequestMapping(value = "/approve/list")
@ResponseBody
public DataGridViewResult approveList(RequisitionVo rv){
rv.setRstatus("申请中");
// 设置分页信息
PageHelper.startPage(rv.getPage(), rv.getLimit());
// 查询
List<Requisition> list = requisitionService.findApproveList(rv);
@ResponseBody
@RequestMapping(value = "/info/update")
public String updateMaterialInfo(Material mi) {
HashMap<String, Object> map = new HashMap<>();
boolean result = materialService.updateMaterialInfo(mi);
if (result) {
map.put("success", true);
map.put("msg", "更改成功!");
} else {
map.put("success", false);
map.put("msg", "更改失败!");
map.put("success", true);
map.put("data", list);
} else {
map.put("success", false);
return JSON.toJSONString(map);
/**
* 物资入库
* @param pi
* @return
*/
@ResponseBody
@RequestMapping(value = "/putin/add")
public String revoke(@RequestParam("rid") String rid) {
HashMap<String, Object> map = new HashMap<>();
boolean result = requisitionService.revoke(rid);
if (result) {
map.put("success", true);
map.put("msg", "撤销成功!");
} else {
map.put("success", false);
map.put("msg", "撤销失败,请稍后重试!");
return JSON.toJSONString(map);
map.put("success", false);
Kind kind = new Kind("005", "其它");
map.put("data", kind);
System.out.println(map);
return JSON.toJSONString(map);
/**
* 上传物资图片
* @param file
* @param request
* @return
*/
@ResponseBody
* 查询所有的领用记录
* @param rv
* @return
*/
@RequestMapping(value = "/distribute/list")
@ResponseBody
public DataGridViewResult distributeList(RequisitionVo rv){
// 设置分页信息
PageHelper.startPage(rv.getPage(), rv.getLimit());
// 查询
List<Requisition> list = requisitionService.findAll(rv);
// 创建分页对象
private PutinService putinService;
@Resource
private StoreService storeService;
@Resource
private RequisitionService requisitionService;
@Resource
private IndexService indexService;
@RequestMapping(value = "/info.html")
public String materialInfo() {
return "/mh/material-info.html";
/**
file.transferTo(new File(imagePath));
data.put("src", src + fileName);
map.put("code", 0);
map.put("msg", "上传成功!");
map.put("data", data);
return JSON.toJSONString(map);
} else {
map.put("code", -1);
map.put("msg", "请选择图片!");
return JSON.toJSONString(map);
} catch (Exception e) {
e.printStackTrace();
map.put("code", -1);
/**
* 审批申请
* @param rt
* @param request
* @return
*/
@ResponseBody
@RequestMapping(value = "/approve/approve.action")
public String doApprove(Requisition rt,HttpServletRequest request){
// 审核人
String uname = (String)request.getSession().getAttribute("uname");
rt.setRverifier(uname);
System.out.println(rt);
return JSON.toJSONString(map);
@RequestMapping(value = "/todo.html")
public String todo(){
return "/staff/todo.html";
/**
* 待领取列表
* @param rv
* @return
*/
@ResponseBody
@RequestMapping(value = "/todo/list")
public DataGridViewResult todoList(RequisitionVo rv,HttpServletRequest request){
*/
@ResponseBody
@RequestMapping(value = "/apply/list")
public DataGridViewResult applyList(RequisitionVo rv,HttpServletRequest request) {
String uname = (String)request.getSession().getAttribute("uname");
rv.setRtaker(uname);
// 设置分页信息
PageHelper.startPage(rv.getPage(), rv.getLimit());
// 查询
List<Requisition> list = requisitionService.findRequisitionList(rv);
// 创建分页对象
PageInfo<Requisition> pageInfo = new PageInfo<>(list);
return "/mh/store.html";
/**
* 查询物资的库存信息
* @param sv
* @return
*/
@RequestMapping(value = "/store/list")
@ResponseBody
public DataGridViewResult findStoreList(StoreVo sv){
// 设置分页信息
PageHelper.startPage(sv.getPage(), sv.getLimit());
// 查询