├── warehouse-web ├── src │ └── main │ │ ├── webapp │ │ ├── WEB-INF │ │ │ ├── js │ │ │ │ ├── login.js │ │ │ │ └── npm.js │ │ │ ├── jsp │ │ │ │ ├── error.jsp │ │ │ │ ├── systemLog.jsp │ │ │ │ ├── goodsAddLog.jsp │ │ │ │ ├── goodsOutLog.jsp │ │ │ │ ├── goodsAnalyse.jsp │ │ │ │ ├── containWarning.jsp │ │ │ │ ├── login.jsp │ │ │ │ ├── changePassword.jsp │ │ │ │ ├── goodsSelect.jsp │ │ │ │ ├── addGoods.jsp │ │ │ │ ├── addPerson.jsp │ │ │ │ ├── manageGoods.jsp │ │ │ │ ├── manageWarehouse.jsp │ │ │ │ ├── addSupplier.jsp │ │ │ │ ├── addWarehouse.jsp │ │ │ │ ├── manageSupplier.jsp │ │ │ │ ├── configGoodsWarehouse.jsp │ │ │ │ ├── managePerson.jsp │ │ │ │ ├── addGoodsOutWarehouse.jsp │ │ │ │ ├── addGoodsIntoWarehouse.jsp │ │ │ │ └── applicationPage.jsp │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── css │ │ │ │ ├── addGoods.css │ │ │ │ ├── addPerson.css │ │ │ │ ├── addSupplier.css │ │ │ │ ├── addWarehouse.css │ │ │ │ ├── goodsSelect.css │ │ │ │ ├── goodsAddLog.css │ │ │ │ ├── goodsOutLog.css │ │ │ │ ├── manageGoods.css │ │ │ │ ├── managePerson.css │ │ │ │ ├── systemLog.css │ │ │ │ ├── containWarning.css │ │ │ │ ├── goodsAnalyse.css │ │ │ │ ├── manageSupplier.css │ │ │ │ ├── manageWarehouse.css │ │ │ │ ├── addGoodsIntoWarehouse.css │ │ │ │ ├── configGoodsWarehouse.css │ │ │ │ ├── changePwd.css │ │ │ │ ├── login.css │ │ │ │ ├── bootstrap-datetimepicker-standalone.min.css │ │ │ │ ├── mainPage.css │ │ │ │ └── bootstrap-select.min.css │ │ │ └── web.xml │ │ └── index.jsp │ │ ├── resources │ │ ├── resource │ │ │ └── mysql.properties │ │ ├── mybatis │ │ │ └── SqlMapConfig.xml │ │ ├── log4j.properties │ │ ├── spring │ │ │ ├── applicationContext-service.xml │ │ │ ├── springmvc.xml │ │ │ ├── applicationContext-dao.xml │ │ │ └── applicationContext-trans.xml │ │ └── sql │ │ │ └── warehouse.sql │ │ └── java │ │ └── com │ │ └── warehouse │ │ └── controller │ │ ├── PageController.java │ │ ├── LogController.java │ │ ├── LoginController.java │ │ ├── GoodsController.java │ │ ├── WarehouseController.java │ │ ├── SupplierController.java │ │ ├── UserController.java │ │ └── ManageController.java └── pom.xml ├── README.md ├── warehouse-utils ├── src │ └── main │ │ └── java │ │ └── com │ │ └── warehouse │ │ └── utils │ │ ├── Test.java │ │ ├── MD5.java │ │ └── TimeUtil.java └── pom.xml ├── warehouse-service ├── src │ └── main │ │ └── java │ │ └── com │ │ └── warehouse │ │ └── service │ │ ├── UserLoginService.java │ │ ├── WarehouseService.java │ │ ├── GoodsService.java │ │ ├── LogService.java │ │ ├── SupplierService.java │ │ ├── impl │ │ ├── UserLoginServiceImpl.java │ │ ├── GoodsServiceImpl.java │ │ ├── WarehouseServiceImpl.java │ │ ├── SupplierServiceImpl.java │ │ ├── LogServiceImpl.java │ │ ├── UserManageServiceImpl.java │ │ └── ManageServiceImpl.java │ │ ├── UserManageService.java │ │ └── ManageService.java └── pom.xml ├── warehouse-common ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── warehouse │ └── common │ ├── WResponse.java │ └── WMessage.java ├── warehouse-bean ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── warehouse │ └── bean │ ├── Log.java │ └── Userinfo.java ├── pom.xml └── warehouse-mapper ├── pom.xml └── src └── main └── java └── com └── warehouse └── mapper ├── LogMapper.java ├── SupplierMapper.java ├── WarehouseMapper.java ├── WarehouseGoodsMapper.java ├── GoodsMapper.java └── UserinfoMapper.java /warehouse-web/src/main/webapp/WEB-INF/js/login.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # warehouse-web 2 | 仓库管理系统,前端使用BootStrap+JQuery+JSP,后端使用Spring+SpringMVC+Mybatis,数据库使用MySQL,开发平台IntelliJ IDEA+open JDK1.8 amd64 3 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | 3 | 4 | 5 |

非法请求

6 | 7 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xianzhixianzhixian/warehouse-web/HEAD/warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xianzhixianzhixian/warehouse-web/HEAD/warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xianzhixianzhixian/warehouse-web/HEAD/warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/resource/mysql.properties: -------------------------------------------------------------------------------- 1 | jdbc.url=jdbc:mysql://localhost:3306/warehouse?characterEncoding=utf8&useSSL=false 2 | jdbc.username=root 3 | jdbc.password=123456 4 | jdbc.driver=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xianzhixianzhixian/warehouse-web/HEAD/warehouse-web/src/main/webapp/WEB-INF/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | 3 | 4 | 登陆页面 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /warehouse-utils/src/main/java/com/warehouse/utils/Test.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.utils; 2 | 3 | public class Test { 4 | 5 | public static void main(String[] args) { 6 | System.out.println(MD5.getMD5("123456")); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/mybatis/SqlMapConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG,A1 2 | log4j.logger.org.mybatis = DEBUG 3 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 4 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/addGoods.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | *{ 11 | margin:0; 12 | padding:0; 13 | } 14 | 15 | .login_internal{ 16 | width:300px; 17 | margin:55px 100px; 18 | } 19 | 20 | .login_label{ 21 | width: 300px; 22 | font-size:17px; 23 | margin-top: 20px; 24 | text-align: center; 25 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/addPerson.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | *{ 11 | margin:0; 12 | padding:0; 13 | } 14 | 15 | .login_internal{ 16 | width:300px; 17 | margin:55px 100px; 18 | } 19 | 20 | .login_label{ 21 | width: 300px; 22 | font-size:17px; 23 | margin-top: 20px; 24 | text-align: center; 25 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/addSupplier.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | *{ 11 | margin:0; 12 | padding:0; 13 | } 14 | 15 | .login_internal{ 16 | width:300px; 17 | margin:55px 100px; 18 | } 19 | 20 | .login_label{ 21 | width: 300px; 22 | font-size:17px; 23 | margin-top: 20px; 24 | text-align: center; 25 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/addWarehouse.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | *{ 11 | margin:0; 12 | padding:0; 13 | } 14 | 15 | .login_internal{ 16 | width:300px; 17 | margin:55px 100px; 18 | } 19 | 20 | .login_label{ 21 | width: 300px; 22 | font-size:17px; 23 | margin-top: 20px; 24 | text-align: center; 25 | } -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/UserLoginService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import com.warehouse.bean.Userinfo; 4 | 5 | /** 6 | * 用户登陆service 7 | * 2018.4.27 8 | */ 9 | public interface UserLoginService{ 10 | 11 | /** 12 | * 检查用户名密码是否正确,返回用户角色等级 13 | * @param user 14 | * @return 15 | */ 16 | public Integer checkUserGetLevel(Userinfo user) throws Exception; 17 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/goodsSelect.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | .div_select{ 10 | margin-top: 15px; 11 | } 12 | 13 | .div_table{ 14 | margin-top: 10px; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | 19 | .div_table table{ 20 | margin: 10px auto; 21 | width: 100%; 22 | } 23 | 24 | .div_table table tr th{ 25 | text-align: center; 26 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/goodsAddLog.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/goodsOutLog.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/manageGoods.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/managePerson.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 90%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/systemLog.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/containWarning.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/goodsAnalyse.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/manageSupplier.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/manageWarehouse.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | } 9 | 10 | .div_button{ 11 | margin-left: 65%; 12 | } 13 | 14 | .div_table{ 15 | margin-top: 10px; 16 | width: 100%; 17 | text-align: center; 18 | } 19 | 20 | .div_table table{ 21 | margin: 10px auto; 22 | width: 100%; 23 | } 24 | 25 | .div_table table tr th{ 26 | text-align: center; 27 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/addGoodsIntoWarehouse.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | float: left; 9 | } 10 | 11 | *{ 12 | margin:0; 13 | padding:0; 14 | } 15 | 16 | .login{ 17 | width: 100%; 18 | margin: auto; 19 | position: absolute; 20 | top: 0; 21 | left: 0; 22 | right: 0; 23 | bottom: 0; 24 | } 25 | 26 | .login_internal{ 27 | width:300px; 28 | margin:0 320px; 29 | } 30 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/configGoodsWarehouse.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html,body{ 7 | height: 100%; 8 | float: left; 9 | } 10 | 11 | *{ 12 | margin:0; 13 | padding:0; 14 | } 15 | 16 | .login{ 17 | width: 100%; 18 | margin: auto; 19 | position: absolute; 20 | top: 0; 21 | left: 0; 22 | right: 0; 23 | bottom: 0; 24 | } 25 | 26 | .login_internal{ 27 | width:300px; 28 | margin:0 320px; 29 | } 30 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/changePwd.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin:0; 3 | padding:0; 4 | } 5 | 6 | .login{ 7 | background-color: #fff; 8 | border-radius: 20px; 9 | width: 500px; 10 | height: 400px; 11 | margin: auto; 12 | position: absolute; 13 | top: 0; 14 | left: 0; 15 | right: 0; 16 | bottom: 0; 17 | } 18 | 19 | .login_internal{ 20 | width:300px; 21 | height:300px; 22 | margin:75px 100px; 23 | } 24 | 25 | .login_label{ 26 | width: 300px; 27 | font-size:17px; 28 | margin-top: 20px; 29 | text-align: center; 30 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/login.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin:0; 3 | padding:0; 4 | } 5 | 6 | .login{ 7 | background-color: #fff; 8 | border-radius: 20px; 9 | width: 500px; 10 | height: 400px; 11 | margin: auto; 12 | position: absolute; 13 | top: 0; 14 | left: 0; 15 | right: 0; 16 | bottom: 0; 17 | } 18 | 19 | .login_internal{ 20 | width:300px; 21 | height:300px; 22 | margin:75px 100px; 23 | } 24 | 25 | .login_label{ 26 | width: 300px; 27 | font-size:17px; 28 | margin-top: 20px; 29 | text-align: center; 30 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /warehouse-utils/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.warehouse 6 | warehouse-utils 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | UTF-8 11 | 12 | 13 | -------------------------------------------------------------------------------- /warehouse-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.warehouse 6 | warehouse-common 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | UTF-8 11 | 12 | 13 | -------------------------------------------------------------------------------- /warehouse-bean/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.warehouse 7 | warehouse-parent 8 | 0.0.1-SNAPSHOT 9 | ../warehouse-parent/pom.xml 10 | 11 | com.warehouse 12 | warehouse-bean 13 | 0.0.1-SNAPSHOT 14 | jar 15 | 16 | UTF-8 17 | 18 | 19 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/PageController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | /** 4 | * 控制页面跳转 5 | * 2018.4.27 6 | */ 7 | 8 | import javax.servlet.http.HttpSession; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | 13 | @Controller 14 | public class PageController { 15 | 16 | @RequestMapping("/") 17 | public String showIndex() throws Exception { 18 | return "index"; 19 | } 20 | 21 | /** 22 | * 打开其它页面 23 | */ 24 | @RequestMapping("/{page}") 25 | public String showPage(@PathVariable String page,HttpSession session) throws Exception { 26 | if(session.getAttribute("username")==null) { 27 | return "error"; 28 | } 29 | return page; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /warehouse-common/src/main/java/com/warehouse/common/WResponse.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.common; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 后台返回数据用到的类 7 | * 2018.4.27 8 | */ 9 | public class WResponse implements Serializable{ 10 | 11 | private String message; 12 | private Object object; 13 | 14 | public WResponse() { 15 | super(); 16 | // TODO Auto-generated constructor stub 17 | } 18 | 19 | public String getMessage() { 20 | return message; 21 | } 22 | 23 | public void setMessage(String message) { 24 | this.message = message; 25 | } 26 | 27 | public Object getObject() { 28 | return object; 29 | } 30 | 31 | public void setObject(Object object) { 32 | this.object = object; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "WResponse [message=" + message + ", object=" + object + "]"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/WarehouseService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | 5 | import com.warehouse.bean.Warehouse; 6 | 7 | /** 8 | * 仓库管理service 9 | * 2018.5.8 10 | */ 11 | public interface WarehouseService { 12 | 13 | /** 14 | * 插入新的仓库 15 | * @param warehouse 16 | */ 17 | public Integer insertWarehouse(Warehouse warehouse) throws Exception; 18 | 19 | /** 20 | * 检测仓库是否已存在 21 | * @param num 22 | * @return 23 | * @throws Exception 24 | */ 25 | public Boolean checkWarehouseExists(String num) throws Exception; 26 | 27 | /** 28 | * 获得所有仓库的信息 29 | * @return 30 | */ 31 | public List selectAllWarehouse() throws Exception; 32 | 33 | /** 34 | * 更新仓库信息 35 | * @param warehouse 36 | * @return 37 | */ 38 | public Integer updateWarehouse(Warehouse warehouse) throws Exception; 39 | } 40 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/GoodsService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | 5 | import com.warehouse.bean.Goods; 6 | import com.warehouse.bean.WarehouseGoods; 7 | 8 | public interface GoodsService { 9 | 10 | /** 11 | * 添加商品信息 12 | * @param goods 13 | * @return 14 | * @throws Exception 15 | */ 16 | public Integer addGoods(Goods goods) throws Exception; 17 | 18 | /** 19 | * 更新商品信息 20 | * @param goods 21 | * @return 22 | * @throws Exception 23 | */ 24 | public Integer updateGoods(Goods goods) throws Exception; 25 | 26 | /** 27 | * 检查商品是否已存在数据库中 28 | * @param num 29 | * @return 30 | * @throws Exception 31 | */ 32 | public Boolean checkGoodsExists(String num) throws Exception; 33 | 34 | /** 35 | * 获取所有商品信息 36 | * @return 37 | * @throws Exception 38 | */ 39 | public List getAllGoods() throws Exception; 40 | } 41 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/LogService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | 5 | import com.warehouse.bean.Log; 6 | 7 | /** 8 | * 系统操作日志service 9 | * 2018.5.8 10 | */ 11 | public interface LogService { 12 | 13 | /** 14 | * 插入log 15 | * @param log 16 | */ 17 | public Integer insertLog(Log log); 18 | 19 | /** 20 | * 获取所有日志 21 | * @return 22 | */ 23 | public List selectAllLog(); 24 | 25 | /** 26 | * 生成log实体 27 | * @param operator 28 | * @param operationType 29 | * @param operationDetail 30 | * @return 31 | */ 32 | public Log createLog(String operator,String operationType,String operationDetail); 33 | 34 | /** 35 | * 根据用户名和操作类型来搜索日志 36 | * @param username 37 | * @param operationtype 38 | * @return 39 | */ 40 | public List selectLogByUsernameAndOperationType(String username,Integer level,String operationtype); 41 | } 42 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/spring/applicationContext-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/SupplierService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | 5 | import com.warehouse.bean.Supplier; 6 | 7 | /** 8 | * 供应商信息service 9 | * 2018.5.11 10 | */ 11 | public interface SupplierService { 12 | 13 | /** 14 | * 获得所有供应商的信息 15 | * @return 16 | * @throws Exception 17 | */ 18 | public List getAllSupplier() throws Exception; 19 | 20 | /** 21 | * 添加供应商信息 22 | * @param supplier 23 | * @return 24 | */ 25 | public Integer addSupplier(Supplier supplier) throws Exception; 26 | 27 | /** 28 | * 检查供应商信息是否存在 29 | * @param suppliernum 30 | * @return 31 | * @throws Exception 32 | */ 33 | public Boolean checkSupplierExist(String suppliernum) throws Exception; 34 | 35 | /** 36 | * 更新供应商信息 37 | * @param supplier 38 | * @return 39 | * @throws Exception 40 | */ 41 | public Integer updateSupplier(Supplier supplier) throws Exception; 42 | 43 | /** 44 | * 根据供应商编号删除供应商信息 45 | * @param num 46 | * @return 47 | * @throws Exception 48 | */ 49 | public Integer deleteSupplierByNum(String num) throws Exception; 50 | } 51 | -------------------------------------------------------------------------------- /warehouse-utils/src/main/java/com/warehouse/utils/MD5.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.utils; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MD5 { 6 | 7 | public static String getMD5(String key) { 8 | char hexDigits[] = { 9 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 10 | }; 11 | try { 12 | byte[] btInput = key.getBytes(); 13 | // 获得MD5摘要算法的 MessageDigest 对象 14 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); 15 | // 使用指定的字节更新摘要 16 | mdInst.update(btInput); 17 | // 获得密文 18 | byte[] md = mdInst.digest(); 19 | // 把密文转换成十六进制的字符串形式 20 | int j = md.length; 21 | char str[] = new char[j * 2]; 22 | int k = 0; 23 | for (int i = 0; i < j; i++) { 24 | byte byte0 = md[i]; 25 | str[k++] = hexDigits[byte0 >>> 4 & 0xf]; 26 | str[k++] = hexDigits[byte0 & 0xf]; 27 | } 28 | return new String(str); 29 | } catch (Exception e) { 30 | return null; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.warehouse 5 | warehouse 6 | 0.0.1-SNAPSHOT 7 | pom 8 | warehouse 9 | 10 | warehouse-utils 11 | warehouse-service 12 | warehouse-bean 13 | warehouse-web 14 | warehouse-mapper 15 | warehouse-parent 16 | warehouse-common 17 | 18 | 19 | 20 | 21 | org.apache.maven.plugins 22 | maven-deploy-plugin 23 | 24 | true 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /warehouse-utils/src/main/java/com/warehouse/utils/TimeUtil.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.utils; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | 8 | /** 9 | * 获取当前时间的工具类 10 | * 2018.5.8 11 | */ 12 | public class TimeUtil { 13 | 14 | public static String getNowerTime() { 15 | Calendar c = Calendar.getInstance();//可以对每个时间域单独修改 16 | 17 | int year = c.get(Calendar.YEAR); 18 | int month = c.get(Calendar.MONTH); 19 | int day = c.get(Calendar.DATE); 20 | int hour = c.get(Calendar.HOUR_OF_DAY); 21 | int minute = c.get(Calendar.MINUTE); 22 | int second = c.get(Calendar.SECOND); 23 | 24 | return year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second; 25 | } 26 | 27 | /** 28 | * 格式化时间日期为yyyy-MM-dd hh:mm:ss 29 | * @param date 30 | * @return 31 | */ 32 | public static Date formatDate(Date date) { 33 | SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 34 | try { 35 | return dateFormat.parse(date.toString()); 36 | } catch (ParseException e) { 37 | // TODO Auto-generated catch block 38 | e.printStackTrace(); 39 | } 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/UserLoginServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.warehouse.bean.Userinfo; 9 | import com.warehouse.bean.UserinfoExample; 10 | import com.warehouse.bean.UserinfoExample.Criteria; 11 | import com.warehouse.mapper.UserinfoMapper; 12 | import com.warehouse.service.UserLoginService; 13 | import com.warehouse.utils.MD5; 14 | 15 | @Service 16 | public class UserLoginServiceImpl implements UserLoginService{ 17 | 18 | @Autowired 19 | private UserinfoMapper userinfoMapper; 20 | 21 | @Override 22 | public Integer checkUserGetLevel(Userinfo user) throws Exception{ 23 | Integer level=-1; 24 | UserinfoExample example=new UserinfoExample(); 25 | Criteria criteria=example.createCriteria(); 26 | criteria.andUsernameEqualTo(user.getUsername()); 27 | criteria.andPasswordEqualTo(MD5.getMD5(user.getPassword())); 28 | 29 | List list=userinfoMapper.selectByExample(example); 30 | if(list.size()>0) { 31 | return list.get(0).getLevel(); 32 | } 33 | return level; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/systemLog.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

