1.概述

本系统是基于Java设计的网页式开发项目,是一款用于物资管理人员对物资管理,其中包括对物资信息,出库物资信息,入库物资信息,物资信息余额等相关内容的管理,具有物资管理、用户管理、出库物资管理、入库物资管理、等相关功能的小型数据库管理应用系统。

2.开发环境

数据库:MySQL

代码编写工具:IntelliJ IDEA 2019

相关编译技术及工具:Jdk1.8 Springboot2.7 Spring SpringMVC Mybatis Thymeleaf Bootstrap3.6 Jquery Ajax HTML CSS JavaScript

3.E-R模型图

4.数据库表

5. 功能演示

6.源代码

package cn.edu.ncst.controller;import cn.edu.ncst.entity.Balance;
import cn.edu.ncst.service.BalanceService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;import javax.annotation.Resource;
import java.util.ArrayList;@Controller
@RequestMapping("/balance")
public class BalanceController {@Resourceprivate BalanceService balanceService;@ResponseBody@GetMapping("/queryall")public ModelAndView queryAll(){ModelAndView mv = new ModelAndView();ArrayList<Balance> list = balanceService.queryAll();mv.addObject("lists",list);mv.setViewName("balance_table");return mv;}@ResponseBody@GetMapping("/selectbyid")public Balance querybyid(Integer id){ArrayList<Balance> list = balanceService.queryAll();for(Balance balance :list){if (balance.getId() == id){return balance;}}return null;}
}
package cn.edu.ncst.controller;import cn.edu.ncst.entity.InResource;
import cn.edu.ncst.service.InResourceService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;import javax.annotation.Resource;
import java.util.ArrayList;
@Controller
@RequestMapping("/inresource")
public class InResourceController {@Resourceprivate InResourceService inResourceService;@GetMapping("/queryall")public ModelAndView queryAll(){ModelAndView mv = new ModelAndView();ArrayList<InResource> list;list = inResourceService.queyrAll();System.out.println(list);mv.addObject("inres",list);mv.setViewName("inresource_table");return mv;}@PostMapping("/add")@ResponseBodypublic String addUser(InResource resource){String info;int i= inResourceService.add(resource);if (i!=0){info="添加成功!";}else {info = "添加失败!";}return info;}@GetMapping("/delete")public String addUser(String id){inResourceService.delete(Integer.parseInt(id));return "redirect:/inresource/queryall";}@GetMapping("/select")@ResponseBodypublic InResource selectById(String id){InResource resource= inResourceService.select(Integer.valueOf(id));return resource;}@PostMapping("/modify")@ResponseBodypublic String modify(InResource resource){String info;int i= inResourceService.modify(resource);if (i!=0){info="修改成功!";}else {info = "修改失败!";}return info;}
}
package cn.edu.ncst.controller;import cn.edu.ncst.entity.OutResource;
import cn.edu.ncst.service.OutResourceService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;import javax.annotation.Resource;
import java.util.ArrayList;@Controller
@RequestMapping("/outresource")
public class OutResourceController {@Resourceprivate OutResourceService outResourceService;@GetMapping("/queryall")public ModelAndView queryAll(){ModelAndView mv = new ModelAndView();ArrayList<OutResource> list;list = outResourceService.queryAll();System.out.println(list);mv.addObject("inres",list);mv.setViewName("outresource_table");return mv;}@PostMapping("/add")@ResponseBodypublic String addUser(OutResource resource){String info;int i= outResourceService.add(resource);if (i!=0){info="添加成功!";}else {info = "添加失败!";}return info;}@GetMapping("/delete")public String addUser(String id){outResourceService.delete(Integer.parseInt(id));return "redirect:/outresource/queryall";}@GetMapping("/select")@ResponseBodypublic OutResource selectById(String id){OutResource resource= outResourceService.select(Integer.valueOf(id));return resource;}@PostMapping("/modify")@ResponseBodypublic String modify(OutResource resource){String info;int i= outResourceService.modify(resource);if (i!=0){info="修改成功!";}else {info = "修改失败!";}return info;}
}
package cn.edu.ncst.controller;import cn.edu.ncst.entity.Resource;
import cn.edu.ncst.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;import java.util.ArrayList;@Controller
@RequestMapping("/resource")
public class ResouceController {@javax.annotation.Resourceprivate ResourceService resourceService;@GetMapping("/queryall")public ModelAndView queryAll(){ModelAndView mv = new ModelAndView();ArrayList<Resource> list;list = resourceService.queyrAll();mv.addObject("res",list);mv.setViewName("resource_table");return mv;}@PostMapping("/add")@ResponseBodypublic String addUser(Resource resource){String info;System.out.println(resource);System.out.println(resource);int i= resourceService.addResource(resource);if (i!=0){info="添加成功!";}else {info = "添加失败!";}return info;}@GetMapping("/delete")public String addUser(String id){resourceService.delete(Integer.parseInt(id));return "redirect:/resource/queryall";}@GetMapping("/select")@ResponseBodypublic Resource selectById(String id){Resource resource= resourceService.select(Integer.valueOf(id));return resource;}@PostMapping("/modify")@ResponseBodypublic String modify(Resource resource){String info;int i= resourceService.modify(resource);if (i!=0){info="修改成功!";}else {info = "修改失败!";}return info;}
}
package cn.edu.ncst.controller;import cn.edu.ncst.entity.User;
import cn.edu.ncst.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;import javax.annotation.Resource;
import java.util.ArrayList;@Controller
@RequestMapping("/user")
public class UserController {@Resourceprivate UserService userService;@GetMapping("/login")public String login(User user){boolean flag = userService.queryByuserNameAndPassword(user);String info;if (flag){return "homePage";}info="用户名或密码错误";return "login_error";}@PostMapping("/add")@ResponseBodypublic String addUser(User user){String info;int i= userService.addUSer(user);if (i!=0){info="添加成功!";}else {info = "添加失败!";}return info;}@GetMapping("/queryall")public ModelAndView queryAll(){ModelAndView mv = new ModelAndView();ArrayList<User> list;list = userService.queyrAll();mv.addObject("users",list);mv.setViewName("user_table");return mv;}@GetMapping("/delete")public String addUser(String userId){userService.deletUserById(Integer.parseInt(userId));return "redirect:/user/queryall";}@GetMapping("/select")@ResponseBodypublic User selectById(String userId){User user= userService.selectById(Integer.parseInt(userId));return user;}@PostMapping("/modify")@ResponseBodypublic String modify(User user){String info;int i= userService.modyfy(user);if (i!=0){info="修改成功!";}else {info = "修改失败!";}return info;}
}
package cn.edu.ncst.dao;import cn.edu.ncst.entity.InResource;
import org.apache.ibatis.annotations.Mapper;import java.util.ArrayList;
@Mapper
public interface InResourceDao {ArrayList<InResource> queryAll();int add(InResource inResource);int delete(Integer id);InResource select(Integer id);int modify(InResource resource);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.edu.ncst.dao.InResourceDao"><select id="queryAll" resultType="cn.edu.ncst.entity.InResource">select * from t_insource</select><insert id="add">insert into t_insource (name,size,category,unit,number,price,money,putTime,opperson,keeper,remark,warehouse)values (#{name},#{size},#{category},#{unit},#{number},#{price},#{money},#{putTime},#{opperson},#{keeper},#{remark},#{warehouse})</insert><delete id="delete">delete from t_insource where id=#{id}</delete><select id="select" resultType="cn.edu.ncst.entity.InResource">select * from t_insource where id=#{id}</select><update id="modify">update t_insource set name=#{name},size=#{size},category=#{category},unit=#{unit},number=#{number},price=#{price},money=#{money},putTime=#{putTime},opperson=#{opperson},keeper=#{keeper},remark=#{remark},warehouse=#{warehouse}where id=#{id}</update>
</mapper>
package cn.edu.ncst.dao;import cn.edu.ncst.entity.OutResource;
import org.apache.ibatis.annotations.Mapper;import java.util.ArrayList;@Mapper
public interface OutResourceDao {ArrayList<OutResource> queryAll();int add(OutResource resource);int delete(Integer id);OutResource select(Integer id);int modify(OutResource resource);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.edu.ncst.dao.OutResourceDao"><select id="queryAll" resultType="cn.edu.ncst.entity.OutResource">select * from t_outsource</select><insert id="add">insert into t_outsource (name,size,category,unit,number,price,money,reTime,opperson,reperson,remark,warehouse)values (#{name},#{size},#{category},#{unit},#{number},#{price},#{money},#{reTime},#{opperson},#{reperson},#{remark},#{warehouse})</insert><delete id="delete">delete from t_outsource where id=#{id}</delete><select id="select" resultType="cn.edu.ncst.entity.OutResource">select * from t_outsource where id=#{id}</select><update id="modify">update t_outsource set name=#{name},size=#{size},category=#{category},unit=#{unit},number=#{number},price=#{price},money=#{money},reTime=#{reTime},opperson=#{opperson},reperson=#{reperson},remark=#{remark},warehouse=#{warehouse}where id=#{id}</update>
</mapper>
package cn.edu.ncst.dao;import cn.edu.ncst.entity.Resource;
import org.apache.ibatis.annotations.Mapper;import java.util.ArrayList;
@Mapper
public interface ResourceDao {ArrayList<Resource> queryAll();int add(Resource resource);int delete(Integer id);Resource select(Integer id);int modify(Resource resource);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.edu.ncst.dao.ResourceDao"><select id="queryAll" resultType="cn.edu.ncst.entity.Resource">select * from t_resource</select><insert id="add">insert into t_resource (name,size,category,unit) values (#{name},#{size},#{category},#{unit})</insert><delete id="delete">delete from t_resource where id=#{id}</delete><select id="select" resultType="cn.edu.ncst.entity.Resource">select * from t_resource where id=#{id}</select><update id="modify">update t_resource set name=#{name},size=#{size},category=#{category},unit=#{unit} where id=#{id}</update>
</mapper>
package cn.edu.ncst.dao;import cn.edu.ncst.entity.User;
import org.apache.ibatis.annotations.Mapper;import java.util.ArrayList;@Mapper
public interface UserDao {int queryByuserNameAndPassword(String userName,String password);int addUser(String userName,String password);ArrayList<User> queryAll();int deleteUser(int userId);User selectById(int userId);int modify(User user);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.edu.ncst.dao.UserDao"><select id="queryByuserNameAndPassword" resultType="int">select count(userId) from t_user where userName=#{userName} and password=#{password}</select><insert id="addUser">insert into t_user (userName,password) values(#{userName},#{password})</insert><select id="queryAll" resultType="cn.edu.ncst.entity.User">select * from t_user</select><delete id="deleteUser">delete from t_user where userId=#{userId}</delete><select id="selectById" resultType="cn.edu.ncst.entity.User">select * from t_user where userId=#{userId}</select><update id="modify">update t_user set userName=#{userName},password=#{password} where userId=#{userId}</update>
</mapper>
package cn.edu.ncst.entity;public class Balance {private int id;private String name;private String size;private String category;private String unit;private String number;private String money;private String warehouse;public Balance() {}public int getId() {return id;}public void setId(int id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSize() {return size;}public void setSize(String size) {this.size = size;}public String getCategory() {return category;}public void setCategory(String category) {this.category = category;}public String getUnit() {return unit;}public void setUnit(String unit) {this.unit = unit;}public String getNumber() {return number;}public void setNumber(String number) {this.number = number;}public String getMoney() {return money;}public void setMoney(String money) {this.money = money;}public String getWarehouse() {return warehouse;}public void setWarehouse(String warehouse) {this.warehouse = warehouse;}public Balance(int id, String name, String size, String category, String unit, String number, String money, String warehouse) {this.id = id;this.name = name;this.size = size;this.category = category;this.unit = unit;this.number = number;this.money = money;this.warehouse = warehouse;}
}
package cn.edu.ncst.entity;public class InResource {private String name;private String size;private Integer id;private String category;private String unit;private String number;private String price;private String money;private String putTime;private String opperson;private String keeper;private String remark;private String warehouse;public InResource() {}public InResource(String name, String size, int id, String category, String unit, String number, String price, String money, String putTime, String opperson, String keeper, String remark, String warehouse) {this.name = name;this.size = size;this.id = id;this.category = category;this.unit = unit;this.number = number;this.price = price;this.money = money;this.putTime = putTime;this.opperson = opperson;this.keeper = keeper;this.remark = remark;this.warehouse = warehouse;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSize() {return size;}public void setSize(String size) {this.size = size;}public int getId() {return id;}public void setId(int id) {this.id = id;}public String getCategory() {return category;}public void setCategory(String category) {this.category = category;}public String getUnit() {return unit;}public void setUnit(String unit) {this.unit = unit;}public String getNumber() {return number;}public void setNumber(String number) {this.number = number;}public String getPrice() {return price;}public void setPrice(String price) {this.price = price;}public String getMoney() {return money;}public void setMoney(String money) {this.money = money;}public String getPutTime() {return putTime;}public void setPutTime(String putTime) {this.putTime = putTime;}public String getOpperson() {return opperson;}public void setOpperson(String opperson) {this.opperson = opperson;}public String getKeeper() {return keeper;}public void setKeeper(String keeper) {this.keeper = keeper;}public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public String getWarehouse() {return warehouse;}public void setWarehouse(String warehouse) {this.warehouse = warehouse;}
}
package cn.edu.ncst.entity;public class OutResource {private String name;private String size;private int id;private String category;private String unit;private String number;private String price;private String money;private String reTime;private String opperson;private String reperson;private String remark;private String warehouse;public OutResource(String name, String size, int id, String category, String unit, String number, String price, String money, String reTime, String opperson, String reperson, String remark, String warehouse) {this.name = name;this.size = size;this.id = id;this.category = category;this.unit = unit;this.number = number;this.price = price;this.money = money;this.reTime = reTime;this.opperson = opperson;this.reperson = reperson;this.remark = remark;this.warehouse = warehouse;}public OutResource() {}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSize() {return size;}public void setSize(String size) {this.size = size;}public int getId() {return id;}public void setId(int id) {this.id = id;}public String getCategory() {return category;}public void setCategory(String category) {this.category = category;}public String getUnit() {return unit;}public void setUnit(String unit) {this.unit = unit;}public String getNumber() {return number;}public void setNumber(String number) {this.number = number;}public String getPrice() {return price;}public void setPrice(String price) {this.price = price;}public String getMoney() {return money;}public void setMoney(String money) {this.money = money;}public String getReTime() {return reTime;}public void setReTime(String reTime) {this.reTime = reTime;}public String getOpperson() {return opperson;}public void setOpperson(String opperson) {this.opperson = opperson;}public String getReperson() {return reperson;}public void setReperson(String reperson) {this.reperson = reperson;}public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public String getWarehouse() {return warehouse;}public void setWarehouse(String warehouse) {this.warehouse = warehouse;}
}
package cn.edu.ncst.entity;public class Resource {private Integer id;private String name;private String size;private String category;private String unit;public Resource(Integer id, String name, String size, String category, String unit) {this.id = id;this.name = name;this.size = size;this.category = category;this.unit = unit;}public Resource() {}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 String getSize() {return size;}public void setSize(String size) {this.size = size;}public String getCategory() {return category;}public void setCategory(String category) {this.category = category;}public String getUnit() {return unit;}public void setUnit(String unit) {this.unit = unit;}@Overridepublic String toString() {return "Resource{" +"id=" + id +", name='" + name + '\'' +", size='" + size + '\'' +", category='" + category + '\'' +", unit='" + unit + '\'' +'}';}
}
package cn.edu.ncst.entity;public class User {private int userId;private String userName;private String password;public User() {}public User(int userId, String userName, String password) {this.userId = userId;this.userName = userName;this.password = password;}public int getUserId() {return userId;}public void setUserId(int userId) {this.userId = userId;}public String getUserName() {return userName;}public void setUserName(String userName) {this.userName = userName;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}@Overridepublic String toString() {return "User{" +"userId=" + userId +", userName=" + userName +", password=" + password +'}';}
}
package cn.edu.ncst;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class MimsApplication {public static void main(String[] args) {SpringApplication.run(MimsApplication.class, args);}}
package cn.edu.ncst.service;import cn.edu.ncst.entity.Balance;import java.util.ArrayList;
import java.util.List;public interface BalanceService {ArrayList<Balance> queryAll();
}
package cn.edu.ncst.service;import cn.edu.ncst.entity.InResource;import java.util.ArrayList;public interface InResourceService {ArrayList<InResource> queyrAll();int add(InResource inResource);int delete(Integer id);InResource select(Integer id);int modify(InResource resource);
}
package cn.edu.ncst.service;import cn.edu.ncst.entity.OutResource;import java.util.ArrayList;public interface OutResourceService {ArrayList<OutResource> queryAll();int add(OutResource resource);int delete(Integer id);OutResource select(Integer id);int modify(OutResource resource);
}
package cn.edu.ncst.service;import cn.edu.ncst.entity.Resource;import java.util.ArrayList;public interface ResourceService {ArrayList<Resource> queyrAll();int addResource(Resource resource);int delete(Integer id);Resource select(Integer id);int modify(Resource resource);
}
package cn.edu.ncst.service;import cn.edu.ncst.entity.User;import java.util.ArrayList;public interface UserService {boolean queryByuserNameAndPassword(User user);int addUSer(User user);ArrayList<User> queyrAll();int deletUserById(int userId);User selectById(int userId);int modyfy(User user);
}
#配置数据库
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/mims?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
spring.datasource.username=root
spring.datasource.password=123456
#配置日志文件
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#配置thymeleaf
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><title>登录页面</title><link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css" /><script src="js/jquery.min.js" type="text/javascript" charset="UTF-8"></script><script src="bootstrap/js/bootstrap.min.js" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<div class="container"><form action="/user/login" class="form-horizontal" id="userForm" role="form"><h2 align="center">用户登录</h2><div class="form-group row"><label for="userName" class="control-label col-md-2 col-md-offset-2">用户名</label><div class="col-md-5"><input type="text" id="userName" name="userName"  class="form-control " placeholder="请输入用户名" /></div></div><div class="form-group"><label for="password" class="control-label col-md-2 col-md-offset-2">密码</label><div class="col-md-5"><input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" /></div></div><br><div class="row"><div class="col-md-2 col-md-offset-5"><input id="submit" class="btn btn-primary" type="submit" value="登录"  /></div><div class="col-md-2"><input type="reset" class="btn btn-primary" value="清空" /></div></div></form>
</div>
</body>
<script type="text/javascript">
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>物资余额浏览</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<h2 align="center">物资余额浏览</h2>
<br><br>
<div class="container>">
<table class="table table-striped table-bordered table-hover tablel" style="table-layout: fixed" ><thead><tr><th><input type="text" id="edit" name="password" class="form-control" placeholder="查询物资编号" /></th><th><button class="btn btn-primary" id="querybtn">查询</button></th></tr><tr><th>物资编号</th><th>物资名称</th><th>规格型号</th><th>类别</th><th>计量单位</th><th>数量</th><th>金额</th><th>仓库</th></tr></thead><tbody><tr class="active" th:each="list:${lists}"><td th:text="${list.getId()}"></td><td th:text="${list.getName()}"></td><td th:text="${list.getSize()}"></td><td th:text="${list.getCategory()}"></td><td th:text="${list.getUnit()}"></td><td th:text="${list.getNumber()}"></td><td th:text="${list.getMoney()}"></td><td th:text="${list.getWarehouse()}"></td></tr></tbody>
</table>
</div><div class="modal fade" id="editModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title"  align="center">物资余额信息</h4></div><div class="modal-body"><form id="editForm"><input type="hidden" id="id" name="id"/><div class="form-group"><label>物资名称</label><input type="text" class="form-control" id="t1" name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control" id="t2" name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control" id="t3" name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control" id="t4" name="unit"></div><div class="form-group"><label>数量</label><input type="text" class="form-control" id="t5" name="number"></div><div class="form-group"><label>金额</label><input type="text" class="form-control" id="t6" name="money"></div><div class="form-group"><label>仓库</label><input type="text" class="form-control" id="t7" name="warehouse"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div></body>
<script type="text/javascript">$("#querybtn").click(function () {if ($("#edit").val()==''||$("#edit").val().length == 0){alert("请输入物资编号")}else{$.ajax({url:"/balance/selectbyid",dataType:"json",data:{id:$("#edit").val()},error:function(){alert("所选目标不存在")},success:function (ret) {$("#editModal").modal('show')$("#id").val(ret.id)$("#t1").val(ret.name);$("#t2").val(ret.size);$("#t3").val(ret.category);$("#t4").val(ret.unit);$("#t5").val(ret.number);$("#t6").val(ret.money);$("#t7").val(ret.warehouse);}})}})</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="utf-8"><title>导航面板</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<div class="panel panel-info"><div class="panel-heading"><h3 class="panel-title" align="center">物资管理系统</h3></div><div class="panel-body"><nav class="navbar navbar-default" role="navigation"><div class="container-fluid"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse"data-target="#example-navbar-collapse"><span class="sr-only">切换导航</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="#">功能导航</a></div><div class="collapse navbar-collapse" id="example-navbar-collapse"><ul class="nav navbar-nav"><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">用户管理 <b class="caret"></b></a><ul class="dropdown-menu"><li><button type="button" class="btn btn-default btn-lg btn-block" id="adduserbtn">增加用户信息</button></li><li><button type="button" class="btn btn-default btn-lg btn-block" id="queryall">查询用户信息</button></li><li><a th:href="@{/user/queryall}" class="btn btn-default btn-lg btn-block">删除用户信息</a></li><li><a th:href="@{/user/queryall}" class="btn btn-default btn-lg btn-block">修改用户信息</a></li></ul></li><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">物资管理 <b class="caret"></b></a><ul class="dropdown-menu"><li><a th:href="@{/resource/queryall}" class="btn btn-default btn-lg btn-block">物资信息输入</a></li><li><a th:href="@{/resource/queryall}" class="btn btn-default btn-lg btn-block">物资信息查询</a></li><li><a th:href="@{/resource/queryall}" class="btn btn-default btn-lg btn-block">物资信息修改</a></li></ul></li><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">入库物资管理 <b class="caret"></b></a><ul class="dropdown-menu"><li><a th:href="@{/inresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息输入</a></li><li><a th:href="@{/inresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息查询</a></li><li><a th:href="@{/inresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息修改</a></li></ul></li><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">出库物资管理 <b class="caret"></b></a><ul class="dropdown-menu"><li><a th:href="@{/outresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息输入</a></li><li><a th:href="@{/outresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息查询</a></li><li><a th:href="@{/outresource/queryall}" class="btn btn-default btn-lg btn-block">物资信息修改</a></li></ul></li><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">物资余额管理 <b class="caret"></b></a><ul class="dropdown-menu"><li><a th:href="@{/balance/queryall}" class="btn btn-default btn-lg btn-block">物资信息查询</a></li><li><a th:href="@{/balance/queryall}" class="btn btn-default btn-lg btn-block">物资信息浏览</a></li></ul></li></ul></div></div></nav><div class="container"><div class="jumbotron"><h1>欢迎登陆本系统!</h1></div></div></div><div class="modal fade" id="userModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true"></button><h4 class="modal-title" id="myModalLabel">增加用户</h4></div><div class="modal-body"><div class="row"><div><label for="userName" class="col-md-offset-3 col-md-2">用户名</label><input type="text" id="userName" name="userName" placeholder="请输入用户名"/></div></div><br><div class="row"><div><label for="password" class="col-md-offset-3 col-md-2">密码 </label><input type="text" id="password" name="password" placeholder="请输入密码"/></div></div></div><div class="row"><div class="modal-footer"><button type="button" class="btn btn-default"data-dismiss="modal">关闭</button><button type="button" id="um1" class="btn btn-primary">添加</button></div></div></div></div></div>
</div>
</body>
<script type="text/javascript">$("#adduserbtn").click(function () {$("#userModal").modal("show")})$("#um1").click(function () {$("#userModal").modal('hide')$.ajax({url:"/user/add",type:"post",dataTpye:'json',data:{userName:$("#userName").val(),password:$("#password").val()},success:function (ret) {alert(ret)}})})$("#queryall").click(function () {window.location.replace("/user/queryall")})
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>入库物资管理</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<h2 align="center">入库物资管理页面</h2>
<br><br>
<div class="container>">
<table class="table table-striped table-bordered table-hover tablel" ><thead><tr><th>操作</th><th>物资编号</th><th>物资名称</th><th>规格型号</th><th>类别</th><th>数量</th><th>单价</th><th>金额</th><th>入库时间</th><th>经办人</th><th>保管人</th><th>仓库</th><th>备注</th></tr></thead><tbody><tr class="active" th:each="inre:${inres}"><td><a th:href="@{/resource/delete(id=${inre.getId()})}" class="btn btn-primary">删除</a></td><td th:text="${inre.getId()}"></td><td th:text="${inre.getName()}"></td><td th:text="${inre.getSize()}"></td><td th:text="${inre.getCategory()}"></td><td th:text="${inre.getNumber()}"></td><td th:text="${inre.getPrice()}"></td><td th:text="${inre.getMoney()}"></td><td th:text="${inre.getPutTime()}"></td><td th:text="${inre.getOpperson()}"></td><td th:text="${inre.getKeeper()}"></td><td th:text="${inre.getWarehouse()}"></td><td th:text="${inre.getRemark()}"></td></tr></tbody><tfoot><tr><th><button class="btn btn-primary" id="addbtn">添加</button><button class="btn btn-primary" id="modify">修改</button></th><th><input type="text" id="edit" name="password" class="form-control" placeholder="请输入修改的物资编号" /></th></tr></tfoot>
</table>
</div><div class="modal fade" id="reModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title" id="myModalLabel" align="center"></h4></div><div class="modal-body"><form id="userForm"><div class="form-group"><label>物资名称</label><input type="text" class="form-control"  name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control"  name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control"  name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control"  name="unit"></div><div class="form-group"><label>数量</label><input type="text" class="form-control"  name="number"></div><div class="form-group"><label>单价</label><input type="text" class="form-control"  name="price"></div><div class="form-group"><label>金额</label><input type="text" class="form-control"  name="money"></div><div class="form-group"><label>入库时间</label><input type="text" class="form-control"  name="putTime"></div><div class="form-group"><label>经办人</label><input type="text" class="form-control"  name="opperson"></div><div class="form-group"><label>保管人</label><input type="text" class="form-control"  name="keeper"></div><div class="form-group"><label>仓库</label><input type="text" class="form-control"  name="warehouse"></div><div class="form-group"><label>备注</label><input type="text" class="form-control"  name="remark"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="saveConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div>
<!-- /.modal --><div class="modal fade" id="editModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title"  align="center">编辑物资信息</h4></div><div class="modal-body"><form id="editForm"><input type="hidden" id="id" name="id"/><div class="form-group"><label>物资名称</label><input type="text" class="form-control" id="t1" name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control" id="t2" name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control" id="t3" name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control" id="t4" name="unit"></div><div class="form-group"><label>数量</label><input type="text" class="form-control" id="t5" name="number"></div><div class="form-group"><label>单价</label><input type="text" class="form-control" id="t6" name="price"></div><div class="form-group"><label>金额</label><input type="text" class="form-control" id="t7" name="money"></div><div class="form-group"><label>入库时间</label><input type="text" class="form-control" id="t8" name="putTime"></div><div class="form-group"><label>经办人</label><input type="text" class="form-control" id="t9" name="opperson"></div><div class="form-group"><label>保管人</label><input type="text" class="form-control" id="t10" name="keeper"></div><div class="form-group"><label>仓库</label><input type="text" class="form-control" id="t11" name="warehouse"></div><div class="form-group"><label>备注</label><input type="text" class="form-control" id="t12" name="remark"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="editConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div></body>
<script type="text/javascript">$("#addbtn").click(function () {$("#reModal").modal("show")$("#myModalLabel").html("添加物资信息")})$("#saveConfirmBtn").click(function () {$("#reModal").modal('hide')$.ajax({url:"/inresource/add",type:"post",dataTpye:'json',data:$("#userForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/inresource/queryall")}})})$("#modify").click(function () {if ($("#edit").val()==''||$("#edit").val().length == 0){alert("请输入物资编号")}else{$.ajax({url:"/inresource/select",dataType:"json",data:{id:$("#edit").val()},error:function(){alert("所选目标不存在")},success:function (ret) {$("#editModal").modal('show')$("#id").val(ret.id)$("#t1").val(ret.name);$("#t2").val(ret.size);$("#t3").val(ret.category);$("#t4").val(ret.unit);$("#t5").val(ret.number);$("#t6").val(ret.price);$("#t7").val(ret.money);$("#t8").val(ret.putTime);$("#t9").val(ret.opperson);$("#t10").val(ret.keeper);$("#t11").val(ret.warehouse);$("#t12").val(ret.remark);}})}})$("#editConfirmBtn").click(function () {$("#editModal").modal('hide')$.ajax({url:"/inresource/modify",type:"post",dataTpye:'json',data:$("#editForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/inresource/queryall")}})})
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>登录页面</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" />
</head>
<body><div class="container"><form action="/user/login" class="form-horizontal" id="userForm" role="form"><h2 align="center" style="color: #c12e2a">用户名或密码错误</h2><div class="form-group row"><label for="userName" class="control-label col-md-2 col-md-offset-2">用户名</label><div class="col-md-5"><input type="text" id="userName" name="userName"  class="form-control " placeholder="请输入用户名" /></div></div><div class="form-group"><label for="password" class="control-label col-md-2 col-md-offset-2">密码</label><div class="col-md-5"><input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" /></div></div><br><div class="row"><div class="col-md-2 col-md-offset-5"><input id="submit" type="submit" class="btn btn-primary" value="登录"  /></div><div class="col-md-2"><input type="reset" class="btn btn-primary" value="清空" /></div></div></form>
</div>
</body>
<script type="text/javascript">
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>出库物资管理</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<h2 align="center">出库物资管理页面</h2>
<br><br>
<div class="container>">
<table class="table table-striped table-bordered table-hover tablel" ><thead><tr><th>操作</th><th>物资编号</th><th>物资名称</th><th>规格型号</th><th>类别</th><th>数量</th><th>单价</th><th>金额</th><th>入库时间</th><th>经办人</th><th>保管人</th><th>仓库</th><th>备注</th></tr></thead><tbody><tr class="active" th:each="inre:${inres}"><td><a th:href="@{/outresource/delete(id=${inre.getId()})}" class="btn btn-primary">删除</a></td><td th:text="${inre.getId()}"></td><td th:text="${inre.getName()}"></td><td th:text="${inre.getSize()}"></td><td th:text="${inre.getCategory()}"></td><td th:text="${inre.getNumber()}"></td><td th:text="${inre.getPrice()}"></td><td th:text="${inre.getMoney()}"></td><td th:text="${inre.getReTime()}"></td><td th:text="${inre.getOpperson()}"></td><td th:text="${inre.getReperson()}"></td><td th:text="${inre.getWarehouse()}"></td><td th:text="${inre.getRemark()}"></td></tr></tbody><tfoot><tr><th><button class="btn btn-primary" id="addbtn">添加</button><button class="btn btn-primary" id="modify">修改</button></th><th><input type="text" id="edit" name="password" class="form-control" placeholder="请输入修改的物资编号" /></th><th></th></tr></tfoot>
</table>
</div><div class="modal fade" id="reModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title" id="myModalLabel" align="center"></h4></div><div class="modal-body"><form id="userForm"><div class="form-group"><label>物资名称</label><input type="text" class="form-control"  name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control"  name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control"  name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control"  name="unit"></div><div class="form-group"><label>数量</label><input type="text" class="form-control"  name="number"></div><div class="form-group"><label>单价</label><input type="text" class="form-control"  name="price"></div><div class="form-group"><label>金额</label><input type="text" class="form-control"  name="money"></div><div class="form-group"><label>入库时间</label><input type="text" class="form-control"  name="reTime"></div><div class="form-group"><label>经办人</label><input type="text" class="form-control"  name="opperson"></div><div class="form-group"><label>保管人</label><input type="text" class="form-control"  name="reperson"></div><div class="form-group"><label>仓库</label><input type="text" class="form-control"  name="warehouse"></div><div class="form-group"><label>备注</label><input type="text" class="form-control"  name="remark"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="saveConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div>
<!-- /.modal --><div class="modal fade" id="editModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title"  align="center">编辑物资信息</h4></div><div class="modal-body"><form id="editForm"><input type="hidden" id="id" name="id"/><div class="form-group"><label>物资名称</label><input type="text" class="form-control" id="t1" name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control" id="t2" name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control" id="t3" name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control" id="t4" name="unit"></div><div class="form-group"><label>数量</label><input type="text" class="form-control" id="t5" name="number"></div><div class="form-group"><label>单价</label><input type="text" class="form-control" id="t6" name="price"></div><div class="form-group"><label>金额</label><input type="text" class="form-control" id="t7" name="money"></div><div class="form-group"><label>领用时间</label><input type="text" class="form-control" id="t8" name="reTime"></div><div class="form-group"><label>经办人</label><input type="text" class="form-control" id="t9" name="opperson"></div><div class="form-group"><label>领用人</label><input type="text" class="form-control" id="t10" name="reperson"></div><div class="form-group"><label>仓库</label><input type="text" class="form-control" id="t11" name="warehouse"></div><div class="form-group"><label>备注</label><input type="text" class="form-control" id="t12" name="remark"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="editConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div></body>
<script type="text/javascript">$("#addbtn").click(function () {$("#reModal").modal("show")$("#myModalLabel").html("添加物资信息")})$("#saveConfirmBtn").click(function () {$("#reModal").modal('hide')$.ajax({url:"/outresource/add",type:"post",dataTpye:'json',data:$("#userForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/outresource/queryall")}})})$("#modify").click(function () {if ($("#edit").val()==''||$("#edit").val().length == 0){alert("请输入物资编号")}else{$.ajax({url:"/outresource/select",dataType:"json",data:{id:$("#edit").val()},error:function(){alert("所选目标不存在")},success:function (ret) {$("#editModal").modal('show')$("#id").val(ret.id)$("#t1").val(ret.name);$("#t2").val(ret.size);$("#t3").val(ret.category);$("#t4").val(ret.unit);$("#t5").val(ret.number);$("#t6").val(ret.price);$("#t7").val(ret.money);$("#t8").val(ret.reTime);$("#t9").val(ret.opperson);$("#t10").val(ret.reperson);$("#t11").val(ret.warehouse);$("#t12").val(ret.remark);}})}})$("#editConfirmBtn").click(function () {$("#editModal").modal('hide')$.ajax({url:"/outresource/modify",type:"post",dataTpye:'json',data:$("#editForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/outresource/queryall")}})})
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>物资管理</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<h2 align="center">物资管理页面</h2>
<br><br>
<div class="container>">
<table class="table table-striped table-bordered table-hover tablel" style="table-layout: fixed"><thead><tr><th>操作</th><th>物资编号</th><th>物资名称</th><th>规格型号</th><th>类别</th><th>计量单位</th></tr></thead><tbody><tr class="active" th:each="re:${res}"><td><a th:href="@{/resource/delete(id=${re.getId()})}" class="btn btn-primary">删除</a></td><td th:text="${re.getId()}"></td><td th:text="${re.getName()}"></td><td th:text="${re.getSize()}"></td><td th:text="${re.getCategory()}"></td><td th:text="${re.getUnit()}"></td></tr></tbody><tfoot><tr><th><button class="btn btn-primary" id="addbtn">添加</button><button class="btn btn-primary" id="modify">修改</button></th><th><input type="text" id="edit" name="password" class="form-control" placeholder="请输入修改的物资编号" /></th><th></th></tr></tfoot>
</table>
</div><div class="modal fade" id="reModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title" id="myModalLabel" align="center"></h4></div><div class="modal-body"><form id="userForm"><input type="hidden"  name="id"/><div class="form-group"><label>物资名称</label><input type="text" class="form-control"  name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control"  name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control"  name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control"  name="unit"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="saveConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div>
<!-- /.modal --><div class="modal fade" id="editModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title"  align="center">编辑物资信息</h4></div><div class="modal-body"><form id="editForm"><input type="hidden" id="id" name="id"/><div class="form-group"><label>物资名称</label><input type="text" class="form-control" id="t1" name="name"></div><div class="form-group"><label>规格型号</label><input type="text" class="form-control" id="t2" name="size"></div><div class="form-group"><label>类别</label><input type="text" class="form-control" id="t3" name="category"></div><div class="form-group"><label>计量单位</label><input type="text" class="form-control" id="t4" name="unit"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="editConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div></body>
<script type="text/javascript">$("#addbtn").click(function () {$("#reModal").modal("show")$("#myModalLabel").html("添加物资信息")})$("#saveConfirmBtn").click(function () {$("#reModal").modal('hide')$.ajax({url:"/resource/add",type:"post",dataTpye:'json',data:$("#userForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/resource/queryall")}})})$("#modify").click(function () {if ($("#edit").val()==''||$("#edit").val().length == 0){alert("请输入物资编号")}else{$.ajax({url:"/resource/select",dataType:"json",data:{id:$("#edit").val()},error:function(){alert("所选目标不存在")},success:function (ret) {$("#editModal").modal('show')$("#id").val(ret.id)$("#t1").val(ret.name);$("#t2").val(ret.size);$("#t3").val(ret.category);$("#t4").val(ret.unit);}})}})$("#editConfirmBtn").click(function () {$("#editModal").modal('hide')$.ajax({url:"/resource/modify",type:"post",dataTpye:'json',data:$("#editForm").serialize(),success:function (ret) {alert(ret)window.location.replace("/resource/queryall")}})})
</script>
</html>
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>用户管理</title><link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/bootstrap.min.css}" /><script th:src="@{/bootstrap/js/jquery.min.js}" type="text/javascript" charset="UTF-8"></script><script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
<h2 align="center">用户管理页面</h2>
<br><br>
<div class="container>">
<table class="table table-striped table-bordered table-hover" style="table-layout: fixed"><thead><tr><th>用户id</th><th>用户名</th><th>用户密码</th><th>操作</th></tr></thead><tbody><tr class="active" th:each="user:${users}"><td th:text="${user.getUserId()}"></td><td th:text="${user.getUserName()}"></td><td th:text="${user.getPassword()}"></td><td><a th:href="@{/user/delete(userId=${user.getUserId})}" class="btn btn-primary">删除</a></td></tr></tbody><tfoot><tr><th></th><th></th><th><input type="text" id="edit" name="password" class="form-control"  placeholder="请输入用户id" /></th><th><button class="btn btn-primary" id="modify">修改</button></th></tr></tfoot>
</table>
</div><div class="modal fade" id="userModal" tabindex="-1" role="dialog"aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal"aria-hidden="true">×</button><h4 class="modal-title" id="myModalLabel">编辑用户信息</h4></div><div class="modal-body"><form id="userForm"><input type="hidden" id="id" name="userId"/><div class="form-group"><label>姓名</label><input type="text" class="form-control" id="userName" name="userName"></div><div class="form-group"><label>密码</label><input type="text" class="form-control" id="password" name="password"></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="saveConfirmBtn">确定</button></div></div><!-- /.modal-content --></div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</body>
<script type="text/javascript">$("#modify").click(function () {if ($("#edit").val()==''||$("#edit").val().length == 0){alert("请输入用户id")}else{$.ajax({url:"/user/select",dataType:"json",data:{userId:$("#edit").val()},error:function(){alert("所选目标不存在")},success:function (ret) {$("#userModal").modal('show')$("#id").val(ret.userId);$("#userName").val(ret.userName);$("#password").val(ret.password);}})}})$("#saveConfirmBtn").click(function () {$("#userModal").modal('hide')$.ajax({url:"/user/modify",type:"post",dataTpye:'json',data:{userId:$("#id").val(),userName:$("#userName").val(),password:$("#password").val()},success:function (ret) {alert(ret)window.location.replace("/user/queryall")}})})
</script>
</html>

