├── screenshot
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
└── 8.png
├── src
├── main
│ ├── webapp
│ │ ├── media
│ │ │ ├── images
│ │ │ │ ├── 404.jpg
│ │ │ │ ├── 500.jpg
│ │ │ │ └── backgroundPic.png
│ │ │ └── icons
│ │ │ │ ├── error-icon.png
│ │ │ │ ├── stock_in-512.png
│ │ │ │ ├── stock_out-512.png
│ │ │ │ ├── success-icon.png
│ │ │ │ ├── warning-icon.png
│ │ │ │ └── stock_search-512.png
│ │ ├── WEB-INF
│ │ │ ├── download
│ │ │ │ ├── goodsInfo.xlsx
│ │ │ │ ├── customerInfo.xlsx
│ │ │ │ ├── supplierInfo.xlsx
│ │ │ │ ├── repositoryInfo.xlsx
│ │ │ │ ├── storageRecord.xlsx
│ │ │ │ └── repositoryAdminInfo.xlsx
│ │ │ └── web.xml
│ │ ├── fonts
│ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ └── glyphicons-halflings-regular.woff2
│ │ ├── css
│ │ │ ├── model
│ │ │ │ └── login
│ │ │ │ │ └── login.css
│ │ │ ├── bootstrapValidator.min.css
│ │ │ └── mainPage.css
│ │ ├── errorPage
│ │ │ ├── 404Error.html
│ │ │ └── 500Error.html
│ │ ├── js
│ │ │ ├── npm.js
│ │ │ ├── bootstrap-datetimepicker.zh-CN.js
│ │ │ ├── bootstrap-table-zh-CN.min.js
│ │ │ └── mainPage.js
│ │ └── pagecomponent
│ │ │ ├── welcomePage.jsp
│ │ │ ├── userOperationRecorderManagement.html
│ │ │ └── accessRecordManagement.html
│ ├── resources
│ │ └── config
│ │ │ ├── log4j.properties
│ │ │ ├── DBConfig.properties
│ │ │ ├── MyBatisConfiguration.xml
│ │ │ ├── SpringMVCConfiguration.xml
│ │ │ ├── ExcelUtilConfig.xml
│ │ │ └── ehcache.xml
│ └── java
│ │ └── com
│ │ └── ken
│ │ └── wms
│ │ ├── util
│ │ ├── aop
│ │ │ ├── UserOperation.java
│ │ │ ├── ServiceLogging.java
│ │ │ └── UserOperationLogging.java
│ │ └── GlobalExceptionHandler.java
│ │ ├── dao
│ │ ├── RolesMapper.java
│ │ ├── RolePermissionMapper.java
│ │ ├── RolesMapper.xml
│ │ ├── UserPermissionMapper.java
│ │ ├── RolePermissionMapper.xml
│ │ ├── UserPermissionMapper.xml
│ │ ├── UserOperationRecordMapper.java
│ │ ├── AccessRecordMapper.java
│ │ ├── UserInfoMapper.java
│ │ ├── RepositoryMapper.java
│ │ ├── GoodsMapper.java
│ │ ├── RepositoryAdminMapper.java
│ │ ├── SupplierMapper.java
│ │ ├── CustomerMapper.java
│ │ ├── UserOperationRecordMapper.xml
│ │ ├── AccessRecordMapper.xml
│ │ ├── UserInfoMapper.xml
│ │ ├── StockInMapper.java
│ │ ├── StorageMapper.java
│ │ ├── StockOutMapper.java
│ │ ├── GoodsMapper.xml
│ │ ├── RepositoryMapper.xml
│ │ ├── CustomerMapper.xml
│ │ ├── SupplierMapper.xml
│ │ ├── RepositoryAdminMapper.xml
│ │ ├── StorageMapper.xml
│ │ ├── StockInMapper.xml
│ │ └── StockOutMapper.xml
│ │ ├── common
│ │ ├── util
│ │ │ ├── ResponseUtil.java
│ │ │ └── Response.java
│ │ ├── controller
│ │ │ └── FileSourceHandler.java
│ │ └── service
│ │ │ └── Interface
│ │ │ ├── StockRecordManageService.java
│ │ │ ├── SystemLogService.java
│ │ │ ├── GoodsManageService.java
│ │ │ ├── SupplierManageService.java
│ │ │ ├── CustomerManageService.java
│ │ │ ├── RepositoryService.java
│ │ │ ├── RepositoryAdminManageService.java
│ │ │ └── StorageManageService.java
│ │ ├── security
│ │ ├── service
│ │ │ ├── Interface
│ │ │ │ ├── AccountService.java
│ │ │ │ └── UserInfoService.java
│ │ │ ├── Impl
│ │ │ │ └── AccountServiceImpl.java
│ │ │ └── FilterChainDefinitionMapBuilder.java
│ │ ├── util
│ │ │ ├── EncryptingModel.java
│ │ │ └── CheckCodeGenerator.java
│ │ ├── controller
│ │ │ └── PageForwardHandler.java
│ │ ├── filter
│ │ │ ├── AnyOfRolesAuthorizationFilter.java
│ │ │ └── ExtendFormAuthenticationFilter.java
│ │ ├── listener
│ │ │ └── AccountSessionListener.java
│ │ └── realms
│ │ │ └── UserAuthorizingRealm.java
│ │ ├── exception
│ │ ├── GoodsManageServiceException.java
│ │ ├── CustomerManageServiceException.java
│ │ ├── SupplierManageServiceException.java
│ │ ├── StorageManageServiceException.java
│ │ ├── RepositoryManageServiceException.java
│ │ ├── SystemLogServiceException.java
│ │ ├── UserInfoServiceException.java
│ │ ├── StockRecordManageServiceException.java
│ │ ├── RepositoryAdminManageServiceException.java
│ │ ├── UserAccountServiceException.java
│ │ └── BusinessException.java
│ │ └── domain
│ │ ├── User.java
│ │ ├── RoleDO.java
│ │ ├── Goods.java
│ │ ├── RolePermissionDO.java
│ │ ├── UserInfoDO.java
│ │ ├── Customer.java
│ │ ├── Supplier.java
│ │ ├── UserInfoDTO.java
│ │ ├── Repository.java
│ │ ├── RepositoryAdmin.java
│ │ ├── Storage.java
│ │ ├── AccessRecordDTO.java
│ │ ├── AccessRecordDO.java
│ │ ├── UserOperationRecordDTO.java
│ │ ├── UserOperationRecordDO.java
│ │ ├── StockInDO.java
│ │ ├── StockOutDO.java
│ │ └── StockRecordDTO.java
└── test
│ └── java
│ └── com
│ └── ken
│ └── wms
│ └── MapperTest.java
├── .gitignore
└── README.md
/screenshot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/1.png
--------------------------------------------------------------------------------
/screenshot/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/2.png
--------------------------------------------------------------------------------
/screenshot/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/3.png
--------------------------------------------------------------------------------
/screenshot/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/4.png
--------------------------------------------------------------------------------
/screenshot/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/5.png
--------------------------------------------------------------------------------
/screenshot/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/6.png
--------------------------------------------------------------------------------
/screenshot/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/7.png
--------------------------------------------------------------------------------
/screenshot/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/screenshot/8.png
--------------------------------------------------------------------------------
/src/main/webapp/media/images/404.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/images/404.jpg
--------------------------------------------------------------------------------
/src/main/webapp/media/images/500.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/images/500.jpg
--------------------------------------------------------------------------------
/src/main/resources/config/log4j.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/resources/config/log4j.properties
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/error-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/error-icon.png
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/stock_in-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/stock_in-512.png
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/stock_out-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/stock_out-512.png
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/success-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/success-icon.png
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/warning-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/warning-icon.png
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/goodsInfo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/goodsInfo.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/media/icons/stock_search-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/icons/stock_search-512.png
--------------------------------------------------------------------------------
/src/main/webapp/media/images/backgroundPic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/media/images/backgroundPic.png
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/customerInfo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/customerInfo.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/supplierInfo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/supplierInfo.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/repositoryInfo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/repositoryInfo.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/storageRecord.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/storageRecord.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/src/main/webapp/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/src/main/webapp/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/download/repositoryAdminInfo.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/WEB-INF/download/repositoryAdminInfo.xlsx
--------------------------------------------------------------------------------
/src/main/webapp/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No77WarehouseManagementSystem/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/src/main/resources/config/DBConfig.properties:
--------------------------------------------------------------------------------
1 | jdbc.user=root
2 | jdbc.password=123456
3 | jdbc.driverClass=com.mysql.jdbc.Driver
4 | jdbc.jdbcUrl=jdbc:mysql://localhost:3306/no77_wms_db
5 | jdbc.testConnectionOnCheckout=true
--------------------------------------------------------------------------------
/src/main/webapp/css/model/login/login.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: url(../../../media/images/backgroundPic.png);
3 | background-size: 100%;
4 | background-position: center;
5 |
6 | margin-top:150px;
7 | }
8 |
9 | #checkCodeImg:hover{
10 | cursor: pointer;
11 | }
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/util/aop/UserOperation.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.util.aop;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * 用户操作注解
7 | * 用于标注用户操作的方法名称
8 | *
9 | * @author Ken
10 | * @since 2017/4/8.
11 | */
12 | @Inherited
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.METHOD)
15 | public @interface UserOperation {
16 | String value();
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RolesMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import org.springframework.stereotype.Repository;
4 |
5 | /**
6 | *
7 | * @author Ken
8 | * @since 2017/3/1.
9 | */
10 | @Repository
11 | public interface RolesMapper {
12 |
13 | /**
14 | * 获取角色对应的ID
15 | * @param roleName 角色名
16 | * @return 返回角色的ID
17 | */
18 | Integer getRoleID(String roleName);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RolePermissionMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.RolePermissionDO;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 角色权限信息 Mapper
10 | *
11 | * @author ken
12 | * @since 2017/2/26.
13 | */
14 | @Repository
15 | public interface RolePermissionMapper {
16 |
17 | List selectAll();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/webapp/errorPage/404Error.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 404
6 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/main/webapp/errorPage/500Error.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 500
6 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/util/ResponseUtil.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.util;
2 |
3 | import org.springframework.stereotype.Component;
4 |
5 | /**
6 | * Response Utils
7 | * Created by Ken on 2017/1/18.
8 | */
9 | @Component
10 | public class ResponseUtil {
11 |
12 | /**
13 | * 生成一个 Response 对象
14 | * @return response 对象
15 | */
16 | public Response newResponseInstance(){
17 | Response response = new Response();
18 |
19 | return response;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RolesMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
16 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/service/Interface/AccountService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.service.Interface;
2 |
3 | import com.ken.wms.exception.UserAccountServiceException;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 账号相关服务
9 | * @author Ken
10 | *
11 | */
12 | public interface AccountService {
13 |
14 | /**
15 | * 密码更改
16 | * @param userID 用户ID
17 | * @param passwordInfo 更改的密码信息
18 | */
19 | public void passwordModify(Integer userID, Map passwordInfo) throws UserAccountServiceException;
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/webapp/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')
--------------------------------------------------------------------------------
/src/main/webapp/css/bootstrapValidator.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * BootstrapValidator (http://bootstrapvalidator.com)
3 | * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
4 | *
5 | * @version v0.5.1-dev, built on 2014-07-23 6:05:15 AM
6 | * @author https://twitter.com/nghuuphuoc
7 | * @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
8 | * @license MIT
9 | */
10 |
11 | .bv-form .help-block{margin-bottom:0}.bv-form .tooltip-inner{text-align:left}.nav-tabs li.bv-tab-success>a{color:#3c763d}.nav-tabs li.bv-tab-error>a{color:#a94442}
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/GoodsManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * GoodsManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class GoodsManageServiceException extends BusinessException {
10 |
11 | GoodsManageServiceException(){
12 | super();
13 | }
14 |
15 | public GoodsManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | GoodsManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/CustomerManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * CustomerManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class CustomerManageServiceException extends BusinessException{
10 |
11 | public CustomerManageServiceException(){
12 | super();
13 | }
14 |
15 | public CustomerManageServiceException(Exception e, String exception){
16 | super(e, exception);
17 | }
18 |
19 | public CustomerManageServiceException(Exception e){
20 | super(e);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/SupplierManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * SupplierManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class SupplierManageServiceException extends BusinessException {
10 |
11 | SupplierManageServiceException(){
12 | super();
13 | }
14 |
15 | public SupplierManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | SupplierManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/StorageManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * StorageManageServiceException异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class StorageManageServiceException extends BusinessException {
10 |
11 | StorageManageServiceException(){
12 | super();
13 | }
14 |
15 | public StorageManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | StorageManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/RepositoryManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * RepositoryManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class RepositoryManageServiceException extends BusinessException {
10 |
11 | RepositoryManageServiceException(){
12 | super();
13 | }
14 |
15 | public RepositoryManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | RepositoryManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/SystemLogServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * 系统操作日志 Service 异常
5 | *
6 | * @author Ken
7 | * @since 2017/4/7.
8 | */
9 | public class SystemLogServiceException extends BusinessException {
10 |
11 | public SystemLogServiceException(){
12 | super();
13 | }
14 |
15 | public SystemLogServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | public SystemLogServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | public SystemLogServiceException(String exceptionDesc){
24 | super(exceptionDesc);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/UserInfoServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * UserInfoService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class UserInfoServiceException extends BusinessException {
10 |
11 | public UserInfoServiceException(){
12 | super();
13 | }
14 |
15 | public UserInfoServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | public UserInfoServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | public UserInfoServiceException(String exceptionDesc){
24 | super(exceptionDesc);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/webapp/js/bootstrap-datetimepicker.zh-CN.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simplified Chinese translation for bootstrap-datetimepicker
3 | * Yuan Cheung
4 | */
5 | ;(function($){
6 | $.fn.datetimepicker.dates['zh-CN'] = {
7 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12 | today: "今天",
13 | suffix: [],
14 | meridiem: ["上午", "下午"]
15 | };
16 | }(jQuery));
17 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/StockRecordManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * StockRecordManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class StockRecordManageServiceException extends BusinessException {
10 |
11 | public StockRecordManageServiceException(){
12 | super();
13 | }
14 |
15 | public StockRecordManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | public StockRecordManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | public StockRecordManageServiceException(String exceptionDesc){
24 | super(exceptionDesc);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/webapp/css/mainPage.css:
--------------------------------------------------------------------------------
1 | body{
2 | padding-top: 70px;
3 | }
4 |
5 | a:link{
6 | text-decoration: none;
7 | }
8 |
9 | .btn-file{
10 | margin-top: 20px;
11 | position: relative;
12 | overflow: hidden;
13 | }
14 |
15 | .btn-file input[type=file]{
16 | position: absolute;
17 | top: 0;
18 | right: 0;
19 | min-width: 100%;
20 | min-height: 100%;
21 | font-size: 100px;
22 | text-align: right;
23 | opacity: 0;
24 | outline: none;
25 | background: white;
26 | cursor: inherit;
27 | display: block;
28 | }
29 |
30 | td,th{
31 | text-align: center;
32 | }
33 |
34 | .bodycontainer{
35 | height: 350px;
36 | width: 100%;
37 | margin: 0;
38 | margin-top: -15px;
39 | overflow-y: auto;
40 | }
41 | .table-scrollable{
42 | margin: 0;
43 | padding:0;
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/RepositoryAdminManageServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * RepositoryAdminManageService异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class RepositoryAdminManageServiceException extends BusinessException {
10 |
11 | public RepositoryAdminManageServiceException(){
12 | super();
13 | }
14 |
15 | public RepositoryAdminManageServiceException(Exception e){
16 | super(e);
17 | }
18 |
19 | public RepositoryAdminManageServiceException(Exception e, String exceptionDesc){
20 | super(e, exceptionDesc);
21 | }
22 |
23 | public RepositoryAdminManageServiceException(String exceptionDesc){
24 | super(exceptionDesc);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/src/main/resources/config/MyBatisConfiguration.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/main/webapp/js/bootstrap-table-zh-CN.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * bootstrap-table - v1.11.0 - 2016-07-02
3 | * https://github.com/wenzhixin/bootstrap-table
4 | * Copyright (c) 2016 zhixin wen
5 | * Licensed MIT License
6 | */
7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery);
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/UserAccountServiceException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * AccountServiceException异常
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class UserAccountServiceException extends BusinessException {
10 |
11 | public static final String PASSWORD_ERROR = "passwordError";
12 | public static final String PASSWORD_UNMATCH = "passwordUnmatched";
13 |
14 | public UserAccountServiceException() {
15 | super();
16 | }
17 |
18 | public UserAccountServiceException(String exceptionDesc) {
19 | super(null, exceptionDesc);
20 | }
21 |
22 | UserAccountServiceException(Exception e) {
23 | super(e);
24 | }
25 |
26 | UserAccountServiceException(Exception e, String exceptionDesc) {
27 | super(e, exceptionDesc);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.exception;
2 |
3 | /**
4 | * 业务层异常的父类
5 | *
6 | * @author Ken
7 | * @since 2017/3/8.
8 | */
9 | public class BusinessException extends Exception{
10 |
11 | private String exceptionDesc;
12 |
13 | public BusinessException(Exception e){
14 | super(e);
15 | }
16 |
17 | BusinessException(Exception e, String exceptionDesc){
18 | super(e);
19 | this.exceptionDesc = exceptionDesc;
20 | }
21 |
22 | BusinessException(String exceptionDesc){
23 | this.exceptionDesc = exceptionDesc;
24 | }
25 |
26 | BusinessException(){}
27 |
28 | public String getExceptionDesc() {
29 | return exceptionDesc;
30 | }
31 |
32 | public void setExceptionDesc(String exceptionDesc) {
33 | this.exceptionDesc = exceptionDesc;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/User.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 系统的使用用户
5 | * @author Ken
6 | *
7 | */
8 | public class User {
9 |
10 | private Integer id;// 用户ID
11 | private String userName;// 用户名
12 | private String password;// 用户密码
13 |
14 | public Integer getId() {
15 | return id;
16 | }
17 |
18 | public void setId(Integer id) {
19 | this.id = id;
20 | }
21 |
22 | public String getUserName() {
23 | return userName;
24 | }
25 |
26 | public void setUserName(String userName) {
27 | this.userName = userName;
28 | }
29 |
30 | public String getPassword() {
31 | return password;
32 | }
33 |
34 | public void setPassword(String password) {
35 | this.password = password;
36 | }
37 |
38 | @Override
39 | public String toString() {
40 | return "User [id=" + id + ", userName=" + userName + ", password=" + password + "]";
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserPermissionMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.RoleDO;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * 用户角色权限映射器
11 | * @author Ken
12 | *
13 | */
14 | @Repository
15 | public interface UserPermissionMapper {
16 |
17 | /**
18 | * 为指定 userID 用户指派指定 roleID 的角色
19 | * @param userID 用户ID
20 | * @param roleID 角色ID
21 | */
22 | void insert(@Param("userID") Integer userID, @Param("roleID") Integer roleID);
23 |
24 | /**
25 | * 删除指定用户的角色
26 | * @param userID 用户ID
27 | */
28 | void deleteByUserID(Integer userID);
29 |
30 | /**
31 | * 获取指定 userID 对应用户拥有的角色
32 | * @param userID 用户ID
33 | * @return 返回 userID 指定用户的角色
34 | */
35 | List selectUserRole(Integer userID);
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RolePermissionMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
23 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/RoleDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 系统使用的角色信息
5 | * @author Ken
6 | *
7 | */
8 | public class RoleDO {
9 |
10 | private Integer id;// 角色ID
11 | private String roleName;// 角色名
12 | private String roleDesc;// 角色描述
13 |
14 | public Integer getId() {
15 | return id;
16 | }
17 |
18 | public void setId(Integer id) {
19 | this.id = id;
20 | }
21 |
22 | public String getRoleName() {
23 | return roleName;
24 | }
25 |
26 | public void setRoleName(String roleName) {
27 | this.roleName = roleName;
28 | }
29 |
30 | public String getRoleDesc() {
31 | return roleDesc;
32 | }
33 |
34 | public void setRoleDesc(String roleDesc) {
35 | this.roleDesc = roleDesc;
36 | }
37 |
38 | @Override
39 | public String toString() {
40 | return "RoleDO{" +
41 | "id=" + id +
42 | ", roleName='" + roleName + '\'' +
43 | ", roleDesc='" + roleDesc + '\'' +
44 | '}';
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserPermissionMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
25 |
26 |
27 | insert into wms_user_role(ROLE_ID,USER_ID)
28 | values(#{roleID},#{userID})
29 |
30 |
31 |
32 | delete from wms_user_role
33 | where USER_ID = #{userID}
34 |
35 |
--------------------------------------------------------------------------------
/src/main/webapp/js/mainPage.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | menuClickAction();
3 | welcomePageInit();
4 | signOut();
5 | getRequestPrefix();
6 | homePage();
7 | });
8 |
9 | // 获取请求前缀
10 | function getRequestPrefix(){
11 | requestPrefix = $('#requestPrefix').text();
12 | }
13 |
14 | // 加载欢迎界面
15 | function welcomePageInit(){
16 | $('#panel').load('pagecomponent/welcomePage.jsp');
17 | }
18 |
19 | // 跳回首页
20 | function homePage(){
21 | $('.home').click(function(){
22 | $('#panel').load('pagecomponent/welcomePage.jsp');
23 | })
24 | }
25 |
26 | // 侧边栏连接点击动作
27 | function menuClickAction() {
28 | $(".menu_item").click(function() {
29 | var url = $(this).attr("name");
30 | $('#panel').load(url);
31 | })
32 | }
33 |
34 | // 注销登陆
35 | function signOut() {
36 | $("#signOut").click(function() {
37 | $.ajax({
38 | type : "GET",
39 | url : "account/logout",
40 | dataType : "json",
41 | contentType : "application/json",
42 | success:function(response){
43 | //刷新
44 | window.location.reload(true);
45 | },error:function(response){
46 |
47 | }
48 | })
49 | })
50 | }
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserOperationRecordMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.UserOperationRecordDO;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.Date;
8 | import java.util.List;
9 |
10 | /**
11 | * 用户操作记录Mapper
12 | *
13 | * @author Ken
14 | * @since 2017/4/9.
15 | */
16 | @Repository
17 | public interface UserOperationRecordMapper {
18 |
19 | /**
20 | * 选择指定用户ID,或时间范围的用户操作记录
21 | *
22 | * @param userID 指定的用户ID
23 | * @param startDate 记录的起始日期
24 | * @param endDate 记录的结束日期
25 | * @return 返回所有符合条件的记录
26 | */
27 | List selectUserOperationRecord(@Param("userID") Integer userID,
28 | @Param("startDate") Date startDate,
29 | @Param("endDate") Date endDate);
30 |
31 | /**
32 | * 插入用户操作记录
33 | *
34 | * @param userOperationRecordDO 用户操作记录
35 | */
36 | void insertUserOperationRecord(UserOperationRecordDO userOperationRecordDO);
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/util/EncryptingModel.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.util;
2 |
3 | import org.springframework.stereotype.Component;
4 |
5 | import java.security.MessageDigest;
6 | import java.security.NoSuchAlgorithmException;
7 |
8 | /**
9 | * 加密模块
10 | * @author Ken
11 | *
12 | */
13 | @Component
14 | public class EncryptingModel {
15 |
16 | /**
17 | * 对字符串进行 MD5 加密
18 | * @param plainString 需要加密的字符串
19 | * @return 返回加密后的字符串
20 | * @throws NoSuchAlgorithmException
21 | */
22 | public String MD5(String plainString) throws NoSuchAlgorithmException,NullPointerException{
23 |
24 | if(plainString == null)
25 | throw new NullPointerException();
26 |
27 | MessageDigest messageDigest = MessageDigest.getInstance("MD5");
28 | messageDigest.update(plainString.getBytes());
29 | byte[] byteData = messageDigest.digest();
30 |
31 | StringBuffer hexString = new StringBuffer();
32 | for (int i = 0; i < byteData.length; i++) {
33 | String hex = Integer.toHexString(0xff & byteData[i]);
34 | if (hex.length() == 1)
35 | hexString.append('0');
36 | hexString.append(hex);
37 | }
38 |
39 | return hexString.toString();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/AccessRecordMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.AccessRecordDO;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.Date;
8 | import java.util.List;
9 |
10 | /**
11 | * 用户登入登出记录因映射器
12 | *
13 | * @author Ken
14 | * @since 2017/3/5.
15 | */
16 | @Repository
17 | public interface AccessRecordMapper {
18 |
19 | /**
20 | * 插入一条用户用户登入登出记录
21 | *
22 | * @param accessRecordDO 用户登入登出记录
23 | */
24 | void insertAccessRecord(AccessRecordDO accessRecordDO);
25 |
26 | /**
27 | * 选择指定用户ID、记录类型、时间范围的登入登出记录
28 | *
29 | * @param userID 用户ID
30 | * @param accessType 记录类型(登入、登出或所有)
31 | * @param startDate 记录的起始日期
32 | * @param endDate 记录的结束日期
33 | * @return 返回所有符合条件的记录
34 | */
35 | List selectAccessRecords(@Param("userID") Integer userID,
36 | @Param("accessType") String accessType,
37 | @Param("startDate") Date startDate,
38 | @Param("endDate") Date endDate);
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/Goods.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 货物信息
5 | * @author Ken
6 | *
7 | */
8 | public class Goods {
9 |
10 | private Integer id;// 货物ID
11 | private String name;// 货物名
12 | private String type;// 货物类型
13 | private String size;// 货物规格
14 | private Double value;// 货物价值
15 |
16 | public Integer getId() {
17 | return id;
18 | }
19 |
20 | public void setId(Integer id) {
21 | this.id = id;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 |
32 | public String getType() {
33 | return type;
34 | }
35 |
36 | public void setType(String type) {
37 | this.type = type;
38 | }
39 |
40 | public String getSize() {
41 | return size;
42 | }
43 |
44 | public void setSize(String size) {
45 | this.size = size;
46 | }
47 |
48 | public Double getValue() {
49 | return value;
50 | }
51 |
52 | public void setValue(Double value) {
53 | this.value = value;
54 | }
55 |
56 | @Override
57 | public String toString() {
58 | return "Goods [id=" + id + ", name=" + name + ", type=" + type + ", size=" + size + ", value=" + value + "]";
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/controller/PageForwardHandler.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.controller;
2 |
3 | import org.apache.shiro.SecurityUtils;
4 | import org.apache.shiro.subject.Subject;
5 | import org.springframework.stereotype.Controller;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 |
8 | /**
9 | * 页面重定向
10 | *
11 | * @author ken
12 | * @since 2017/2/27.
13 | */
14 | @RequestMapping("/")
15 | @Controller
16 | public class PageForwardHandler {
17 |
18 | /**
19 | * 内部重定向到登陆页面
20 | *
21 | * @return 跳转的 jsp
22 | */
23 | @RequestMapping("login")
24 | public String loginPageForward() {
25 | // 判断但钱用户是否已经登陆
26 | Subject currentSubject = SecurityUtils.getSubject();
27 | if (!currentSubject.isAuthenticated())
28 | return "login";
29 | else
30 | return "mainPage";
31 | }
32 |
33 | /**
34 | * 内部重定向到主页面
35 | *
36 | * @return 跳转的 jsp
37 | */
38 | @RequestMapping("mainPage")
39 | public String showLoginView() {
40 | Subject currentSubject = SecurityUtils.getSubject();
41 | if (!currentSubject.isAuthenticated())
42 | return "login";
43 | else
44 | return "mainPage";
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 77.仓库管理系统
2 |
3 | - 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/))
4 | - 技术探讨、资料分享,请加QQ群:692619798
5 | - 作者微信:19941326836 QQ:952045282
6 | - 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习
7 | - 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务
8 | - 所有选题地址 ([https://github.com/YuLin-Coder/AllProjectCatalog](https://github.com/YuLin-Coder/AllProjectCatalog))
9 |
10 | ## 项目介绍
11 | 基于ssm的仓库管理系统:前端jsp、jquery、bootstrap,后端 maven、springmvc、spring、mybatis,集成库存管理、出入库管理、供应商信息管理、货物信息管理等功能于一体的系统。
12 |
13 | ## 功能介绍
14 |
15 | - 库存管理:库存信息的增删改查,出入库记录查询,多条件搜索查询
16 | - 出入库管理:货物入库,入库时选择对应的仓库下拉列表,填入供应商名称和入库货物名称,输入入库数量;货物出库则类似货物入库
17 | - 人员管理:仓库管理员信息的增删改查,导入,导出
18 | - 供应商信息管理:供应商增删改查,关键词搜索
19 | - 客户信息管理:客户信息增删改查,导入,导出
20 | - 货物信息管理:货物信息的增删改查,导入,导出
21 | - 仓库信息管理:仓库信息的增删改查,导入,导出
22 | - 系统维护:更改密码,系统日志查询,登录日志查询
23 |
24 | ## 环境
25 |
26 | - IntelliJ IDEA 2009.3
27 |
28 | - Mysql 5.7.26
29 |
30 | - Tomcat 7.0.73
31 |
32 | - JDK 1.8
33 |
34 | ## 运行截图
35 | 
36 |
37 | 
38 |
39 | 
40 |
41 | 
42 |
43 | 
44 |
45 | 
46 |
47 | 
48 |
49 | 
50 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/RolePermissionDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * URL 的角色角色权限信息
5 | *
6 | * @author ken
7 | * @since 2017/2/26
8 | */
9 | public class RolePermissionDO {
10 |
11 | /**
12 | * URL 的角色角色权限信息名称
13 | */
14 | private String name;
15 |
16 | /**
17 | * URL 的角色角色权限信息对应的 URL
18 | */
19 | private String url;
20 |
21 | /**
22 | * URL 的角色角色权限信息对应的角色
23 | */
24 | private String role;
25 |
26 |
27 | /**
28 | * 对应的 getter & setter
29 | */
30 |
31 | public void setName(String name) {
32 | this.name = name;
33 | }
34 |
35 | public void setUrl(String url) {
36 | this.url = url;
37 | }
38 |
39 | public void setRole(String role) {
40 | this.role = role;
41 | }
42 |
43 | public String getName() {
44 | return name;
45 | }
46 |
47 | public String getUrl() {
48 | return url;
49 | }
50 |
51 | public String getRole() {
52 | return role;
53 | }
54 |
55 | @Override
56 | public String toString() {
57 | return "RolePermissionDO{" +
58 | "name='" + name + '\'' +
59 | ", url='" + url + '\'' +
60 | ", role='" + role + '\'' +
61 | '}';
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/UserInfoDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 用户账户信息(数据传输对象)
5 | * @author ken
6 | * @since 2017/2/26.
7 | */
8 | public class UserInfoDO {
9 |
10 | /**
11 | * 用户ID
12 | */
13 | private Integer userID;
14 |
15 | /**
16 | * 用户名
17 | */
18 | private String userName;
19 |
20 | /**
21 | * 用户密码(已加密)
22 | */
23 | private String password;
24 |
25 | /**
26 | * 用户账户属性的 getter 以及 setter
27 | */
28 |
29 | public String getUserName() {
30 | return userName;
31 | }
32 |
33 | public Integer getUserID() {
34 | return userID;
35 | }
36 |
37 | public String getPassword() {
38 | return password;
39 | }
40 |
41 | public void setUserID(Integer userID) {
42 | this.userID = userID;
43 | }
44 |
45 | public void setUserName(String userName) {
46 | this.userName = userName;
47 | }
48 |
49 | public void setPassword(String password) {
50 | this.password = password;
51 | }
52 |
53 | @Override
54 | public String toString() {
55 | return "UserInfoDO{" +
56 | "userID=" + userID +
57 | ", userName='" + userName + '\'' +
58 | ", password='" + password + '\'' +
59 | '}';
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.UserInfoDO;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 用户账户信息 Mapper
10 | *
11 | * @author ken
12 | * @since 2017/2/26.
13 | */
14 | @Repository
15 | public interface UserInfoMapper {
16 |
17 | /**
18 | * 选择指定 id 的 user 信息
19 | *
20 | * @param userID 用户ID
21 | * @return 返回指定 userID 对应的 user 信息
22 | */
23 | UserInfoDO selectByUserID(Integer userID);
24 |
25 | /**
26 | * 选择指定 userName 的 user 信息
27 | *
28 | * @param userName 用户名
29 | * @return 返回指定 userName 对应的 user 信息
30 | */
31 | UserInfoDO selectByName(String userName);
32 |
33 | /**
34 | * 选择全部的 user 信息
35 | *
36 | * @return 返回所有的 user 信息
37 | */
38 | List selectAll();
39 |
40 |
41 | /**
42 | * 更新 user 对象信息
43 | *
44 | * @param user 更新 user 对象信息
45 | */
46 | void update(UserInfoDO user);
47 |
48 | /**
49 | * 删除指定 id 的user 信息
50 | *
51 | * @param id 用户ID
52 | */
53 | void deleteById(Integer id);
54 |
55 | /**
56 | * 插入一个 user 对象信息
57 | * 不需指定对象的主键id,数据库自动生成
58 | *
59 | * @param user 需要插入的用户信息
60 | */
61 | void insert(UserInfoDO user);
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/filter/AnyOfRolesAuthorizationFilter.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.filter;
2 |
3 | import org.apache.shiro.subject.Subject;
4 | import org.apache.shiro.web.filter.authz.RolesAuthorizationFilter;
5 |
6 | import javax.servlet.ServletRequest;
7 | import javax.servlet.ServletResponse;
8 | import java.io.IOException;
9 |
10 | /**
11 | * 自定义过滤器,继承自 RolesAuthorizationFilter ,实现了多个角色可以访问某一条url
12 | * @author Ken
13 | * @since 2017/3/3.
14 | */
15 | public class AnyOfRolesAuthorizationFilter extends RolesAuthorizationFilter{
16 |
17 | @Override
18 | public boolean isAccessAllowed(ServletRequest request, ServletResponse response,
19 | Object mappedValue) throws IOException{
20 |
21 | final Subject subject = getSubject(request, response);
22 | final String[] rolesArray = (String[]) mappedValue;
23 |
24 | if (rolesArray == null || rolesArray.length == 0){
25 | // no roles specified, so nothing to check - allow access
26 | // System.out.println("no roles");
27 | return true;
28 | }
29 |
30 | for (String role : rolesArray){
31 | // System.out.println(role);
32 | if (subject.hasRole(role)){
33 | return true;
34 | }
35 | }
36 |
37 | return false;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/util/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.util;
2 |
3 | import com.ken.wms.exception.BusinessException;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 | import org.springframework.web.bind.annotation.ControllerAdvice;
7 | import org.springframework.web.bind.annotation.ExceptionHandler;
8 |
9 | /**
10 | * 全局异常处理器
11 | *
12 | * @author Ken
13 | * @since 2017/3/8.
14 | */
15 | @ControllerAdvice
16 | public class GlobalExceptionHandler {
17 |
18 | private static Logger logger = LoggerFactory.getLogger("ExceptionLogging");
19 |
20 | /**
21 | * 捕获并记录Controller层抛出的非BusinessException异常
22 | */
23 | @ExceptionHandler(value = Exception.class)
24 | public void handleException(Exception e){
25 | if (!(e instanceof BusinessException)){
26 | if (logger.isErrorEnabled()){
27 | StringBuilder builder = new StringBuilder();
28 | builder.append("cause:").append(e.getMessage());
29 | builder.append("\n\tstackTrack:\n");
30 | for (StackTraceElement stack : e.getStackTrace()) {
31 | builder.append("\t\t");
32 | builder.append(stack.toString());
33 | builder.append("\n");
34 | }
35 | logger.error(builder.toString());
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RepositoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.Repository;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * Repository 映射器
9 | * @author Ken
10 | *
11 | */
12 | @org.springframework.stereotype.Repository
13 | public interface RepositoryMapper {
14 |
15 | /**
16 | * 选择全部的 Repository 记录
17 | * @return 返回全部的 Repository
18 | */
19 | List selectAll();
20 |
21 | /**
22 | * 选择全部的未分配的 repository 记录
23 | * @return 返回所有未分配的 Repository
24 | */
25 | List selectUnassign();
26 |
27 | /**
28 | * 选择指定 Repository ID 的 Repository 记录
29 | * @param repositoryID 仓库ID
30 | * @return 返回指定的Repository
31 | */
32 | Repository selectByID(Integer repositoryID);
33 |
34 | /**
35 | * 选择指定 repository Address 的 repository 记录
36 | * @param address 仓库地址
37 | * @return 返回指定的Repository
38 | */
39 | List selectByAddress(String address);
40 |
41 | /**
42 | * 插入一条新的 Repository 记录
43 | * @param repository 仓库信息
44 | */
45 | void insert(Repository repository);
46 |
47 | /**
48 | * 批量插入 Repository 记录
49 | * @param repositories 存有若干条记录的 List
50 | */
51 | void insertbatch(List repositories);
52 |
53 | /**
54 | * 更新 Repository 记录
55 | * @param repository 仓库信息
56 | */
57 | void update(Repository repository);
58 |
59 | /**
60 | * 删除指定 Repository ID 的 Repository 记录
61 | * @param repositoryID 仓库ID
62 | */
63 | void deleteByID(Integer repositoryID);
64 | }
65 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/Customer.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 客户信息
5 | * @author Ken
6 | *
7 | */
8 | public class Customer {
9 |
10 | private Integer id;// 客户ID
11 | private String name;// 客户名
12 | private String personInCharge;// 负责人
13 | private String tel;// 联系电话
14 | private String email;// 电子邮件
15 | private String address;// 地址
16 |
17 | public Integer getId() {
18 | return id;
19 | }
20 |
21 | public void setId(Integer id) {
22 | this.id = id;
23 | }
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 | public String getPersonInCharge() {
34 | return personInCharge;
35 | }
36 |
37 | public void setPersonInCharge(String personInCharge) {
38 | this.personInCharge = personInCharge;
39 | }
40 |
41 | public String getTel() {
42 | return tel;
43 | }
44 |
45 | public void setTel(String tel) {
46 | this.tel = tel;
47 | }
48 |
49 | public String getEmail() {
50 | return email;
51 | }
52 |
53 | public void setEmail(String email) {
54 | this.email = email;
55 | }
56 |
57 | public String getAddress() {
58 | return address;
59 | }
60 |
61 | public void setAddress(String address) {
62 | this.address = address;
63 | }
64 |
65 | @Override
66 | public String toString() {
67 | return "Customer [id=" + id + ", name=" + name + ", personInCharge=" + personInCharge + ", tel=" + tel
68 | + ", email=" + email + ", address=" + address + "]";
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/Supplier.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 供应商信息
5 | *
6 | * @author Ken
7 | *
8 | */
9 | public class Supplier {
10 |
11 | private Integer id;// 供应商ID
12 | private String name;// 供应商名
13 | private String personInCharge;// 负责人
14 | private String tel;// 联系电话
15 | private String email;// 电子邮件
16 | private String address;// 供应商地址
17 |
18 | public Integer getId() {
19 | return id;
20 | }
21 |
22 | public void setId(Integer id) {
23 | this.id = id;
24 | }
25 |
26 | public String getName() {
27 | return name;
28 | }
29 |
30 | public void setName(String name) {
31 | this.name = name;
32 | }
33 |
34 | public String getPersonInCharge() {
35 | return personInCharge;
36 | }
37 |
38 | public void setPersonInCharge(String personInCharge) {
39 | this.personInCharge = personInCharge;
40 | }
41 |
42 | public String getTel() {
43 | return tel;
44 | }
45 |
46 | public void setTel(String tel) {
47 | this.tel = tel;
48 | }
49 |
50 | public String getEmail() {
51 | return email;
52 | }
53 |
54 | public void setEmail(String email) {
55 | this.email = email;
56 | }
57 |
58 | public String getAddress() {
59 | return address;
60 | }
61 |
62 | public void setAddress(String address) {
63 | this.address = address;
64 | }
65 |
66 | @Override
67 | public String toString() {
68 | return "Supplier [id=" + id + ", name=" + name + ", personInCharge=" + personInCharge + ", tel=" + tel
69 | + ", email=" + email + ", address=" + address + "]";
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/GoodsMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 |
4 | import com.ken.wms.domain.Goods;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * 货物信息映射器
11 | * @author Ken
12 | *
13 | */
14 | @Repository
15 | public interface GoodsMapper {
16 |
17 | /**
18 | * 选择所有的 Goods
19 | * @return 返回所有的Goods
20 | */
21 | List selectAll();
22 |
23 | /**
24 | * 选择指定 id 的 Goods
25 | * @param id 货物的ID
26 | * @return 返回执行ID对应的Goods
27 | */
28 | Goods selectById(Integer id);
29 |
30 | /**
31 | * 选择指定 Goods name 的 Goods
32 | * @param goodsName 货物的名称
33 | * @return 返回指定GoodsName对应的货物
34 | */
35 | Goods selectByName(String goodsName);
36 |
37 | /**
38 | * 选择制定 goods name 的 goods
39 | * 模糊匹配
40 | * @param goodsName 货物德名称
41 | * @return 返回模糊匹配指定goodsName的货物
42 | */
43 | List selectApproximateByName(String goodsName);
44 |
45 | /**
46 | * 插入一条新的记录到数据库
47 | * @param goods 货物信息
48 | */
49 | void insert(Goods goods);
50 |
51 | /**
52 | * 批量插入新的记录到数据库中
53 | * @param goods 存放 goods 信息的 List
54 | */
55 | void insertBatch(List goods);
56 |
57 | /**
58 | * 更新 Goods 到数据库中
59 | * 该 Customer 必须已经存在于数据库中,即已经分配主键,否则将更新失败
60 | * @param goods 货物信息
61 | */
62 | void update(Goods goods);
63 |
64 | /**
65 | * 删除指定 id 的 goods
66 | * @param id 货物ID
67 | */
68 | void deleteById(Integer id);
69 |
70 | /**
71 | * 删除指定 goods name 的 goods
72 | * @param goodsName 货物的名称
73 | */
74 | void deleteByName(String goodsName);
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RepositoryAdminMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.RepositoryAdmin;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * RepositoryAdmin 映射器
10 | * @author Ken
11 | *
12 | */
13 | @Repository
14 | public interface RepositoryAdminMapper {
15 |
16 | /**
17 | * 选择指定 ID 的仓库管理员信息
18 | * @param id 仓库管理员ID
19 | * @return 返回指定 ID 的仓库管理员信息
20 | */
21 | RepositoryAdmin selectByID(Integer id);
22 |
23 | /**
24 | * 选择指定 name 的仓库管理员信息。
25 | * 支持模糊查找
26 | * @param name 仓库管理员名字
27 | * @return 返回若干条指定 name 的仓库管理员信息
28 | */
29 | List selectByName(String name);
30 |
31 | /**
32 | * 选择所有的仓库管理员信息
33 | * @return 返回所有的仓库管理员信息
34 | */
35 | List selectAll();
36 |
37 | /**
38 | * 选择已指派指定 repositoryID 的仓库管理员信息
39 | * @param repositoryID 指派的仓库ID
40 | * @return 返回已指派指定 repositoryID 的仓库管理员信息
41 | */
42 | RepositoryAdmin selectByRepositoryID(Integer repositoryID);
43 |
44 | /**
45 | * 插入一条仓库管理员信息
46 | * @param repositoryAdmin 仓库管理员信息
47 | */
48 | void insert(RepositoryAdmin repositoryAdmin);
49 |
50 | /**
51 | * 批量插入仓库管理员信息
52 | * @param repositoryAdmins 存放若干条仓库管理员信息的 List
53 | */
54 | void insertBatch(List repositoryAdmins);
55 |
56 | /**
57 | * 更新仓库管理员信息
58 | * @param repositoryAdmin 仓库管理员信息
59 | */
60 | void update(RepositoryAdmin repositoryAdmin);
61 |
62 | /**
63 | * 删除指定 ID 的仓库管理员信息
64 | * @param id 仓库管理员 ID
65 | */
66 | void deleteByID(Integer id);
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/resources/config/SpringMVCConfiguration.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/controller/FileSourceHandler.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.controller;
2 |
3 | import org.springframework.stereotype.Controller;
4 | import org.springframework.web.bind.annotation.PathVariable;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 |
8 | import javax.servlet.ServletContext;
9 | import javax.servlet.http.HttpServletRequest;
10 | import javax.servlet.http.HttpServletResponse;
11 | import java.io.IOException;
12 | import java.nio.file.Files;
13 | import java.nio.file.Path;
14 | import java.nio.file.Paths;
15 |
16 | /**
17 | * 处理文件下载请求
18 | *
19 | * @author Ken
20 | */
21 | @Controller
22 | @RequestMapping("/commons/fileSource")
23 | public class FileSourceHandler {
24 |
25 | @RequestMapping(value = "download/{fileName:.+}", method = RequestMethod.GET)
26 | public void fileDownload(@PathVariable("fileName") String fileName, HttpServletRequest request,
27 | HttpServletResponse response) throws IOException {
28 |
29 | if (fileName == null)
30 | return;
31 |
32 | // 获取文件
33 | ServletContext context = request.getServletContext();
34 | String directory = context.getRealPath("/WEB-INF/download");
35 | Path file = Paths.get(directory, fileName);
36 | if (Files.exists(file)) {
37 | // 设置响应头
38 | response.addHeader("Content-Disposition", "attachment;filename=" + file.getFileName());
39 | Files.copy(file, response.getOutputStream());
40 | response.getOutputStream().flush();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/UserInfoDTO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | /**
7 | * 用户账户信息(数据传输对象)
8 | * @author ken
9 | * @since 2017/2/26.
10 | */
11 | public class UserInfoDTO {
12 |
13 | /**
14 | * 用户ID
15 | */
16 | private Integer userID;
17 |
18 | /**
19 | * 用户名
20 | */
21 | private String userName;
22 |
23 | /**
24 | * 用户密码(已加密)
25 | */
26 | private String password;
27 |
28 | /**
29 | * 用户角色
30 | */
31 | private List role = new ArrayList<>();
32 |
33 | /**
34 | * 用户账户属性的 getter 以及 setter
35 | */
36 |
37 | public String getUserName() {
38 | return userName;
39 | }
40 |
41 | public List getRole() {
42 | return role;
43 | }
44 |
45 | public Integer getUserID() {
46 | return userID;
47 | }
48 |
49 | public String getPassword() {
50 | return password;
51 | }
52 |
53 | public void setUserID(Integer userID) {
54 | this.userID = userID;
55 | }
56 |
57 | public void setUserName(String userName) {
58 | this.userName = userName;
59 | }
60 |
61 | public void setPassword(String password) {
62 | this.password = password;
63 | }
64 |
65 | public void setRole(List role) {
66 | this.role = role;
67 | }
68 |
69 | @Override
70 | public String toString() {
71 | return "UserInfoDTO{" +
72 | "userID=" + userID +
73 | ", userName='" + userName + '\'' +
74 | ", password='" + password + '\'' +
75 | ", role=" + role +
76 | '}';
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/service/Interface/UserInfoService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.service.Interface;
2 |
3 | import com.ken.wms.domain.UserInfoDTO;
4 | import com.ken.wms.exception.UserInfoServiceException;
5 |
6 | import java.util.List;
7 | import java.util.Set;
8 |
9 | /**
10 | * 用户账户信息 service
11 | * @author ken
12 | * @since 2017/2/26.
13 | */
14 | public interface UserInfoService {
15 |
16 | /**
17 | * 获取指定用户ID对应的用户账户信息
18 | * @param userID 用户ID
19 | * @return 返回用户账户信息
20 | */
21 | UserInfoDTO getUserInfo(Integer userID) throws UserInfoServiceException;
22 |
23 | /**
24 | * 获取指定 userName 对应的用户账户信息
25 | * @param userName 用户名
26 | * @return 返回用户账户信息
27 | */
28 | UserInfoDTO getUserInfo(String userName) throws UserInfoServiceException;
29 |
30 | /**
31 | * 获取所有用户账户信息
32 | * @return 返回所有的用户账户信息
33 | */
34 | List getAllUserInfo() throws UserInfoServiceException;
35 |
36 | /**
37 | * 更新用户的账户信息
38 | * @param userInfoDTO 用户账户信息
39 | */
40 | void updateUserInfo(UserInfoDTO userInfoDTO) throws UserInfoServiceException;
41 |
42 | /**
43 | * 删除指定 userID 的用户账户信息
44 | * @param userID 指定的用户ID
45 | */
46 | void deleteUserInfo(Integer userID) throws UserInfoServiceException;
47 |
48 | /**
49 | * 添加一条用户账户信息
50 | * @param userInfoDTO 需要添加的用户账户信息
51 | */
52 | boolean insertUserInfo(UserInfoDTO userInfoDTO) throws UserInfoServiceException;
53 |
54 | /**
55 | * 获取用户的权限角色
56 | * @param userID 用户 ID
57 | * @return 返回一个保存有用户角色的 Set,若该用户没有任何角色,则返回一个不包含任何元素的 Set
58 | */
59 | Set getUserRoles(Integer userID) throws UserInfoServiceException;
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/Repository.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 仓库信息
5 | * @author Ken
6 | *
7 | */
8 | public class Repository {
9 |
10 | private Integer id;// 仓库ID
11 | private String address;// 仓库地址
12 | private String status;// 仓库状态
13 | private String area;// 仓库面积
14 | private String desc;// 仓库描述
15 | private Integer adminID;//仓库管理员ID
16 | private String adminName; //仓库管理员名字
17 |
18 | public Integer getAdminID() {
19 | return adminID;
20 | }
21 |
22 | public void setAdminID(Integer adminID) {
23 | this.adminID = adminID;
24 | }
25 |
26 | public String getArea() {
27 | return area;
28 | }
29 |
30 | public void setArea(String area) {
31 | this.area = area;
32 | }
33 |
34 | public String getDesc() {
35 | return desc;
36 | }
37 |
38 | public void setDesc(String desc) {
39 | this.desc = desc;
40 | }
41 |
42 | public String getAdminName() {
43 | return adminName;
44 | }
45 |
46 | public void setAdminName(String adminName) {
47 | this.adminName = adminName;
48 | }
49 |
50 | public Integer getId() {
51 | return id;
52 | }
53 |
54 | public void setId(Integer id) {
55 | this.id = id;
56 | }
57 |
58 | public String getAddress() {
59 | return address;
60 | }
61 |
62 | public void setAddress(String address) {
63 | this.address = address;
64 | }
65 |
66 | public String getStatus() {
67 | return status;
68 | }
69 |
70 | public void setStatus(String status) {
71 | this.status = status;
72 | }
73 |
74 | @Override
75 | public String toString() {
76 | return "Repository [id=" + id + ", address=" + address + ", status=" + status + ", area=" + area + ", desc="
77 | + desc + ", adminID=" + adminID + ", adminName=" + adminName + "]";
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/SupplierMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.Supplier;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Supplier 映射器
10 | * @author Ken
11 | *
12 | */
13 | @Repository
14 | public interface SupplierMapper {
15 |
16 | /**
17 | * 选择全部的 Supplier
18 | * @return 返回所有的供应商
19 | */
20 | List selectAll();
21 |
22 | /**
23 | * 选择指定 id 的 Supplier
24 | * @param id 供应商ID
25 | * @return 返回指定ID对应的供应商
26 | */
27 | Supplier selectById(Integer id);
28 |
29 | /**
30 | * 选择指定 supplier name 的 Supplier
31 | * @param supplierName 供应商名称
32 | * @return 返回supplierName对应的供应商
33 | */
34 | Supplier selectBuName(String supplierName);
35 |
36 | /**
37 | * 选择指定 supplier name 的 Supplier
38 | * 与 selectBuName 方法的区别在于本方法将返回相似匹配的结果
39 | * @param supplierName 供应商名
40 | * @return 返回所有模糊匹配指定supplierName的供应商
41 | */
42 | List selectApproximateByName(String supplierName);
43 |
44 | /**
45 | * 插入 Supplier 到数据库中
46 | * 不需要指定 Supplier 的主键,采用的数据库 AI 方式
47 | * @param supplier Supplier 实例
48 | */
49 | void insert(Supplier supplier);
50 |
51 | /**
52 | * 批量插入 Supplier 到数据库中
53 | * @param suppliers 存放 Supplier 实例的 Lists
54 | */
55 | void insertBatch(List suppliers);
56 |
57 | /**
58 | * 更新 Supplier 到数据库
59 | * 该 Supplier 必须已经存在于数据库中,即已经分配主键,否则将更新失败
60 | * @param supplier Supplier 实例
61 | */
62 | void update(Supplier supplier);
63 |
64 | /**
65 | * 删除指定 id 的Supplier
66 | * @param id 供应商ID
67 | */
68 | void deleteById(Integer id);
69 |
70 | /**
71 | * 删除指定 supplierName 的 Supplier
72 | * @param supplierName 供应商名称
73 | */
74 | void deleteByName(String supplierName);
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/CustomerMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.Customer;
4 | import org.springframework.stereotype.Repository;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * 客户信息 Customer 映射器
10 | * @author Ken
11 | *
12 | */
13 | @Repository
14 | public interface CustomerMapper {
15 |
16 | /**
17 | * 选择所有的 Customer
18 | * @return 返回所有的 Customer
19 | */
20 | List selectAll();
21 |
22 | /**
23 | * 选择指定 id 的 Supplier
24 | * @param id Customer的ID
25 | * @return 返回指定ID对应的Customer
26 | */
27 | Customer selectById(Integer id);
28 |
29 | /**
30 | * 选择指定 Customer name 的 customer
31 | * @param customerName 客户的名称
32 | * @return 返回指定CustomerName对应的Customer
33 | */
34 | Customer selectByName(String customerName);
35 |
36 | /**
37 | * 选择指定 customer name 的 Customer
38 | * 与 selectByName 方法的区别在于本方法将返回相似匹配的结果
39 | * @param customerName Customer 供应商名
40 | * @return 返回模糊匹配指定customerName 对应的Customer
41 | */
42 | List selectApproximateByName(String customerName);
43 |
44 | /**
45 | * 插入 Customer 到数据库中
46 | * 不需要指定 Customer 的主键,采用的数据库 AI 方式
47 | * @param customer Customer 实例
48 | */
49 | void insert(Customer customer);
50 |
51 | /**
52 | * 批量插入 Customer 到数据库中
53 | * @param customers 存放 Customer 实例的 List
54 | */
55 | void insertBatch(List customers);
56 |
57 | /**
58 | * 更新 Customer 到数据库
59 | * 该 Customer 必须已经存在于数据库中,即已经分配主键,否则将更新失败
60 | * @param customer customer 实例
61 | */
62 | void update(Customer customer);
63 |
64 | /**
65 | * 删除指定 id 的 customer
66 | * @param id customer ID
67 | */
68 | void deleteById(Integer id);
69 |
70 | /**
71 | * 删除指定 customerName 的 customer
72 | * @param customerName 客户名称
73 | */
74 | void deleteByName(String customerName);
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/RepositoryAdmin.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | import java.sql.Date;
4 |
5 | /**
6 | * 仓库管理员信息
7 | * @author Ken
8 | *
9 | */
10 | public class RepositoryAdmin {
11 |
12 | private Integer id;// 仓库管理员ID
13 | private String name;// 姓名
14 | private String sex;// 性别
15 | private String tel;// 联系电话
16 | private String address;// 地址
17 | private Date birth;// 出生日期
18 | private Integer repositoryBelongID;// 所属仓库ID
19 |
20 |
21 | public Integer getRepositoryBelongID() {
22 | return repositoryBelongID;
23 | }
24 |
25 | public void setRepositoryBelongID(Integer repositoryBelongID) {
26 | this.repositoryBelongID = repositoryBelongID;
27 | }
28 |
29 | public Integer getId() {
30 | return id;
31 | }
32 |
33 | public void setId(Integer id) {
34 | this.id = id;
35 | }
36 |
37 | public String getName() {
38 | return name;
39 | }
40 |
41 | public void setName(String name) {
42 | this.name = name;
43 | }
44 |
45 | public String getSex() {
46 | return sex;
47 | }
48 |
49 | public void setSex(String sex) {
50 | this.sex = sex;
51 | }
52 |
53 | public String getTel() {
54 | return tel;
55 | }
56 |
57 | public void setTel(String tel) {
58 | this.tel = tel;
59 | }
60 |
61 | public String getAddress() {
62 | return address;
63 | }
64 |
65 | public void setAddress(String address) {
66 | this.address = address;
67 | }
68 |
69 | public Date getBirth() {
70 | return birth;
71 | }
72 |
73 | public void setBirth(Date birth) {
74 | this.birth = birth;
75 | }
76 |
77 | @Override
78 | public String toString() {
79 | return "RepositoryAdmin [id=" + id + ", name=" + name + ", sex=" + sex + ", tel=" + tel + ", address=" + address
80 | + ", birth=" + birth + ", repositoryBelongID=" + repositoryBelongID + "]";
81 | }
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserOperationRecordMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
37 |
38 |
39 | insert into wms_operation_record(USER_ID, USER_NAME, OPERATION_NAME, OPERATION_TIME, OPERATION_RESULT)
40 | values(#{userID}, #{userName}, #{operationName}, #{operationTime}, #{operationResult})
41 |
42 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/AccessRecordMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | insert into wms_access_record(USER_ID, USER_NAME, ACCESS_TYPE, ACCESS_TIME, ACCESS_IP)
18 | values(#{userID}, #{userName}, #{accessType}, #{accessTime}, #{accessIP})
19 |
20 |
21 |
46 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/UserInfoMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
24 |
25 |
35 |
36 |
44 |
45 |
46 | insert into wms_user(USER_ID,USER_USERNAME,USER_PASSWORD)
47 | values (#{userID},#{userName},#{password})
48 |
49 |
50 |
51 | update wms_user set
52 | USER_USERNAME = #{userName},
53 | USER_PASSWORD = #{password}
54 | where
55 | USER_ID = #{userID}
56 |
57 |
58 |
59 | delete from wms_user
60 | where
61 | USER_ID = #{userID}
62 |
63 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/Storage.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 仓库库存
5 | *
6 | * @author Ken
7 | *
8 | */
9 | public class Storage {
10 |
11 | private Integer goodsID;// 货物ID
12 | private String goodsName;// 货物名称
13 | private String goodsSize;// 货物规格
14 | private String goodsType;// 货物类型
15 | private Double goodsValue;// 货物价值
16 | private Integer repositoryID;// 仓库ID
17 | private Long number;// 库存数量
18 |
19 | public Integer getGoodsID() {
20 | return goodsID;
21 | }
22 |
23 | public void setGoodsID(Integer goodsID) {
24 | this.goodsID = goodsID;
25 | }
26 |
27 | public String getGoodsName() {
28 | return goodsName;
29 | }
30 |
31 | public void setGoodsName(String goodsName) {
32 | this.goodsName = goodsName;
33 | }
34 |
35 | public String getGoodsSize() {
36 | return goodsSize;
37 | }
38 |
39 | public void setGoodsSize(String goodsSize) {
40 | this.goodsSize = goodsSize;
41 | }
42 |
43 | public String getGoodsType() {
44 | return goodsType;
45 | }
46 |
47 | public void setGoodsType(String goodsType) {
48 | this.goodsType = goodsType;
49 | }
50 |
51 | public Double getGoodsValue() {
52 | return goodsValue;
53 | }
54 |
55 | public void setGoodsValue(Double goodsValue) {
56 | this.goodsValue = goodsValue;
57 | }
58 |
59 | public Integer getRepositoryID() {
60 | return repositoryID;
61 | }
62 |
63 | public void setRepositoryID(Integer repositoryID) {
64 | this.repositoryID = repositoryID;
65 | }
66 |
67 | public Long getNumber() {
68 | return number;
69 | }
70 |
71 | public void setNumber(Long number) {
72 | this.number = number;
73 | }
74 |
75 | @Override
76 | public String toString() {
77 | return "Storage [goodsID=" + goodsID + ", goodsName=" + goodsName + ", goodsSize=" + goodsSize + ", goodsType="
78 | + goodsType + ", goodsValue=" + goodsValue + ", repositoryID=" + repositoryID + ", number=" + number
79 | + "]";
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/util/aop/ServiceLogging.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.util.aop;
2 |
3 | import org.aspectj.lang.JoinPoint;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 |
7 |
8 | /**
9 | * Service层日志处理
10 | *
11 | * @author Ken
12 | * @since 2017/3/8.
13 | */
14 | public class ServiceLogging {
15 |
16 | private static Logger exceptionLogger = LoggerFactory.getLogger("ExceptionLogging");
17 | private static Logger methodInvokeLogger = LoggerFactory.getLogger("MethodInvokeLogging");
18 |
19 | /**
20 | * 捕获Service层抛出的异常并做日志
21 | *
22 | * @param throwable 方法抛出的异常
23 | */
24 | public void loggingServiceException(Throwable throwable) {
25 | if (exceptionLogger.isErrorEnabled()) {
26 | StringBuilder builder = new StringBuilder();
27 | builder.append("cause:").append(throwable.getMessage());
28 | builder.append("\n\tstackTrack:\n");
29 | for (StackTraceElement stack : throwable.getStackTrace()) {
30 | builder.append("\t\t");
31 | builder.append(stack.toString());
32 | builder.append("\n");
33 | }
34 | exceptionLogger.error(builder.toString());
35 | }
36 | }
37 |
38 | /**
39 | * 记录Service方法的调用
40 | *
41 | * @param joinPoint 切入点
42 | */
43 | public void loggingMethodInvoked(JoinPoint joinPoint) {
44 | if (methodInvokeLogger.isDebugEnabled()) {
45 | String methodName = joinPoint.getSignature().getName();
46 | Object[] args = joinPoint.getArgs();
47 | StringBuilder builder = new StringBuilder();
48 | builder.append("Invoked Method:").append(methodName);
49 | builder.append("\targs:");
50 | for (Object arg : args) {
51 | builder.append(arg.toString());
52 | }
53 | methodInvokeLogger.debug(builder.toString());
54 | }
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/util/aop/UserOperationLogging.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.util.aop;
2 |
3 | import com.ken.wms.common.service.Interface.SystemLogService;
4 | import com.ken.wms.exception.SystemLogServiceException;
5 | import org.apache.shiro.SecurityUtils;
6 | import org.apache.shiro.session.Session;
7 | import org.apache.shiro.subject.Subject;
8 | import org.aspectj.lang.JoinPoint;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 |
11 | /**
12 | * 用户操作日志记录
13 | *
14 | * @author Ken
15 | * @since 2017/4/8.
16 | */
17 | public class UserOperationLogging {
18 |
19 | @Autowired
20 | private SystemLogService systemLogService;
21 |
22 | /**
23 | * 记录用户操作
24 | *
25 | * @param joinPoint 切入点信息
26 | */
27 | public void loggingUserOperation(JoinPoint joinPoint, Object returnValue, UserOperation userOperation){
28 |
29 | if (userOperation != null) {
30 | // 获取 annotation 的值
31 | String userOperationValue = userOperation.value();
32 |
33 | // 获取调用的方法名
34 | String methodName = joinPoint.getSignature().getName();
35 |
36 | // 获取除 import* export* 外的方法的返回值
37 | String invokedResult = "-";
38 | if (!methodName.matches("^import\\w*") && !methodName.matches("^export\\w*")){
39 | if (returnValue instanceof Boolean) {
40 | boolean result = (boolean) returnValue;
41 | invokedResult = result ? "成功" : "失败";
42 | }
43 | }
44 |
45 | // 获取用户信息
46 | Subject currentSubject = SecurityUtils.getSubject();
47 | Session session = currentSubject.getSession();
48 | Integer userID = (Integer) session.getAttribute("userID");
49 | String userName = (String) session.getAttribute("userName");
50 |
51 | // 插入记录
52 | try{
53 | systemLogService.insertUserOperationRecord(userID, userName, userOperationValue, invokedResult);
54 | } catch (SystemLogServiceException e) {
55 | // do log
56 | }
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/StockRecordManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 | import com.ken.wms.exception.StockRecordManageServiceException;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 出入库管理
9 | *
10 | * @author Ken
11 | */
12 | public interface StockRecordManageService {
13 |
14 | /**
15 | * 货物入库操作
16 | *
17 | * @param supplierID 供应商ID
18 | * @param goodsID 货物ID
19 | * @param repositoryID 入库仓库ID
20 | * @param number 入库数量
21 | * @return 返回一个boolean 值,若值为true表示入库成功,否则表示入库失败
22 | */
23 | boolean stockInOperation(Integer supplierID, Integer goodsID, Integer repositoryID, long number, String personInCharge) throws StockRecordManageServiceException;
24 |
25 | /**
26 | * 货物出库操作
27 | *
28 | * @param customerID 客户ID
29 | * @param goodsID 货物ID
30 | * @param repositoryID 出库仓库ID
31 | * @param number 出库数量
32 | * @return 返回一个boolean值,若值为true表示出库成功,否则表示出库失败
33 | */
34 | boolean stockOutOperation(Integer customerID, Integer goodsID, Integer repositoryID, long number, String personInCharge) throws StockRecordManageServiceException;
35 |
36 | /**
37 | * 查询出入库记录
38 | *
39 | * @param repositoryID 仓库ID
40 | * @param endDateStr 查询记录起始日期
41 | * @param startDateStr 查询记录结束日期
42 | * @param searchType 记录查询方式
43 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
44 | */
45 | Map selectStockRecord(Integer repositoryID, String startDateStr, String endDateStr, String searchType) throws StockRecordManageServiceException;
46 |
47 | /**
48 | * 分页查询出入库记录
49 | *
50 | * @param repositoryID 仓库ID
51 | * @param endDateStr 查询记录起始日期
52 | * @param startDateStr 查询记录结束日期
53 | * @param searchType 记录查询方式
54 | * @param offset 分页偏移值
55 | * @param limit 分页大小
56 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
57 | */
58 | Map selectStockRecord(Integer repositoryID, String startDateStr, String endDateStr, String searchType, int offset, int limit) throws StockRecordManageServiceException;
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StockInMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.StockInDO;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.Date;
8 | import java.util.List;
9 |
10 | /**
11 | * 入库记录映射器
12 | *
13 | * @author Ken
14 | */
15 | @Repository
16 | public interface StockInMapper {
17 |
18 | /**
19 | * 选择全部的入库记录
20 | *
21 | * @return 返回全部的入库记录
22 | */
23 | List selectAll();
24 |
25 | /**
26 | * 选择指定供应商ID相关的入库记录
27 | *
28 | * @param supplierID 指定的供应商ID
29 | * @return 返回指定供应商相关的入库记录
30 | */
31 | List selectBySupplierId(Integer supplierID);
32 |
33 | /**
34 | * 选择指定货物ID相关的入库记录
35 | *
36 | * @param goodID 指定的货物ID
37 | * @return 返回指定货物相关的入库记录
38 | */
39 | List selectByGoodID(Integer goodID);
40 |
41 | /**
42 | * 选择指定仓库ID相关的入库记录
43 | *
44 | * @param repositoryID 指定的仓库ID
45 | * @return 返回指定仓库相关的入库记录
46 | */
47 | List selectByRepositoryID(Integer repositoryID);
48 |
49 | /**
50 | * 选择指定仓库ID以及指定日期范围内的入库记录
51 | *
52 | * @param repositoryID 指定的仓库ID
53 | * @param startDate 记录的起始日期
54 | * @param endDate 记录的结束日期
55 | * @return 返回所有符合要求的入库记录
56 | */
57 | List selectByRepositoryIDAndDate(@Param("repositoryID") Integer repositoryID,
58 | @Param("startDate") Date startDate,
59 | @Param("endDate") Date endDate);
60 |
61 | /**
62 | * 选择指定入库记录的ID的入库记录
63 | *
64 | * @param id 入库记录ID
65 | * @return 返回指定ID的入库记录
66 | */
67 | StockInDO selectByID(Integer id);
68 |
69 | /**
70 | * 添加一条新的入库记录
71 | *
72 | * @param stockInDO 入库记录
73 | */
74 | void insert(StockInDO stockInDO);
75 |
76 | /**
77 | * 更新入库记录
78 | *
79 | * @param stockInDO 入库记录
80 | */
81 | void update(StockInDO stockInDO);
82 |
83 | /**
84 | * 删除指定ID的入库记录
85 | *
86 | * @param id 指定删除入库记录的ID
87 | */
88 | void deleteByID(Integer id);
89 | }
90 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StorageMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.Storage;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * 库存信息映射器
12 | * @author Ken
13 | *
14 | */
15 | @Repository
16 | public interface StorageMapper {
17 |
18 | /**
19 | * 选择所有的库存信息
20 | * @return 返回所有的库存信息
21 | */
22 | List selectAllAndRepositoryID(@Param("repositoryID") Integer repositoryID);
23 |
24 | /**
25 | * 选择指定货物ID和仓库ID的库存信息
26 | * @param goodsID 货物ID
27 | * @param repositoryID 库存ID
28 | * @return 返回所有指定货物ID和仓库ID的库存信息
29 | */
30 | List selectByGoodsIDAndRepositoryID(@Param("goodsID") Integer goodsID,
31 | @Param("repositoryID") Integer repositoryID);
32 |
33 | /**
34 | * 选择指定货物名的库存信息
35 | * @param goodsName 货物名称
36 | * @return 返回所有指定货物名称的库存信息
37 | */
38 | List selectByGoodsNameAndRepositoryID(@Param("goodsName") String goodsName,
39 | @Param("repositoryID") Integer repositoryID);
40 |
41 | /**
42 | * 选择指定货物类型的库存信息
43 | * @param goodsType 货物类型
44 | * @return 返回所有指定货物类型的库存信息
45 | */
46 | List selectByGoodsTypeAndRepositoryID(@Param("goodsType") String goodsType,
47 | @Param("repositoryID") Integer repositoryID);
48 |
49 | /**
50 | * 更新库存信息
51 | * 该库存信息必需已经存在于数据库当中,否则更新无效
52 | * @param storage 库存信息
53 | */
54 | void update(Storage storage);
55 |
56 | /**
57 | * 插入新的库存信息
58 | * @param storage 库存信息
59 | */
60 | void insert(Storage storage);
61 |
62 | /**
63 | * 批量导入库存信息
64 | * @param storages 若干条库存信息
65 | */
66 | void insertBatch(List storages);
67 |
68 | /**
69 | * 删除指定货物ID的库存信息
70 | * @param goodsID 货物ID
71 | */
72 | void deleteByGoodsID(Integer goodsID);
73 |
74 | /**
75 | * 删除指定仓库的库存信息
76 | * @param repositoryID 仓库ID
77 | */
78 | void deleteByRepositoryID(Integer repositoryID);
79 |
80 | /**
81 | * 删除指定仓库中的指定货物的库存信息
82 | * @param goodsID 货物ID
83 | * @param repositoryID 仓库ID
84 | */
85 | void deleteByRepositoryIDAndGoodsID(@Param("goodsID") Integer goodsID, @Param("repositoryID") Integer repositoryID);
86 | }
87 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StockOutMapper.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.dao;
2 |
3 | import com.ken.wms.domain.StockOutDO;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.springframework.stereotype.Repository;
6 |
7 | import java.util.Date;
8 | import java.util.List;
9 |
10 | /**
11 | * 出库记录 映射器
12 | *
13 | * @author Ken
14 | */
15 | @Repository
16 | public interface StockOutMapper {
17 |
18 | /**
19 | * 选择全部的出库记录
20 | *
21 | * @return 返回所有的出库记录
22 | */
23 | List selectAll();
24 |
25 | /**
26 | * 选择指定客户ID相关的出库记录
27 | *
28 | * @param customerId 指定的客户ID
29 | * @return 返回指定客户相关的出库记录
30 | */
31 | List selectByCustomerId(Integer customerId);
32 |
33 | /**
34 | * 选择指定货物ID相关的出库记录
35 | *
36 | * @param goodId 指定的货物ID
37 | * @return 返回指定货物ID相关的出库记录
38 | */
39 | List selectByGoodId(Integer goodId);
40 |
41 | /**
42 | * 选择指定仓库ID关联的出库记录
43 | *
44 | * @param repositoryID 指定的仓库ID
45 | * @return 返回指定仓库ID相关的出库记录
46 | */
47 | List selectByRepositoryID(Integer repositoryID);
48 |
49 | /**
50 | * 选择指定仓库ID以及指定日期范围内的出库记录
51 | *
52 | * @param repositoryID 指定的仓库ID
53 | * @param startDate 记录起始日期
54 | * @param endDate 记录结束日期
55 | * @return 返回所有符合指定要求的出库记录
56 | */
57 | List selectByRepositoryIDAndDate(@Param("repositoryID") Integer repositoryID,
58 | @Param("startDate") Date startDate,
59 | @Param("endDate") Date endDate);
60 |
61 | /**
62 | * 选择指定ID的出库记录
63 | *
64 | * @param id 指定的出库记录ID
65 | * @return 返回指定ID的出库记录
66 | */
67 | StockOutDO selectById(Integer id);
68 |
69 | /**
70 | * 插入一条新的出库记录
71 | *
72 | * @param stockOutDO 出库记录
73 | */
74 | void insert(StockOutDO stockOutDO);
75 |
76 | /**
77 | * 更新出库记录
78 | *
79 | * @param stockOutDO 出库记录
80 | */
81 | void update(StockOutDO stockOutDO);
82 |
83 | /**
84 | * 删除指定ID的出库记录
85 | *
86 | * @param id 指定的出库记录ID
87 | */
88 | void deleteById(Integer id);
89 | }
90 |
--------------------------------------------------------------------------------
/src/main/webapp/pagecomponent/welcomePage.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
18 |
19 |
20 |
21 |
22 | - 主页
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
39 |
40 |
49 |
50 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/util/Response.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.util;
2 |
3 | import org.apache.commons.collections.map.HashedMap;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * controller 返回的信息载体 response
9 | * @author ken
10 | *
11 | * Created by Ken on 2017/1/18.
12 | */
13 | public class Response {
14 |
15 | public static final String RESPONSE_RESULT_SUCCESS = "success";
16 | public static final String RESPONSE_RESULT_ERROR = "error";
17 |
18 | // response 中可能使用的值
19 | private static final String RESPONSE_RESULT = "result";
20 | private static final String RESPONSE_MSG = "msg";
21 | private static final String RESPONSE_DATA = "data";
22 | private static final String RESPONSE_TOTAL = "total";
23 |
24 | // 存放响应中的信息
25 | private Map responseContent;
26 |
27 | // Constructor
28 | Response() {
29 | this.responseContent = new HashedMap(10);
30 | }
31 |
32 | /**
33 | * 设置 response 的状态
34 | * @param result response 的状态,值为 success 或 error
35 | */
36 | public void setResponseResult(String result){
37 | this.responseContent.put(Response.RESPONSE_RESULT,result);
38 | }
39 |
40 | /**
41 | * 设置 response 的附加信息
42 | * @param msg response 的附加信息
43 | */
44 | public void setResponseMsg(String msg){
45 | this.responseContent.put(Response.RESPONSE_MSG,msg);
46 | }
47 |
48 | /**
49 | * 设置 response 中携带的数据
50 | * @param data response 中携带的数据
51 | */
52 | public void setResponseData(Object data){
53 | this.responseContent.put(Response.RESPONSE_DATA,data);
54 | }
55 |
56 | /**
57 | * 设置 response 中携带数据的数量,与 RESPONSE_DATA 配合使用
58 | * @param total 携带数据的数量
59 | */
60 | public void setResponseTotal(long total){
61 | this.responseContent.put(Response.RESPONSE_TOTAL,total);
62 | }
63 |
64 | /**
65 | * 设置 response 自定义信息
66 | * @param key 自定义信息的 key
67 | * @param value 自定义信息的值
68 | */
69 | public void setCustomerInfo(String key, Object value){
70 | this.responseContent.put(key,value);
71 | }
72 |
73 | /**
74 | * 生成 response
75 | * @return 代表 response 的一个 Map 对象
76 | */
77 | public Map generateResponse(){
78 | return this.responseContent;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/AccessRecordDTO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 登入登出记录DTO
5 | *
6 | * @author Ken
7 | * @since 2017/4/8.
8 | */
9 | public class AccessRecordDTO {
10 |
11 | /**
12 | * 登入登出记录ID
13 | */
14 | private Integer id;
15 |
16 | /**
17 | * 登陆用户ID
18 | */
19 | private Integer userID;
20 |
21 | /**
22 | * 登陆用户名
23 | */
24 | private String userName;
25 |
26 | /**
27 | * 登入或登出时间
28 | */
29 | private String accessTime;
30 |
31 | /**
32 | * 用户登入或登出对应的IP地址
33 | */
34 | private String accessIP;
35 |
36 | /**
37 | * 记录类型,登入或登出
38 | */
39 | private String accessType;
40 |
41 | public Integer getId() {
42 | return id;
43 | }
44 |
45 | public Integer getUserID() {
46 | return userID;
47 | }
48 |
49 | public String getUserName() {
50 | return userName;
51 | }
52 |
53 | public String getAccessTime() {
54 | return accessTime;
55 | }
56 |
57 | public String getAccessIP() {
58 | return accessIP;
59 | }
60 |
61 | public String getAccessType() {
62 | return accessType;
63 | }
64 |
65 | public void setId(Integer id) {
66 | this.id = id;
67 | }
68 |
69 | public void setUserID(Integer userID) {
70 | this.userID = userID;
71 | }
72 |
73 | public void setUserName(String userName) {
74 | this.userName = userName;
75 | }
76 |
77 | public void setAccessTime(String accessTime) {
78 | this.accessTime = accessTime;
79 | }
80 |
81 | public void setAccessIP(String accessIP) {
82 | this.accessIP = accessIP;
83 | }
84 |
85 | public void setAccessType(String accessType) {
86 | this.accessType = accessType;
87 | }
88 |
89 | @Override
90 | public String toString() {
91 | return "AccessRecordDTO{" +
92 | "id=" + id +
93 | ", userID=" + userID +
94 | ", userName='" + userName + '\'' +
95 | ", accessTime='" + accessTime + '\'' +
96 | ", accessIP='" + accessIP + '\'' +
97 | ", accessType='" + accessType + '\'' +
98 | '}';
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/AccessRecordDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * 用户登入登出记录
7 | *
8 | * @author Ken
9 | * @since 2017/3/5.
10 | */
11 | public class AccessRecordDO {
12 |
13 | /**
14 | * 登入登出记录ID
15 | * 仅当该记录从数据库取出时有效
16 | */
17 | private Integer id;
18 |
19 | /**
20 | * 登陆用户ID
21 | */
22 | private Integer userID;
23 |
24 | /**
25 | * 登陆用户名
26 | */
27 | private String userName;
28 |
29 | /**
30 | * 记录类型,登入或登出
31 | */
32 | private String accessType;
33 |
34 | /**
35 | * 登入或登出时间
36 | */
37 | private Date accessTime;
38 |
39 | /**
40 | * 用户登入或登出对应的IP地址
41 | */
42 | private String accessIP;
43 |
44 | public Integer getId() {
45 | return id;
46 | }
47 |
48 | public Integer getUserID() {
49 | return userID;
50 | }
51 |
52 | public String getUserName() {
53 | return userName;
54 | }
55 |
56 | public String getAccessIP() {
57 | return accessIP;
58 | }
59 |
60 | public String getAccessType() {
61 | return accessType;
62 | }
63 |
64 | public Date getAccessTime() {
65 | return accessTime;
66 | }
67 |
68 | public void setId(Integer id) {
69 | this.id = id;
70 | }
71 |
72 | public void setUserID(Integer userID) {
73 | this.userID = userID;
74 | }
75 |
76 | public void setUserName(String userName) {
77 | this.userName = userName;
78 | }
79 |
80 | public void setAccessType(String accessType) {
81 | this.accessType = accessType;
82 | }
83 |
84 | public void setAccessTime(Date accessTime) {
85 | this.accessTime = accessTime;
86 | }
87 |
88 | public void setAccessIP(String accessIP) {
89 | this.accessIP = accessIP;
90 | }
91 |
92 | @Override
93 | public String toString() {
94 | return "AccessRecordDO{" +
95 | "id=" + id +
96 | ", userID=" + userID +
97 | ", userName='" + userName + '\'' +
98 | ", accessType='" + accessType + '\'' +
99 | ", accessTime=" + accessTime +
100 | ", accessIP='" + accessIP + '\'' +
101 | '}';
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/UserOperationRecordDTO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 用户操作记录DTO
5 | *
6 | * @author Ken
7 | * @since 2017/4/9.
8 | */
9 | public class UserOperationRecordDTO {
10 |
11 | /**
12 | * 操作记录ID
13 | */
14 | private Integer id;
15 |
16 | /**
17 | * 执行操作的用户ID
18 | */
19 | private Integer userID;
20 |
21 | /**
22 | * 执行操作的用户名
23 | */
24 | private String userName;
25 |
26 | /**
27 | * 操作的名称
28 | */
29 | private String operationName;
30 |
31 | /**
32 | * 操作执行的时间
33 | */
34 | private String operationTime;
35 |
36 | /**
37 | * 操作执行的结果
38 | */
39 | private String operationResult;
40 |
41 | public Integer getId() {
42 | return id;
43 | }
44 |
45 | public Integer getUserID() {
46 | return userID;
47 | }
48 |
49 | public String getUserName() {
50 | return userName;
51 | }
52 |
53 | public String getOperationName() {
54 | return operationName;
55 | }
56 |
57 | public String getOperationTime() {
58 | return operationTime;
59 | }
60 |
61 | public String getOperationResult() {
62 | return operationResult;
63 | }
64 |
65 | public void setId(Integer id) {
66 | this.id = id;
67 | }
68 |
69 | public void setUserID(Integer userID) {
70 | this.userID = userID;
71 | }
72 |
73 | public void setUserName(String userName) {
74 | this.userName = userName;
75 | }
76 |
77 | public void setOperationName(String operationName) {
78 | this.operationName = operationName;
79 | }
80 |
81 | public void setOperationTime(String operationTime) {
82 | this.operationTime = operationTime;
83 | }
84 |
85 | public void setOperationResult(String operationResult) {
86 | this.operationResult = operationResult;
87 | }
88 |
89 | @Override
90 | public String toString() {
91 | return "UserOperationRecordDTO{" +
92 | "id=" + id +
93 | ", userID=" + userID +
94 | ", userName='" + userName + '\'' +
95 | ", operationName='" + operationName + '\'' +
96 | ", operationTime='" + operationTime + '\'' +
97 | ", operationResult='" + operationResult + '\'' +
98 | '}';
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/UserOperationRecordDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * 用户操作记录DO
7 | *
8 | * @author Ken
9 | * @since 2017/4/9.
10 | */
11 | public class UserOperationRecordDO {
12 |
13 | /**
14 | * 记录ID
15 | */
16 | private Integer id;
17 |
18 | /**
19 | * 执行操作的用户ID
20 | */
21 | private Integer userID;
22 |
23 | /**
24 | * 执行操作的用户名
25 | */
26 | private String userName;
27 |
28 | /**
29 | * 操作的名称
30 | */
31 | private String operationName;
32 |
33 | /**
34 | * 执行操作的时间
35 | */
36 | private Date operationTime;
37 |
38 | /**
39 | * 执行操作结果
40 | */
41 | private String operationResult;
42 |
43 | public void setId(Integer id) {
44 | this.id = id;
45 | }
46 |
47 | public void setUserID(Integer userID) {
48 | this.userID = userID;
49 | }
50 |
51 | public void setUserName(String userName) {
52 | this.userName = userName;
53 | }
54 |
55 | public void setOperationName(String operationName) {
56 | this.operationName = operationName;
57 | }
58 |
59 | public void setOperationTime(Date operationTime) {
60 | this.operationTime = operationTime;
61 | }
62 |
63 | public void setOperationResult(String operationResult) {
64 | this.operationResult = operationResult;
65 | }
66 |
67 | public Integer getId() {
68 | return id;
69 | }
70 |
71 | public Integer getUserID() {
72 | return userID;
73 | }
74 |
75 | public String getUserName() {
76 | return userName;
77 | }
78 |
79 | public String getOperationName() {
80 | return operationName;
81 | }
82 |
83 | public Date getOperationTime() {
84 | return operationTime;
85 | }
86 |
87 | public String getOperationResult() {
88 | return operationResult;
89 | }
90 |
91 | @Override
92 | public String toString() {
93 | return "UserOperationRecordDO{" +
94 | "id=" + id +
95 | ", userID=" + userID +
96 | ", userName='" + userName + '\'' +
97 | ", operationName='" + operationName + '\'' +
98 | ", operationTime=" + operationTime +
99 | ", operationResult='" + operationResult + '\'' +
100 | '}';
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/listener/AccountSessionListener.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.listener;
2 |
3 | import com.ken.wms.common.service.Interface.SystemLogService;
4 | import com.ken.wms.dao.AccessRecordMapper;
5 | import com.ken.wms.domain.AccessRecordDO;
6 | import com.ken.wms.exception.SystemLogServiceException;
7 | import org.springframework.beans.BeansException;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.context.ApplicationContext;
10 | import org.springframework.context.ApplicationContextAware;
11 | import org.springframework.stereotype.Component;
12 | import org.springframework.web.context.WebApplicationContext;
13 |
14 | import javax.servlet.http.HttpSession;
15 | import javax.servlet.http.HttpSessionEvent;
16 | import javax.servlet.http.HttpSessionListener;
17 | import java.util.Date;
18 |
19 | /**
20 | * 用户Session监听器
21 | * 当用户session注销时,记录用户账户登出的时间
22 | *
23 | * @author Ken
24 | * @since 2017/3/4.
25 | */
26 | @Component
27 | public class AccountSessionListener implements HttpSessionListener, ApplicationContextAware{
28 |
29 | @Autowired
30 | private SystemLogService systemLogService;
31 |
32 | @Override
33 | public void sessionCreated(HttpSessionEvent se) {
34 | // 当session被创建时
35 | }
36 |
37 | @Override
38 | public void sessionDestroyed(HttpSessionEvent se) {
39 | // 获取用户的session
40 | HttpSession session = se.getSession();
41 |
42 | // 判断是否为已经登陆的用户
43 | // 判断依据是isAuthentication的值
44 | try {
45 | String isAuthenticate = (String) session.getAttribute("isAuthenticate");
46 | if (isAuthenticate != null && isAuthenticate.equals("true")) {
47 | Integer userID = (Integer) session.getAttribute("userID");
48 | String userName = (String) session.getAttribute("userName");
49 | String accessIP = "-";
50 | systemLogService.insertAccessRecord(userID, userName, accessIP, SystemLogService.ACCESS_TYPE_LOGOUT);
51 | }
52 | } catch (SystemLogServiceException e) {
53 | // do log
54 | }
55 | }
56 |
57 | @Override
58 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
59 | if (applicationContext instanceof WebApplicationContext){
60 | ((WebApplicationContext)applicationContext).getServletContext().addListener(this);
61 | }else{
62 | throw new RuntimeException();
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/GoodsMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
26 |
27 |
39 |
40 |
52 |
53 |
65 |
66 |
67 | insert into wms_goods(GOOD_NAME,GOOD_RYPE,GOOD_SIZE,GOOD_VALUE)
68 | values (#{name},#{type},#{size},#{value})
69 |
70 |
71 |
72 | insert into wms_goods(GOOD_NAME,GOOD_RYPE,GOOD_SIZE,GOOD_VALUE)
73 | values
74 |
75 | (#{goods.name},#{goods.type},#{goods.size},#{goods.value})
76 |
77 |
78 |
79 |
80 | update
81 | wms_goods
82 | set
83 | GOOD_NAME = #{name},
84 | GOOD_RYPE = #{type},
85 | GOOD_SIZE = #{size},
86 | GOOD_VALUE = #{value}
87 | where
88 | GOOD_ID = #{id}
89 |
90 |
91 |
92 | delete from wms_goods
93 | where GOOD_ID = #{id}
94 |
95 |
96 |
97 | delete from wms_goods
98 | where GOOD_NAME = #{goodsName}
99 |
100 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/util/CheckCodeGenerator.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.util;
2 |
3 |
4 | import org.springframework.stereotype.Component;
5 |
6 | import java.awt.*;
7 | import java.awt.geom.Line2D;
8 | import java.awt.image.BufferedImage;
9 | import java.util.HashMap;
10 | import java.util.Map;
11 | import java.util.Random;
12 |
13 | /**
14 | * 图形验证码产生器
15 | * @author Ken
16 | *
17 | */
18 | @Component
19 | public class CheckCodeGenerator {
20 |
21 | private static char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
22 | 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
23 |
24 | private static int width = 80;// 生成验证码的宽度
25 | private static int height = 35;// 生成验证码的高度
26 | private static int codeCount = 4;// 验证码个数
27 | private static int lineCounr = 20;
28 | private static Font font;// 验证码字体样式
29 |
30 | static {
31 | font = new Font("楷体", Font.BOLD|Font.ITALIC, 25);
32 | }
33 |
34 | /**
35 | * 获取验证码
36 | * @return
37 | */
38 | public Map generlateCheckCode() {
39 |
40 | // 存储验证码
41 | StringBuilder codeBuilder = new StringBuilder();
42 |
43 | Random random = new Random();
44 |
45 | // 创建 BufferedImage 对象
46 | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
47 | // 创建Grapchics2D对象
48 | Graphics graphics = image.getGraphics();
49 | Graphics2D graphics2d = (Graphics2D) graphics;
50 |
51 | // 设置图片
52 | graphics.setColor(Color.white);
53 | graphics.fillRect(1, 1, width - 2, height - 2);
54 | graphics.setFont(font);
55 |
56 | graphics.setColor(Color.gray);
57 | // 绘制颜色和位置全部为随机产生的线条,该线条为2f
58 | for (int i = 1; i <= lineCounr; i++) {
59 | int x = random.nextInt(width - 1);
60 | int y = random.nextInt(height - 1);
61 | int x1 = random.nextInt(width - 1);
62 | int y1 = random.nextInt(height - 1);
63 |
64 | Line2D line2d = new Line2D.Double(x, y, x1, y1);
65 |
66 | graphics2d.draw(line2d);
67 | }
68 |
69 | // 设置验证码中的内容
70 | for (int i = 0; i < codeCount; i++) {
71 | graphics.setColor(getRandColor());
72 | char c = codeSequence[random.nextInt(codeSequence.length - 1)];
73 | codeBuilder.append(c);
74 | graphics2d.drawString(c + "", 10 + 15 * i, 25);
75 | }
76 |
77 | Map checkCode = new HashMap();
78 | checkCode.put("checkCodeString", codeBuilder.toString());
79 | checkCode.put("checkCodeImage", image);
80 |
81 | return checkCode;
82 | }
83 |
84 | /**
85 | * 随机生成颜色
86 | *
87 | * @return
88 | */
89 | private Color getRandColor() {
90 | Random random = new Random();
91 |
92 | int r, g, b;
93 | r = random.nextInt(255);
94 | g = random.nextInt(255);
95 | b = random.nextInt(255);
96 |
97 | return new Color(r, g, b);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 | WMS
7 |
8 |
9 |
10 |
11 | springDispatcherServlet
12 | org.springframework.web.servlet.DispatcherServlet
13 |
14 | contextConfigLocation
15 | classpath:config/SpringMVCConfiguration.xml
16 |
17 | 1
18 |
19 |
20 |
21 |
22 | springDispatcherServlet
23 | /
24 |
25 |
26 |
27 |
28 | log4jConfigLocation
29 | classpath:config/log4j.properties
30 |
31 |
32 | org.springframework.web.util.Log4jConfigListener
33 |
34 |
35 |
36 |
37 |
38 | shiroFilter
39 | org.springframework.web.filter.DelegatingFilterProxy
40 |
41 | targetFilterLifecycle
42 | true
43 |
44 |
45 |
46 | shiroFilter
47 | /*
48 |
49 |
50 |
51 |
52 |
53 | contextConfigLocation
54 | classpath:config/SpringApplicationConfiguration.xml
55 |
56 |
57 |
58 |
59 | org.springframework.web.context.ContextLoaderListener
60 |
61 |
62 |
63 | 404
64 | /errorPage/404Error.html
65 |
66 |
67 | 500
68 | /errorPage/500Error.html
69 |
70 |
71 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/SystemLogService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 | import com.ken.wms.exception.SystemLogServiceException;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * 系统操作日志Service接口
9 | *
10 | * @author Ken
11 | * @since 2017/4/7.
12 | */
13 | public interface SystemLogService {
14 |
15 | String ACCESS_TYPE_LOGIN = "login";
16 | String ACCESS_TYPE_LOGOUT = "logout";
17 |
18 | /**
19 | * 插入用户登入登出记录
20 | *
21 | * @param userID 用户ID
22 | * @param userName 用户名
23 | * @param accessIP 登陆IP
24 | * @param accessType 记录类型
25 | */
26 | void insertAccessRecord(Integer userID, String userName, String accessIP, String accessType) throws SystemLogServiceException;
27 |
28 | /**
29 | * 查询指定用户ID、记录类型或日期范围的登入登出记录
30 | *
31 | * @param userID 用户ID
32 | * @param accessType 记录类型
33 | * @param startDateStr 记录起始日期
34 | * @param endDateStr 记录结束日期
35 | * @return 返回一个Map, 其中键值为 data 的值为所有符合条件的记录, 而键值为 total 的值为符合条件的记录总条数
36 | */
37 | Map selectAccessRecord(Integer userID, String accessType, String startDateStr, String endDateStr) throws SystemLogServiceException;
38 |
39 | /**
40 | * 分页查询指定用户ID、记录类型或日期范围的登入登出记录
41 | *
42 | * @param userID 用户ID
43 | * @param accessType 记录类型
44 | * @param startDateStr 记录起始日期
45 | * @param endDateStr 记录结束日期
46 | * @param offset 分页偏移值
47 | * @param limit 分页大小
48 | * @return 返回一个Map, 其中键值为 data 的值为所有符合条件的记录, 而键值为 total 的值为符合条件的记录总条数
49 | */
50 | Map selectAccessRecord(Integer userID, String accessType, String startDateStr, String endDateStr, int offset, int limit) throws SystemLogServiceException;
51 |
52 | /**
53 | * 插入用户操作记录
54 | *
55 | * @param userID 执行操作的用户ID
56 | * @param userName 执行操作的用户名
57 | * @param operationName 操作的名称
58 | * @param operationResult 操作的记过
59 | */
60 | void insertUserOperationRecord(Integer userID, String userName, String operationName, String operationResult) throws SystemLogServiceException;
61 |
62 | /**
63 | * 查询指定用户ID或日期范围的用户操作记录
64 | *
65 | * @param userID 用户ID
66 | * @param startDateStr 记录的起始日期
67 | * @param endDateStr 记录的结束日期
68 | * @return 返回一个Map, 其中键值为 data 的值为所有符合条件的记录, 而键值为 total 的值为符合条件的记录总条数
69 | */
70 | Map selectUserOperationRecord(Integer userID, String startDateStr, String endDateStr) throws SystemLogServiceException;
71 |
72 | /**
73 | * 分页查询指定用户ID或日期范围的用户操作记录
74 | *
75 | * @param userID 用户ID
76 | * @param startDateStr 记录的起始日期
77 | * @param endDateStr 记录的结束日期
78 | * @param offset 分页的偏移值
79 | * @param limit 分页的大小
80 | * @return 返回一个Map, 其中键值为 data 的值为所有符合条件的记录, 而键值为 total 的值为符合条件的记录总条数
81 | */
82 | Map selectUserOperationRecord(Integer userID, String startDateStr, String endDateStr, int offset, int limit) throws SystemLogServiceException;
83 | }
84 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/GoodsManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.Goods;
5 | import com.ken.wms.exception.GoodsManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 货物信息管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface GoodsManageService {
18 |
19 | /**
20 | * 返回指定goods ID 的货物记录
21 | *
22 | * @param goodsId 货物ID
23 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
24 | */
25 | Map selectById(Integer goodsId) throws GoodsManageServiceException;
26 |
27 | /**
28 | * 返回指定 goods name 的货物记录
29 | * 支持查询分页以及模糊查询
30 | *
31 | * @param offset 分页的偏移值
32 | * @param limit 分页的大小
33 | * @param goodsName 货物的名称
34 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
35 | */
36 | Map selectByName(int offset, int limit, String goodsName) throws GoodsManageServiceException;
37 |
38 | /**
39 | * 返回指定 goods name 的货物记录
40 | * 支持模糊查询
41 | *
42 | * @param goodsName 货物名称
43 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
44 | */
45 | Map selectByName(String goodsName) throws GoodsManageServiceException;
46 |
47 | /**
48 | * 分页查询货物记录
49 | *
50 | * @param offset 分页的偏移值
51 | * @param limit 分页的大小
52 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
53 | */
54 | Map selectAll(int offset, int limit) throws GoodsManageServiceException;
55 |
56 | /**
57 | * 查询所有的货物记录
58 | *
59 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
60 | */
61 | Map selectAll() throws GoodsManageServiceException;
62 |
63 | /**
64 | * 添加货物记录
65 | *
66 | * @param goods 货物信息
67 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
68 | */
69 | boolean addGoods(Goods goods) throws GoodsManageServiceException;
70 |
71 | /**
72 | * 更新货物记录
73 | *
74 | * @param goods 供应商信息
75 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
76 | */
77 | boolean updateGoods(Goods goods) throws GoodsManageServiceException;
78 |
79 | /**
80 | * 删除货物记录
81 | *
82 | * @param goodsId 货物ID
83 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
84 | */
85 | boolean deleteGoods(Integer goodsId) throws GoodsManageServiceException;
86 |
87 | /**
88 | * 从文件中导入货物信息
89 | *
90 | * @param file 导入信息的文件
91 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
92 | */
93 | Map importGoods(MultipartFile file) throws GoodsManageServiceException;
94 |
95 | /**
96 | * 导出货物信息到文件中
97 | *
98 | * @param goods 包含若干条 Supplier 信息的 List
99 | * @return excel 文件
100 | */
101 | File exportGoods(List goods);
102 | }
103 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RepositoryMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
29 |
47 |
48 |
61 |
62 |
75 |
76 |
77 | insert into wms_respository(REPO_ADDRESS,REPO_STATUS,REPO_AREA,REPO_DESC)
78 | values(#{address},#{status},#{area},#{desc})
79 |
80 |
81 |
82 | insert into wms_respository(REPO_ADDRESS,REPO_STATUS,REPO_AREA,REPO_DESC)
83 | values
84 |
85 | (#{repository.address},#{repository.status},#{repository.area},#{repository.desc})
86 |
87 |
88 |
89 |
90 | update
91 | wms_respository
92 | set
93 | REPO_ADDRESS = #{address},
94 | REPO_STATUS = #{status},
95 | REPO_AREA = #{area},
96 | REPO_desc = #{desc}
97 | where
98 | REPO_ID = #{id}
99 |
100 |
101 |
102 | delete from wms_respository
103 | where REPO_ID = #{id}
104 |
105 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/StockInDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 |
4 | import java.util.Date;
5 |
6 | /**
7 | * 入库记录
8 | *
9 | * @author Ken
10 | */
11 | public class StockInDO {
12 |
13 | /**
14 | * 入库记录
15 | */
16 | private Integer id;
17 |
18 | /**
19 | * 供应商ID
20 | */
21 | private Integer supplierID;
22 |
23 | /**
24 | * 供应商名称
25 | */
26 | private String supplierName;
27 |
28 | /**
29 | * 商品ID
30 | */
31 | private Integer goodID;
32 |
33 | /**
34 | * 商品名称
35 | */
36 | private String goodName;
37 |
38 | /**
39 | * 入库仓库ID
40 | */
41 | private Integer repositoryID;
42 |
43 | /**
44 | * 入库数量
45 | */
46 | private long number;
47 |
48 | /**
49 | * 入库日期
50 | */
51 | private Date time;
52 |
53 | /**
54 | * 入库经手人
55 | */
56 | private String personInCharge;
57 |
58 | public Integer getRepositoryID() {
59 | return repositoryID;
60 | }
61 |
62 | public void setRepositoryID(Integer repositoryID) {
63 | this.repositoryID = repositoryID;
64 | }
65 |
66 | public Integer getSupplierID() {
67 | return supplierID;
68 | }
69 |
70 | public void setSupplierID(Integer supplierID) {
71 | this.supplierID = supplierID;
72 | }
73 |
74 | public Integer getGoodID() {
75 | return goodID;
76 | }
77 |
78 | public void setGoodID(Integer goodID) {
79 | this.goodID = goodID;
80 | }
81 |
82 | public Integer getId() {
83 | return id;
84 | }
85 |
86 | public void setId(Integer id) {
87 | this.id = id;
88 | }
89 |
90 | public String getSupplierName() {
91 | return supplierName;
92 | }
93 |
94 | public void setSupplierName(String supplierName) {
95 | this.supplierName = supplierName;
96 | }
97 |
98 | public String getGoodName() {
99 | return goodName;
100 | }
101 |
102 | public void setGoodName(String goodName) {
103 | this.goodName = goodName;
104 | }
105 |
106 | public long getNumber() {
107 | return number;
108 | }
109 |
110 | public void setNumber(long number) {
111 | this.number = number;
112 | }
113 |
114 | public Date getTime() {
115 | return time;
116 | }
117 |
118 | public void setTime(Date time) {
119 | this.time = time;
120 | }
121 |
122 | public String getPersonInCharge() {
123 | return personInCharge;
124 | }
125 |
126 | public void setPersonInCharge(String personInCharge) {
127 | this.personInCharge = personInCharge;
128 | }
129 |
130 | @Override
131 | public String toString() {
132 | return "StockInDO [id=" + id + ", supplierID=" + supplierID + ", supplierName=" + supplierName + ", goodID="
133 | + goodID + ", goodName=" + goodName + ", repositoryID=" + repositoryID + ", number=" + number
134 | + ", time=" + time + ", personInCharge=" + personInCharge + "]";
135 | }
136 |
137 | }
138 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/StockOutDO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 |
4 | import java.util.Date;
5 |
6 | /**
7 | * 出库记录
8 | *
9 | * @author Ken
10 | */
11 | public class StockOutDO {
12 |
13 | /**
14 | * 出库记录ID
15 | */
16 | private Integer id;
17 |
18 | /**
19 | * 客户ID
20 | */
21 | private Integer customerID;
22 |
23 | /**
24 | * 客户名称
25 | */
26 | private String customerName;
27 |
28 | /**
29 | * 商品ID
30 | */
31 | private Integer goodID;
32 |
33 | /**
34 | * 商品名称
35 | */
36 | private String goodName;
37 |
38 | /**
39 | * 出库仓库ID
40 | */
41 | private Integer repositoryID;
42 |
43 | /**
44 | * 商品出库数量
45 | */
46 | private long number;
47 |
48 | /**
49 | * 出库日期
50 | */
51 | private Date time;
52 |
53 | /**
54 | * 出库经手人
55 | */
56 | private String personInCharge;// 经手人
57 |
58 | public Integer getRepositoryID() {
59 | return repositoryID;
60 | }
61 |
62 | public void setRepositoryID(Integer repositoryID) {
63 | this.repositoryID = repositoryID;
64 | }
65 |
66 | public Integer getId() {
67 | return id;
68 | }
69 |
70 | public void setId(Integer id) {
71 | this.id = id;
72 | }
73 |
74 | public Integer getCustomerID() {
75 | return customerID;
76 | }
77 |
78 | public void setCustomerID(Integer customerID) {
79 | this.customerID = customerID;
80 | }
81 |
82 | public String getCustomerName() {
83 | return customerName;
84 | }
85 |
86 | public void setCustomerName(String customerName) {
87 | this.customerName = customerName;
88 | }
89 |
90 | public Integer getGoodID() {
91 | return goodID;
92 | }
93 |
94 | public void setGoodID(Integer goodID) {
95 | this.goodID = goodID;
96 | }
97 |
98 | public String getGoodName() {
99 | return goodName;
100 | }
101 |
102 | public void setGoodName(String goodName) {
103 | this.goodName = goodName;
104 | }
105 |
106 | public long getNumber() {
107 | return number;
108 | }
109 |
110 | public void setNumber(long number) {
111 | this.number = number;
112 | }
113 |
114 | public Date getTime() {
115 | return time;
116 | }
117 |
118 | public void setTime(Date time) {
119 | this.time = time;
120 | }
121 |
122 | public String getPersonInCharge() {
123 | return personInCharge;
124 | }
125 |
126 | public void setPersonInCharge(String personInCharge) {
127 | this.personInCharge = personInCharge;
128 | }
129 |
130 | @Override
131 | public String toString() {
132 | return "StockOutDO [id=" + id + ", customerID=" + customerID + ", customerName=" + customerName + ", goodID="
133 | + goodID + ", goodName=" + goodName + ", repositoryID=" + repositoryID + ", number=" + number
134 | + ", time=" + time + ", personInCharge=" + personInCharge + "]";
135 | }
136 |
137 | }
138 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/CustomerMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
29 |
42 |
43 |
56 |
57 |
70 |
71 |
72 | insert into wms_customer(CUSTOMER_NAME,CUSTOMER_PERSON,CUSTOMER_TEL,CUSTOMER_EMAIL,CUSTOMER_ADDRESS)
73 | values (#{name},#{personInCharge},#{tel},#{email},#{address})
74 |
75 |
76 |
77 | insert into wms_customer(CUSTOMER_NAME,CUSTOMER_PERSON,CUSTOMER_TEL,CUSTOMER_EMAIL,CUSTOMER_ADDRESS)
78 | values
79 |
80 | (#{customer.name},#{customer.personInCharge},#{customer.tel},#{customer.email},#{customer.address})
81 |
82 |
83 |
84 |
85 | update
86 | wms_customer
87 | set
88 | CUSTOMER_NAME = #{name},
89 | CUSTOMER_PERSON = #{personInCharge},
90 | CUSTOMER_TEL = #{tel},
91 | CUSTOMER_EMAIL = #{email},
92 | CUSTOMER_ADDRESS = #{address}
93 | where
94 | CUSTOMER_ID = #{id}
95 |
96 |
97 |
98 | delete from wms_customer
99 | where CUSTOMER_ID = #{id}
100 |
101 |
102 |
103 | delete from wms_customer
104 | where CUSTOMER_NAME = #{name}
105 |
106 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/domain/StockRecordDTO.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.domain;
2 |
3 | /**
4 | * 出库/入库记录DO
5 | *
6 | * @author Ken
7 | * @since 2017/4/5.
8 | */
9 | public class StockRecordDTO {
10 |
11 | /**
12 | * 记录ID
13 | */
14 | private Integer recordID;
15 |
16 | /**
17 | * 记录的类型(出库/入库)
18 | */
19 | private String type;
20 |
21 | /**
22 | * 供应商(入库)或客户(出库)名称
23 | */
24 | private String supplierOrCustomerName;
25 |
26 | /**
27 | * 商品名称
28 | */
29 | private String goodsName;
30 |
31 | /**
32 | * 出库或入库仓库ID
33 | */
34 | private Integer repositoryID;
35 |
36 | /**
37 | * 出库或入库数量
38 | */
39 | private long number;
40 |
41 | /**
42 | * 出库或入库时间
43 | */
44 | private String time;
45 |
46 | /**
47 | * 出库或入库经手人
48 | */
49 | private String personInCharge;
50 |
51 |
52 | public Integer getRecordID() {
53 | return recordID;
54 | }
55 |
56 | public String getType() {
57 | return type;
58 | }
59 |
60 | public String getSupplierOrCustomerName() {
61 | return supplierOrCustomerName;
62 | }
63 |
64 | public String getGoodsName() {
65 | return goodsName;
66 | }
67 |
68 | public Integer getRepositoryID() {
69 | return repositoryID;
70 | }
71 |
72 | public long getNumber() {
73 | return number;
74 | }
75 |
76 | public String getTime() {
77 | return time;
78 | }
79 |
80 | public String getPersonInCharge() {
81 | return personInCharge;
82 | }
83 |
84 | public void setRecordID(Integer recordID) {
85 | this.recordID = recordID;
86 | }
87 |
88 | public void setType(String type) {
89 | this.type = type;
90 | }
91 |
92 | public void setSupplierOrCustomerName(String supplierOrCustomerName) {
93 | this.supplierOrCustomerName = supplierOrCustomerName;
94 | }
95 |
96 | public void setGoodsName(String goodsName) {
97 | this.goodsName = goodsName;
98 | }
99 |
100 | public void setRepositoryID(Integer repositoryID) {
101 | this.repositoryID = repositoryID;
102 | }
103 |
104 | public void setNumber(long number) {
105 | this.number = number;
106 | }
107 |
108 | public void setTime(String time) {
109 | this.time = time;
110 | }
111 |
112 | public void setPersonInCharge(String personInCharge) {
113 | this.personInCharge = personInCharge;
114 | }
115 |
116 | @Override
117 | public String toString() {
118 | return "StockRecordDTO{" +
119 | "recordID=" + recordID +
120 | ", type='" + type + '\'' +
121 | ", supplierOrCustomerName='" + supplierOrCustomerName + '\'' +
122 | ", goodsName='" + goodsName + '\'' +
123 | ", repositoryID=" + repositoryID +
124 | ", number=" + number +
125 | ", time=" + time +
126 | ", personInCharge='" + personInCharge + '\'' +
127 | '}';
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/service/Impl/AccountServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.service.Impl;
2 |
3 |
4 | import com.ken.wms.domain.UserInfoDTO;
5 | import com.ken.wms.exception.UserAccountServiceException;
6 | import com.ken.wms.exception.UserInfoServiceException;
7 | import com.ken.wms.security.service.Interface.AccountService;
8 | import com.ken.wms.security.service.Interface.UserInfoService;
9 | import com.ken.wms.security.util.EncryptingModel;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.stereotype.Service;
12 |
13 | import java.security.NoSuchAlgorithmException;
14 | import java.util.Map;
15 |
16 | /**
17 | * 账户Service
18 | *
19 | * @author Ken
20 | * @since 2017-3-1
21 | */
22 | @Service
23 | public class AccountServiceImpl implements AccountService {
24 |
25 | @Autowired
26 | private UserInfoService userInfoService;
27 | @Autowired
28 | private EncryptingModel encryptingModel;
29 |
30 |
31 | private static final String OLD_PASSWORD = "oldPassword";
32 | private static final String NEW_PASSWORD = "newPassword";
33 | private static final String REPEAT_PASSWORD = "rePassword";
34 |
35 | /**
36 | * 密码更改
37 | */
38 | @Override
39 | public void passwordModify(Integer userID, Map passwordInfo) throws UserAccountServiceException {
40 |
41 | if (passwordInfo == null)
42 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_ERROR);
43 |
44 | // 获取更改密码信息
45 | String rePassword = (String) passwordInfo.get(REPEAT_PASSWORD);
46 | String newPassword = (String) passwordInfo.get(NEW_PASSWORD);
47 | String oldPassword = (String) passwordInfo.get(OLD_PASSWORD);
48 | if (rePassword == null || newPassword == null || oldPassword == null)
49 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_ERROR);
50 |
51 | try {
52 | // 获取用户的账户信息
53 | UserInfoDTO user = userInfoService.getUserInfo(userID);
54 | if (user == null) {
55 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_ERROR);
56 | }
57 |
58 | // 新密码一致性验证
59 | if (!newPassword.equals(rePassword)) {
60 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_UNMATCH);
61 | }
62 |
63 | // 原密码正确性验证
64 | String password;
65 | password = encryptingModel.MD5(oldPassword + userID);
66 | if (!password.equals(user.getPassword()))
67 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_ERROR);
68 |
69 | // 获得新的密码并加密
70 | password = encryptingModel.MD5(newPassword + userID);
71 |
72 | // 验证成功后更新数据库
73 | user.setPassword(password);
74 | userInfoService.updateUserInfo(user);
75 | } catch (NoSuchAlgorithmException | NullPointerException | UserInfoServiceException e) {
76 | throw new UserAccountServiceException(UserAccountServiceException.PASSWORD_ERROR);
77 | }
78 |
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/SupplierManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.Supplier;
5 | import com.ken.wms.exception.SupplierManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 供应商信息管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface SupplierManageService {
18 |
19 | /**
20 | * 返回指定supplierID 的供应商记录
21 | *
22 | * @param supplierId 供应商ID
23 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
24 | */
25 | Map selectById(Integer supplierId) throws SupplierManageServiceException;
26 |
27 | /**
28 | * 返回指定 supplierName 的供应商记录
29 | * 支持查询分页以及模糊查询
30 | *
31 | * @param offset 分页的偏移值
32 | * @param limit 分页的大小
33 | * @param supplierName 供应商的名称
34 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
35 | */
36 | Map selectByName(int offset, int limit, String supplierName) throws SupplierManageServiceException;
37 |
38 | /**
39 | * 返回指定 supplierName 的供应商记录
40 | * 支持模糊查询
41 | *
42 | * @param supplierName supplierName 供应商名称
43 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
44 | */
45 | Map selectByName(String supplierName) throws SupplierManageServiceException;
46 |
47 | /**
48 | * 分页查询供应商记录
49 | *
50 | * @param offset 分页的偏移值
51 | * @param limit 分页的大小
52 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
53 | */
54 | Map selectAll(int offset, int limit) throws SupplierManageServiceException;
55 |
56 | /**
57 | * 查询所有的供应商记录
58 | *
59 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
60 | */
61 | Map selectAll() throws SupplierManageServiceException;
62 |
63 | /**
64 | * 添加供应商记录
65 | *
66 | * @param supplier 供应商信息
67 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
68 | */
69 | boolean addSupplier(Supplier supplier) throws SupplierManageServiceException;
70 |
71 | /**
72 | * 更新供应商记录
73 | *
74 | * @param supplier 供应商信息
75 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
76 | */
77 | boolean updateSupplier(Supplier supplier) throws SupplierManageServiceException;
78 |
79 | /**
80 | * 删除供应商记录
81 | *
82 | * @param supplierId 供应商ID
83 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
84 | */
85 | boolean deleteSupplier(Integer supplierId);
86 |
87 | /**
88 | * 从文件中导入供应商信息
89 | *
90 | * @param file 导入信息的文件
91 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
92 | */
93 | Map importSupplier(MultipartFile file);
94 |
95 | /**
96 | * 导出供应商信息到文件中
97 | *
98 | * @param suppliers 包含若干条 Supplier 信息的 List
99 | * @return excel 文件
100 | */
101 | File exportSupplier(List suppliers);
102 | }
103 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/SupplierMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
29 |
42 |
43 |
56 |
57 |
70 |
71 |
72 | insert into wms_supplier(SUPPLIER_NAME,SUPPLIER_PERSON,SUPPLIER_TEL,SUPPLIER_EMAIL,SUPPLIER_ADDRESS)
73 | values(#{name},#{personInCharge},#{tel},#{email},#{address})
74 |
75 |
76 |
77 | insert into wms_supplier(SUPPLIER_NAME,SUPPLIER_PERSON,SUPPLIER_TEL,SUPPLIER_EMAIL,SUPPLIER_ADDRESS)
78 | values
79 |
80 | (#{supplier.name},#{supplier.personInCharge},#{supplier.tel},#{supplier.email},#{supplier.address})
81 |
82 |
83 |
84 |
85 | update
86 | wms_supplier
87 | set
88 | SUPPLIER_NAME = #{name},
89 | SUPPLIER_PERSON = #{personInCharge},
90 | SUPPLIER_TEL = #{tel},
91 | SUPPLIER_EMAIL = #{email},
92 | SUPPLIER_ADDRESS = #{address}
93 | where
94 | SUPPLIER_ID = #{id}
95 |
96 |
97 |
98 | delete from wms_supplier
99 | where SUPPLIER_ID = #{id}
100 |
101 |
102 |
103 | delete from wms_supplier
104 | where SUPPLIER_NAME = #{name}
105 |
106 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/CustomerManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.Customer;
5 | import com.ken.wms.exception.CustomerManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 客户信息管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface CustomerManageService {
18 |
19 | /**
20 | * 返回指定customer id 的客户记录
21 | *
22 | * @param customerId 客户ID
23 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
24 | */
25 | Map selectById(Integer customerId) throws CustomerManageServiceException;
26 |
27 | /**
28 | * 返回指定 customer name 的客户记录
29 | * 支持查询分页以及模糊查询
30 | *
31 | * @param offset 分页的偏移值
32 | * @param limit 分页的大小
33 | * @param customerName 客户的名称
34 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
35 | */
36 | Map selectByName(int offset, int limit, String customerName) throws CustomerManageServiceException;
37 |
38 | /**
39 | * 返回指定 customer Name 的客户记录
40 | * 支持模糊查询
41 | *
42 | * @param customerName 客户名称
43 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
44 | */
45 | Map selectByName(String customerName) throws CustomerManageServiceException;
46 |
47 | /**
48 | * 分页查询客户的记录
49 | *
50 | * @param offset 分页的偏移值
51 | * @param limit 分页的大小
52 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
53 | */
54 | Map selectAll(int offset, int limit) throws CustomerManageServiceException;
55 |
56 | /**
57 | * 查询所有客户的记录
58 | *
59 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
60 | */
61 | Map selectAll() throws CustomerManageServiceException;
62 |
63 | /**
64 | * 添加客户信息
65 | *
66 | * @param customer 客户信息
67 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
68 | */
69 | boolean addCustomer(Customer customer) throws CustomerManageServiceException;
70 |
71 | /**
72 | * 更新客户信息
73 | *
74 | * @param customer 客户信息
75 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
76 | */
77 | boolean updateCustomer(Customer customer) throws CustomerManageServiceException;
78 |
79 | /**
80 | * 删除客户信息
81 | *
82 | * @param customerId 客户ID
83 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
84 | */
85 | boolean deleteCustomer(Integer customerId) throws CustomerManageServiceException;
86 |
87 | /**
88 | * 从文件中导入客户信息
89 | *
90 | * @param file 导入信息的文件
91 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
92 | */
93 | Map importCustomer(MultipartFile file) throws CustomerManageServiceException;
94 |
95 | /**
96 | * 导出客户信息到文件中
97 | *
98 | * @param customers 包含若干条 customer 信息的 List
99 | * @return Excel 文件
100 | */
101 | File exportCustomer(List customers);
102 | }
103 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/RepositoryAdminMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
30 |
31 |
45 |
46 |
60 |
61 |
75 |
76 |
77 | insert into wms_repo_admin(REPO_ADMIN_NAME,REPO_ADMIN_SEX,REPO_ADMIN_TEL,REPO_ADMIN_ADDRESS,REPO_ADMIN_BIRTH,REPO_ADMIN_REPOID)
78 | values(#{name},#{sex},#{tel},#{address},#{birth},#{repositoryBelongID})
79 |
80 |
81 |
82 | insert into wms_repo_admin(REPO_ADMIN_NAME,REPO_ADMIN_SEX,REPO_ADMIN_TEL,REPO_ADMIN_ADDRESS,REPO_ADMIN_BIRTH,REPO_ADMIN_REPOID)
83 | values
84 |
85 | (#{repositoryAdmin.name},#{repositoryAdmin.sex},#{repositoryAdmin.tel},#{repositoryAdmin.address},#{repositoryAdmin.birth},#{repositoryAdmin.repositoryBelongID})
86 |
87 |
88 |
89 |
90 | update
91 | wms_repo_admin
92 | set
93 | REPO_ADMIN_NAME = #{name},
94 | REPO_ADMIN_SEX = #{sex},
95 | REPO_ADMIN_TEL = #{tel},
96 | REPO_ADMIN_ADDRESS = #{address},
97 | REPO_ADMIN_BIRTH = #{birth},
98 | REPO_ADMIN_REPOID = #{repositoryBelongID}
99 | where
100 | REPO_ADMIN_ID = #{id}
101 |
102 |
103 |
104 | delete from wms_repo_admin
105 | where REPO_ADMIN_ID = #{id}
106 |
107 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/RepositoryService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.Repository;
5 | import com.ken.wms.exception.RepositoryManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 仓库信息管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface RepositoryService {
18 |
19 | /**
20 | * 返回指定 repository ID 的仓库记录
21 | *
22 | * @param repositoryId 仓库ID
23 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
24 | */
25 | Map selectById(Integer repositoryId) throws RepositoryManageServiceException;
26 |
27 | /**
28 | * 返回指定 repository address 的仓库记录
29 | * 支持查询分页以及模糊查询
30 | *
31 | * @param offset 分页的偏移值
32 | * @param limit 分页的大小
33 | * @param address 仓库的地址
34 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
35 | */
36 | Map selectByAddress(int offset, int limit, String address) throws RepositoryManageServiceException;
37 |
38 | /**
39 | * 返回指定 repository address 的仓库记录
40 | * 支持模糊查询
41 | *
42 | * @param address 仓库名称
43 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
44 | */
45 | Map selectByAddress(String address) throws RepositoryManageServiceException;
46 |
47 | /**
48 | * 分页查询仓库记录
49 | *
50 | * @param offset 分页的偏移值
51 | * @param limit 分页的大小
52 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
53 | */
54 | Map selectAll(int offset, int limit) throws RepositoryManageServiceException;
55 |
56 | /**
57 | * 查询所有的仓库记录
58 | *
59 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
60 | */
61 | Map selectAll() throws RepositoryManageServiceException;
62 |
63 | /**
64 | * 查询所有未指派仓库管理员的仓库记录
65 | *
66 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
67 | */
68 | Map selectUnassign() throws RepositoryManageServiceException;
69 |
70 | /**
71 | * 添加仓库记录
72 | *
73 | * @param repository 仓库信息
74 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
75 | */
76 | boolean addRepository(Repository repository) throws RepositoryManageServiceException;
77 |
78 | /**
79 | * 更新仓库记录
80 | *
81 | * @param repository 仓库信息
82 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
83 | */
84 | boolean updateRepository(Repository repository) throws RepositoryManageServiceException;
85 |
86 | /**
87 | * 删除仓库记录
88 | *
89 | * @param repositoryId 仓库ID
90 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
91 | */
92 | boolean deleteRepository(Integer repositoryId) throws RepositoryManageServiceException;
93 |
94 | /**
95 | * 从文件中导入仓库信息
96 | *
97 | * @param file 导入信息的文件
98 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
99 | */
100 | Map importRepository(MultipartFile file) throws RepositoryManageServiceException;
101 |
102 | /**
103 | * 导出仓库信息到文件中
104 | *
105 | * @param repositories 包含若干条 Supplier 信息的 List
106 | * @return excel 文件
107 | */
108 | File exportRepository(List repositories);
109 | }
110 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/service/FilterChainDefinitionMapBuilder.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.service;
2 |
3 | import com.ken.wms.dao.RolePermissionMapper;
4 | import com.ken.wms.domain.RolePermissionDO;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 |
7 | import java.util.LinkedHashMap;
8 | import java.util.List;
9 |
10 | /**
11 | * 获取 URL 权限信息工厂类
12 | * @author ken
13 | * @since 2017/2/26.
14 | */
15 | public class FilterChainDefinitionMapBuilder {
16 | @Autowired
17 | private RolePermissionMapper rolePermissionMapper;
18 | private StringBuilder builder = new StringBuilder();
19 |
20 | /**
21 | * 获取授权信息
22 | * @return 返回授权信息列表
23 | */
24 | public LinkedHashMap builderFilterChainDefinitionMap(){
25 | LinkedHashMap permissionMap = new LinkedHashMap<>();
26 |
27 | // 固定的权限配置
28 | permissionMap.put("/css/**", "anon");
29 | permissionMap.put("/js/**", "anon");
30 | permissionMap.put("/fonts/**", "anon");
31 | permissionMap.put("/media/**", "anon");
32 | permissionMap.put("/pagecomponent/**", "anon");
33 | permissionMap.put("/login", "anon");
34 | permissionMap.put("/account/login", "anon");
35 | permissionMap.put("/account/checkCode/**", "anon");
36 |
37 | // 可变化的权限配置
38 | LinkedHashMap permissions = getPermissionDataFromDB();
39 | if (permissions != null){
40 | permissionMap.putAll(permissions);
41 | }
42 |
43 | // 其余权限配置
44 | permissionMap.put("/", "authc");
45 |
46 | // permissionMap.forEach((s, s2) -> {System.out.println(s + ":" + s2);});
47 |
48 | return permissionMap;
49 | }
50 |
51 | /**
52 | * 获取配置在数据库中的 URL 权限信息
53 | * @return 返回所有保存在数据库中的 URL 保存信息
54 | */
55 | private LinkedHashMap getPermissionDataFromDB(){
56 | LinkedHashMap permissionData = null;
57 |
58 | List rolePermissionDOS = rolePermissionMapper.selectAll();
59 | if (rolePermissionDOS != null){
60 | permissionData = new LinkedHashMap<>(rolePermissionDOS.size());
61 | String url;
62 | String role;
63 | String permission;
64 | for (RolePermissionDO rolePermissionDO : rolePermissionDOS){
65 | url = rolePermissionDO.getUrl();
66 | role = rolePermissionDO.getRole();
67 |
68 | // 判断该 url 是否已经存在
69 | if (permissionData.containsKey(url)){
70 | builder.delete(0, builder.length());
71 | builder.append(permissionData.get(url));
72 | builder.insert(builder.length() - 1, ",");
73 | builder.insert(builder.length() - 1, role);
74 | }else{
75 | builder.delete(0, builder.length());
76 | builder.append("authc,roles[").append(role).append("]");
77 | }
78 | permission = builder.toString();
79 | // System.out.println(url + ":" + permission);
80 | permissionData.put(url, permission);
81 | }
82 | }
83 |
84 | return permissionData;
85 | }
86 |
87 | // /**
88 | // * 构造角色权限
89 | // * @param role 角色
90 | // * @return 返回 roles[role name] 格式的字符串
91 | // */
92 | // private String permissionStringBuilder(String role){
93 | // builder.delete(0, builder.length());
94 | // return builder.append("authc,roles[").append(role).append("]").toString();
95 | // }
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/resources/config/ExcelUtilConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | name
7 | 供应商名
8 |
9 |
10 | personInCharge
11 | 负责人
12 |
13 |
14 | tel
15 | 联系电话
16 |
17 |
18 | email
19 | 电子邮件
20 |
21 |
22 | address
23 | 供应商地址
24 |
25 |
26 |
27 |
28 |
29 | name
30 | 客户名称
31 |
32 |
33 | personInCharge
34 | 负责人
35 |
36 |
37 | tel
38 | 联系电话
39 |
40 |
41 | email
42 | 电子邮件
43 |
44 |
45 | address
46 | 地址
47 |
48 |
49 |
50 |
51 |
52 | id
53 | 货物ID
54 |
55 |
56 | name
57 | 货物名称
58 |
59 |
60 | type
61 | 货物类型
62 |
63 |
64 | size
65 | 货物规格
66 |
67 |
68 | value
69 | 货物价值
70 |
71 |
72 |
73 |
74 |
75 | id
76 | 仓库ID
77 |
78 |
79 | address
80 | 仓库地址
81 |
82 |
83 | status
84 | 仓库状态
85 |
86 |
87 | area
88 | 仓库面积
89 |
90 |
91 | desc
92 | 仓库描述
93 |
94 |
95 | adminID
96 | 仓库管理员ID
97 |
98 |
99 | adminName
100 | 仓库管理员名字
101 |
102 |
103 |
104 |
105 |
106 | id
107 | ID
108 |
109 |
110 | name
111 | 姓名
112 |
113 |
114 | sex
115 | 性别
116 |
117 |
118 | tel
119 | 联系电话
120 |
121 |
122 | address
123 | 联系地址
124 |
125 |
126 | birth
127 | 出生日期
128 |
129 |
130 | repositoryBelongID
131 | 所属仓库ID
132 |
133 |
134 |
135 |
136 | goodsID
137 | 货物ID
138 |
139 |
140 | goodsName
141 | 货物名称
142 |
143 |
144 | goodsSize
145 | 货物规格
146 |
147 |
148 | goodsType
149 | 货物类型
150 |
151 |
152 | goodsValue
153 | 货物价值
154 |
155 |
156 | repositoryID
157 | 仓库ID
158 |
159 |
160 | number
161 | 库存数量
162 |
163 |
164 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/RepositoryAdminManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.RepositoryAdmin;
5 | import com.ken.wms.exception.RepositoryAdminManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 仓库管理员管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface RepositoryAdminManageService {
18 |
19 | /**
20 | * 返回指定repository id 的仓库管理员记录
21 | *
22 | * @param repositoryAdminID 仓库管理员ID
23 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
24 | */
25 | Map selectByID(Integer repositoryAdminID) throws RepositoryAdminManageServiceException;
26 |
27 | /**
28 | * 返回所属指定 repositoryID 的仓库管理员信息
29 | *
30 | * @param repositoryID 仓库ID 其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
31 | * @return 返回一个Map,
32 | */
33 | Map selectByRepositoryID(Integer repositoryID) throws RepositoryAdminManageServiceException;
34 |
35 | /**
36 | * 返回指定 repository address 的仓库管理员记录
37 | * 支持查询分页以及模糊查询
38 | *
39 | * @param offset 分页的偏移值
40 | * @param limit 分页的大小
41 | * @param name 仓库管理员的名称
42 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
43 | */
44 | Map selectByName(int offset, int limit, String name);
45 |
46 | /**
47 | * 返回指定 repository Name 的仓库管理员记录
48 | * 支持模糊查询
49 | *
50 | * @param name 仓库管理员名称
51 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
52 | */
53 | Map selectByName(String name);
54 |
55 | /**
56 | * 分页查询仓库管理员的记录
57 | *
58 | * @param offset 分页的偏移值
59 | * @param limit 分页的大小
60 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
61 | */
62 | Map selectAll(int offset, int limit) throws RepositoryAdminManageServiceException;
63 |
64 | /**
65 | * 查询所有仓库管理员的记录
66 | *
67 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
68 | */
69 | Map selectAll() throws RepositoryAdminManageServiceException;
70 |
71 | /**
72 | * 添加仓库管理员信息
73 | *
74 | * @param repositoryAdmin 仓库管理员信息
75 | * @return 返回一个boolean值,值为true代表添加成功,否则代表失败
76 | */
77 | boolean addRepositoryAdmin(RepositoryAdmin repositoryAdmin) throws RepositoryAdminManageServiceException;
78 |
79 | /**
80 | * 更新仓库管理员信息
81 | *
82 | * @param repositoryAdmin 仓库管理员信息
83 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
84 | */
85 | boolean updateRepositoryAdmin(RepositoryAdmin repositoryAdmin) throws RepositoryAdminManageServiceException;
86 |
87 | /**
88 | * 删除仓库管理员信息
89 | *
90 | * @param repositoryAdminID 仓库管理员ID
91 | * @return 返回一个boolean值,值为true代表删除成功,否则代表失败
92 | */
93 | boolean deleteRepositoryAdmin(Integer repositoryAdminID) throws RepositoryAdminManageServiceException;
94 |
95 | /**
96 | * 为仓库管理员指派指定 ID 的仓库
97 | *
98 | * @param repositoryAdminID 仓库管理员ID
99 | * @param repositoryID 所指派的仓库ID
100 | * @return 返回一个 boolean 值,值为 true 表示仓库指派成功,否则表示失败
101 | */
102 | boolean assignRepository(Integer repositoryAdminID, Integer repositoryID) throws RepositoryAdminManageServiceException;
103 |
104 | /**
105 | * 从文件中导入仓库管理员信息
106 | *
107 | * @param file 导入信息的文件
108 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
109 | */
110 | Map importRepositoryAdmin(MultipartFile file) throws RepositoryAdminManageServiceException;
111 |
112 | /**
113 | * 导出仓库管理员信息到文件中
114 | *
115 | * @param repositoryAdmins 包含若干条 repository 信息的 List
116 | * @return Excel 文件
117 | */
118 | File exportRepositoryAdmin(List repositoryAdmins);
119 | }
120 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/filter/ExtendFormAuthenticationFilter.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.filter;
2 |
3 | import org.apache.shiro.authc.AuthenticationException;
4 | import org.apache.shiro.authc.AuthenticationToken;
5 | import org.apache.shiro.subject.Subject;
6 | import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 |
10 | import javax.servlet.ServletRequest;
11 | import javax.servlet.ServletResponse;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 |
15 | /**
16 | * 扩展 FormAuthenticationFilter ,对部分方法重写,使其支持 Ajax 请求
17 | *
18 | * @author ken
19 | * @since 2017/2/26
20 | */
21 | public class ExtendFormAuthenticationFilter extends FormAuthenticationFilter {
22 | private static final Logger log = LoggerFactory.getLogger(FormAuthenticationFilter.class);
23 |
24 | @Override
25 | protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception{
26 | HttpServletRequest httpServletRequest = (HttpServletRequest) request;
27 | HttpServletResponse httpServletResponse = (HttpServletResponse) response;
28 |
29 | if (!"XMLHttpRequest".equalsIgnoreCase(httpServletRequest.getHeader("X-Requested-with"))){
30 | // 请求为普通请求
31 | if(this.isLoginRequest(request, response)) {
32 | if(this.isLoginSubmission(request, response)) {
33 | if(log.isTraceEnabled()) {
34 | log.trace("Login submission detected. Attempting to execute login.");
35 | }
36 |
37 | return this.executeLogin(request, response);
38 | } else {
39 | if(log.isTraceEnabled()) {
40 | log.trace("Login page view.");
41 | }
42 |
43 | return true;
44 | }
45 | } else {
46 | if(log.isTraceEnabled()) {
47 | log.trace("Attempting to access a path which requires authentication. Forwarding to the Authentication url [" + this.getLoginUrl() + "]");
48 | }
49 |
50 | this.saveRequestAndRedirectToLogin(request, response);
51 | return false;
52 | }
53 | }else{
54 | // 请求为 Ajax 请求
55 | httpServletResponse.setStatus(HttpServletResponse.SC_FORBIDDEN);
56 | return false;
57 | }
58 |
59 | }
60 |
61 | @Override
62 | protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
63 | HttpServletRequest httpServletRequest = (HttpServletRequest) request;
64 | HttpServletResponse httpServletResponse = (HttpServletResponse) response;
65 |
66 | if (!"XMLHttpRequest".equalsIgnoreCase(httpServletRequest.getHeader("X-Requested-with"))){
67 | // 请求为普通请求
68 | this.issueSuccessRedirect(request, response);
69 | }else{
70 | // 请求为 Ajax 请求
71 | httpServletResponse.setStatus(HttpServletResponse.SC_OK);
72 | }
73 |
74 | return false;
75 | }
76 |
77 | @Override
78 | protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) {
79 | if(log.isDebugEnabled()) {
80 | log.debug("Authentication exception", e);
81 | }
82 |
83 | HttpServletRequest httpServletRequest = (HttpServletRequest) request;
84 | HttpServletResponse httpServletResponse = (HttpServletResponse) response;
85 |
86 | if (!"XMLHttpRequest".equalsIgnoreCase(httpServletRequest.getHeader("X-Requested-With"))){
87 | // 请求为普通请求
88 | this.setFailureAttribute(request, e);
89 | return true;
90 | }else{
91 | // 请求为 Ajax 请求
92 | // do some thing to return a json
93 | httpServletResponse.setStatus(HttpServletResponse.SC_FORBIDDEN);
94 | return false;
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/src/main/webapp/pagecomponent/userOperationRecorderManagement.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
96 |
97 |
98 |
99 | - 系统日志
100 |
101 |
102 |
103 |
111 |
112 |
118 |
119 |
120 |
123 |
124 |
125 |
130 |
131 |
--------------------------------------------------------------------------------
/src/main/resources/config/ehcache.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
18 |
19 |
20 |
21 |
37 |
44 |
45 |
63 |
64 |
73 |
80 |
81 |
84 | -->
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/src/main/webapp/pagecomponent/accessRecordManagement.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
99 |
100 |
101 |
102 | - 系统登陆日志
103 |
104 |
105 |
106 |
114 |
115 |
123 |
124 |
125 |
128 |
129 |
130 |
140 |
145 |
146 |
--------------------------------------------------------------------------------
/src/test/java/com/ken/wms/MapperTest.java:
--------------------------------------------------------------------------------
1 | //package com.ken.wms;
2 | //
3 | //import com.ken.wms.common.service.Interface.StockRecordManageService;
4 | //import com.ken.wms.common.service.Interface.SystemLogService;
5 | //import com.ken.wms.dao.AccessRecordMapper;
6 | //import com.ken.wms.dao.StockInMapper;
7 | //import com.ken.wms.dao.StockOutMapper;
8 | //import com.ken.wms.dao.UserOperationRecordMapper;
9 | //import com.ken.wms.domain.*;
10 | //import com.ken.wms.exception.StockRecordManageServiceException;
11 | //import com.ken.wms.exception.SystemLogServiceException;
12 | //import org.junit.Test;
13 | //import org.junit.runner.RunWith;
14 | //import org.springframework.beans.factory.annotation.Autowired;
15 | //import org.springframework.test.context.ContextConfiguration;
16 | //import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
17 | //
18 | //import java.text.DateFormat;
19 | //import java.text.ParseException;
20 | //import java.text.SimpleDateFormat;
21 | //import java.util.Date;
22 | //import java.util.List;
23 | //import java.util.Map;
24 | //
25 | ///**
26 | // * Created by Ken on 2017/4/5.
27 | // */
28 | //@ContextConfiguration(locations = "classpath:config/SpringApplicationConfiguration.xml")
29 | //@RunWith(SpringJUnit4ClassRunner.class)
30 | //public class MapperTest {
31 | //
32 | // @Autowired
33 | // private
34 | // StockInMapper stockInMapper;
35 | // @Autowired
36 | // private StockOutMapper stockOutMapper;
37 | // @Autowired
38 | // private StockRecordManageService stockRecordManageService;
39 | // @Autowired
40 | // private AccessRecordMapper accessRecordMapper;
41 | // @Autowired
42 | // private SystemLogService systemLogService;
43 | // @Autowired
44 | // private UserOperationRecordMapper userOperationRecordMapper;
45 | //
46 | // @Test
47 | // public void selectUserOperationRecordServiceTest() throws SystemLogServiceException {
48 | // Map result = systemLogService.selectUserOperationRecord(1001, "", "");
49 | // List userOperationRecordDTOS = (List) result.get("data");
50 | // userOperationRecordDTOS.forEach(System.out::println);
51 | // }
52 | //
53 | // @Test
54 | // public void addUserOperationRecordServiceTest() throws SystemLogServiceException {
55 | // systemLogService.insertUserOperationRecord(1001, "ken", "insert new row", "fail");
56 | // }
57 | //
58 | // @Test
59 | // public void addUserOperationRecordTest(){
60 | // UserOperationRecordDO userOperationRecordDO = new UserOperationRecordDO();
61 | // userOperationRecordDO.setUserID(1001);
62 | // userOperationRecordDO.setUserName("ken");
63 | // userOperationRecordDO.setOperationName("set param");
64 | // userOperationRecordDO.setOperationTime(new Date());
65 | // userOperationRecordDO.setOperationResult("success");
66 | //
67 | // userOperationRecordMapper.insertUserOperationRecord(userOperationRecordDO);
68 | // }
69 | //
70 | // @Test
71 | // public void selectUserOperationRecordTest(){
72 | // List userOperationRecordDOS = userOperationRecordMapper.selectUserOperationRecord(1002, null, null);
73 | // userOperationRecordDOS.forEach(System.out::println);
74 | // }
75 | //
76 | // @Test
77 | // public void selectAccessRecordServiceTest() throws SystemLogServiceException {
78 | // Map result = systemLogService.selectAccessRecord(null, "all", "", "");
79 | // List accessRecordDOS = (List) result.get("data");
80 | // accessRecordDOS.forEach(System.out::println);
81 | // }
82 | //
83 | // @Test
84 | // public void selectAccessRecordByUserIDTest(){
85 | // List accessRecordDOS = accessRecordMapper.selectAccessRecords(null, "all", null, null);
86 | // accessRecordDOS.forEach(System.out::println);
87 | // }
88 | //
89 | // @Test
90 | // public void selectStockRecordTest() throws StockRecordManageServiceException {
91 | // Map result = stockRecordManageService.selectStockRecord(-1, "", "", "all", 5, 5);
92 | // }
93 | //
94 | // @Test
95 | // public void selectByRepositoryIDAndDateTest() throws ParseException {
96 | // String startDateString = "2017-04-03";
97 | // String endDateString = "2017-04-06";
98 | // DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
99 | // Date startDate = dateFormat.parse(startDateString);
100 | // Date endDate = dateFormat.parse(endDateString);
101 | // Date newDate = new Date();
102 | // System.out.println(endDate);
103 | // System.out.println(newDate);
104 | // List stockInDOS = stockInMapper.selectByRepositoryIDAndDate(1005, startDate, endDate);
105 | // stockInDOS.forEach(System.out::println);
106 | // }
107 | //
108 | // @Test
109 | // public void selectStockOutByRepositoryIDAndDateTest() {
110 | // List stockOutDOS = stockOutMapper.selectByRepositoryIDAndDate(1003, null, null);
111 | // stockOutDOS.forEach(System.out::println);
112 | // }
113 | //}
114 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StorageMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
22 |
31 |
32 |
50 |
51 |
70 |
71 |
90 |
91 |
110 |
111 |
112 | update
113 | wms_record_storage
114 | set
115 | RECORD_GOODID = #{goodsID},
116 | RECORD_REPOSITORY = #{repositoryID},
117 | RECORD_NUMBER = #{number}
118 | where
119 | RECORD_GOODID = #{goodsID} and
120 | RECORD_REPOSITORY = #{repositoryID}
121 |
122 |
123 |
124 | insert into wms_record_storage
125 | (
126 | RECORD_GOODID,
127 | RECORD_REPOSITORY,
128 | RECORD_NUMBER
129 | )
130 | values
131 | (
132 | #{goodsID},
133 | #{repositoryID},
134 | #{number}
135 | )
136 |
137 |
138 |
139 | insert into wms_record_storage(RECORD_GOODID,RECORD_REPOSITORY,RECORD_NUMBER)
140 | values
141 |
142 | (
143 | #{storage.goodsID},#{storage.repositoryID},#{storage.number})
144 |
145 |
146 |
147 |
148 | delete from
149 | wms_record_storage
150 | where
151 | RECORD_GOODID = #{goodsID}
152 |
153 |
154 |
155 | delete from
156 | wms_record_storage
157 | where
158 | wms_record_storage.RECORD_REPOSITORY = #{repositoryID}
159 |
160 |
161 |
162 | delete from
163 | wms_record_storage
164 | where
165 | RECORD_GOODID = #{goodsID} and
166 | wms_record_storage.RECORD_REPOSITORY = #{repositoryID}
167 |
168 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/common/service/Interface/StorageManageService.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.common.service.Interface;
2 |
3 |
4 | import com.ken.wms.domain.Storage;
5 | import com.ken.wms.exception.StorageManageServiceException;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import java.io.File;
9 | import java.util.List;
10 | import java.util.Map;
11 |
12 | /**
13 | * 库存信息管理 service
14 | *
15 | * @author Ken
16 | */
17 | public interface StorageManageService {
18 |
19 | /**
20 | * 返回所有的库存记录
21 | *
22 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
23 | */
24 | Map selectAll(Integer repositoryID) throws StorageManageServiceException;
25 |
26 | /**
27 | * 分页返回所有的库存记录
28 | *
29 | * @param offset 分页偏移值
30 | * @param limit 分页大小
31 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
32 | */
33 | Map selectAll(Integer repositoryID, int offset, int limit) throws StorageManageServiceException;
34 |
35 | /**
36 | * 返回指定货物ID的库存记录
37 | *
38 | * @param goodsID 指定的货物ID
39 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
40 | */
41 | Map selectByGoodsID(Integer goodsID, Integer repositoryID) throws StorageManageServiceException;
42 |
43 | /**
44 | * 分页返回指定的货物库存记录
45 | *
46 | * @param goodsID 指定的货物ID
47 | * @param offset 分页偏移值
48 | * @param limit 分页大小
49 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
50 | */
51 | Map selectByGoodsID(Integer goodsID, Integer repositoryID, int offset, int limit) throws StorageManageServiceException;
52 |
53 | /**
54 | * 返回指定货物名称的库存记录
55 | *
56 | * @param goodsName 货物名称
57 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
58 | */
59 | Map selectByGoodsName(String goodsName, Integer repositoryID) throws StorageManageServiceException;
60 |
61 | /**
62 | * 分页返回指定货物名称的库存记录
63 | *
64 | * @param goodsName 货物名称
65 | * @param offset 分页偏移值
66 | * @param limit 分页大小
67 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
68 | */
69 | Map selectByGoodsName(String goodsName, Integer repositoryID, int offset, int limit) throws StorageManageServiceException;
70 |
71 | /**
72 | * 返回指定货物类型的库存记录
73 | *
74 | * @param goodsType 指定的货物类型
75 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
76 | */
77 | Map selectByGoodsType(String goodsType, Integer Repository) throws StorageManageServiceException;
78 |
79 | /**
80 | * 分页返回指定货物类型的库存记录
81 | *
82 | * @param goodsType 指定的货物类型
83 | * @param offset 分页偏移值
84 | * @param limit 分页大小
85 | * @return 结果的一个Map,其中: key为 data 的代表记录数据;key 为 total 代表结果记录的数量
86 | */
87 | Map selectByGoodsType(String goodsType, Integer repositoryID, int offset, int limit) throws StorageManageServiceException;
88 |
89 | /**
90 | * 添加一条库存记录
91 | *
92 | * @param goodsID 指定的货物ID
93 | * @param repositoryID 指定的仓库ID
94 | * @param number 库存数量
95 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
96 | */
97 | boolean addNewStorage(Integer goodsID, Integer repositoryID, long number) throws StorageManageServiceException;
98 |
99 | /**
100 | * 更新一条库存记录
101 | *
102 | * @param goodsID 指定的货物ID
103 | * @param repositoryID 指定的仓库ID
104 | * @param number 更新的库存数量
105 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
106 | */
107 | boolean updateStorage(Integer goodsID, Integer repositoryID, long number) throws StorageManageServiceException;
108 |
109 | /**
110 | * 为指定的货物库存记录增加指定数目
111 | *
112 | * @param goodsID 货物ID
113 | * @param repositoryID 仓库ID
114 | * @param number 增加的数量
115 | * @return 返回一个 boolean 值,若值为true表示数目增加成功,否则表示增加失败
116 | */
117 | boolean storageIncrease(Integer goodsID, Integer repositoryID, long number) throws StorageManageServiceException;
118 |
119 | /**
120 | * 为指定的货物库存记录减少指定的数目
121 | *
122 | * @param goodsID 货物ID
123 | * @param repositoryID 仓库ID
124 | * @param number 减少的数量
125 | * @return 返回一个 boolean 值,若值为 true 表示数目减少成功,否则表示增加失败
126 | */
127 | boolean storageDecrease(Integer goodsID, Integer repositoryID, long number) throws StorageManageServiceException;
128 |
129 | /**
130 | * 删除一条库存记录
131 | * 货物ID与仓库ID可唯一确定一条库存记录
132 | *
133 | * @param goodsID 指定的货物ID
134 | * @param repositoryID 指定的仓库ID
135 | * @return 返回一个boolean值,值为true代表更新成功,否则代表失败
136 | */
137 | boolean deleteStorage(Integer goodsID, Integer repositoryID) throws StorageManageServiceException;
138 |
139 | /**
140 | * 导入库存记录
141 | *
142 | * @param file 保存有的库存记录的文件
143 | * @return 返回一个Map,其中:key为total代表导入的总记录数,key为available代表有效导入的记录数
144 | */
145 | Map importStorage(MultipartFile file) throws StorageManageServiceException;
146 |
147 | /**
148 | * 导出库存记录
149 | *
150 | * @param storages 保存有库存记录的List
151 | * @return excel 文件
152 | */
153 | File exportStorage(List storages);
154 | }
155 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/security/realms/UserAuthorizingRealm.java:
--------------------------------------------------------------------------------
1 | package com.ken.wms.security.realms;
2 |
3 | import com.ken.wms.common.service.Interface.RepositoryAdminManageService;
4 | import com.ken.wms.common.service.Interface.SystemLogService;
5 | import com.ken.wms.domain.RepositoryAdmin;
6 | import com.ken.wms.domain.UserInfoDTO;
7 | import com.ken.wms.exception.RepositoryAdminManageServiceException;
8 | import com.ken.wms.exception.UserInfoServiceException;
9 | import com.ken.wms.security.service.Interface.UserInfoService;
10 | import com.ken.wms.security.util.EncryptingModel;
11 | import org.apache.commons.lang3.StringUtils;
12 | import org.apache.shiro.SecurityUtils;
13 | import org.apache.shiro.authc.*;
14 | import org.apache.shiro.authz.AuthorizationInfo;
15 | import org.apache.shiro.authz.SimpleAuthorizationInfo;
16 | import org.apache.shiro.realm.AuthorizingRealm;
17 | import org.apache.shiro.session.Session;
18 | import org.apache.shiro.subject.PrincipalCollection;
19 | import org.apache.shiro.subject.Subject;
20 | import org.springframework.beans.factory.annotation.Autowired;
21 |
22 | import java.security.NoSuchAlgorithmException;
23 | import java.util.HashSet;
24 | import java.util.List;
25 | import java.util.Set;
26 |
27 | /**
28 | * 用户的认证与授权
29 | *
30 | * @author ken
31 | * @since 2017/2/26.
32 | */
33 | public class UserAuthorizingRealm extends AuthorizingRealm {
34 |
35 | @Autowired
36 | private UserInfoService userInfoService;
37 | @Autowired
38 | private EncryptingModel encryptingModel;
39 | @Autowired
40 | private RepositoryAdminManageService repositoryAdminManageService;
41 | @Autowired
42 | private SystemLogService systemLogService;
43 |
44 | /**
45 | * 对用户进行角色授权
46 | *
47 | * @param principalCollection 用户信息
48 | * @return 返回用户授权信息
49 | */
50 | @SuppressWarnings("unchecked")
51 | @Override
52 | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
53 | // 创建存放用户角色的 Set
54 | Set roles = new HashSet<>();
55 |
56 | //获取用户角色
57 | Object principal = principalCollection.getPrimaryPrincipal();
58 | if (principal instanceof String) {
59 | String userID = (String) principal;
60 | if (StringUtils.isNumeric(userID)) {
61 | try {
62 | UserInfoDTO userInfo = userInfoService.getUserInfo(Integer.valueOf(userID));
63 | if (userInfo != null) {
64 | // 设置用户角色
65 | roles.addAll(userInfo.getRole());
66 | }
67 | } catch (UserInfoServiceException e) {
68 | // do logger
69 | }
70 | }
71 | }
72 |
73 | return new SimpleAuthorizationInfo(roles);
74 | }
75 |
76 | /**
77 | * 对用户进行认证
78 | *
79 | * @param authenticationToken 用户凭证
80 | * @return 返回用户的认证信息
81 | * @throws AuthenticationException 用户认证异常信息
82 | * Realm的认证方法,自动将token传入,比较token与数据库的数据是否匹配
83 | * 验证逻辑是先根据用户名查询用户,
84 | * 如果查询到的话再将查询到的用户名和密码放到SimpleAuthenticationInfo对象中,
85 | * Shiro会自动根据用户输入的密码和查询到的密码进行匹配,如果匹配不上就会抛出异常,
86 | * 匹配上之后就会执行doGetAuthorizationInfo()进行相应的权限验证。
87 | */
88 | @SuppressWarnings("unchecked")
89 | @Override
90 | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws
91 | AuthenticationException {
92 |
93 | String realmName = getName();
94 | String credentials = "";
95 |
96 | // 获取用户名对应的用户账户信息
97 | try {
98 | UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) authenticationToken;
99 | String principal = usernamePasswordToken.getUsername();
100 |
101 | if (!StringUtils.isNumeric(principal))
102 | throw new AuthenticationException();
103 | Integer userID = Integer.valueOf(principal);
104 | //依赖于/security.service.Interface.UserInfoService,UserInfoDTO中包含用户ID,用户名,密码,角色
105 | //wms_user表
106 | UserInfoDTO userInfoDTO = userInfoService.getUserInfo(userID);
107 |
108 | if (userInfoDTO != null) {
109 | Subject currentSubject = SecurityUtils.getSubject();
110 | Session session = currentSubject.getSession();
111 |
112 | // 设置部分用户信息到 Session
113 | session.setAttribute("userID", userID);
114 | session.setAttribute("userName", userInfoDTO.getUserName());
115 | //获取该用户的所属仓库
116 | List repositoryAdmin = (List) repositoryAdminManageService.selectByID(userInfoDTO.getUserID()).get("data");
117 | session.setAttribute("repositoryBelong", (repositoryAdmin.isEmpty()) ? "none" : repositoryAdmin.get(0).getRepositoryBelongID());
118 |
119 |
120 | // 结合验证码对密码进行处理
121 | String checkCode = (String) session.getAttribute("checkCode");
122 | String password = userInfoDTO.getPassword();
123 | if (checkCode != null && password != null) {
124 | checkCode = checkCode.toUpperCase();
125 | credentials = encryptingModel.MD5(password + checkCode);
126 | }
127 | }
128 | //比对账号密码
129 | //principal前端传来userid
130 | //credentials为数据库的密码,加chexkcode的MD5加密
131 | //realmName为com.ken.wms.security.realms.UserAuthorizingRealm_0
132 | return new SimpleAuthenticationInfo(principal, credentials, realmName);
133 |
134 | } catch (UserInfoServiceException | RepositoryAdminManageServiceException | NoSuchAlgorithmException e) {
135 | throw new AuthenticationException();
136 | }
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StockInMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
56 |
57 |
75 |
76 |
94 |
95 |
113 |
114 |
140 |
141 |
142 | insert into wms_record_in(RECORD_SUPPLIERID,RECORD_GOODID,RECORD_NUMBER,RECORD_TIME,RECORD_PERSON,RECORD_REPOSITORYID)
143 | values(#{supplierID},#{goodID},#{number},#{time},#{personInCharge},#{repositoryID})
144 |
145 |
146 |
147 | update
148 | wms_record_in
149 | set
150 | RECORD_SUPPLIERID = #{supplierID},
151 | RECORD_GOODID = #{goodID},
152 | RECORD_NUMBER = #{number},
153 | RECORD_TIME = #{time},
154 | RECORD_PERSON = #{personInCharge}
155 | where
156 | RECORD_ID = #{id}
157 |
158 |
159 |
160 | delete from wms_record_in
161 | where RECORD_ID = #{id}
162 |
163 |
--------------------------------------------------------------------------------
/src/main/java/com/ken/wms/dao/StockOutMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
37 |
38 |
56 |
57 |
75 |
76 |
94 |
95 |
113 |
114 |
140 |
141 |
142 | insert into wms_record_out(RECORD_CUSTOMERID,RECORD_GOODID,RECORD_NUMBER,RECORD_TIME,RECORD_PERSON,RECORD_REPOSITORYID)
143 | values(#{customerID},#{goodID},#{number},#{time},#{personInCharge},#{repositoryID})
144 |
145 |
146 |
147 | update
148 | wms_record_out
149 | set
150 | RECORD_CUSTOMERID = #{customerID},
151 | RECORD_GOODID = #{goodID},
152 | RECORD_NUMBER = #{number},
153 | RECORD_TIME = #{time},
154 | RECORD_PERSON = #{personInCharge}
155 | where
156 | RECORD_ID = #{id}
157 |
158 |
159 |
160 | delete from wms_record_out
161 | where RECORD_ID = #{id}
162 |
163 |
--------------------------------------------------------------------------------