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

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 {
    @Resource
    private 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 {
    @Resource
    private 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")
    @ResponseBody
    public 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")
    @ResponseBody
    public InResource selectById(String id){
        InResource resource= inResourceService.select(Integer.valueOf(id));
        return resource;
    }
    @PostMapping("/modify")
    @ResponseBody
    public 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 {
    @Resource
    private 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")
    @ResponseBody
    public 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")
    @ResponseBody
    public OutResource selectById(String id){
        OutResource resource= outResourceService.select(Integer.valueOf(id));
        return resource;
    }
    @PostMapping("/modify")
    @ResponseBody
    public 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.Resource
    private 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")
    @ResponseBody
    public 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")
    @ResponseBody
    public Resource selectById(String id){
        Resource resource= resourceService.select(Integer.valueOf(id));
        return resource;
    }
    @PostMapping("/modify")
    @ResponseBody
    public 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 {
    @Resource
    private 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")
    @ResponseBody
    public 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")
    @ResponseBody
    public User selectById(String userId){
        User user= userService.selectById(Integer.parseInt(userId));
        return user;
    }

    @PostMapping("/modify")
    @ResponseBody
    public 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;
    }

    @Override
    public 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;
    }

    @Override
    public 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>

 

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>