物资信息管理系统(springboot+bootstrap+jquery+ajax适合才学完springboot的童鞋,基本的增删改查)相关推荐

  1. JQuery Easyui/TopJUI 用JS创建数据表格并实现增删改查功能

    JQuery Easyui/TopJUI 用JS创建数据表格并实现增删改查功能 JQuery Easyui/TopJUI 用JS创建数据表格并实现增删改查功能 html <table id=&q ...

  2. ajax servlet增删改查,Servlet ajax 文件上传和JDBC+Servler用户表增删改查

    昨天晚上帮一个妹子,应该是大二或者大三的.解决了Servlet+JDBC实现用户表的增删改查功能,当时妹子遇到的问题是文件上传和日期格式处理不太会. 我让她把代码发我,我本地调试,结果发现坑很多,就是 ...

  3. 利用ajax获取数据对学生表进行简单的增删改查

    前言 本次练习没有使用前端框架,默认以表格方式拼接渲染数据,后端数据返回没有采用规范的数据形式返回 默认你能用springboot-mybatis从后端获取到数据 spring boot 静态资源处理 ...

  4. node ajax crud,基于node.js和rethinkdb的CRUD(增删改查)Web服务

    基于node.js和rethinkdb的CRUD(增删改查)Web服务 这是一个简单的REST web服务演示案例源码,使用Node.JS和Express 和RethinkDB,后者持久化JSON数据 ...

  5. Jsp+Ssh+Mysql实现的简单的企业物资信息管理系统

    此篇给大家演示的是一款基于jsp+ssh(spring+struts2+mysql)实现的企业物资信息管理系统 实现了基本的管理员.操作员等用户管理.物品分类管理.物品管理.入库管理.出库管理.库存预 ...

  6. java医用物资信息管理系统 ssm

    本医用物资信息管理系统主要满足了几类用户的需求,即超级管理员.保管人员.供应商.申领人,普通管理员等.下面对这几类用户的功能需求进行详细的分析. 超级管理员对科室管理和人员管理 (2)保管人员信息功能 ...

  7. 物资信息管理系统建设技术服务说明来自博奥智源科技

    建设目标 物资信息管理系统在一期建设的基础上完善和拓展系统功能,实现业务数据优化处理,批产需求物资请购流程优化,物资扫码出入库提高效率,单据附件满足管理需要,优化系统操作界面,使物资信息管理系统更好的 ...

  8. springBoot加layui和mybatis后台管理系统增删改查分页登录注销修改密码功能

    超市订单管理系统 1 登录页面 1.1 登录 点击提交按钮提交form表单使用post请求把(String name, String password)数据传到后台loginController 路径 ...

  9. 基于Python Flask框架+jquery Ajax技术实现的增删改查(CRUD)+Ajax的异步文件上传

    运行界面(话不多说先上图) 运行之后的index界面,有登陆.注册功能 登陆界面,输入数据库中用户名.密码不为空且密码是加密的数据,进入main界面 注册界面,用的bootstrop的弹窗,用户名和密 ...