系统日志

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
操 作 人操 作 时 间操 作 类 型操 作 细 节
${log.operatorName }${log.operationType }${log.operationDetail }
31 |
32 | 33 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/goodsAddLog.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

入库日志

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
操 作 人操 作 时 间操 作 类 型操 作 细 节
${log.operatorName }${log.operationType }${log.operationDetail }
31 |
32 | 33 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/goodsOutLog.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

出库日志

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
操 作 人操 作 时 间操 作 类 型操 作 细 节
${log.operatorName }${log.operationType }${log.operationDetail }
31 |
32 | 33 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/goodsAnalyse.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

物资信息统计

16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
物资编号物资名称存放仓库编号仓库名称已存数量
${warehousegoods.goodsNum }${warehousegoods.goodsName }${warehousegoods.warehouseNum }${warehousegoods.warehouseName }${warehousegoods.containNumber }
31 |
32 | 33 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/UserManageService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | 5 | import com.warehouse.bean.Userinfo; 6 | 7 | /** 8 | * 用户管理service 9 | * 2018.5.2 10 | */ 11 | public interface UserManageService { 12 | 13 | /** 14 | * 超级管理员添加新用户 15 | * @param userinfo 16 | * @return 17 | * @throws Exception 18 | */ 19 | public Integer addPerson(Userinfo userinfo) throws Exception; 20 | 21 | /** 22 | * 更改用户密码 23 | * @param userinfo 24 | * @return 25 | */ 26 | public Integer updatePassword(Userinfo userinfo) throws Exception; 27 | 28 | /** 29 | * 检查新密码是否和旧密码相同 30 | * @param userinfo 31 | * @return 32 | * @throws Exception 33 | */ 34 | public Boolean checkPasswdIsSameByUsername(Userinfo userinfo) throws Exception; 35 | 36 | /** 37 | * 检查用户是否存在 38 | * @param username 39 | * @return 40 | */ 41 | public Boolean checkUserExists(String username) throws Exception; 42 | 43 | /** 44 | * 获取所有的非超级管理员的用户 45 | * @return 46 | */ 47 | public List selectAllUser() throws Exception; 48 | 49 | /** 50 | * 更新除了用户名之外的用户信息 51 | * @param userinfo 52 | * @return 53 | */ 54 | public Integer updateUserinfo(Userinfo userinfo) throws Exception; 55 | 56 | /** 57 | * 根据用户名删除用户信息 58 | * @param username 59 | * @return 60 | * @throws Exception 61 | */ 62 | public Integer deletePersonByUsername(String username) throws Exception; 63 | } 64 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/ManageService.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.warehouse.bean.Goods; 7 | import com.warehouse.bean.WarehouseGoods; 8 | 9 | /** 10 | * 仓库管理service 11 | * 2018.5.13 12 | */ 13 | public interface ManageService { 14 | 15 | /** 16 | * 获取goods表中所有物资编号和warehouse表中所有仓库编号 17 | * @return 18 | */ 19 | public Map selectGoodsAndWarehouse(); 20 | 21 | /** 22 | * 查找记录是否存在 23 | * @param record 24 | * @return 25 | * @throws Exception 26 | */ 27 | public Boolean checkRecordExist(WarehouseGoods record) throws Exception; 28 | 29 | /** 30 | * 插入一条记录 31 | * @return 32 | * @throws Exception 33 | */ 34 | public Integer insertRecord(WarehouseGoods record) throws Exception; 35 | 36 | /** 37 | * 更新记录 38 | * @param record 39 | * @return 40 | */ 41 | public Integer updateRecord(WarehouseGoods record) throws Exception; 42 | 43 | /** 44 | * 根据商品编号和仓库编号获取库存相关信息 45 | * @param goodsNum 46 | * @param warehouseNum 47 | * @return 48 | * @throws Exception 49 | */ 50 | public List getWarehouseGoodsNumInfo(String goodsNum,String warehouseNum) throws Exception; 51 | 52 | /** 53 | * 根据搜索关键字和搜索类型查询物资数据(模糊查询或精确查询) 54 | * @param words 55 | * @param type 56 | * @return 57 | */ 58 | public List selectGoodsByType(String words,String type) throws Exception; 59 | 60 | /** 61 | * 从warehouse_goods表中获取所有记录 62 | * @return 63 | */ 64 | public List selectAllWarehouseGoods() throws Exception; 65 | } 66 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/GoodsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.warehouse.bean.Goods; 9 | import com.warehouse.bean.GoodsExample; 10 | import com.warehouse.bean.GoodsExample.Criteria; 11 | import com.warehouse.bean.WarehouseGoods; 12 | import com.warehouse.bean.WarehouseGoodsExample; 13 | import com.warehouse.mapper.GoodsMapper; 14 | import com.warehouse.mapper.WarehouseGoodsMapper; 15 | import com.warehouse.service.GoodsService; 16 | 17 | @Service 18 | public class GoodsServiceImpl implements GoodsService { 19 | 20 | @Autowired 21 | private GoodsMapper goodsMapper; 22 | 23 | @Override 24 | public Integer addGoods(Goods goods) throws Exception { 25 | return goodsMapper.insertSelective(goods); 26 | } 27 | 28 | @Override 29 | public Integer updateGoods(Goods goods) throws Exception { 30 | GoodsExample example=new GoodsExample(); 31 | Criteria criteria=example.createCriteria(); 32 | criteria.andNumEqualTo(goods.getNum()); 33 | return goodsMapper.updateByExampleSelective(goods, example); 34 | } 35 | 36 | @Override 37 | public Boolean checkGoodsExists(String num) throws Exception { 38 | GoodsExample example=new GoodsExample(); 39 | Criteria criteria=example.createCriteria(); 40 | criteria.andNumEqualTo(num); 41 | 42 | Long count = goodsMapper.countByExample(example); 43 | if(count>0) { 44 | return true; 45 | } 46 | return false; 47 | } 48 | 49 | @Override 50 | public List getAllGoods() throws Exception { 51 | return goodsMapper.selectByExample(null); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/spring/springmvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/WarehouseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.warehouse.bean.Warehouse; 9 | import com.warehouse.bean.WarehouseExample; 10 | import com.warehouse.bean.WarehouseExample.Criteria; 11 | import com.warehouse.mapper.WarehouseMapper; 12 | import com.warehouse.service.WarehouseService; 13 | 14 | @Service 15 | public class WarehouseServiceImpl implements WarehouseService { 16 | 17 | @Autowired 18 | private WarehouseMapper warehouseMapper; 19 | 20 | @Override 21 | public Integer insertWarehouse(Warehouse warehouse) throws Exception { 22 | return warehouseMapper.insertSelective(warehouse); 23 | } 24 | 25 | @Override 26 | public Boolean checkWarehouseExists(String num) throws Exception { 27 | WarehouseExample example=new WarehouseExample(); 28 | Criteria criteria=example.createCriteria(); 29 | criteria.andNumEqualTo(num); 30 | Long count=warehouseMapper.countByExample(example); 31 | if(count>0) { 32 | return true; 33 | } 34 | return false; 35 | } 36 | 37 | @Override 38 | public List selectAllWarehouse() throws Exception { 39 | WarehouseExample example=new WarehouseExample(); 40 | return warehouseMapper.selectByExample(example); 41 | } 42 | 43 | @Override 44 | public Integer updateWarehouse(Warehouse warehouse) throws Exception { 45 | 46 | WarehouseExample example=new WarehouseExample(); 47 | Criteria criteria=example.createCriteria(); 48 | criteria.andNumEqualTo(warehouse.getNum()); 49 | return warehouseMapper.updateByExampleSelective(warehouse, example); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /warehouse-common/src/main/java/com/warehouse/common/WMessage.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.common; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * 定义统一的消息 7 | * 2018.5.2 8 | */ 9 | 10 | public class WMessage implements Serializable { 11 | 12 | /** 13 | * 操作失败 14 | */ 15 | public static final String MSG_FAIL="fail"; 16 | 17 | /** 18 | * 操作成功 19 | */ 20 | public static final String MSG_SUCCESS="success"; 21 | 22 | /** 23 | * 新密码与原密码相同 24 | */ 25 | public static final String MSG_SAME_PASSWD="passwd_same"; 26 | 27 | /** 28 | * 用户名已存在 29 | */ 30 | public static final String MSG_USER_EXISTS="user_exists"; 31 | 32 | /** 33 | * 仓库信息已存在 34 | */ 35 | public static final String MSG_WAREHOUSE_EXISTS="warehouse_exists"; 36 | 37 | /** 38 | * 供应商信息已存在 39 | */ 40 | public static final String MSG_SUPPILER_EXISTS="suppiler_exists"; 41 | 42 | /** 43 | * 物资信息已存在 44 | */ 45 | public static final String MSG_GOODS_EXISTS="goods_exists"; 46 | 47 | /** 48 | * 操作类型:添加 49 | */ 50 | public static final String MSG_OPREATION_ADD="添加"; 51 | 52 | /** 53 | * 操作类型:修改 54 | */ 55 | public static final String MSG_OPREATION_UPDATE="更新"; 56 | 57 | /** 58 | * 操作类型:删除 59 | */ 60 | public static final String MSG_OPREATION_DELETE="删除"; 61 | 62 | /** 63 | * 操作类型:登陆 64 | */ 65 | public static final String MSG_OPREATION_LOGIN="登陆"; 66 | 67 | /** 68 | * 操作类型:商品入库 69 | */ 70 | public static final String MSG_OPREATION_ADD_GOODS="商品入库"; 71 | 72 | /** 73 | * 操作类型:商品出库 74 | */ 75 | public static final String MSG_OPREATION_OUT_GOODS="商品出库"; 76 | 77 | /** 78 | * 操作类型:添加配置 79 | */ 80 | public static final String MSG_OPREATION_ADD_CONFIG="添加配置"; 81 | 82 | /** 83 | * 操作类型:更新配置 84 | */ 85 | public static final String MSG_OPREATION_UPDATE_CONFIG="更新配置"; 86 | } 87 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/bootstrap-datetimepicker-standalone.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-time:before{content:"\e023"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-calendar:before{content:"\e109"}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.collapse{display:none}.collapse.in{display:block}.dropdown-menu{position:absolute;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.list-unstyled{padding-left:0;list-style:none}/*# sourceMappingURL=bootstrap-datetimepicker-standalone.min.css.map */ -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/SupplierServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.warehouse.bean.Supplier; 9 | import com.warehouse.bean.SupplierExample; 10 | import com.warehouse.bean.SupplierExample.Criteria; 11 | import com.warehouse.mapper.SupplierMapper; 12 | import com.warehouse.service.SupplierService; 13 | 14 | @Service 15 | public class SupplierServiceImpl implements SupplierService { 16 | 17 | @Autowired 18 | private SupplierMapper supplierMapper; 19 | 20 | @Override 21 | public Integer addSupplier(Supplier supplier) throws Exception { 22 | return supplierMapper.insertSelective(supplier); 23 | } 24 | 25 | @Override 26 | public Boolean checkSupplierExist(String suppliernum) throws Exception { 27 | 28 | SupplierExample example=new SupplierExample(); 29 | Criteria criteria=example.createCriteria(); 30 | criteria.andNumEqualTo(suppliernum); 31 | 32 | Long count=supplierMapper.countByExample(example); 33 | if(count>0) { 34 | return true; 35 | } 36 | return false; 37 | } 38 | 39 | @Override 40 | public Integer updateSupplier(Supplier supplier) throws Exception { 41 | SupplierExample example=new SupplierExample(); 42 | Criteria criteria=example.createCriteria(); 43 | criteria.andNumEqualTo(supplier.getNum()); 44 | return supplierMapper.updateByExampleSelective(supplier, example); 45 | } 46 | 47 | @Override 48 | public List getAllSupplier() throws Exception { 49 | return supplierMapper.selectByExample(null); 50 | } 51 | 52 | @Override 53 | public Integer deleteSupplierByNum(String num) throws Exception { 54 | SupplierExample example=new SupplierExample(); 55 | Criteria criteria=example.createCriteria(); 56 | criteria.andNumEqualTo(num); 57 | return supplierMapper.deleteByExample(example); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/LogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import com.warehouse.bean.Log; 10 | import com.warehouse.bean.LogExample; 11 | import com.warehouse.bean.LogExample.Criteria; 12 | import com.warehouse.common.WMessage; 13 | import com.warehouse.mapper.LogMapper; 14 | import com.warehouse.service.LogService; 15 | import com.warehouse.utils.TimeUtil; 16 | 17 | @Service 18 | @RequestMapping("/log") 19 | public class LogServiceImpl implements LogService { 20 | 21 | @Autowired 22 | private LogMapper logMapper; 23 | 24 | @Override 25 | public Integer insertLog(Log log) { 26 | return logMapper.insertSelective(log); 27 | } 28 | 29 | @Override 30 | public Log createLog(String operator, String operationType, String operationDetail) { 31 | Log log=new Log(); 32 | log.setOperatorName(operator); 33 | log.setOperationType(operationType); 34 | log.setOperationDetail(operationDetail); 35 | return log; 36 | } 37 | 38 | @Override 39 | public List selectAllLog() { 40 | return logMapper.selectByExample(null); 41 | } 42 | 43 | @Override 44 | public List selectLogByUsernameAndOperationType(String username,Integer level,String operationtype) { 45 | List loglist=null; 46 | if(level==1) { 47 | LogExample example=new LogExample(); 48 | Criteria criteria=example.createCriteria(); 49 | criteria.andOperationTypeEqualTo(operationtype); 50 | loglist=logMapper.selectByExample(example); 51 | }else if(level==2) { 52 | LogExample example=new LogExample(); 53 | Criteria criteria=example.createCriteria(); 54 | criteria.andOperatorNameEqualTo(username); 55 | criteria.andOperationTypeEqualTo(operationtype); 56 | loglist=logMapper.selectByExample(example); 57 | } 58 | return loglist; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/spring/applicationContext-dao.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/containWarning.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

库存预警

16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
物资编号物资名称存放仓库编号仓库名称已存数量可出库数量可入库数量仓库总容量
${warehousegoods.goodsNum }${warehousegoods.goodsName }${warehousegoods.warehouseNum }${warehousegoods.warehouseName }${warehousegoods.containNumber }${warehousegoods.containNumber }${warehousegoods.containNumber }${warehousegoods.topmost - warehousegoods.containNumber }${warehousegoods.topmost - warehousegoods.containNumber }${warehousegoods.topmost }
44 |
45 | 46 | -------------------------------------------------------------------------------- /warehouse-mapper/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.warehouse 7 | warehouse-parent 8 | 0.0.1-SNAPSHOT 9 | ../warehouse-parent/pom.xml 10 | 11 | com.warehouse 12 | warehouse-mapper 13 | 0.0.1-SNAPSHOT 14 | jar 15 | 16 | UTF-8 17 | 18 | 19 | 20 | 21 | com.warehouse 22 | warehouse-bean 23 | 0.0.1-SNAPSHOT 24 | 25 | 26 | 27 | org.mybatis 28 | mybatis 29 | 30 | 31 | org.mybatis 32 | mybatis-spring 33 | 34 | 35 | 36 | mysql 37 | mysql-connector-java 38 | 39 | 40 | 41 | com.alibaba 42 | druid 43 | 44 | 45 | 46 | 47 | 48 | 49 | src/main/java 50 | 51 | **/*.properties 52 | **/*.xml 53 | 54 | false 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/spring/applicationContext-trans.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | index.jsp 9 | 10 | 11 | 12 | 13 | contextConfigLocation 14 | classpath:spring/applicationContext-*.xml 15 | 16 | 17 | org.springframework.web.context.ContextLoaderListener 18 | 19 | 20 | 21 | 22 | CharacterEncodingFilter 23 | org.springframework.web.filter.CharacterEncodingFilter 24 | 25 | encoding 26 | UTF-8 27 | 28 | 29 | forceEncoding 30 | true 31 | 32 | 33 | 34 | CharacterEncodingFilter 35 | 36 | /* 37 | 38 | 39 | 40 | warehouse 41 | org.springframework.web.servlet.DispatcherServlet 42 | 43 | 44 | contextConfigLocation 45 | classpath:spring/springmvc.xml 46 | 47 | 1 48 | 49 | 50 | warehouse 51 | / 52 | 53 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/LogController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.aspectj.bridge.WeaveMessage; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | 14 | import com.warehouse.bean.Log; 15 | import com.warehouse.bean.Warehouse; 16 | import com.warehouse.common.WMessage; 17 | import com.warehouse.service.LogService; 18 | 19 | /** 20 | * 日志controller 21 | * 2018.5.9 22 | */ 23 | @Controller 24 | @RequestMapping("/log") 25 | public class LogController { 26 | 27 | @Autowired 28 | private LogService logService; 29 | 30 | @RequestMapping(value = "/showAllLog", method = RequestMethod.GET) 31 | public String showAllLog(HttpSession session,Model model) { 32 | if(session.getAttribute("username")==null) { 33 | return "error"; 34 | } 35 | 36 | List loglist=logService.selectAllLog(); 37 | model.addAttribute("loglist",loglist); 38 | return "systemLog"; 39 | } 40 | 41 | @RequestMapping(value = "/showInsertLog", method = RequestMethod.GET) 42 | public String showInsertLog(HttpSession session,Model model) { 43 | if(session.getAttribute("username")==null) { 44 | return "error"; 45 | } 46 | 47 | List loglist=logService.selectLogByUsernameAndOperationType( 48 | (String)session.getAttribute("username"), 49 | (Integer)session.getAttribute("level"), 50 | WMessage.MSG_OPREATION_ADD_GOODS); 51 | model.addAttribute("loglist",loglist); 52 | return "goodsAddLog"; 53 | } 54 | 55 | @RequestMapping(value = "/showDeleteLog", method = RequestMethod.GET) 56 | public String showDeleteLog(HttpSession session,Model model) { 57 | if(session.getAttribute("username")==null) { 58 | return "error"; 59 | } 60 | List loglist=logService.selectLogByUsernameAndOperationType( 61 | (String)session.getAttribute("username"), 62 | (Integer)session.getAttribute("level"), 63 | WMessage.MSG_OPREATION_OUT_GOODS); 64 | model.addAttribute("loglist",loglist); 65 | return "goodsOutLog"; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /warehouse-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.warehouse 7 | warehouse-parent 8 | 0.0.1-SNAPSHOT 9 | ../warehouse-parent/pom.xml 10 | 11 | warehouse-web 12 | war 13 | 14 | 15 | 16 | com.warehouse 17 | warehouse-service 18 | 0.0.1-SNAPSHOT 19 | 20 | 21 | 22 | jstl 23 | jstl 24 | 25 | 26 | javax.servlet 27 | javax.servlet-api 28 | provided 29 | 30 | 31 | javax.servlet.jsp 32 | jsp-api 33 | provided 34 | 35 | 36 | 37 | com.fasterxml.jackson.core 38 | jackson-databind 39 | 40 | 41 | 42 | commons-fileupload 43 | commons-fileupload 44 | 45 | 46 | junit 47 | junit 48 | test 49 | 50 | 51 | 52 | 53 | 54 | org.apache.tomcat.maven 55 | tomcat7-maven-plugin 56 | 2.2 57 | 58 | 8080 59 | / 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /warehouse-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.warehouse 7 | warehouse-parent 8 | 0.0.1-SNAPSHOT 9 | ../warehouse-parent/pom.xml 10 | 11 | com.warehouse 12 | warehouse-service 13 | 0.0.1-SNAPSHOT 14 | jar 15 | 16 | UTF-8 17 | 18 | 19 | 20 | com.warehouse 21 | warehouse-mapper 22 | 0.0.1-SNAPSHOT 23 | 24 | 25 | com.warehouse 26 | warehouse-utils 27 | 0.0.1-SNAPSHOT 28 | 29 | 30 | com.warehouse 31 | warehouse-common 32 | 0.0.1-SNAPSHOT 33 | 34 | 35 | 36 | org.springframework 37 | spring-context 38 | 39 | 40 | org.springframework 41 | spring-beans 42 | 43 | 44 | org.springframework 45 | spring-webmvc 46 | 47 | 48 | org.springframework 49 | spring-jdbc 50 | 51 | 52 | org.springframework 53 | spring-aspects 54 | 55 | 56 | 57 | 58 | 59 | maven-assembly-plugin 60 | 61 | 62 | jar-with-dependencies 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 仓储管理系统登陆页面 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 40 | 41 | 70 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | /** 6 | * 登陆验证controller 7 | * 2018.4.27 8 | */ 9 | 10 | import javax.servlet.http.HttpSession; 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestMethod; 16 | import org.springframework.web.bind.annotation.RequestParam; 17 | import org.springframework.web.bind.annotation.ResponseBody; 18 | import com.warehouse.bean.Log; 19 | import com.warehouse.bean.Userinfo; 20 | import com.warehouse.common.WMessage; 21 | import com.warehouse.common.WResponse; 22 | import com.warehouse.service.LogService; 23 | import com.warehouse.service.UserLoginService; 24 | import com.warehouse.utils.TimeUtil; 25 | 26 | @Controller 27 | @RequestMapping("/login") 28 | public class LoginController { 29 | 30 | @Autowired 31 | private UserLoginService userLoginService; 32 | 33 | @Autowired 34 | private LogService logService; 35 | 36 | /** 37 | * 返回登陆结果信息 38 | * @param userinfo 39 | * @return 40 | * @throws Exception 41 | */ 42 | @ResponseBody 43 | @RequestMapping(value = "/userLogin" , method = RequestMethod.POST) 44 | public WResponse userLogin(Userinfo userinfo,HttpSession session) throws Exception { 45 | 46 | Integer level=userLoginService.checkUserGetLevel(userinfo); 47 | userinfo.setLevel(level); 48 | userinfo.setPassword(""); 49 | WResponse response=new WResponse(); 50 | response.setObject(userinfo); 51 | 52 | if(level==-1) { 53 | response.setMessage(WMessage.MSG_FAIL); 54 | }else { 55 | session.setAttribute("username", userinfo.getUsername()); 56 | response.setMessage(WMessage.MSG_SUCCESS); 57 | } 58 | 59 | Log log=logService.createLog(userinfo.getUsername(), 60 | WMessage.MSG_OPREATION_LOGIN, 61 | "用户: "+userinfo.getUsername() 62 | +"等级: "+userinfo.getLevel() 63 | +" 于 "+TimeUtil.getNowerTime() 64 | +" 登陆系统 结果: "+response.getMessage()); 65 | logService.insertLog(log); 66 | 67 | return response; 68 | } 69 | 70 | /** 71 | * 判定用户等级,并返回视图 72 | * @param username 73 | * @param level 74 | * @param session 75 | * @return 76 | * @throws Exception 77 | */ 78 | @RequestMapping(value = "/userPageSelect", method = RequestMethod.GET) 79 | public String userPageSelect(@RequestParam("username") String username,@RequestParam("level") Integer level,HttpSession session) 80 | throws Exception { 81 | 82 | if(session.getAttribute("username")==null) { 83 | return "error"; 84 | } 85 | 86 | session.setAttribute("level", level); 87 | return "applicationPage"; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/changePassword.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 38 | 39 | 71 | -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/UserManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.warehouse.bean.Userinfo; 9 | import com.warehouse.bean.UserinfoExample; 10 | import com.warehouse.bean.UserinfoExample.Criteria; 11 | import com.warehouse.mapper.UserinfoMapper; 12 | import com.warehouse.service.UserManageService; 13 | import com.warehouse.utils.MD5; 14 | 15 | @Service 16 | public class UserManageServiceImpl implements UserManageService { 17 | 18 | @Autowired 19 | private UserinfoMapper userinfoMapper; 20 | 21 | @Override 22 | public Integer updatePassword(Userinfo userinfo) throws Exception { 23 | 24 | return userinfoMapper.updatePasswordByUsername(userinfo); 25 | } 26 | 27 | @Override 28 | public Boolean checkPasswdIsSameByUsername(Userinfo userinfo) throws Exception { 29 | 30 | UserinfoExample example=new UserinfoExample(); 31 | Criteria criteria=example.createCriteria(); 32 | criteria.andUsernameEqualTo(userinfo.getUsername()); 33 | 34 | List list=userinfoMapper.selectByExample(example); 35 | 36 | if(list.size()>0) { 37 | if(list.get(0).getPassword().equals(MD5.getMD5(userinfo.getPassword()))) { 38 | return true; 39 | } 40 | } 41 | 42 | return false; 43 | } 44 | 45 | @Override 46 | public Integer addPerson(Userinfo userinfo) throws Exception { 47 | 48 | userinfo.setPassword(MD5.getMD5(userinfo.getPassword())); 49 | return userinfoMapper.insertSelective(userinfo); 50 | } 51 | 52 | @Override 53 | public Boolean checkUserExists(String username) throws Exception { 54 | 55 | UserinfoExample example=new UserinfoExample(); 56 | Criteria criteria=example.createCriteria(); 57 | criteria.andUsernameEqualTo(username); 58 | Long count=userinfoMapper.countByExample(example); 59 | 60 | 61 | if(count==0 || count==null) { 62 | return Boolean.FALSE; 63 | } 64 | return Boolean.TRUE; 65 | } 66 | 67 | @Override 68 | public List selectAllUser() throws Exception{ 69 | UserinfoExample example=new UserinfoExample(); 70 | Criteria criteria=example.createCriteria(); 71 | criteria.andLevelNotEqualTo(1); 72 | 73 | return userinfoMapper.selectByExample(example); 74 | } 75 | 76 | @Override 77 | public Integer updateUserinfo(Userinfo userinfo) throws Exception { 78 | UserinfoExample example=new UserinfoExample(); 79 | Criteria criteria=example.createCriteria(); 80 | criteria.andUsernameEqualTo(userinfo.getUsername()); 81 | if(userinfo.getPassword().length()==0 || userinfo.getPassword()==null) { 82 | userinfo.setPassword(null); 83 | }else { 84 | userinfo.setPassword(MD5.getMD5(userinfo.getPassword())); 85 | } 86 | return userinfoMapper.updateByExampleSelective(userinfo, example); 87 | } 88 | 89 | @Override 90 | public Integer deletePersonByUsername(String username) throws Exception { 91 | return userinfoMapper.deletePersonByUsername(username); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/goodsSelect.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

物资查询

19 |
20 |
21 |
22 |
23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 |
37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
编号名称扩展配件单价备注
${goods.num }${goods.name }${goods.extendsParts }${goods.price }${goods.remark }
53 |
54 | 55 | 84 | -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/LogMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.Log; 4 | import com.warehouse.bean.LogExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface LogMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table log 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(LogExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table log 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(LogExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table log 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table log 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(Log record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table log 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(Log record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table log 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(LogExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table log 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | Log selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table log 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") Log record, @Param("example") LogExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table log 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") Log record, @Param("example") LogExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table log 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(Log record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table log 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(Log record); 96 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/mainPage.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin:0; 3 | padding:0; 4 | } 5 | 6 | html,body{ 7 | height:100%; 8 | } 9 | 10 | .div_left{ 11 | width: 25%; 12 | height: 100%; 13 | float: left; 14 | } 15 | 16 | .div_right{ 17 | width: 75%; 18 | height: 100%; 19 | float: left; 20 | } 21 | 22 | .div_top{ 23 | height: 15%; 24 | width: 100%; 25 | background-color: #222222; 26 | } 27 | 28 | .div_top p{ 29 | position: absolute; 30 | top: 5%; 31 | left: 45%; 32 | color: white; 33 | font-size: 25px; 34 | } 35 | 36 | .div_bottom{ 37 | margin: 15px auto; 38 | height: 80%; 39 | width: 95%;s 40 | } 41 | 42 | .jsp_frame{ 43 | width: 100%; 44 | height: 100%; 45 | frameborder: no; 46 | border: 0px; 47 | } 48 | 49 | #main-nav { 50 | } 51 | 52 | #main-nav.nav-tabs.nav-stacked > li > a { 53 | padding: 10px 8px; 54 | font-size: 14px; 55 | color: #4A515B; 56 | background: #E9E9E9; 57 | background: -moz-linear-gradient(top, #FAFAFA 0%, #E9E9E9 100%); 58 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FAFAFA), color-stop(100%,#E9E9E9)); 59 | background: -webkit-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); 60 | background: -o-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); 61 | background: -ms-linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); 62 | background: linear-gradient(top, #FAFAFA 0%,#E9E9E9 100%); 63 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9'); 64 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FAFAFA', endColorstr='#E9E9E9')"; 65 | border: 1px solid #D5D5D5; 66 | border-radius: 4px; 67 | } 68 | 69 | #main-nav.nav-tabs.nav-stacked > li > a > span { 70 | color: #4A515B; 71 | } 72 | 73 | #main-nav.nav-tabs.nav-stacked > li.active > a, #main-nav.nav-tabs.nav-stacked > li > a:hover { 74 | color: #FFF; 75 | background: #3C4049; 76 | background: -moz-linear-gradient(top, #4A515B 0%, #3C4049 100%); 77 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4A515B), color-stop(100%,#3C4049)); 78 | background: -webkit-linear-gradient(top, #4A515B 0%,#3C4049 100%); 79 | background: -o-linear-gradient(top, #4A515B 0%,#3C4049 100%); 80 | background: -ms-linear-gradient(top, #4A515B 0%,#3C4049 100%); 81 | background: linear-gradient(top, #4A515B 0%,#3C4049 100%); 82 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049'); 83 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049')"; 84 | border-color: #2B2E33; 85 | } 86 | 87 | #main-nav.nav-tabs.nav-stacked > li.active > a, #main-nav.nav-tabs.nav-stacked > li > a:hover > span { 88 | color: #FFF; 89 | } 90 | 91 | #main-nav.nav-tabs.nav-stacked > li { 92 | margin-bottom: 4px; 93 | } 94 | 95 | /*定义二级菜单样式*/ 96 | .secondmenu a { 97 | font-size: 14px; 98 | color: #4A515B; 99 | text-align: center; 100 | } 101 | 102 | .navbar-static-top { 103 | background-color: #212121; 104 | margin-bottom: 5px; 105 | } 106 | 107 | .navbar-brand { 108 | background: url('') no-repeat 10px 8px; 109 | display: inline-block; 110 | vertical-align: middle; 111 | padding-left: 50px; 112 | color: #fff; 113 | } 114 | -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/SupplierMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.Supplier; 4 | import com.warehouse.bean.SupplierExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SupplierMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table supplier 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(SupplierExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table supplier 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(SupplierExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table supplier 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table supplier 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(Supplier record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table supplier 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(Supplier record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table supplier 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(SupplierExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table supplier 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | Supplier selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table supplier 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") Supplier record, @Param("example") SupplierExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table supplier 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") Supplier record, @Param("example") SupplierExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table supplier 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(Supplier record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table supplier 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(Supplier record); 96 | } -------------------------------------------------------------------------------- /warehouse-service/src/main/java/com/warehouse/service/impl/ManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.service.impl; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.warehouse.bean.Goods; 11 | import com.warehouse.bean.GoodsExample; 12 | import com.warehouse.bean.Warehouse; 13 | import com.warehouse.bean.WarehouseGoods; 14 | import com.warehouse.bean.WarehouseGoodsExample; 15 | import com.warehouse.bean.WarehouseGoodsExample.Criteria; 16 | import com.warehouse.mapper.GoodsMapper; 17 | import com.warehouse.mapper.WarehouseGoodsMapper; 18 | import com.warehouse.mapper.WarehouseMapper; 19 | import com.warehouse.service.ManageService; 20 | 21 | @Service 22 | public class ManageServiceImpl implements ManageService { 23 | 24 | @Autowired 25 | private GoodsMapper goodsMapper; 26 | 27 | @Autowired 28 | private WarehouseMapper warehouseMapper; 29 | 30 | @Autowired 31 | private WarehouseGoodsMapper warehouseGoodsMapper; 32 | 33 | @Override 34 | public Map selectGoodsAndWarehouse() { 35 | 36 | List goodslist=goodsMapper.selectByExample(null); 37 | List warehouselist=warehouseMapper.selectByExample(null); 38 | Map map=new HashMap<>(); 39 | map.put("goodslist", goodslist); 40 | map.put("warehouselist", warehouselist); 41 | return map; 42 | } 43 | 44 | @Override 45 | public Boolean checkRecordExist(WarehouseGoods record) throws Exception { 46 | WarehouseGoodsExample example=new WarehouseGoodsExample(); 47 | Criteria criteria=example.createCriteria(); 48 | criteria.andGoodsNumEqualTo(record.getGoodsNum()); 49 | criteria.andWarehouseNumEqualTo(record.getWarehouseNum()); 50 | Long count=warehouseGoodsMapper.countByExample(example); 51 | if(count>0) { 52 | return true; 53 | } 54 | return false; 55 | } 56 | 57 | @Override 58 | public Integer insertRecord(WarehouseGoods record) throws Exception { 59 | return warehouseGoodsMapper.insertSelective(record); 60 | } 61 | 62 | @Override 63 | public Integer updateRecord(WarehouseGoods record) throws Exception { 64 | WarehouseGoodsExample example=new WarehouseGoodsExample(); 65 | Criteria criteria=example.createCriteria(); 66 | criteria.andGoodsNumEqualTo(record.getGoodsNum()); 67 | criteria.andWarehouseNumEqualTo(record.getWarehouseNum()); 68 | return warehouseGoodsMapper.updateByExampleSelective(record, example); 69 | } 70 | 71 | @Override 72 | public List getWarehouseGoodsNumInfo(String goodsNum, String warehouseNum) throws Exception { 73 | WarehouseGoodsExample example=new WarehouseGoodsExample(); 74 | Criteria criteria=example.createCriteria(); 75 | criteria.andGoodsNumEqualTo(goodsNum); 76 | criteria.andWarehouseNumEqualTo(warehouseNum); 77 | return warehouseGoodsMapper.selectByExample(example); 78 | } 79 | 80 | @Override 81 | public List selectGoodsByType(String words, String type) throws Exception { 82 | if(words==null || words.length()==0) { 83 | return goodsMapper.selectByExample(null); 84 | }else{ 85 | return goodsMapper.selectGoodsByWordsAndType(words, type); 86 | } 87 | } 88 | 89 | @Override 90 | public List selectAllWarehouseGoods() throws Exception { 91 | return warehouseGoodsMapper.selectByExample(null); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addGoods.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 46 |
47 | 48 | 88 | -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/WarehouseMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.Warehouse; 4 | import com.warehouse.bean.WarehouseExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface WarehouseMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table warehouse 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(WarehouseExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table warehouse 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(WarehouseExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table warehouse 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table warehouse 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(Warehouse record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table warehouse 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(Warehouse record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table warehouse 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(WarehouseExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table warehouse 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | Warehouse selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table warehouse 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") Warehouse record, @Param("example") WarehouseExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table warehouse 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") Warehouse record, @Param("example") WarehouseExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table warehouse 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(Warehouse record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table warehouse 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(Warehouse record); 96 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addPerson.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 49 |
50 | 51 | 85 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/manageGoods.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

物资信息管理

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 |
物资编号物资名称扩展配件单价(人名币/元)操作人操作时间备注操作
${goods.num }${goods.name }${goods.extendsParts }${goods.price }${goods.operator }${goods.remark } 32 | 33 |
37 |
38 | 39 | 88 | -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/WarehouseGoodsMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.WarehouseGoods; 4 | import com.warehouse.bean.WarehouseGoodsExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface WarehouseGoodsMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table warehouse_goods 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(WarehouseGoodsExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table warehouse_goods 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(WarehouseGoodsExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table warehouse_goods 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table warehouse_goods 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(WarehouseGoods record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table warehouse_goods 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(WarehouseGoods record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table warehouse_goods 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(WarehouseGoodsExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table warehouse_goods 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | WarehouseGoods selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table warehouse_goods 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") WarehouseGoods record, @Param("example") WarehouseGoodsExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table warehouse_goods 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") WarehouseGoods record, @Param("example") WarehouseGoodsExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table warehouse_goods 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(WarehouseGoods record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table warehouse_goods 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(WarehouseGoods record); 96 | } -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/GoodsMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.Goods; 4 | import com.warehouse.bean.GoodsExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface GoodsMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table goods 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(GoodsExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table goods 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(GoodsExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table goods 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table goods 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(Goods record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table goods 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(Goods record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table goods 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(GoodsExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table goods 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | Goods selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table goods 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table goods 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table goods 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(Goods record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table goods 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(Goods record); 96 | 97 | /** 98 | * 根据搜索关键字搜索物资 99 | * @param words 100 | * @param type 101 | * @return 102 | */ 103 | List selectGoodsByWordsAndType(@Param("words") String words,@Param("type") String type); 104 | } -------------------------------------------------------------------------------- /warehouse-mapper/src/main/java/com/warehouse/mapper/UserinfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.mapper; 2 | 3 | import com.warehouse.bean.Userinfo; 4 | import com.warehouse.bean.UserinfoExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UserinfoMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table userinfo 12 | * 13 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 14 | */ 15 | long countByExample(UserinfoExample example); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table userinfo 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | int deleteByExample(UserinfoExample example); 24 | 25 | /** 26 | * This method was generated by MyBatis Generator. 27 | * This method corresponds to the database table userinfo 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | int deleteByPrimaryKey(Long id); 32 | 33 | /** 34 | * This method was generated by MyBatis Generator. 35 | * This method corresponds to the database table userinfo 36 | * 37 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 38 | */ 39 | int insert(Userinfo record); 40 | 41 | /** 42 | * This method was generated by MyBatis Generator. 43 | * This method corresponds to the database table userinfo 44 | * 45 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 46 | */ 47 | int insertSelective(Userinfo record); 48 | 49 | /** 50 | * This method was generated by MyBatis Generator. 51 | * This method corresponds to the database table userinfo 52 | * 53 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 54 | */ 55 | List selectByExample(UserinfoExample example); 56 | 57 | /** 58 | * This method was generated by MyBatis Generator. 59 | * This method corresponds to the database table userinfo 60 | * 61 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 62 | */ 63 | Userinfo selectByPrimaryKey(Long id); 64 | 65 | /** 66 | * This method was generated by MyBatis Generator. 67 | * This method corresponds to the database table userinfo 68 | * 69 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 70 | */ 71 | int updateByExampleSelective(@Param("record") Userinfo record, @Param("example") UserinfoExample example); 72 | 73 | /** 74 | * This method was generated by MyBatis Generator. 75 | * This method corresponds to the database table userinfo 76 | * 77 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 78 | */ 79 | int updateByExample(@Param("record") Userinfo record, @Param("example") UserinfoExample example); 80 | 81 | /** 82 | * This method was generated by MyBatis Generator. 83 | * This method corresponds to the database table userinfo 84 | * 85 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 86 | */ 87 | int updateByPrimaryKeySelective(Userinfo record); 88 | 89 | /** 90 | * This method was generated by MyBatis Generator. 91 | * This method corresponds to the database table userinfo 92 | * 93 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 94 | */ 95 | int updateByPrimaryKey(Userinfo record); 96 | 97 | /** 98 | * 根据用命名更新密码 99 | * @param record 100 | * @return 101 | */ 102 | int updatePasswordByUsername(Userinfo record); 103 | 104 | /** 105 | * 根据用户名删除用户信息 106 | * @param username 107 | * @return 108 | */ 109 | int deletePersonByUsername(String username); 110 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/manageWarehouse.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

仓库管理

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 |
编号仓库名负责人负责人联系方式所属公司合同签订日期操作人操作时间备注操作
${warehouse.num }${warehouse.name }${warehouse.responser }${warehouse.responserPhone }${warehouse.company }${warehouse.operator }${warehouse.remark } 34 | 35 |
39 |
40 | 41 | 92 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/GoodsController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.warehouse.bean.Goods; 15 | import com.warehouse.bean.Log; 16 | import com.warehouse.bean.Supplier; 17 | import com.warehouse.common.WMessage; 18 | import com.warehouse.common.WResponse; 19 | import com.warehouse.service.GoodsService; 20 | import com.warehouse.service.LogService; 21 | import com.warehouse.utils.TimeUtil; 22 | 23 | /** 24 | * 商品操作controller 25 | * 2018.5.12 26 | */ 27 | @Controller 28 | @RequestMapping("/goods") 29 | public class GoodsController { 30 | 31 | @Autowired 32 | private GoodsService goodsService; 33 | 34 | @Autowired 35 | private LogService logService; 36 | 37 | @ResponseBody 38 | @RequestMapping(value = "/addGoods", method = RequestMethod.POST) 39 | public WResponse addGoods(Goods goods,HttpSession session) throws Exception { 40 | WResponse response=new WResponse(); 41 | 42 | if(goodsService.checkGoodsExists(goods.getNum())) { 43 | response.setMessage(WMessage.MSG_GOODS_EXISTS); 44 | }else { 45 | goods.setOperator((String)session.getAttribute("username")); 46 | Integer num = goodsService.addGoods(goods); 47 | if(num>0) { 48 | response.setMessage(WMessage.MSG_SUCCESS); 49 | }else { 50 | response.setMessage(WMessage.MSG_FAIL); 51 | } 52 | } 53 | 54 | Log log = logService.createLog((String)session.getAttribute("username"), 55 | WMessage.MSG_OPREATION_ADD, 56 | "用户: "+session.getAttribute("username") 57 | +" 等级: "+session.getAttribute("level") 58 | +" 于 "+TimeUtil.getNowerTime() 59 | +" 添加物资信息: " 60 | +" 物资编号: "+goods.getNum() 61 | +" 物资名称: "+goods.getName() 62 | +" 物资配件: "+goods.getExtendsParts() 63 | +" 物资价格(元/件):"+goods.getPrice() 64 | +" 备注: "+goods.getRemark() 65 | +" 结果: "+ response.getMessage()); 66 | logService.insertLog(log); 67 | 68 | return response; 69 | } 70 | 71 | @RequestMapping(value = "/manageGoods", method = RequestMethod.GET) 72 | public String manageSupplier(HttpSession session,Model model) throws Exception { 73 | if(session.getAttribute("username")==null) { 74 | return "error"; 75 | } 76 | List goodslist = goodsService.getAllGoods(); 77 | model.addAttribute("goodslist", goodslist); 78 | 79 | return "manageGoods"; 80 | } 81 | 82 | @ResponseBody 83 | @RequestMapping(value = "/updateGoods", method = RequestMethod.POST) 84 | public WResponse updateSupplier(HttpSession session,Goods goods) throws Exception{ 85 | WResponse response=new WResponse(); 86 | goods.setOperator((String)session.getAttribute("username")); 87 | Integer num = goodsService.updateGoods(goods); 88 | if(num>0) { 89 | response.setMessage(WMessage.MSG_SUCCESS); 90 | }else{ 91 | response.setMessage(WMessage.MSG_FAIL); 92 | } 93 | 94 | Log log = logService.createLog((String)session.getAttribute("username"), 95 | WMessage.MSG_OPREATION_UPDATE, 96 | "用户: "+session.getAttribute("username") 97 | +" 等级: "+session.getAttribute("level") 98 | +" 于 "+TimeUtil.getNowerTime() 99 | +" 更新物资信息: " 100 | +" 物资编号: "+goods.getNum() 101 | +" 物资名称: "+goods.getName() 102 | +" 物资配件: "+goods.getExtendsParts() 103 | +" 物资价格(元/件):"+goods.getPrice() 104 | +" 备注: "+goods.getRemark() 105 | +" 结果: "+ response.getMessage()); 106 | logService.insertLog(log); 107 | 108 | return response; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /warehouse-web/src/main/resources/sql/warehouse.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE warehouse CHARACTER SET utf8; 2 | USE warehouse; 3 | 4 | #人员表 5 | CREATE TABLE `userinfo` ( 6 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '表主键', 7 | `username` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名', 8 | `level` int(4) NOT NULL DEFAULT '3' COMMENT '权限,1是超级管理员,2是普通管理员,3是普通用户', 9 | `password` varchar(255) NOT NULL DEFAULT '' COMMENT '密码', 10 | `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', 11 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建的时间', 12 | `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录更新的时间', 13 | PRIMARY KEY (`id`) 14 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表'; 15 | 16 | 17 | #物资信息表 18 | CREATE TABLE `goods` ( 19 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '表主键', 20 | `num` varchar(255) NOT NULL DEFAULT '' COMMENT '物资编号', 21 | `name` varchar(100) NOT NULL DEFAULT '' COMMENT '物资名称', 22 | `extends_parts` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展配件', 23 | `price` double NOT NULL DEFAULT '0' COMMENT '商品的单价', 24 | `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '物资备注', 25 | `operator` varchar(70) NOT NULL DEFAULT '' COMMENT '操作人', 26 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建日期', 27 | `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新记录的日期', 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物资信息表' ; 30 | 31 | #仓库表 32 | CREATE TABLE `warehouse` ( 33 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', 34 | `num` varchar(255) NOT NULL DEFAULT '' COMMENT '仓库编号', 35 | `name` varchar(50) NOT NULL DEFAULT '' COMMENT '仓库名称', 36 | `responser` varchar(50) NOT NULL DEFAULT '' COMMENT '仓库负责人', 37 | `responser_phone` varchar(70) NOT NULL DEFAULT '' COMMENT '仓库负责人联系方式', 38 | `company` varchar(150) NOT NULL DEFAULT '' COMMENT '仓库所属公司', 39 | `contract_date` date NOT NULL DEFAULT '1000-01-01' COMMENT '仓库签订合同的日期', 40 | `operator` varchar(70) NOT NULL DEFAULT '' COMMENT '操作人', 41 | `updateed_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新日期', 42 | `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', 43 | PRIMARY KEY (`id`) 44 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仓库表'; 45 | 46 | #供应商信息表 47 | CREATE TABLE `supplier` ( 48 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '表主键', 49 | `num` varchar(255) NOT NULL DEFAULT '' COMMENT '供应商编号', 50 | `name` varchar(100) NOT NULL DEFAULT '' COMMENT '供应商名称', 51 | `receiver` varchar(50) NOT NULL DEFAULT '' COMMENT '对接人', 52 | `receiver_phone` varchar(70) NOT NULL DEFAULT '' COMMENT '对接人联系方式', 53 | `responser` varchar(50) NOT NULL DEFAULT '' COMMENT '负责人', 54 | `responser_phone` varchar(70) NOT NULL DEFAULT '' COMMENT '负责人联系方式', 55 | `operator` varchar(70) NOT NULL DEFAULT '' COMMENT '操作人', 56 | `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', 57 | `updatetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', 58 | `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', 59 | PRIMARY KEY (`id`) 60 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='供应商信息管理表'; 61 | 62 | #仓库和物资关联表 63 | CREATE TABLE `warehouse_goods` ( 64 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', 65 | `goods_num` varchar(255) NOT NULL DEFAULT '' COMMENT '商品编号', 66 | `goods_name` varchar(100) NOT NULL DEFAULT '' COMMENT '商品名', 67 | `warehouse_num` varchar(255) NOT NULL DEFAULT '' COMMENT '仓库编号', 68 | `warehouse_name` varchar(100) NOT NULL DEFAULT '' COMMENT '仓库名', 69 | `contain_number` bigint(20) NOT NULL DEFAULT '0' COMMENT '已存商品数量', 70 | `bottommost` bigint(20) NOT NULL DEFAULT '0' COMMENT '最低商品库存预警值', 71 | `topmost` bigint(20) NOT NULL DEFAULT '0' COMMENT '最高库存预警值', 72 | PRIMARY KEY (`id`) 73 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仓库商品关联表'; 74 | 75 | #日志表 76 | CREATE TABLE `log` ( 77 | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', 78 | `operator_name` varchar(100) NOT NULL DEFAULT '' COMMENT '操作者', 79 | `operator_num` varchar(255) NOT NULL DEFAULT '' COMMENT '操作者编号', 80 | `opreator_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间', 81 | `operation_type` varchar(50) NOT NULL DEFAULT '' COMMENT '操作类型,增加、删除、修改', 82 | `operation_detail` varchar(255) NOT NULL DEFAULT '' COMMENT '操作商品细节', 83 | PRIMARY KEY (`id`) 84 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操作日志表'; -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/WarehouseController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | 11 | /** 12 | * 仓库管理的controller 13 | * 2018.5.2 14 | */ 15 | 16 | import org.springframework.stereotype.Controller; 17 | import org.springframework.ui.Model; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.RequestMethod; 20 | import org.springframework.web.bind.annotation.RequestParam; 21 | import org.springframework.web.bind.annotation.ResponseBody; 22 | 23 | import com.warehouse.bean.Log; 24 | import com.warehouse.bean.Warehouse; 25 | import com.warehouse.common.WMessage; 26 | import com.warehouse.common.WResponse; 27 | import com.warehouse.service.LogService; 28 | import com.warehouse.service.WarehouseService; 29 | import com.warehouse.utils.TimeUtil; 30 | 31 | @Controller 32 | @RequestMapping("/warehouse") 33 | public class WarehouseController { 34 | 35 | @Autowired 36 | private WarehouseService warehouseService; 37 | 38 | @Autowired 39 | private LogService logService; 40 | 41 | @ResponseBody 42 | @RequestMapping(value = "/addWarehouse", method = RequestMethod.POST) 43 | public WResponse addWarehouse(Warehouse warehouse,@RequestParam("contract_date") String contractdate,HttpSession session) throws Exception { 44 | WResponse response=new WResponse(); 45 | SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd"); 46 | Date date =sdf.parse(contractdate); 47 | warehouse.setContractDate(date); 48 | warehouse.setOperator((String)session.getAttribute("username")); 49 | if(warehouseService.checkWarehouseExists(warehouse.getNum())) { 50 | response.setMessage(WMessage.MSG_WAREHOUSE_EXISTS); 51 | }else { 52 | Integer num=warehouseService.insertWarehouse(warehouse); 53 | if(num>0) { 54 | response.setMessage(WMessage.MSG_SUCCESS); 55 | }else { 56 | response.setMessage(WMessage.MSG_FAIL); 57 | } 58 | } 59 | 60 | Log log=logService.createLog((String)session.getAttribute("username"), 61 | WMessage.MSG_OPREATION_ADD, 62 | "用户: "+session.getAttribute("username") 63 | +" 等级: "+session.getAttribute("level") 64 | +" 于 "+TimeUtil.getNowerTime() 65 | +" 添加仓库信息: " 66 | +" 仓库编号: "+warehouse.getNum() 67 | +" 仓库名: "+warehouse.getName() 68 | +" 负责人: "+warehouse.getResponser() 69 | +" 负责人电话: "+warehouse.getResponserPhone() 70 | +" 合同签订日期: "+warehouse.getContractDate() 71 | +" 所属公司: "+warehouse.getCompany() 72 | +" 备注: "+warehouse.getRemark() 73 | +" 结果: "+ response.getMessage()); 74 | logService.insertLog(log); 75 | 76 | return response; 77 | } 78 | 79 | @RequestMapping(value = "/manageWarehouse", method = RequestMethod.GET) 80 | public String manageWarehouse(HttpSession session,Model model) throws Exception { 81 | 82 | if(session.getAttribute("username")==null) { 83 | return "error"; 84 | } 85 | 86 | List warehouselist=warehouseService.selectAllWarehouse(); 87 | model.addAttribute("warehouselist",warehouselist); 88 | return "manageWarehouse"; 89 | } 90 | 91 | @ResponseBody 92 | @RequestMapping(value = "/updateWarehouse", method = RequestMethod.POST) 93 | public WResponse updateWarehouse(Warehouse warehouse,HttpSession session) throws Exception { 94 | 95 | WResponse response=new WResponse(); 96 | warehouse.setOperator((String)session.getAttribute("username")); 97 | 98 | Integer num=warehouseService.updateWarehouse(warehouse); 99 | if(num>0) { 100 | response.setMessage(WMessage.MSG_SUCCESS); 101 | }else { 102 | response.setMessage(WMessage.MSG_FAIL); 103 | } 104 | 105 | Log log=logService.createLog((String)session.getAttribute("username"), 106 | WMessage.MSG_OPREATION_UPDATE, 107 | "用户: "+session.getAttribute("username") 108 | +" 等级: "+session.getAttribute("level") 109 | +" 于 "+TimeUtil.getNowerTime() 110 | +" 更新仓库信息为: " 111 | +" 仓库编号: "+warehouse.getNum() 112 | +" 仓库名: "+warehouse.getName() 113 | +" 负责人: "+warehouse.getResponser() 114 | +" 负责人电话: "+warehouse.getResponserPhone() 115 | +" 所属公司: "+warehouse.getCompany() 116 | +" 备注: "+warehouse.getRemark() 117 | +" 结果: "+ response.getMessage()); 118 | logService.insertLog(log); 119 | 120 | return response; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addSupplier.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 58 |
59 | 60 | 111 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addWarehouse.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 60 |
61 | 62 | 117 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/manageSupplier.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

仓库员工管理

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 |
供应商编号供应商名称对接人对接人联系方式负责人负责人联系方式操作人操作时间备注操作
${supplier.num }${supplier.name }${supplier.receiver }${supplier.receiverPhone }${supplier.responser }${supplier.responserPhone }${supplier.operator }${supplier.remark } 34 | 35 |
39 |
40 | 41 | 120 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/SupplierController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import com.warehouse.bean.Log; 16 | import com.warehouse.bean.Supplier; 17 | import com.warehouse.common.WMessage; 18 | import com.warehouse.common.WResponse; 19 | import com.warehouse.service.LogService; 20 | import com.warehouse.service.SupplierService; 21 | import com.warehouse.utils.TimeUtil; 22 | 23 | /** 24 | * 供应商信息管理controller 25 | * 2018.5.11 26 | */ 27 | @Controller 28 | @RequestMapping("/supplier") 29 | public class SupplierController { 30 | 31 | @Autowired 32 | private SupplierService supplierService; 33 | 34 | @Autowired 35 | private LogService logService; 36 | 37 | @ResponseBody 38 | @RequestMapping(value = "/addSupplier", method = RequestMethod.POST) 39 | public WResponse addSupplier(HttpSession session,Supplier supplier) throws Exception { 40 | WResponse response=new WResponse(); 41 | 42 | if(supplierService.checkSupplierExist(supplier.getNum())) { 43 | response.setMessage(WMessage.MSG_SUPPILER_EXISTS); 44 | }else { 45 | supplier.setOperator((String)session.getAttribute("username")); 46 | Integer num = supplierService.addSupplier(supplier); 47 | if(num>0) { 48 | response.setMessage(WMessage.MSG_SUCCESS); 49 | }else{ 50 | response.setMessage(WMessage.MSG_FAIL); 51 | } 52 | } 53 | Log log = logService.createLog((String)session.getAttribute("username"), 54 | WMessage.MSG_OPREATION_ADD, 55 | "用户: "+session.getAttribute("username") 56 | +" 等级: "+session.getAttribute("level") 57 | +" 于 "+TimeUtil.getNowerTime() 58 | +" 添加供应商: " 59 | +" 编号: "+supplier.getNum() 60 | +" 名称: "+supplier.getName() 61 | +" 对接人: "+supplier.getReceiver() 62 | +" 对接人联系方式: "+supplier.getReceiverPhone() 63 | +" 负责人: "+supplier.getResponser() 64 | +" 负责人联系方式: "+supplier.getResponserPhone() 65 | +" 备注: "+supplier.getRemark() 66 | +" 结果: "+ response.getMessage()); 67 | logService.insertLog(log); 68 | 69 | return response; 70 | } 71 | 72 | @RequestMapping(value = "/manageSupplier", method = RequestMethod.GET) 73 | public String manageSupplier(HttpSession session,Model model) throws Exception { 74 | if(session.getAttribute("username")==null) { 75 | return "error"; 76 | } 77 | List supplierlist = supplierService.getAllSupplier(); 78 | model.addAttribute("supplierlist", supplierlist); 79 | 80 | return "manageSupplier"; 81 | } 82 | 83 | @ResponseBody 84 | @RequestMapping(value = "/updateSupplier", method = RequestMethod.POST) 85 | public WResponse updateSupplier(HttpSession session,Supplier supplier) throws Exception{ 86 | WResponse response=new WResponse(); 87 | supplier.setOperator((String)session.getAttribute("username")); 88 | Integer num = supplierService.updateSupplier(supplier); 89 | if(num>0) { 90 | response.setMessage(WMessage.MSG_SUCCESS); 91 | }else{ 92 | response.setMessage(WMessage.MSG_FAIL); 93 | } 94 | 95 | Log log = logService.createLog((String)session.getAttribute("username"), 96 | WMessage.MSG_OPREATION_UPDATE, 97 | "用户: "+session.getAttribute("username") 98 | +" 等级: "+session.getAttribute("level") 99 | +" 于 "+TimeUtil.getNowerTime() 100 | +" 更新供应商为: " 101 | +" 编号: "+supplier.getNum() 102 | +" 名称: "+supplier.getName() 103 | +" 对接人: "+supplier.getReceiver() 104 | +" 对接人联系方式: "+supplier.getReceiverPhone() 105 | +" 负责人: "+supplier.getResponser() 106 | +" 负责人联系方式: "+supplier.getResponserPhone() 107 | +" 备注: "+supplier.getRemark() 108 | +" 结果: "+ response.getMessage()); 109 | logService.insertLog(log); 110 | 111 | return response; 112 | } 113 | 114 | @ResponseBody 115 | @RequestMapping(value = "/deleteSupplier", method = RequestMethod.POST) 116 | public WResponse deleteSupplier(@RequestParam("num") String suppliernum,HttpSession session) throws Exception { 117 | WResponse response=new WResponse(); 118 | Integer num = supplierService.deleteSupplierByNum(suppliernum); 119 | if(num>0) { 120 | response.setMessage(WMessage.MSG_SUCCESS); 121 | }else{ 122 | response.setMessage(WMessage.MSG_FAIL); 123 | } 124 | 125 | Log log = logService.createLog((String)session.getAttribute("username"), 126 | WMessage.MSG_OPREATION_DELETE, 127 | "用户: "+session.getAttribute("username") 128 | +" 等级: "+session.getAttribute("level") 129 | +" 于 "+TimeUtil.getNowerTime() 130 | +" 删除供应商: "+suppliernum 131 | +" 结果: "+ response.getMessage()); 132 | logService.insertLog(log); 133 | return response; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/configGoodsWarehouse.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 45 | 46 | 121 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletResponse; 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import com.warehouse.bean.Log; 16 | import com.warehouse.bean.Userinfo; 17 | import com.warehouse.common.WMessage; 18 | import com.warehouse.common.WResponse; 19 | import com.warehouse.service.LogService; 20 | import com.warehouse.service.UserManageService; 21 | import com.warehouse.utils.MD5; 22 | import com.warehouse.utils.TimeUtil; 23 | 24 | /** 25 | * 人员管理controller 26 | * 2018.5.2 27 | */ 28 | @Controller 29 | @RequestMapping("/person") 30 | public class UserController { 31 | 32 | @Autowired 33 | private UserManageService userManageService; 34 | 35 | @Autowired 36 | private LogService logService; 37 | 38 | @ResponseBody 39 | @RequestMapping(value = "/addPerson", method=RequestMethod.POST) 40 | public WResponse addPerson(Userinfo userinfo,HttpSession session) throws Exception { 41 | WResponse response=new WResponse(); 42 | 43 | if (userManageService.checkUserExists(userinfo.getUsername())) { 44 | response.setMessage(WMessage.MSG_USER_EXISTS); 45 | }else { 46 | Integer num=userManageService.addPerson(userinfo); 47 | if(num<1) { 48 | response.setMessage(WMessage.MSG_FAIL); 49 | }else{ 50 | response.setMessage(WMessage.MSG_SUCCESS); 51 | } 52 | } 53 | 54 | Log log=logService.createLog((String)session.getAttribute("username"), 55 | WMessage.MSG_OPREATION_ADD, 56 | "用户: "+session.getAttribute("username") 57 | +" 等级: "+session.getAttribute("level") 58 | +" 于 "+TimeUtil.getNowerTime() 59 | +" 添加用户: " 60 | +" 用户名: "+userinfo.getUsername() 61 | +" 等级: "+userinfo.getLevel() 62 | +" 备注: "+userinfo.getRemark() 63 | +" 结果: "+ response.getMessage()); 64 | logService.insertLog(log); 65 | 66 | return response; 67 | } 68 | 69 | @ResponseBody 70 | @RequestMapping(value = "/changePassword", method=RequestMethod.POST) 71 | public WResponse changePassword(Userinfo userinfo,HttpSession session) throws Exception { 72 | 73 | WResponse response=new WResponse(); 74 | userinfo.setUsername((String)session.getAttribute("username")); 75 | userinfo.setPassword(MD5.getMD5(userinfo.getPassword())); 76 | if (userManageService.checkPasswdIsSameByUsername(userinfo)) { 77 | response.setMessage(WMessage.MSG_SAME_PASSWD); 78 | }else { 79 | Integer num=userManageService.updatePassword(userinfo); 80 | 81 | if(num>=1) { 82 | response.setMessage(WMessage.MSG_SUCCESS); 83 | }else { 84 | response.setMessage(WMessage.MSG_FAIL); 85 | } 86 | } 87 | 88 | Log log=logService.createLog((String)session.getAttribute("username"), 89 | WMessage.MSG_OPREATION_UPDATE, 90 | "用户: "+session.getAttribute("username") 91 | +" 等级: "+session.getAttribute("level") 92 | +" 于 "+TimeUtil.getNowerTime() 93 | +" 更改 "+userinfo.getUsername()+" 的密码: " 94 | +" 结果: "+ response.getMessage()); 95 | logService.insertLog(log); 96 | 97 | return response; 98 | } 99 | 100 | @RequestMapping(value = "/managePerson", method = RequestMethod.GET) 101 | public String managePerson(HttpSession session,Model model) throws Exception { 102 | 103 | if(session.getAttribute("username")==null) { 104 | return "error"; 105 | } 106 | 107 | List userlist=userManageService.selectAllUser(); 108 | model.addAttribute("userlist",userlist); 109 | return "managePerson"; 110 | } 111 | 112 | @ResponseBody 113 | @RequestMapping(value = "/updateUserinfo", method = RequestMethod.POST) 114 | public WResponse updateUserinfo(Userinfo userinfo,HttpSession session) throws Exception { 115 | WResponse response=new WResponse(); 116 | if (userManageService.checkPasswdIsSameByUsername(userinfo)) { 117 | response.setMessage(WMessage.MSG_SAME_PASSWD); 118 | }else { 119 | Integer num=userManageService.updateUserinfo(userinfo); 120 | if(num>0) { 121 | response.setMessage(WMessage.MSG_SUCCESS); 122 | }else { 123 | response.setMessage(WMessage.MSG_FAIL); 124 | } 125 | } 126 | 127 | Log log=logService.createLog((String)session.getAttribute("username"), 128 | WMessage.MSG_OPREATION_UPDATE, 129 | "用户: "+session.getAttribute("username") 130 | +" 等级: "+session.getAttribute("level") 131 | +" 于 "+TimeUtil.getNowerTime() 132 | +" 更新用户信息为: " 133 | +" 用户名: "+userinfo.getUsername() 134 | +" 等级: "+userinfo.getLevel() 135 | +" 备注: "+userinfo.getRemark() 136 | +" 结果: "+ response.getMessage()); 137 | logService.insertLog(log); 138 | 139 | return response; 140 | } 141 | 142 | @ResponseBody 143 | @RequestMapping(value = "/deletePerson", method = RequestMethod.POST) 144 | public WResponse deletePerson(String username,HttpSession session) throws Exception { 145 | WResponse response=new WResponse(); 146 | Integer num=userManageService.deletePersonByUsername(username); 147 | if(num>0) { 148 | response.setMessage(WMessage.MSG_SUCCESS); 149 | }else { 150 | response.setMessage(WMessage.MSG_FAIL); 151 | } 152 | 153 | Log log=logService.createLog((String)session.getAttribute("username"), 154 | WMessage.MSG_OPREATION_DELETE, 155 | "用户: "+session.getAttribute("username") 156 | +" 等级: "+session.getAttribute("level") 157 | +" 于 "+TimeUtil.getNowerTime() 158 | +" 删除用户: "+username 159 | +" 结果: "+ response.getMessage()); 160 | logService.insertLog(log); 161 | 162 | return response; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/managePerson.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="com.warehouse.bean.Userinfo"%> 3 | <%@ page pageEncoding="utf-8"%> 4 | <%@ page language="java" isELIgnored="false"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

仓库员工管理

17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 |
用 户 名权 限密 码备 注创 建 时 间修 改 时 间操 作
${user.username } 26 | 27 | 28 | 管理员 29 | 普通用户 30 | 31 | 32 | ${user.remark } 38 | 39 |
43 |
44 | 45 | 149 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/css/bootstrap-select.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap-select v1.12.4 (http://silviomoreto.github.io/bootstrap-select) 3 | * 4 | * Copyright 2013-2017 bootstrap-select 5 | * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) 6 | */select.bs-select-hidden,select.selectpicker{display:none!important}.bootstrap-select{width:220px\9}.bootstrap-select>.dropdown-toggle{width:100%;padding-right:25px;z-index:1}.bootstrap-select>.dropdown-toggle.bs-placeholder,.bootstrap-select>.dropdown-toggle.bs-placeholder:active,.bootstrap-select>.dropdown-toggle.bs-placeholder:focus,.bootstrap-select>.dropdown-toggle.bs-placeholder:hover{color:#999}.bootstrap-select>select{position:absolute!important;bottom:0;left:50%;display:block!important;width:.5px!important;height:100%!important;padding:0!important;opacity:0!important;border:none}.bootstrap-select>select.mobile-device{top:0;left:0;display:block!important;width:100%!important;z-index:2}.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child)>.btn{border-radius:0}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-group-lg .bootstrap-select.btn-group.form-control .dropdown-toggle,.form-group-sm .bootstrap-select.btn-group.form-control .dropdown-toggle{height:100%;font-size:inherit;line-height:inherit;border-radius:inherit}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.bootstrap-select.btn-group.disabled,.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group.disabled:focus,.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group.bs-container{position:absolute;height:0!important;padding:0!important}.bootstrap-select.btn-group.bs-container .dropdown-menu{z-index:1060}.bootstrap-select.btn-group .dropdown-toggle .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li.active small{color:#fff}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option{position:static}.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none} -------------------------------------------------------------------------------- /warehouse-bean/src/main/java/com/warehouse/bean/Log.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Log { 6 | /** 7 | * 8 | * This field was generated by MyBatis Generator. 9 | * This field corresponds to the database column log.id 10 | * 11 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 12 | */ 13 | private Long id; 14 | 15 | /** 16 | * 17 | * This field was generated by MyBatis Generator. 18 | * This field corresponds to the database column log.operator_name 19 | * 20 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 21 | */ 22 | private String operatorName; 23 | 24 | /** 25 | * 26 | * This field was generated by MyBatis Generator. 27 | * This field corresponds to the database column log.operator_num 28 | * 29 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 30 | */ 31 | private String operatorNum; 32 | 33 | /** 34 | * 35 | * This field was generated by MyBatis Generator. 36 | * This field corresponds to the database column log.opreator_time 37 | * 38 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 39 | */ 40 | private Date opreatorTime; 41 | 42 | /** 43 | * 44 | * This field was generated by MyBatis Generator. 45 | * This field corresponds to the database column log.operation_type 46 | * 47 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 48 | */ 49 | private String operationType; 50 | 51 | /** 52 | * 53 | * This field was generated by MyBatis Generator. 54 | * This field corresponds to the database column log.operation_detail 55 | * 56 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 57 | */ 58 | private String operationDetail; 59 | 60 | /** 61 | * This method was generated by MyBatis Generator. 62 | * This method returns the value of the database column log.id 63 | * 64 | * @return the value of log.id 65 | * 66 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 67 | */ 68 | public Long getId() { 69 | return id; 70 | } 71 | 72 | /** 73 | * This method was generated by MyBatis Generator. 74 | * This method sets the value of the database column log.id 75 | * 76 | * @param id the value for log.id 77 | * 78 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 79 | */ 80 | public void setId(Long id) { 81 | this.id = id; 82 | } 83 | 84 | /** 85 | * This method was generated by MyBatis Generator. 86 | * This method returns the value of the database column log.operator_name 87 | * 88 | * @return the value of log.operator_name 89 | * 90 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 91 | */ 92 | public String getOperatorName() { 93 | return operatorName; 94 | } 95 | 96 | /** 97 | * This method was generated by MyBatis Generator. 98 | * This method sets the value of the database column log.operator_name 99 | * 100 | * @param operatorName the value for log.operator_name 101 | * 102 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 103 | */ 104 | public void setOperatorName(String operatorName) { 105 | this.operatorName = operatorName == null ? null : operatorName.trim(); 106 | } 107 | 108 | /** 109 | * This method was generated by MyBatis Generator. 110 | * This method returns the value of the database column log.operator_num 111 | * 112 | * @return the value of log.operator_num 113 | * 114 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 115 | */ 116 | public String getOperatorNum() { 117 | return operatorNum; 118 | } 119 | 120 | /** 121 | * This method was generated by MyBatis Generator. 122 | * This method sets the value of the database column log.operator_num 123 | * 124 | * @param operatorNum the value for log.operator_num 125 | * 126 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 127 | */ 128 | public void setOperatorNum(String operatorNum) { 129 | this.operatorNum = operatorNum == null ? null : operatorNum.trim(); 130 | } 131 | 132 | /** 133 | * This method was generated by MyBatis Generator. 134 | * This method returns the value of the database column log.opreator_time 135 | * 136 | * @return the value of log.opreator_time 137 | * 138 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 139 | */ 140 | public Date getOpreatorTime() { 141 | return opreatorTime; 142 | } 143 | 144 | /** 145 | * This method was generated by MyBatis Generator. 146 | * This method sets the value of the database column log.opreator_time 147 | * 148 | * @param opreatorTime the value for log.opreator_time 149 | * 150 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 151 | */ 152 | public void setOpreatorTime(Date opreatorTime) { 153 | this.opreatorTime = opreatorTime; 154 | } 155 | 156 | /** 157 | * This method was generated by MyBatis Generator. 158 | * This method returns the value of the database column log.operation_type 159 | * 160 | * @return the value of log.operation_type 161 | * 162 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 163 | */ 164 | public String getOperationType() { 165 | return operationType; 166 | } 167 | 168 | /** 169 | * This method was generated by MyBatis Generator. 170 | * This method sets the value of the database column log.operation_type 171 | * 172 | * @param operationType the value for log.operation_type 173 | * 174 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 175 | */ 176 | public void setOperationType(String operationType) { 177 | this.operationType = operationType == null ? null : operationType.trim(); 178 | } 179 | 180 | /** 181 | * This method was generated by MyBatis Generator. 182 | * This method returns the value of the database column log.operation_detail 183 | * 184 | * @return the value of log.operation_detail 185 | * 186 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 187 | */ 188 | public String getOperationDetail() { 189 | return operationDetail; 190 | } 191 | 192 | /** 193 | * This method was generated by MyBatis Generator. 194 | * This method sets the value of the database column log.operation_detail 195 | * 196 | * @param operationDetail the value for log.operation_detail 197 | * 198 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 199 | */ 200 | public void setOperationDetail(String operationDetail) { 201 | this.operationDetail = operationDetail == null ? null : operationDetail.trim(); 202 | } 203 | } -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addGoodsOutWarehouse.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 57 | 58 | 159 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/addGoodsIntoWarehouse.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | <%@ page language="java" import="com.warehouse.utils.*" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 57 | 58 | 159 | -------------------------------------------------------------------------------- /warehouse-web/src/main/webapp/WEB-INF/jsp/applicationPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ page pageEncoding="utf-8"%> 2 | 3 | 4 | 5 | 后台管理页面 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 20 | <% 21 | String username=(String)session.getAttribute("username"); 22 | Integer level=(Integer)session.getAttribute("level"); 23 | %> 24 |
25 |
26 |
27 | 114 |
115 |
116 |
117 |
118 |
119 |
120 | <% 121 | String words="尊敬的"; 122 | if(level==1){ 123 | words+="超级管理员"; 124 | } else if(level==2){ 125 | words+="管理员"; 126 | } else if(level==3){ 127 | words+="用户"; 128 | } 129 | words=words+username+",欢迎使用本系统!"; 130 | %> 131 |

<%=words %>

132 |
133 |
134 | 135 |
136 |
137 |
138 | 139 | -------------------------------------------------------------------------------- /warehouse-web/src/main/java/com/warehouse/controller/ManageController.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.controller; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import com.warehouse.bean.Goods; 18 | import com.warehouse.bean.Log; 19 | import com.warehouse.bean.WarehouseGoods; 20 | import com.warehouse.common.WMessage; 21 | import com.warehouse.common.WResponse; 22 | import com.warehouse.service.LogService; 23 | import com.warehouse.service.ManageService; 24 | import com.warehouse.utils.TimeUtil; 25 | 26 | /** 27 | * 仓库管理controller 28 | * 2018.5.13 29 | */ 30 | @Controller 31 | @RequestMapping("/manage") 32 | public class ManageController { 33 | 34 | @Autowired 35 | private ManageService manageService; 36 | 37 | @Autowired 38 | private LogService logService; 39 | 40 | @ResponseBody 41 | @RequestMapping(value = "/selectGoodsAndWarehouse", method = RequestMethod.GET) 42 | public WResponse selectGoodsAndWarehouse() { 43 | WResponse response=new WResponse(); 44 | Map map=manageService.selectGoodsAndWarehouse(); 45 | 46 | if (map==null || map.isEmpty()) { 47 | response.setMessage(WMessage.MSG_FAIL); 48 | }else { 49 | response.setMessage(WMessage.MSG_SUCCESS); 50 | } 51 | 52 | response.setObject(map); 53 | return response; 54 | } 55 | 56 | @ResponseBody 57 | @RequestMapping(value = "/addConfig", method = RequestMethod.POST) 58 | public WResponse addConfig(WarehouseGoods config,HttpSession session) throws Exception { 59 | WResponse response=new WResponse(); 60 | String operation=""; 61 | Integer num=0; 62 | if(manageService.checkRecordExist(config)) { 63 | operation=WMessage.MSG_OPREATION_UPDATE_CONFIG; 64 | num=manageService.updateRecord(config); 65 | }else { 66 | operation=WMessage.MSG_OPREATION_ADD_CONFIG; 67 | num=manageService.insertRecord(config); 68 | } 69 | 70 | if(num>0) { 71 | response.setMessage(WMessage.MSG_SUCCESS); 72 | }else { 73 | response.setMessage(WMessage.MSG_FAIL); 74 | } 75 | 76 | Log log = logService.createLog((String)session.getAttribute("username"), 77 | operation, 78 | "用户: "+session.getAttribute("username") 79 | +" 等级: "+session.getAttribute("level") 80 | +" 于 "+TimeUtil.getNowerTime() 81 | +" 配置物资仓库: " 82 | +" 仓库编号: "+config.getWarehouseNum() 83 | +" 仓库名: "+config.getWarehouseName() 84 | +" 物资编号: "+config.getGoodsNum() 85 | +" 物资名: "+config.getGoodsName() 86 | +" 最低库存: "+config.getBottommost() 87 | +" 最高库存: "+config.getTopmost() 88 | +" 结果: "+ response.getMessage()); 89 | logService.insertLog(log); 90 | return response; 91 | } 92 | 93 | @ResponseBody 94 | @RequestMapping(value = "/addRecord", method = RequestMethod.POST) 95 | public WResponse addRecord(WarehouseGoods record,HttpSession session,@RequestParam("operation") String operationTpye) throws Exception { 96 | WResponse response=new WResponse(); 97 | String operation=""; 98 | Integer num=0; 99 | if(!manageService.checkRecordExist(record)) { 100 | operation=WMessage.MSG_OPREATION_ADD_GOODS; 101 | num=manageService.insertRecord(record); 102 | }else { 103 | if(operationTpye.equals("add")) { 104 | operation=WMessage.MSG_OPREATION_ADD_GOODS; 105 | }else if(operationTpye.equals("remove")) { 106 | operation=WMessage.MSG_OPREATION_OUT_GOODS; 107 | } 108 | num=manageService.updateRecord(record); 109 | } 110 | if(num>0) { 111 | response.setMessage(WMessage.MSG_SUCCESS); 112 | }else { 113 | response.setMessage(WMessage.MSG_FAIL); 114 | } 115 | 116 | Log log = logService.createLog((String)session.getAttribute("username"), 117 | operation, 118 | "用户: "+session.getAttribute("username") 119 | +" 等级: "+session.getAttribute("level") 120 | +" 于 "+TimeUtil.getNowerTime() 121 | +" 操作物资: " 122 | +" 仓库编号: "+record.getWarehouseNum() 123 | +" 仓库名: "+record.getWarehouseName() 124 | +" 物资编号: "+record.getGoodsNum() 125 | +" 物资名: "+record.getGoodsName() 126 | +" 库存数量: "+record.getContainNumber() 127 | +" 结果: "+ response.getMessage()); 128 | log.setOperatorNum(record.getContainNumber().toString()); 129 | logService.insertLog(log); 130 | 131 | return response; 132 | } 133 | 134 | @ResponseBody 135 | @RequestMapping(value = "/getWarehouseGoodsNumInfo", method = RequestMethod.GET) 136 | public WResponse getWarehouseGoodsNumInfo(String goodsNum,String warehouseNum) throws Exception { 137 | WResponse response=new WResponse(); 138 | List list=manageService.getWarehouseGoodsNumInfo(goodsNum, warehouseNum); 139 | if(list.size()==0) { 140 | response.setMessage(WMessage.MSG_FAIL); 141 | }else { 142 | response.setMessage(WMessage.MSG_SUCCESS); 143 | response.setObject(list.get(0)); 144 | } 145 | 146 | return response; 147 | } 148 | 149 | @RequestMapping(value = "/goodsSelect", method = RequestMethod.GET) 150 | public String goodsSelect(HttpSession session,Model model) throws Exception { 151 | if (session.getAttribute("username")==null) { 152 | return "error"; 153 | } 154 | List goodslist=manageService.selectGoodsByType(null, null); 155 | model.addAttribute("goodslist", goodslist); 156 | return "goodsSelect"; 157 | } 158 | 159 | @ResponseBody 160 | @RequestMapping(value = "/selectGoodsByType", method = RequestMethod.GET) 161 | public WResponse selectGoodsByType(String words,String type) throws Exception { 162 | WResponse response=new WResponse(); 163 | List goodslist=null; 164 | if(words==null) { 165 | goodslist=manageService.selectGoodsByType(null, null); 166 | }else { 167 | goodslist=manageService.selectGoodsByType(words, type); 168 | } 169 | if(goodslist==null || goodslist.size()==0) { 170 | response.setMessage(WMessage.MSG_FAIL); 171 | }else if(goodslist!=null && goodslist.size()>0) { 172 | response.setMessage(WMessage.MSG_SUCCESS); 173 | response.setObject(goodslist); 174 | } 175 | return response; 176 | } 177 | 178 | @RequestMapping(value = "/selectAllWarehouseGoods", method = RequestMethod.GET) 179 | public String selectAllWarehouseGoods(HttpSession session,Model model) throws Exception { 180 | if (session.getAttribute("username")==null) { 181 | return "error"; 182 | } 183 | 184 | List warehousegoodslist=manageService.selectAllWarehouseGoods(); 185 | model.addAttribute("warehousegoodslist", warehousegoodslist); 186 | return "goodsAnalyse"; 187 | } 188 | 189 | @RequestMapping(value = "/containWarning", method = RequestMethod.GET) 190 | public String containWarning(HttpSession session,Model model) throws Exception { 191 | if (session.getAttribute("username")==null) { 192 | return "error"; 193 | } 194 | 195 | List warehousegoodslist=manageService.selectAllWarehouseGoods(); 196 | model.addAttribute("warehousegoodslist", warehousegoodslist); 197 | return "containWarning"; 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /warehouse-bean/src/main/java/com/warehouse/bean/Userinfo.java: -------------------------------------------------------------------------------- 1 | package com.warehouse.bean; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | 6 | public class Userinfo { 7 | /** 8 | * 9 | * This field was generated by MyBatis Generator. 10 | * This field corresponds to the database column userinfo.id 11 | * 12 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 13 | */ 14 | private Long id; 15 | 16 | /** 17 | * 18 | * This field was generated by MyBatis Generator. 19 | * This field corresponds to the database column userinfo.username 20 | * 21 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 27 | * This field was generated by MyBatis Generator. 28 | * This field corresponds to the database column userinfo.level 29 | * 30 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 31 | */ 32 | private Integer level; 33 | 34 | /** 35 | * 36 | * This field was generated by MyBatis Generator. 37 | * This field corresponds to the database column userinfo.password 38 | * 39 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 40 | */ 41 | private String password; 42 | 43 | /** 44 | * 45 | * This field was generated by MyBatis Generator. 46 | * This field corresponds to the database column userinfo.remark 47 | * 48 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 49 | */ 50 | private String remark; 51 | 52 | /** 53 | * 54 | * This field was generated by MyBatis Generator. 55 | * This field corresponds to the database column userinfo.created_at 56 | * 57 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 58 | */ 59 | private Date createdAt; 60 | 61 | /** 62 | * 63 | * This field was generated by MyBatis Generator. 64 | * This field corresponds to the database column userinfo.updated_at 65 | * 66 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 67 | */ 68 | private Date updatedAt; 69 | 70 | /** 71 | * This method was generated by MyBatis Generator. 72 | * This method returns the value of the database column userinfo.id 73 | * 74 | * @return the value of userinfo.id 75 | * 76 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 77 | */ 78 | public Long getId() { 79 | return id; 80 | } 81 | 82 | /** 83 | * This method was generated by MyBatis Generator. 84 | * This method sets the value of the database column userinfo.id 85 | * 86 | * @param id the value for userinfo.id 87 | * 88 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 89 | */ 90 | public void setId(Long id) { 91 | this.id = id; 92 | } 93 | 94 | /** 95 | * This method was generated by MyBatis Generator. 96 | * This method returns the value of the database column userinfo.username 97 | * 98 | * @return the value of userinfo.username 99 | * 100 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 101 | */ 102 | public String getUsername() { 103 | return username; 104 | } 105 | 106 | /** 107 | * This method was generated by MyBatis Generator. 108 | * This method sets the value of the database column userinfo.username 109 | * 110 | * @param username the value for userinfo.username 111 | * 112 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 113 | */ 114 | public void setUsername(String username) { 115 | this.username = username == null ? null : username.trim(); 116 | } 117 | 118 | /** 119 | * This method was generated by MyBatis Generator. 120 | * This method returns the value of the database column userinfo.level 121 | * 122 | * @return the value of userinfo.level 123 | * 124 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 125 | */ 126 | public Integer getLevel() { 127 | return level; 128 | } 129 | 130 | /** 131 | * This method was generated by MyBatis Generator. 132 | * This method sets the value of the database column userinfo.level 133 | * 134 | * @param level the value for userinfo.level 135 | * 136 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 137 | */ 138 | public void setLevel(Integer level) { 139 | this.level = level; 140 | } 141 | 142 | /** 143 | * This method was generated by MyBatis Generator. 144 | * This method returns the value of the database column userinfo.password 145 | * 146 | * @return the value of userinfo.password 147 | * 148 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 149 | */ 150 | public String getPassword() { 151 | return password; 152 | } 153 | 154 | /** 155 | * This method was generated by MyBatis Generator. 156 | * This method sets the value of the database column userinfo.password 157 | * 158 | * @param password the value for userinfo.password 159 | * 160 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 161 | */ 162 | public void setPassword(String password) { 163 | this.password = password == null ? null : password.trim(); 164 | } 165 | 166 | /** 167 | * This method was generated by MyBatis Generator. 168 | * This method returns the value of the database column userinfo.remark 169 | * 170 | * @return the value of userinfo.remark 171 | * 172 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 173 | */ 174 | public String getRemark() { 175 | return remark; 176 | } 177 | 178 | /** 179 | * This method was generated by MyBatis Generator. 180 | * This method sets the value of the database column userinfo.remark 181 | * 182 | * @param remark the value for userinfo.remark 183 | * 184 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 185 | */ 186 | public void setRemark(String remark) { 187 | this.remark = remark == null ? null : remark.trim(); 188 | } 189 | 190 | /** 191 | * This method was generated by MyBatis Generator. 192 | * This method returns the value of the database column userinfo.created_at 193 | * 194 | * @return the value of userinfo.created_at 195 | * 196 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 197 | */ 198 | public Date getCreatedAt() { 199 | return createdAt; 200 | } 201 | 202 | /** 203 | * This method was generated by MyBatis Generator. 204 | * This method sets the value of the database column userinfo.created_at 205 | * 206 | * @param createdAt the value for userinfo.created_at 207 | * 208 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 209 | */ 210 | public void setCreatedAt(Date createdAt) { 211 | this.createdAt = createdAt; 212 | } 213 | 214 | /** 215 | * This method was generated by MyBatis Generator. 216 | * This method returns the value of the database column userinfo.updated_at 217 | * 218 | * @return the value of userinfo.updated_at 219 | * 220 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 221 | */ 222 | public Date getUpdatedAt() { 223 | return updatedAt; 224 | } 225 | 226 | /** 227 | * This method was generated by MyBatis Generator. 228 | * This method sets the value of the database column userinfo.updated_at 229 | * 230 | * @param updatedAt the value for userinfo.updated_at 231 | * 232 | * @mbg.generated Wed Apr 25 17:07:20 CST 2018 233 | */ 234 | public void setUpdatedAt(Date updatedAt) { 235 | this.updatedAt = updatedAt; 236 | } 237 | 238 | @Override 239 | public String toString() { 240 | return "Userinfo [username=" + username + ", level=" + level + ", remark=" + remark + "]"; 241 | } 242 | } --------------------------------------------------------------------------------