最新文章

  1. c++ vscode 第三方库_Windows平台配置VSCode的C/C++环境,超清晰
  2. C语言函数怎么像python那样返回多个值?(三种方法:1、设置全局变量 2、传递指针 3、使用结构体返回不同类型的数据)
  3. ASP.Net请求处理机制初步探索之旅 - Part 3 管道
  4. python字符串变量s的值是python网络爬虫_【Python爬虫作业】-字符串
  5. Spring-tx-TransactionInfo
  6. JavaScript 开发者经常忽略或误用的七个基础知识点
  7. Win XP 如何禁用屏保
  8. web服务器主机头文件,在Win2k下建立虚拟Web主机
  9. 零基础玩转树莓派(六)—遥控小车
  10. 校赛热身赛 Problem D. Unsolved Mystery
  11. 【牛客练习赛13】 A B C D【康拓展开】 E【DP or 记忆化搜索】 F 【思维】
  12. Akka默认20s超时修改配置
  13. 自建kafka和公有云kafka对比
  14. TCP/IP协议分层
  15. Unity的UGUI使用Text和Image实现文字下划线
  16. Git: Cannot update paths and switch to branch 'feature' at the same time.
  17. ESD静电保护二极管的优点有哪些?
  18. xampp 可道云_Windows下用kodexplorer可道云在本地搭建私有云的步骤
  19. 耐克中国物流中心三期在江苏太仓落成和运营
  20. 51单片机可以用来练手的60个小设计

热门文章

  1. python中row的使用_关于Python中openpyxl使用iter_rows()的方法
  2. windows下git客户端的下载安装及使用教程
  3. Activity之间的数据回传
  4. linux epoll 单线程,epoll+多线程实现服务器问题
  5. bootstrap上传之后的处理_bootstrap-fileinput 进阶 -- 实现上传失败清除之前的预览图且可以继续上传...
  6. 项目的行政收尾工作主要有哪些
  7. PaddlePaddle预训练模型大合集,还有官方使用说明书
  8. 大数据技术基础_网易大数据体系之时序数据技术
  9. oracle两表联查分组,oracle解决多表关联分组查询问题
  10. 学计算机设计制图需啥基础,学CAD制图需要什么软件