├── .idea
├── WMS.iml
├── artifacts
│ ├── luv_server_war.xml
│ └── luv_server_war_exploded.xml
├── compiler.xml
├── encodings.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── kotlinc.xml
├── libraries
│ ├── Maven__aopalliance_aopalliance_1_0.xml
│ ├── Maven__com_alibaba_fastjson_1_2_38.xml
│ ├── Maven__com_auth0_java_jwt_3_1_0.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_8_10.xml
│ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_8_10.xml
│ ├── Maven__commons_codec_commons_codec_1_10.xml
│ ├── Maven__commons_collections_commons_collections_3_2_1.xml
│ ├── Maven__commons_dbcp_commons_dbcp_1_4.xml
│ ├── Maven__commons_io_commons_io_2_4.xml
│ ├── Maven__commons_lang_commons_lang_2_4.xml
│ ├── Maven__commons_logging_commons_logging_1_2.xml
│ ├── Maven__commons_pool_commons_pool_1_5_4.xml
│ ├── Maven__io_jsonwebtoken_jjwt_0_7_0.xml
│ ├── Maven__javax_servlet_javax_servlet_api_3_1_0.xml
│ ├── Maven__javax_servlet_jsp_jsp_api_2_2.xml
│ ├── Maven__log4j_log4j_1_2_17.xml
│ ├── Maven__mysql_mysql_connector_java_5_1_30.xml
│ ├── Maven__org_apache_commons_commons_lang3_3_1.xml
│ ├── Maven__org_apache_velocity_velocity_1_7.xml
│ ├── Maven__org_bouncycastle_bcprov_jdk15on_1_55.xml
│ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml
│ ├── Maven__org_mybatis_generator_mybatis_generator_core_1_3_2.xml
│ ├── Maven__org_mybatis_mybatis_3_2_8.xml
│ ├── Maven__org_mybatis_mybatis_spring_1_2_3.xml
│ ├── Maven__org_slf4j_slf4j_api_1_7_7.xml
│ ├── Maven__org_springframework_security_spring_security_acl_4_1_3_RELEASE.xml
│ ├── Maven__org_springframework_security_spring_security_config_4_1_3_RELEASE.xml
│ ├── Maven__org_springframework_security_spring_security_core_4_1_3_RELEASE.xml
│ ├── Maven__org_springframework_security_spring_security_taglibs_4_1_3_RELEASE.xml
│ ├── Maven__org_springframework_security_spring_security_web_4_1_3_RELEASE.xml
│ ├── Maven__org_springframework_spring_aop_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_beans_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_context_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_context_support_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_core_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_expression_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_jdbc_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_test_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_tx_4_3_7_RELEASE.xml
│ ├── Maven__org_springframework_spring_web_4_3_7_RELEASE.xml
│ └── Maven__org_springframework_spring_webmvc_4_3_7_RELEASE.xml
├── misc.xml
├── modules.xml
├── uiDesigner.xml
└── workspace.xml
├── luv-comm
├── luv-comm.iml
└── pom.xml
├── luv-server
├── luv-server.iml
├── pom.xml
└── src
│ └── main
│ ├── resources
│ ├── jdbc.properties
│ ├── log4j.properties
│ └── redis.properties
│ └── webapp
│ ├── META-INF
│ └── MANIFEST.MF
│ ├── WEB-INF
│ ├── classes
│ │ ├── jdbc.properties
│ │ └── log4j.properties
│ ├── config
│ │ └── spring
│ │ │ ├── spring-mvc.xml
│ │ │ └── spring-mybatis.xml
│ └── web.xml
│ └── index.jsp
├── luv-wms-parent
├── luv-wms-parent.iml
├── pom.xml
├── wms-api
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── cn
│ │ │ └── luvletter
│ │ │ ├── base
│ │ │ ├── GoodsService.java
│ │ │ ├── StorageAreaService.java
│ │ │ ├── StorageLocationService.java
│ │ │ ├── WarehouseService.java
│ │ │ └── vo
│ │ │ │ ├── GoodsSerarchVo.java
│ │ │ │ └── StorageLocationVo.java
│ │ │ ├── in
│ │ │ └── InStockService.java
│ │ │ ├── main
│ │ │ ├── MainService.java
│ │ │ ├── model
│ │ │ │ └── Dictionary.java
│ │ │ └── vo
│ │ │ │ └── SelectDSVo.java
│ │ │ ├── order
│ │ │ └── OrderService.java
│ │ │ ├── out
│ │ │ └── OutStockService.java
│ │ │ ├── stock
│ │ │ ├── StockService.java
│ │ │ └── vo
│ │ │ │ └── StockVo.java
│ │ │ └── sys
│ │ │ ├── api
│ │ │ ├── DictionaryService.java
│ │ │ ├── OperatorService.java
│ │ │ ├── PermissionService.java
│ │ │ ├── RoleService.java
│ │ │ ├── SettingService.java
│ │ │ └── SysService.java
│ │ │ ├── model
│ │ │ ├── Operator.java
│ │ │ ├── OperatorExample.java
│ │ │ ├── OprtRole.java
│ │ │ ├── OprtRoleExample.java
│ │ │ ├── Permission.java
│ │ │ ├── PermissionTree.java
│ │ │ └── Role.java
│ │ │ └── vo
│ │ │ ├── NavigationVo.java
│ │ │ └── OperatorVo.java
│ └── wms-api.iml
├── wms-common
│ ├── pom.xml
│ ├── src
│ │ └── main
│ │ │ ├── java
│ │ │ └── cn
│ │ │ │ └── luvletter
│ │ │ │ ├── base
│ │ │ │ └── BaseController.java
│ │ │ │ ├── bean
│ │ │ │ ├── ApiResult.java
│ │ │ │ ├── AuthBean.java
│ │ │ │ ├── AuthenticationBean.java
│ │ │ │ └── PrintBean.java
│ │ │ │ ├── config
│ │ │ │ ├── CacheConfig.java
│ │ │ │ └── RedisConfig.java
│ │ │ │ ├── constant
│ │ │ │ └── SqlConstant.java
│ │ │ │ ├── exception
│ │ │ │ ├── ApplicationException.java
│ │ │ │ └── InvalidTokenException.java
│ │ │ │ ├── filter
│ │ │ │ ├── CustomAuthenticationFilter.java
│ │ │ │ ├── JwtAuthenticationTokenFilter.java
│ │ │ │ └── ProcessFilter.java
│ │ │ │ ├── interceptor
│ │ │ │ └── ProcessInterceptor.java
│ │ │ │ ├── plugin
│ │ │ │ ├── CommentGenerator.java
│ │ │ │ └── SerializablePlugin.java
│ │ │ │ ├── security
│ │ │ │ ├── AESPasswordEncoder.java
│ │ │ │ ├── MyAccessDecisionManager.java
│ │ │ │ ├── SecurityConfig.java
│ │ │ │ ├── URLFilterSecurityInterceptor.java
│ │ │ │ ├── URLInvocationSecurityMetadataSourceService.java
│ │ │ │ ├── handler
│ │ │ │ │ ├── AjaxAccessDeniedHandler.java
│ │ │ │ │ ├── AjaxAuthFailHandler.java
│ │ │ │ │ ├── AjaxAuthSuccessHandler.java
│ │ │ │ │ └── AjaxAuthenticationEntryPoint.java
│ │ │ │ └── service
│ │ │ │ │ └── OprtService.java
│ │ │ │ └── util
│ │ │ │ ├── AESUtil.java
│ │ │ │ ├── ActiveUserUtil.java
│ │ │ │ ├── BeanUtils.java
│ │ │ │ ├── DateUtil.java
│ │ │ │ ├── ExcelUtil.java
│ │ │ │ ├── JWTUtil.java
│ │ │ │ ├── JdbcUtil.java
│ │ │ │ ├── MybatisGeneratorUtil.java
│ │ │ │ ├── PropertyUtil.java
│ │ │ │ ├── RedisUtil.java
│ │ │ │ ├── ResponseUtil.java
│ │ │ │ ├── VelocityUtil.java
│ │ │ │ └── WMSUtil.java
│ │ │ └── resources
│ │ │ ├── generator.properties
│ │ │ ├── generatorConfig.xml
│ │ │ ├── jdbc.properties
│ │ │ ├── redis.properties
│ │ │ └── template
│ │ │ └── generatorConfig.vm
│ └── wms-common.iml
├── wms-service
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── cn
│ │ │ │ └── luvletter
│ │ │ │ ├── base
│ │ │ │ └── impl
│ │ │ │ │ ├── GoodsServiceImpl.java
│ │ │ │ │ ├── StorageAreaServiceImpl.java
│ │ │ │ │ ├── StorageLocationServiceImpl.java
│ │ │ │ │ └── WarehouseServiceImpl.java
│ │ │ │ ├── in
│ │ │ │ └── impl
│ │ │ │ │ └── InStockServiceImpl.java
│ │ │ │ ├── main
│ │ │ │ ├── dao
│ │ │ │ │ ├── DictionaryMapper.java
│ │ │ │ │ └── mapper
│ │ │ │ │ │ └── DictionaryMapper.xml
│ │ │ │ └── impl
│ │ │ │ │ └── MainServiceImpl.java
│ │ │ │ ├── order
│ │ │ │ └── impl
│ │ │ │ │ └── OrderServiceImpl.java
│ │ │ │ ├── out
│ │ │ │ └── impl
│ │ │ │ │ └── OutStockServiceimpl.java
│ │ │ │ ├── stock
│ │ │ │ └── impl
│ │ │ │ │ └── StockServiceImpl.java
│ │ │ │ └── sys
│ │ │ │ ├── dao
│ │ │ │ ├── OperatorMapper.java
│ │ │ │ ├── OprtRoleMapper.java
│ │ │ │ ├── PermissionMapper.java
│ │ │ │ ├── RoleMapper.java
│ │ │ │ └── mapper
│ │ │ │ │ ├── OperatorMapper.xml
│ │ │ │ │ ├── OprtRoleMapper.xml
│ │ │ │ │ ├── PermissionMapper.xml
│ │ │ │ │ └── RoleMapper.xml
│ │ │ │ └── impl
│ │ │ │ ├── DictionaryServiceImpl.java
│ │ │ │ ├── OperatorServiceImpl.java
│ │ │ │ ├── PermisssionServiceImpl.java
│ │ │ │ ├── RoleServiceImpl.java
│ │ │ │ ├── SettingServiceImpl.java
│ │ │ │ └── SysServiceImpl.java
│ │ └── test
│ │ │ └── java
│ │ │ ├── AuthTest.java
│ │ │ └── JUnit4ClassRunner.java
│ └── wms-service.iml
└── wms-web
│ ├── pom.xml
│ ├── src
│ └── main
│ │ └── java
│ │ └── cn
│ │ └── luvletter
│ │ ├── base
│ │ ├── GoodsController.java
│ │ ├── StorageAreaController.java
│ │ ├── StorageLocationController.java
│ │ └── WarehouseController.java
│ │ ├── in
│ │ └── InStockController.java
│ │ ├── main
│ │ └── CommonController.java
│ │ ├── order
│ │ └── OrderController.java
│ │ ├── out
│ │ └── OutStockController.java
│ │ ├── stock
│ │ └── StockController.java
│ │ └── sys
│ │ ├── AuthController.java
│ │ ├── DictionaryController.java
│ │ ├── OperatorController.java
│ │ ├── RoleAssianmentController.java
│ │ └── SettingController.java
│ └── wms-web.iml
└── readme.md
/.idea/WMS.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/artifacts/luv_server_war.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | $PROJECT_DIR$/luv-server/target
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_alibaba_fastjson_1_2_38.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_auth0_java_jwt_3_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_codec_commons_codec_1_10.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_collections_commons_collections_3_2_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_dbcp_commons_dbcp_1_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_io_commons_io_2_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_lang_commons_lang_2_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__commons_pool_commons_pool_1_5_4.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_7_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__javax_servlet_jsp_jsp_api_2_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__log4j_log4j_1_2_17.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_30.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_commons_commons_lang3_3_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_apache_velocity_velocity_1_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15on_1_55.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_mybatis_generator_mybatis_generator_core_1_3_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_mybatis_mybatis_3_2_8.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_mybatis_mybatis_spring_1_2_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_acl_4_1_3_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_config_4_1_3_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_core_4_1_3_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_taglibs_4_1_3_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_security_spring_security_web_4_1_3_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_aop_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_beans_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_context_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_context_support_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_core_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_expression_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_jdbc_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_test_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_tx_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_web_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/libraries/Maven__org_springframework_spring_webmvc_4_3_7_RELEASE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/luv-server/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | cn.luvletter
8 | luv-wms-parent
9 | 1.0-SNAPSHOT
10 | ../luv-wms-parent/pom.xml
11 |
12 | cn.luvletter
13 | luv-server
14 | 1.0-SNAPSHOT
15 | war
16 |
17 |
18 |
19 |
20 | cn.luvletter
21 | wms-api
22 | 1.0-SNAPSHOT
23 |
24 |
25 | cn.luvletter
26 | wms-service
27 | 1.0-SNAPSHOT
28 |
29 |
30 | cn.luvletter
31 | wms-web
32 | 1.0-SNAPSHOT
33 |
34 |
35 |
36 |
37 | wms-server
38 |
39 |
--------------------------------------------------------------------------------
/luv-server/src/main/resources/jdbc.properties:
--------------------------------------------------------------------------------
1 | driver=com.mysql.jdbc.Driver
2 | url=jdbc:mysql://127.0.0.1:3306/luv_wms?useUnicode=true&characterEncoding=utf-8
3 | username=root
4 | password=123456
5 | #�����ʼ������
6 | initialSize=10
7 | #�������������
8 | maxActive=50
9 | #����������
10 | maxIdle=20
11 | #������ȴ�ʱ��
12 | maxWait=60000
13 | #����������
14 | minIdle=6
15 | #获取连接检测
16 | testOnBorrow=false
17 | testWhileIdle=true
18 | testOnReturn=false
19 | minEvictableIdleTimeMillis=300000
20 | validationQuery=SELECT 'x'
21 | timeBetweenEvictionRunsMillis=60000
--------------------------------------------------------------------------------
/luv-server/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | LOG_DIR = .\\luv_wms_log
2 | log4j.rootLogger = debug,stdout
3 |
4 | log4j.category.org.springframework = DEBUG,SPRING,stdout
5 | log4j.additivity.org.springframework = false
6 |
7 | log4j.category.cn.luvletter = DEBUG,LUV,stdout
8 | log4j.additivity.cn.luvletter = false
9 |
10 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender
11 | log4j.appender.stdout.Target = System.out
12 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
13 | log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
14 |
15 | # SPRING
16 | log4j.appender.SPRING=org.apache.log4j.RollingFileAppender
17 | log4j.appender.SPRING.File=${LOG_DIR}/luvwms-spring.log
18 | log4j.appender.SPRING.MaxBackupIndex=100
19 | log4j.appender.SPRING.MaxFileSize=5000000
20 | log4j.appender.SPRING.layout=org.apache.log4j.PatternLayout
21 | log4j.appender.SPRING.layout.ConversionPattern=[%d{ISO8601}] %-5p %-x %X{user} %n %m%n
22 |
23 | #LUV
24 | log4j.appender.LUV=org.apache.log4j.RollingFileAppender
25 | log4j.appender.LUV.File=${LOG_DIR}/luvwms.log
26 | log4j.appender.LUV.MaxBackupIndex=100
27 | log4j.appender.LUV.MaxFileSize=5000000
28 | log4j.appender.LUV.layout=org.apache.log4j.PatternLayout
29 | log4j.appender.LUV.layout.ConversionPattern=[%d{ISO8601}] %-5p %-x %X{user} %n %m%n
--------------------------------------------------------------------------------
/luv-server/src/main/resources/redis.properties:
--------------------------------------------------------------------------------
1 | # Redis settings
2 | redis.host=127.0.0.1
3 | redis.port=6379
4 | redis.pass=1234567
5 | redis.dbIndex=0
6 | redis.expiration=3000
7 | redis.maxIdle=300
8 | redis.maxActive=600
9 | redis.maxWait=1000
10 | redis.testOnBorrow=true
11 |
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Built-By: 72659
3 | Created-By: IntelliJ IDEA
4 | Build-Jdk: 1.8.0_144
5 |
6 |
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/WEB-INF/classes/jdbc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SimonXcx/LUVWMS/3b33084522892cc1a743bd94e6119e31ec3160f5/luv-server/src/main/webapp/WEB-INF/classes/jdbc.properties
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/WEB-INF/classes/log4j.properties:
--------------------------------------------------------------------------------
1 | LOG_DIR = D:\\logs
2 | log4j.rootLogger = debug,stdout
3 |
4 | log4j.category.org.springframework = DEBUG,SPRING,LUV
5 | log4j.additivity.org.springframework = false
6 |
7 | log4j.category.cn.luvletter = DEBUG,LUV
8 | log4j.additivity.cn.luvletter = false
9 |
10 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender
11 | log4j.appender.stdout.Target = System.out
12 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
13 | log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
14 |
15 | # SPRING
16 | log4j.appender.SPRING=org.apache.log4j.RollingFileAppender
17 | log4j.appender.SPRING.File=${LOG_DIR}/luvwms-spring.log
18 | log4j.appender.SPRING.MaxBackupIndex=100
19 | log4j.appender.SPRING.MaxFileSize=5000000
20 | log4j.appender.SPRING.layout=org.apache.log4j.PatternLayout
21 | log4j.appender.SPRING.layout.ConversionPattern=[%d{ISO8601}] %-5p %-x %X{user} %n %m%n
22 |
23 | #LUV
24 | log4j.appender.LUV = org.apache.log4j.ConsoleAppender
25 | log4j.appender.LUV.Target = System.out
26 | log4j.appender.LUV.layout = org.apache.log4j.PatternLayout
27 | log4j.appender.LUV.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/WEB-INF/config/spring/spring-mvc.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | Archetype Created Web Application
7 |
8 |
9 | contextConfigLocation
10 | /WEB-INF/config/spring/*.xml
11 |
12 |
13 |
14 | processFilter
15 | cn.luvletter.filter.ProcessFilter
16 |
17 |
18 | CharacterEncodingFilter
19 | org.springframework.web.filter.CharacterEncodingFilter
20 |
21 | encoding
22 | utf-8
23 |
24 |
25 |
26 | CharacterEncodingFilter
27 | /*
28 |
29 |
30 |
31 | springSecurityFilterChain
32 |
33 | org.springframework.web.filter.DelegatingFilterProxy
34 |
35 |
36 |
37 |
38 | processFilter
39 | /*
40 |
41 |
42 |
43 | springSecurityFilterChain
44 | /*
45 |
46 |
47 |
48 | org.springframework.web.context.ContextLoaderListener
49 |
50 |
51 | springmvc
52 | org.springframework.web.servlet.DispatcherServlet
53 |
54 | contextConfigLocation
55 | WEB-INF/config/spring/spring-mvc.xml
56 |
57 |
58 |
59 | springmvc
60 | /
61 |
62 |
63 |
--------------------------------------------------------------------------------
/luv-server/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 72659
4 | Date: 2018/2/9
5 | Time: 16:37
6 | --%>
7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
8 |
9 |
10 |
11 |
12 |
13 | WMS仓储管理系统
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/luv-wms-parent/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | cn.luvletter
8 | luv-comm
9 | 1.0-SNAPSHOT
10 | ../luv-comm/pom.xml
11 |
12 |
13 | luv-wms-parent
14 | 1.0-SNAPSHOT
15 | pom
16 |
17 |
18 |
19 |
20 | wms-api
21 | wms-service
22 | wms-web
23 | wms-common
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | luv-wms-parent
7 | cn.luvletter
8 | 1.0-SNAPSHOT
9 | ../pom.xml
10 |
11 | 4.0.0
12 | jar
13 | wms-api
14 |
15 |
16 |
17 | cn.luvletter
18 | wms-common
19 | 1.0-SNAPSHOT
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/GoodsService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base;
2 |
3 | import cn.luvletter.base.model.Goods;
4 | import cn.luvletter.base.vo.GoodsSerarchVo;
5 | import cn.luvletter.bean.ApiResult;
6 |
7 | import javax.servlet.http.HttpServletRequest;
8 | /**
9 | * @author Zephyr Ji
10 | * @ Description: 商品
11 | * @ Date 2018/3/28
12 | */
13 | public interface GoodsService {
14 | /**
15 | * @Description: 获取商品列表
16 | * @Date: 14:13 2018/3/28
17 | */
18 | ApiResult getGoods(GoodsSerarchVo serarchVo, HttpServletRequest httpServletRequest);
19 |
20 | /**
21 | * @Description: 更新商品
22 | * @Date: 14:14 2018/3/28
23 | */
24 | ApiResult update(Goods goods, HttpServletRequest httpServletRequest);
25 |
26 | /**
27 | * @Description: 删除商品
28 | * @Date: 14:14 2018/3/28
29 | */
30 | ApiResult delById(String id, HttpServletRequest httpServletRequest);
31 |
32 | /**
33 | * @Description: 新增商品
34 | * @Date: 14:15 2018/3/28
35 | */
36 | ApiResult sava(Goods goods, HttpServletRequest httpServletRequest);
37 |
38 | String genDn(String warehouse, String companyNo);
39 | }
40 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/StorageAreaService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base;
2 |
3 | import cn.luvletter.base.model.StorageArea;
4 | import cn.luvletter.bean.ApiResult;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 |
8 | /**
9 | * @author Zephyr Ji
10 | * @ Description: 库区接口
11 | * @ Date 2018/3/6
12 | */
13 | public interface StorageAreaService {
14 | /**
15 | * @Description: 获取所有库区
16 | * @Date: 9:17 2018/3/28
17 | */
18 | ApiResult getStorageArea(HttpServletRequest httpServletRequest);
19 |
20 | /**
21 | * @Description: 根据id删除库区
22 | * @Date: 9:17 2018/3/28
23 | */
24 | ApiResult delById(String id, HttpServletRequest httpServletRequest);
25 |
26 | /**
27 | * @Description: 新增库区
28 | * @Date: 9:18 2018/3/28
29 | */
30 | ApiResult sava(StorageArea storageArea, HttpServletRequest httpServletRequest);
31 |
32 | /**
33 | * @Description: 更新库区
34 | * @Date: 13:43 2018/3/28
35 | */
36 | ApiResult update(StorageArea storageArea, HttpServletRequest httpServletRequest);
37 | }
38 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/StorageLocationService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base;
2 |
3 | import cn.luvletter.base.model.StorageLocation;
4 | import cn.luvletter.base.vo.StorageLocationVo;
5 | import cn.luvletter.bean.ApiResult;
6 | import javax.servlet.http.HttpServletRequest;
7 |
8 | /**
9 | * @author Zephyr Ji
10 | * @ Description: 库位
11 | * @ Date 2018/3/6
12 | */
13 | public interface StorageLocationService {
14 | /**
15 | * @Description: 获取所有库位
16 | * @Date: 13:11 2018/3/28
17 | * @param httpServletRequest
18 | */
19 | ApiResult getStorageLocation(HttpServletRequest httpServletRequest);
20 |
21 | /**
22 | * @Description: 根据id删除库位
23 | * @Date: 13:11 2018/3/28
24 | */
25 | ApiResult delById(String id, HttpServletRequest httpServletRequest);
26 |
27 | /**
28 | * @Description: 批量新增库位
29 | * @Date: 13:12 2018/3/28
30 | * @param storageLocationVo
31 | * @param httpServletRequest
32 | */
33 | ApiResult sava(StorageLocationVo storageLocationVo, HttpServletRequest httpServletRequest);
34 |
35 | /**
36 | * @Description: 更新库位
37 | * @Date: 13:52 2018/3/28
38 | */
39 | ApiResult update(StorageLocation storageLocation, HttpServletRequest httpServletRequest);
40 | }
41 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/WarehouseService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base;
2 |
3 | import cn.luvletter.base.model.Warehouse;
4 | import cn.luvletter.bean.ApiResult;
5 |
6 | /**
7 | * @author Zephyr Ji
8 | * @ Description: TODO
9 | * @ Date 2018/3/6
10 | */
11 | public interface WarehouseService {
12 | ApiResult getStorageArea();
13 |
14 | ApiResult delById(String id);
15 |
16 | ApiResult sava(Warehouse warehouse);
17 | }
18 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/vo/GoodsSerarchVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base.vo;
2 |
3 | import java.io.UnsupportedEncodingException;
4 |
5 | /**
6 | * @author Zephyr Ji
7 | * @ Description: 商品列表查询参数
8 | * @ Date 2018/3/28
9 | */
10 | public class GoodsSerarchVo {
11 | private String goodsName;
12 | private String pn;
13 | private String goodsColor;
14 |
15 | public String getGoodsName() {
16 | return goodsName;
17 | }
18 |
19 | public void setGoodsName(String goodsName) throws UnsupportedEncodingException {
20 | this.goodsName = new String(goodsName.getBytes("ISO-8859-1"), "UTF-8");
21 | }
22 |
23 | public String getPn() {
24 | return pn;
25 | }
26 |
27 | public void setPn(String pn) {
28 | this.pn = pn;
29 | }
30 |
31 | public String getGoodsColor() {
32 | return goodsColor;
33 | }
34 |
35 | public void setGoodsColor(String goodsColor) throws UnsupportedEncodingException {
36 | this.goodsColor = new String(goodsColor.getBytes("ISO-8859-1"), "UTF-8");
37 | }
38 |
39 | @Override
40 | public String toString() {
41 | return "GoodsSerarchVo{" +
42 | "goodsName='" + goodsName + '\'' +
43 | ", pn='" + pn + '\'' +
44 | ", goodsColor='" + goodsColor + '\'' +
45 | '}';
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/base/vo/StorageLocationVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base.vo;
2 |
3 | import org.hibernate.validator.constraints.NotEmpty;
4 |
5 | /**
6 | * @author Zephyr Ji
7 | * @ Description: 批量新增库位
8 | * @ Date 2018/3/28
9 | */
10 | public class StorageLocationVo {
11 | /**
12 | * 库位开始编码
13 | */
14 | @NotEmpty(message = "库位开始编码不能为空 ")
15 | private String storageLocationStart;
16 | /**
17 | * 库位结束编码
18 | */
19 | @NotEmpty(message = "库位结束编码不能为空 ")
20 | private String storageLocationEnd;
21 | /**
22 | * 区域编号
23 | */
24 | @NotEmpty(message = "区域编号不能为空 ")
25 | private String areaNo;
26 | /**
27 | * 库位类型
28 | */
29 | @NotEmpty(message = "库位类型不能为空 ")
30 | private String storageLocationType;
31 |
32 | public String getStorageLocationStart() {
33 | return storageLocationStart;
34 | }
35 |
36 | public void setStorageLocationStart(String storageLocationStart) {
37 | this.storageLocationStart = storageLocationStart;
38 | }
39 |
40 | public String getStorageLocationEnd() {
41 | return storageLocationEnd;
42 | }
43 |
44 | public void setStorageLocationEnd(String storageLocationEnd) {
45 | this.storageLocationEnd = storageLocationEnd;
46 | }
47 |
48 | public String getAreaNo() {
49 | return areaNo;
50 | }
51 |
52 | public void setAreaNo(String areaNo) {
53 | this.areaNo = areaNo;
54 | }
55 |
56 | public String getStorageLocationType() {
57 | return storageLocationType;
58 | }
59 |
60 | public void setStorageLocationType(String storageLocationType) {
61 | this.storageLocationType = storageLocationType;
62 | }
63 |
64 | @Override
65 | public String toString() {
66 | return "StorageLocationVo{" +
67 | "storageLocationStart='" + storageLocationStart + '\'' +
68 | ", storageLocationEnd='" + storageLocationEnd + '\'' +
69 | ", areaNo='" + areaNo + '\'' +
70 | ", storageLocationType='" + storageLocationType + '\'' +
71 | '}';
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/in/InStockService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.in;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import org.springframework.web.multipart.MultipartFile;
5 |
6 | import javax.servlet.http.HttpServletRequest; /**
7 | * @author Zephyr Ji
8 | * @ Description: TODO
9 | * @ Date 2018/3/29
10 | */
11 | public interface InStockService {
12 | /**
13 | * @Description: 获取入库单列表
14 | * @Date: 11:14 2018/3/29
15 | */
16 | ApiResult getInStock(HttpServletRequest httpServletRequest);
17 | /**
18 | * @Description: 根据id获取入库单明细
19 | * @Date: 11:14 2018/3/29
20 | */
21 | ApiResult getInDtl(String id, HttpServletRequest httpServletRequest);
22 |
23 | /**
24 | * @Description: 导入入库单
25 | * @Date: 14:06 2018/4/3
26 | */
27 | ApiResult uploadInStock(MultipartFile file, HttpServletRequest httpServletRequest);
28 | }
29 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/main/MainService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.main;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/2
9 | */
10 | public interface MainService {
11 | /**
12 | * @Description: 列表字段翻译
13 | * @Date: 15:07 2018/4/2
14 | */
15 | ApiResult getComboBox(String pid, String value);
16 |
17 | /**
18 | * 获取下拉框选项
19 | * @param pid
20 | * @return
21 | */
22 | ApiResult getSelectDS(String pid);
23 | }
24 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/main/model/Dictionary.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.main.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Date;
5 |
6 | /**
7 | * @author Zephyr
8 | * @Description: 字典
9 | * @Date 2018/4/2
10 | */
11 | public class Dictionary implements Serializable {
12 |
13 | private static final long serialVersionUID = -712002438953498525L;
14 |
15 | private Long id;
16 | private String rid;
17 | private String paraId;
18 | private String text;
19 | private String remark;
20 | private String pid;
21 | private Date gmtCreate;
22 | private Date gmtModified;
23 |
24 | public Long getId() {
25 | return id;
26 | }
27 |
28 | public void setId(Long id) {
29 | this.id = id;
30 | }
31 |
32 | public String getRid() {
33 | return rid;
34 | }
35 |
36 | public void setRid(String rid) {
37 | this.rid = rid;
38 | }
39 |
40 | public String getParaId() {
41 | return paraId;
42 | }
43 |
44 | public void setParaId(String paraId) {
45 | this.paraId = paraId;
46 | }
47 |
48 | public String getText() {
49 | return text;
50 | }
51 |
52 | public void setText(String text) {
53 | this.text = text;
54 | }
55 |
56 | public String getRemark() {
57 | return remark;
58 | }
59 |
60 | public void setRemark(String remark) {
61 | this.remark = remark;
62 | }
63 |
64 | public String getPid() {
65 | return pid;
66 | }
67 |
68 | public void setPid(String pid) {
69 | this.pid = pid;
70 | }
71 |
72 | public Date getGmtCreate() {
73 | return gmtCreate;
74 | }
75 |
76 | public void setGmtCreate(Date gmtCreate) {
77 | this.gmtCreate = gmtCreate;
78 | }
79 |
80 | public Date getGmtModified() {
81 | return gmtModified;
82 | }
83 |
84 | public void setGmtModified(Date gmtModified) {
85 | this.gmtModified = gmtModified;
86 | }
87 |
88 | @Override
89 | public String toString() {
90 | return "Dictionary{" +
91 | "id=" + id +
92 | ", rid='" + rid + '\'' +
93 | ", paraId='" + paraId + '\'' +
94 | ", text='" + text + '\'' +
95 | ", remark='" + remark + '\'' +
96 | ", pid='" + pid + '\'' +
97 | ", gmtCreate=" + gmtCreate +
98 | ", gmtModified=" + gmtModified +
99 | '}';
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/main/vo/SelectDSVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.main.vo;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/10
9 | */
10 | public class SelectDSVo implements Serializable {
11 |
12 | private static final long serialVersionUID = 5616243027392526908L;
13 |
14 | private String label;
15 | private String value;
16 |
17 | public String getLabel() {
18 | return label;
19 | }
20 |
21 | public void setLabel(String label) {
22 | this.label = label;
23 | }
24 |
25 | public String getValue() {
26 | return value;
27 | }
28 |
29 | public void setValue(String value) {
30 | this.value = value;
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return "SelectDSVo{" +
36 | "label='" + label + '\'' +
37 | ", value='" + value + '\'' +
38 | '}';
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/order/OrderService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.order;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | import javax.servlet.http.HttpServletRequest; /**
6 | * @author Zephyr
7 | * @Description: 订单接口
8 | * @Date 2018/4/3
9 | */
10 | public interface OrderService {
11 | /**
12 | * @Description: 获取订单列表
13 | * @Date: 10:45 2018/4/3
14 | */
15 | ApiResult getOrder(HttpServletRequest httpServletRequest);
16 | /**
17 | * @Description:获取订单明细
18 | * @Date: 10:46 2018/4/3
19 | */
20 | ApiResult getOrderDtl(String id, HttpServletRequest httpServletRequest);
21 | }
22 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/out/OutStockService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.out;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 | /**
7 | * @author Zephyr
8 | * @Description:
9 | * @Date 2018/3/29
10 | */
11 | public interface OutStockService {
12 | /**
13 | * @Description: 获取出库单列表
14 | * @Date: 13:31 2018/3/29
15 | */
16 | ApiResult getOutStock(HttpServletRequest httpServletRequest);
17 | /**
18 | * @Description: 获取出库单明细
19 | * @Date: 13:31 2018/3/29
20 | */
21 | ApiResult getOutStockDtl(String id, HttpServletRequest httpServletRequest);
22 | }
23 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/stock/StockService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.stock;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 |
7 | /**
8 | * @author Zephyr
9 | * @Description: 库存
10 | * @Date 2018/4/9
11 | */
12 | public interface StockService {
13 |
14 | /**
15 | * @Description: 获取库存表头
16 | * @Date: 16:43 2018/4/9
17 | */
18 | ApiResult getStock(HttpServletRequest httpServletRequest);
19 |
20 | /**
21 | * @Description: 获取库存表明细
22 | * @Date: 16:43 2018/4/9
23 | */
24 | ApiResult getStockDtl(String id, HttpServletRequest httpServletRequest);
25 | }
26 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/stock/vo/StockVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.stock.vo;
2 |
3 | import cn.luvletter.base.model.Goods;
4 | import cn.luvletter.stock.model.Stock;
5 |
6 | /**
7 | * @author Zephyr
8 | * @Description:
9 | * @Date 2018/4/9
10 | */
11 | public class StockVo extends Stock {
12 |
13 | private Goods goods;
14 |
15 | public Goods getGoods() {
16 | return goods;
17 | }
18 |
19 | public void setGoods(Goods goods) {
20 | this.goods = goods;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/DictionaryService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.main.model.Dictionary;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | /**
8 | * @author Zephyr
9 | * @Description:
10 | * @Date 2018/4/21
11 | */
12 | public interface DictionaryService {
13 | ApiResult getDictionary(HttpServletRequest httpServletRequest);
14 |
15 | ApiResult update(Dictionary dictionary, HttpServletRequest httpServletRequest);
16 |
17 | ApiResult delById(String id, HttpServletRequest httpServletRequest);
18 |
19 | ApiResult sava(Dictionary dictionary, HttpServletRequest httpServletRequest);
20 | }
21 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/OperatorService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.sys.model.Operator;
5 |
6 | import javax.servlet.http.HttpServletRequest; /**
7 | * @author Zephyr
8 | * @Description: 人员
9 | * @Date 2018/4/20
10 | */
11 | public interface OperatorService {
12 | /**
13 | * @Description: 获取人员列表
14 | * @Date: 16:46 2018/4/20
15 | */
16 | ApiResult getOperators(HttpServletRequest httpServletRequest);
17 |
18 | /**
19 | * @Description: 更新人员信息
20 | * @Date: 16:47 2018/4/20
21 | */
22 | ApiResult update(Operator operator, HttpServletRequest httpServletRequest);
23 |
24 | /**
25 | * @Description: 删除人员信息
26 | * @Date: 16:48 2018/4/20
27 | */
28 | ApiResult delById(String id, HttpServletRequest httpServletRequest);
29 |
30 | /**
31 | * @Description: 新增人员信息
32 | * @Date: 16:48 2018/4/20
33 | */
34 | ApiResult sava(Operator operator, HttpServletRequest httpServletRequest);
35 | }
36 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/PermissionService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/17
9 | */
10 | public interface PermissionService {
11 | /**
12 | * @Description: 树根据key获取节点
13 | * @Date: 15:08 2018/4/17
14 | */
15 | ApiResult getPermission(String key);
16 | }
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/RoleService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/17
9 | */
10 | public interface RoleService {
11 | /**
12 | * @Description: 获得所有角色
13 | * @Date: 14:43 2018/4/17
14 | */
15 | ApiResult getRule();
16 | }
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/SettingService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.sys.model.Permission;
5 |
6 | /**
7 | * @author Zephyr Ji
8 | * @ Description: 系统设置接口
9 | * @ Date 2018/3/1
10 | */
11 | public interface SettingService {
12 | /**
13 | * @Description: 得到所有菜单
14 | * @Date: 14:14 2018/3/1
15 | */
16 | ApiResult getNavigation();
17 |
18 | /**
19 | * @Description: 删除菜单配置
20 | * @Date: 14:46 2018/3/2
21 | */
22 | ApiResult delNavigation(String id);
23 |
24 | /**
25 | * @Description: 新增菜单
26 | * @Date: 11:25 2018/3/5
27 | */
28 | ApiResult saveNavigation(Permission permission);
29 |
30 | /**
31 | * @Description: 更新菜单
32 | * @Date: 11:27 2018/3/5
33 | */
34 | ApiResult updateNavigation(Permission permission);
35 | }
36 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/api/SysService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.api;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.bean.AuthenticationBean;
5 | import cn.luvletter.sys.model.Operator;
6 |
7 | import javax.servlet.http.HttpServletResponse;
8 |
9 | /**
10 | * @author Zephyr Ji
11 | * @ Description: TODO
12 | * @ Date 2018/2/13
13 | */
14 | public interface SysService {
15 | ApiResult register(Operator operator);
16 | ApiResult login(AuthenticationBean authenticationBean, HttpServletResponse response);
17 | String refresh(String oldToken);
18 | ApiResult getAuth();
19 | ApiResult getNav(String operatorNo);
20 | }
21 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/model/OprtRole.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Date;
5 |
6 | public class OprtRole implements Serializable {
7 | private Integer id;
8 |
9 | /**
10 | * 用户账号
11 | *
12 | * @mbggenerated
13 | */
14 | private String oprtNo;
15 |
16 | /**
17 | * 角色编号
18 | *
19 | * @mbggenerated
20 | */
21 | private String roleNo;
22 |
23 | /**
24 | * 创建时间
25 | *
26 | * @mbggenerated
27 | */
28 | private Date gmtCreate;
29 |
30 | private static final long serialVersionUID = 1L;
31 |
32 | public Integer getId() {
33 | return id;
34 | }
35 |
36 | public void setId(Integer id) {
37 | this.id = id;
38 | }
39 |
40 | public String getOprtNo() {
41 | return oprtNo;
42 | }
43 |
44 | public void setOprtNo(String oprtNo) {
45 | this.oprtNo = oprtNo;
46 | }
47 |
48 | public String getRoleNo() {
49 | return roleNo;
50 | }
51 |
52 | public void setRoleNo(String roleNo) {
53 | this.roleNo = roleNo;
54 | }
55 |
56 | public Date getGmtCreate() {
57 | return gmtCreate;
58 | }
59 |
60 | public void setGmtCreate(Date gmtCreate) {
61 | this.gmtCreate = gmtCreate;
62 | }
63 |
64 | @Override
65 | public String toString() {
66 | StringBuilder sb = new StringBuilder();
67 | sb.append(getClass().getSimpleName());
68 | sb.append(" [");
69 | sb.append("Hash = ").append(hashCode());
70 | sb.append(", id=").append(id);
71 | sb.append(", oprtNo=").append(oprtNo);
72 | sb.append(", roleNo=").append(roleNo);
73 | sb.append(", gmtCreate=").append(gmtCreate);
74 | sb.append("]");
75 | return sb.toString();
76 | }
77 |
78 | @Override
79 | public boolean equals(Object that) {
80 | if (this == that) {
81 | return true;
82 | }
83 | if (that == null) {
84 | return false;
85 | }
86 | if (getClass() != that.getClass()) {
87 | return false;
88 | }
89 | OprtRole other = (OprtRole) that;
90 | return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
91 | && (this.getOprtNo() == null ? other.getOprtNo() == null : this.getOprtNo().equals(other.getOprtNo()))
92 | && (this.getRoleNo() == null ? other.getRoleNo() == null : this.getRoleNo().equals(other.getRoleNo()))
93 | && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()));
94 | }
95 |
96 | @Override
97 | public int hashCode() {
98 | final int prime = 31;
99 | int result = 1;
100 | result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
101 | result = prime * result + ((getOprtNo() == null) ? 0 : getOprtNo().hashCode());
102 | result = prime * result + ((getRoleNo() == null) ? 0 : getRoleNo().hashCode());
103 | result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
104 | return result;
105 | }
106 | }
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/model/Permission.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.model;
2 |
3 | /**
4 | * @author Zephyr Ji
5 | * @ Description: 权限
6 | * @ Date 2018/2/10
7 | */
8 | public class Permission {
9 | /**
10 | * 主键
11 | */
12 | private int id;
13 | private String permissionNo;
14 | private String permissionName;
15 | private String permissionDesc;
16 | private String permissionUrl;
17 | private String permissionPid;
18 | private String permissionIcon;
19 | private String isLeaf;
20 | private String check;
21 |
22 | public String getCheck() {
23 | return check;
24 | }
25 |
26 | public void setCheck(String check) {
27 | this.check = check;
28 | }
29 |
30 | public String getIsLeaf() {
31 | return isLeaf;
32 | }
33 |
34 | public void setIsLeaf(String isLeaf) {
35 | this.isLeaf = isLeaf;
36 | }
37 |
38 | public int getId() {
39 | return id;
40 | }
41 |
42 | public void setId(int id) {
43 | this.id = id;
44 | }
45 |
46 | public String getPermissionNo() {
47 | return permissionNo;
48 | }
49 |
50 | public void setPermissionNo(String permissionNo) {
51 | this.permissionNo = permissionNo;
52 | }
53 |
54 | public String getPermissionName() {
55 | return permissionName;
56 | }
57 |
58 | public void setPermissionName(String permissionName) {
59 | this.permissionName = permissionName;
60 | }
61 |
62 | public String getPermissionDesc() {
63 | return permissionDesc;
64 | }
65 |
66 | public void setPermissionDesc(String permissionDesc) {
67 | this.permissionDesc = permissionDesc;
68 | }
69 |
70 | public String getPermissionUrl() {
71 | return permissionUrl;
72 | }
73 |
74 | public void setPermissionUrl(String permissionUrl) {
75 | this.permissionUrl = permissionUrl;
76 | }
77 |
78 | public String getPermissionIcon() {
79 | return permissionIcon;
80 | }
81 |
82 | public void setPermissionIcon(String permissionIcon) {
83 | this.permissionIcon = permissionIcon;
84 | }
85 |
86 | public String getPermissionPid() {
87 | return permissionPid;
88 | }
89 |
90 | public void setPermissionPid(String permissionPid) {
91 | this.permissionPid = permissionPid;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/model/PermissionTree.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.model;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/18
9 | */
10 | public class PermissionTree extends Permission {
11 | private List permissionChild;
12 |
13 | public List getPermissionChild() {
14 | return permissionChild;
15 | }
16 |
17 | public void setPermissionChild(List permissionChild) {
18 | this.permissionChild = permissionChild;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/model/Role.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.model;
2 |
3 | /**
4 | * @author Zephyr
5 | * @Description:
6 | * @Date 2018/4/17
7 | */
8 | public class Role {
9 | private Integer id;
10 | /**
11 | * 角色编号
12 | */
13 | private String roleNo;
14 | /**
15 | * 角色名称
16 | */
17 | private String roleName;
18 |
19 | public Integer getId() {
20 | return id;
21 | }
22 |
23 | public void setId(Integer id) {
24 | this.id = id;
25 | }
26 |
27 | public String getRoleNo() {
28 | return roleNo;
29 | }
30 |
31 | public void setRoleNo(String roleNo) {
32 | this.roleNo = roleNo;
33 | }
34 |
35 | public String getRoleName() {
36 | return roleName;
37 | }
38 |
39 | public void setRoleName(String roleName) {
40 | this.roleName = roleName;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/vo/NavigationVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.vo;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description: 菜单
8 | * @Date 2018/4/21
9 | */
10 | public class NavigationVo {
11 | /**
12 | * 标题
13 | */
14 | private String text;
15 | /**
16 | * 路径
17 | */
18 | private String to;
19 | /**
20 | * 图标
21 | */
22 | private String icon;
23 | /**
24 | * 子菜单
25 | */
26 | private List children;
27 |
28 | public String getText() {
29 | return text;
30 | }
31 |
32 | public void setText(String text) {
33 | this.text = text;
34 | }
35 |
36 | public String getTo() {
37 | return to;
38 | }
39 |
40 | public void setTo(String to) {
41 | this.to = to;
42 | }
43 |
44 | public String getIcon() {
45 | return icon;
46 | }
47 |
48 | public void setIcon(String icon) {
49 | this.icon = icon;
50 | }
51 |
52 | public List getChildren() {
53 | return children;
54 | }
55 |
56 | public void setChildren(List children) {
57 | this.children = children;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-api/src/main/java/cn/luvletter/sys/vo/OperatorVo.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.sys.vo;
2 |
3 | import cn.luvletter.sys.model.Operator;
4 |
5 | import java.util.Date;
6 | import java.util.List;
7 |
8 | /**
9 | * @author Zephyr
10 | * @Description:
11 | * @Date 2018/4/20
12 | */
13 | public class OperatorVo {
14 | /**
15 | * 主键
16 | *
17 | * @mbggenerated
18 | */
19 | private Long id;
20 |
21 | /**
22 | * 帐号
23 | *
24 | * @mbggenerated
25 | */
26 | private String no;
27 |
28 | /**
29 | * 名称
30 | *
31 | * @mbggenerated
32 | */
33 | private String name;
34 |
35 | /**
36 | * 地址
37 | *
38 | * @mbggenerated
39 | */
40 | private String address;
41 |
42 | /**
43 | * 联系电话
44 | *
45 | * @mbggenerated
46 | */
47 | private Long phone;
48 |
49 | /**
50 | * 性别
51 | *
52 | * @mbggenerated
53 | */
54 | private String sex;
55 |
56 | /**
57 | * 状态
58 | *
59 | * @mbggenerated
60 | */
61 | private Integer flag;
62 |
63 | /**
64 | * 创建人ID
65 | *
66 | * @mbggenerated
67 | */
68 | private Long oprtNo;
69 |
70 | /**
71 | * 创建人
72 | *
73 | * @mbggenerated
74 | */
75 | private String oprtName;
76 |
77 | /**
78 | * 创建时间
79 | *
80 | * @mbggenerated
81 | */
82 | private Date oprtTime;
83 |
84 | /**
85 | * 角色no
86 | */
87 | private List roleList;
88 |
89 | public List getRoleList() {
90 | return roleList;
91 | }
92 |
93 | public void setRoleList(List roleList) {
94 | this.roleList = roleList;
95 | }
96 |
97 | public Long getId() {
98 | return id;
99 | }
100 |
101 | public void setId(Long id) {
102 | this.id = id;
103 | }
104 |
105 | public String getNo() {
106 | return no;
107 | }
108 |
109 | public void setNo(String no) {
110 | this.no = no;
111 | }
112 |
113 | public String getName() {
114 | return name;
115 | }
116 |
117 | public void setName(String name) {
118 | this.name = name;
119 | }
120 |
121 | public String getAddress() {
122 | return address;
123 | }
124 |
125 | public void setAddress(String address) {
126 | this.address = address;
127 | }
128 |
129 | public Long getPhone() {
130 | return phone;
131 | }
132 |
133 | public void setPhone(Long phone) {
134 | this.phone = phone;
135 | }
136 |
137 | public String getSex() {
138 | return sex;
139 | }
140 |
141 | public void setSex(String sex) {
142 | this.sex = sex;
143 | }
144 |
145 | public Integer getFlag() {
146 | return flag;
147 | }
148 |
149 | public void setFlag(Integer flag) {
150 | this.flag = flag;
151 | }
152 |
153 | public Long getOprtNo() {
154 | return oprtNo;
155 | }
156 |
157 | public void setOprtNo(Long oprtNo) {
158 | this.oprtNo = oprtNo;
159 | }
160 |
161 | public String getOprtName() {
162 | return oprtName;
163 | }
164 |
165 | public void setOprtName(String oprtName) {
166 | this.oprtName = oprtName;
167 | }
168 |
169 | public Date getOprtTime() {
170 | return oprtTime;
171 | }
172 |
173 | public void setOprtTime(Date oprtTime) {
174 | this.oprtTime = oprtTime;
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | luv-wms-parent
7 | cn.luvletter
8 | 1.0-SNAPSHOT
9 | ../pom.xml
10 |
11 | 4.0.0
12 | jar
13 |
14 | wms-common
15 |
16 |
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/base/BaseController.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.base;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import org.springframework.context.ApplicationContext;
5 | import org.springframework.web.bind.annotation.ExceptionHandler;
6 |
7 | /**
8 | * @author Zephyr Ji
9 | * @ Description: 基础controller ,异常处理
10 | * @ Date 2018/2/9
11 | */
12 | public class BaseController {
13 | @ExceptionHandler
14 | public ApiResult exceptionHandler(Exception e){
15 | ApiResult apiResult = new ApiResult().isFalse();
16 | if(e instanceof ApplicationContext){
17 | apiResult.setMessage(e.getMessage());
18 | }else {
19 | e.printStackTrace();
20 | apiResult.setMessage("系统异常");
21 | }
22 | return apiResult;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/bean/ApiResult.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.bean;
2 |
3 | import org.springframework.validation.BindingResult;
4 | import org.springframework.validation.FieldError;
5 |
6 | import java.io.Serializable;
7 | import java.util.List;
8 |
9 | /**
10 | * @author Zephyr Ji
11 | * @ Description: 返回前端实体
12 | * @ Date 2018/2/9
13 | */
14 | public class ApiResult implements Serializable{
15 |
16 | private static final long serialVersionUID = 1837004257486125428L;
17 | /**
18 | * 返回状态,默认成功success,失败false
19 | */
20 | private String status = "success";
21 | /**
22 | * 返回消息
23 | */
24 | private String message;
25 | /**
26 | * 数据
27 | */
28 | private Object data;
29 |
30 | private long total;
31 |
32 | public ApiResult() {}
33 | public ApiResult(String message){
34 | this.message = message;
35 | }
36 | public ApiResult(String message, Object data) {
37 | this.message = message;
38 | this.data = data;
39 | }
40 |
41 | public ApiResult isFalse(){
42 | this.status="false";
43 | return this;
44 | }
45 |
46 | public void setMessage(List fieldErrorList){
47 | StringBuilder sb = new StringBuilder();
48 | for(FieldError fieldError : fieldErrorList){
49 | sb.append(fieldError.getDefaultMessage());
50 | }
51 | this.setMessage(sb.toString());
52 | }
53 |
54 | public long getTotal() {
55 | return total;
56 | }
57 |
58 | public void setTotal(long total) {
59 | this.total = total;
60 | }
61 |
62 | public String getMessage() {
63 | return message;
64 | }
65 |
66 | public void setMessage(String message) {
67 | this.message = message;
68 | }
69 |
70 | public Object getData() {
71 | return data;
72 | }
73 |
74 | public void setData(Object data) {
75 | this.data = data;
76 | }
77 |
78 | public String getStatus() {
79 | return status;
80 | }
81 |
82 | @Override
83 | public String toString() {
84 | return "ApiResult{" +
85 | "status='" + status + '\'' +
86 | ", message='" + message + '\'' +
87 | ", data=" + data +
88 | ", total=" + total +
89 | '}';
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/bean/AuthBean.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.bean;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @author Zephyr
7 | * @Description:
8 | * @Date 2018/4/24
9 | */
10 | public class AuthBean {
11 | private String url;
12 |
13 | private String name;
14 |
15 | public String getName() {
16 | return name;
17 | }
18 |
19 | public void setName(String name) {
20 | this.name = name;
21 | }
22 |
23 | public String getUrl() {
24 |
25 | return url;
26 | }
27 |
28 | public void setUrl(String url) {
29 | this.url = url;
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | return "AuthBean{" +
35 | "url='" + url + '\'' +
36 | ", name='" + name + '\'' +
37 | '}';
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/bean/AuthenticationBean.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.bean;
2 |
3 | /**
4 | * @author Zephyr Ji
5 | * @ Description: 登陆信息
6 | * @ Date 2018/2/11
7 | */
8 | public class AuthenticationBean {
9 | private String account;
10 | private String password;
11 | private String roleNo;
12 | private String idAddr;
13 | private String warehouseNo;
14 | private boolean checkbox;
15 |
16 |
17 | public String getWarehouseNo() {
18 | return warehouseNo;
19 | }
20 |
21 | public void setWarehouseNo(String warehouseNo) {
22 | this.warehouseNo = warehouseNo;
23 | }
24 |
25 | public String getIdAddr() {
26 | return idAddr;
27 | }
28 |
29 | public void setIdAddr(String idAddr) {
30 | this.idAddr = idAddr;
31 | }
32 |
33 | public String getAccount() {
34 | return account;
35 | }
36 |
37 | public void setAccount(String account) {
38 | this.account = account;
39 | }
40 |
41 | public String getPassword() {
42 | return password;
43 | }
44 |
45 | public void setPassword(String password) {
46 | this.password = password;
47 | }
48 |
49 | public String getRoleNo() {
50 | return roleNo;
51 | }
52 |
53 | public void setRoleNo(String roleNo) {
54 | this.roleNo = roleNo;
55 | }
56 |
57 | public boolean isCheckbox() {
58 | return checkbox;
59 | }
60 |
61 | public void setCheckbox(boolean checkbox) {
62 | this.checkbox = checkbox;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/bean/PrintBean.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.bean;
2 |
3 | import org.springframework.beans.BeansException;
4 | import org.springframework.beans.factory.BeanFactory;
5 | import org.springframework.beans.factory.BeanFactoryAware;
6 | import org.springframework.beans.factory.support.DefaultListableBeanFactory;
7 | import org.springframework.context.ApplicationContext;
8 | import org.springframework.context.ApplicationContextAware;
9 | import org.springframework.stereotype.Component;
10 |
11 | /**
12 | * @author Zephyr Ji
13 | * @ Description: TODO
14 | * @ Date 2018/3/9
15 | */
16 | @Component
17 | public class PrintBean implements BeanFactoryAware ,ApplicationContextAware{
18 | private DefaultListableBeanFactory beanFactory;
19 | private ApplicationContext applicationContext;
20 | @Override
21 | public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
22 | this.beanFactory = (DefaultListableBeanFactory) beanFactory;
23 | }
24 |
25 | @Override
26 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
27 | this.applicationContext = applicationContext;
28 | this.printThisContentBean();
29 | }
30 |
31 | private void printThisContentBean(){
32 | String[] beanDefinitionNames = this.beanFactory.getBeanDefinitionNames();
33 | for (String beanDefName : beanDefinitionNames) {
34 | System.out.println("SpringBean==========" + beanDefName);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/config/CacheConfig.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.config;
2 |
3 | import org.springframework.cache.CacheManager;
4 | import org.springframework.cache.annotation.CachingConfigurerSupport;
5 | import org.springframework.cache.annotation.EnableCaching;
6 | import org.springframework.cache.interceptor.KeyGenerator;
7 | import org.springframework.context.annotation.Bean;
8 | import org.springframework.context.annotation.Configuration;
9 | import org.springframework.context.annotation.Primary;
10 | import org.springframework.data.redis.cache.RedisCacheManager;
11 | import org.springframework.data.redis.core.RedisTemplate;
12 |
13 |
14 | /**
15 | * @author Zephyr
16 | * @Description:
17 | * @Date 2018/4/24
18 | */
19 | @Configuration
20 | @EnableCaching
21 | public class CacheConfig extends CachingConfigurerSupport {
22 |
23 | @Bean("simpleKeyGenerator")
24 | @Primary
25 | public KeyGenerator simpleKeyGenerator() {
26 | return (target, method, params) -> {
27 | StringBuilder sb = new StringBuilder();
28 | sb.append(target.getClass().getName());
29 | sb.append(method.getName());
30 | for (Object obj : params) {
31 | sb.append(obj.toString());
32 | }
33 | return sb.toString();
34 | };
35 | }
36 |
37 | @Bean("cacheManager")
38 | @Primary
39 | public CacheManager cacheManager(RedisTemplate redisTemplate){
40 | return new RedisCacheManager(redisTemplate);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.config;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.annotation.PropertySource;
7 | import org.springframework.core.env.Environment;
8 | import org.springframework.data.redis.cache.RedisCacheManager;
9 | import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
10 | import org.springframework.data.redis.core.RedisTemplate;
11 | import org.springframework.data.redis.serializer.RedisSerializer;
12 | import org.springframework.data.redis.serializer.StringRedisSerializer;
13 | import redis.clients.jedis.JedisPoolConfig;
14 |
15 | /**
16 | * @author Zephyr Ji
17 | * @ Description: redis 的一些bean 库位
18 | * @ Date 2018/3/6
19 | */
20 | @Configuration
21 | @PropertySource("classpath:/redis.properties")
22 | public class RedisConfig {
23 | @Autowired
24 | private Environment env;
25 | @Bean
26 | public JedisPoolConfig jedisPoolConfig(){
27 | JedisPoolConfig poolConfig = new JedisPoolConfig();
28 | poolConfig.setMaxIdle(env.getProperty("redis.maxIdle",Integer.class));
29 | poolConfig.setMaxTotal(env.getProperty("redis.maxActive",Integer.class));
30 | poolConfig.setMaxWaitMillis(env.getProperty("redis.maxWait",Long.class));
31 | poolConfig.setTestOnBorrow(env.getProperty("redis.testOnBorrow",Boolean.class));
32 | return poolConfig;
33 | }
34 | @Bean
35 | public JedisConnectionFactory jedisConnectionFactory(JedisPoolConfig jedisPoolConfig){
36 | JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
37 | connectionFactory.setHostName(env.getProperty("redis.host"));
38 | connectionFactory.setPort(env.getProperty("redis.port",Integer.class));
39 | connectionFactory.setPassword(env.getProperty("redis.pass"));
40 | connectionFactory.setDatabase(env.getProperty("redis.dbIndex",Integer.class));
41 | connectionFactory.setPoolConfig(jedisPoolConfig);
42 | return connectionFactory;
43 | }
44 | @Bean
45 | public RedisTemplate redisTemplate (JedisConnectionFactory jedisConnectionFactory){
46 | RedisTemplate template = new RedisTemplate();
47 | RedisSerializer stringSerializer = new StringRedisSerializer();
48 | template.setConnectionFactory(jedisConnectionFactory);
49 | template.setStringSerializer(stringSerializer);
50 | return template;
51 | }
52 | @Bean
53 | public RedisCacheManager redisCacheManager(RedisTemplate redisTemplate){
54 | RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
55 | cacheManager.setDefaultExpiration(env.getProperty("redis.expiration",Long.class));
56 | return cacheManager;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/constant/SqlConstant.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.constant;
2 |
3 | /**
4 | * @author Zephyr Ji
5 | * @ Description: TODO
6 | * @ Date 2018/2/24
7 | */
8 | public class SqlConstant {
9 | public static final String SELECT_OPRT_BY_NO = "select No account,`password` from sys_operator where NO=? ";
10 | public static final String SELECT_ALL_AUTH = "select sr.role_name name,sp.permission_url url from sys_permission sp LEFT JOIN sys_role_permission srp on sp.permission_no=srp.permission_no\n" +
11 | "LEFT JOIN sys_role sr on srp.role_no=sr.role_no where 1=1 and sp.permission_pid !=0";
12 | }
13 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/exception/ApplicationException.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.exception;
2 |
3 | /**
4 | * @author Zephyr Ji
5 | * @ Description: 应用异常
6 | * @ Date 2018/2/9
7 | */
8 | public class ApplicationException extends RuntimeException {
9 | public ApplicationException() {
10 | super();
11 | }
12 |
13 | public ApplicationException(String message) {
14 | super(message);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/exception/InvalidTokenException.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.exception;
2 |
3 | /**
4 | * @author Zephyr Ji
5 | * @ Description: token失效异常
6 | * @ Date 2018/2/26
7 | */
8 | public class InvalidTokenException extends RuntimeException{
9 | public InvalidTokenException() {
10 | super();
11 | }
12 |
13 | public InvalidTokenException(String message) {
14 | super(message);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/filter/CustomAuthenticationFilter.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.filter;
2 |
3 | import cn.luvletter.bean.AuthenticationBean;
4 | import com.fasterxml.jackson.databind.ObjectMapper;
5 | import org.springframework.http.MediaType;
6 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
7 | import org.springframework.security.core.Authentication;
8 | import org.springframework.security.core.AuthenticationException;
9 | import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
10 |
11 | import javax.servlet.http.HttpServletRequest;
12 | import javax.servlet.http.HttpServletResponse;
13 | import java.io.IOException;
14 | import java.io.InputStream;
15 |
16 | /**
17 | * @author Zephyr Ji
18 | * @ Description: 自定义身份验证过滤器,重写了获取账号和密码的方式,以json方式获取
19 | * @ Date 2018/2/11
20 | */
21 | public class CustomAuthenticationFilter extends UsernamePasswordAuthenticationFilter {
22 | @Override
23 | public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
24 |
25 | if(request.getContentType().equals(MediaType.APPLICATION_JSON_UTF8_VALUE)
26 | ||request.getContentType().equals(MediaType.APPLICATION_JSON_VALUE)){
27 |
28 | ObjectMapper mapper = new ObjectMapper();
29 | UsernamePasswordAuthenticationToken authRequest = null;
30 | try (InputStream is = request.getInputStream()){
31 | AuthenticationBean authenticationBean = mapper.readValue(is,AuthenticationBean.class);
32 | authRequest = new UsernamePasswordAuthenticationToken(
33 | authenticationBean.getAccount(), authenticationBean.getPassword());
34 | }catch (IOException e) {
35 | e.printStackTrace();
36 | authRequest = new UsernamePasswordAuthenticationToken(
37 | "", "");
38 | }
39 | setDetails(request, authRequest);
40 |
41 | return this.getAuthenticationManager().authenticate(authRequest);
42 | } else {
43 | return super.attemptAuthentication(request, response);
44 | }
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/filter/ProcessFilter.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.filter;
2 |
3 | import cn.luvletter.util.ResponseUtil;
4 |
5 | import javax.servlet.*;
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 | import java.io.IOException;
9 | import java.util.HashMap;
10 | import java.util.Map;
11 |
12 | /**
13 | * @author Zephyr Ji
14 | * @ Description: option请求过滤器
15 | * @ Date 2018/2/11
16 | */
17 | public class ProcessFilter implements Filter {
18 |
19 | private static final String OPTIONS = "OPTIONS";
20 | public static final Map opM = new HashMap<>();
21 |
22 | static {
23 | opM.put("data","option");
24 | }
25 |
26 | @Override
27 | public void init(FilterConfig filterConfig) throws ServletException {
28 |
29 | }
30 |
31 | @Override
32 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
33 | HttpServletResponse httpServletResponse = (HttpServletResponse) response;
34 |
35 | HttpServletRequest httpServletRequest = (HttpServletRequest) request;
36 |
37 | httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
38 |
39 | httpServletResponse.setHeader("Access-Control-Expose-Headers", "Authorization");
40 |
41 | httpServletResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
42 |
43 | httpServletResponse.setHeader("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
44 |
45 | String method= httpServletRequest.getMethod();
46 |
47 | if (OPTIONS.equals(method)){
48 | httpServletResponse.setStatus(200);
49 |
50 | ResponseUtil.returnJson(httpServletResponse,opM);
51 | return ;
52 | }
53 |
54 | chain.doFilter(request, response);
55 |
56 | }
57 |
58 | @Override
59 | public void destroy() {
60 |
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/interceptor/ProcessInterceptor.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.interceptor;
2 |
3 | import org.springframework.web.servlet.HandlerInterceptor;
4 | import org.springframework.web.servlet.ModelAndView;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 | import java.util.Map;
9 |
10 | /**
11 | * @author Zephyr Ji
12 | * @ Description: TODO
13 | * @ Date 2018/2/8
14 | */
15 | @Deprecated
16 | public class ProcessInterceptor implements HandlerInterceptor {
17 |
18 | private static final String OPTIONS="OPTIONS";
19 |
20 | @Override
21 | public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
22 |
23 | httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
24 |
25 | httpServletResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
26 |
27 | httpServletResponse.setHeader("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
28 |
29 | httpServletResponse.setHeader("Content-Type","application/x-www-form-urlencoded");
30 |
31 | String method= httpServletRequest.getMethod();
32 |
33 | if (OPTIONS.equals(method)){
34 | httpServletResponse.setStatus(200);
35 | return false;
36 | }
37 |
38 | return true;
39 | }
40 |
41 | @Override
42 | public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
43 |
44 | }
45 |
46 | @Override
47 | public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
48 |
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/plugin/CommentGenerator.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.plugin;
2 |
3 | import org.mybatis.generator.api.IntrospectedColumn;
4 | import org.mybatis.generator.api.IntrospectedTable;
5 | import org.mybatis.generator.api.dom.java.Field;
6 | import org.mybatis.generator.internal.DefaultCommentGenerator;
7 |
8 | /**
9 | * 生成model中,字段增加注释
10 | * Created by ZhangShuzheng on 2017/1/11.
11 | */
12 | public class CommentGenerator extends DefaultCommentGenerator {
13 |
14 | @Override
15 | public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
16 | super.addFieldComment(field, introspectedTable, introspectedColumn);
17 | if (introspectedColumn.getRemarks() != null && !introspectedColumn.getRemarks().equals("")) {
18 | field.addJavaDocLine("/**");
19 | field.addJavaDocLine(" * " + introspectedColumn.getRemarks());
20 | addJavadocTag(field, false);
21 | field.addJavaDocLine(" */");
22 | }
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/plugin/SerializablePlugin.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.plugin;
2 |
3 | import org.mybatis.generator.api.IntrospectedTable;
4 | import org.mybatis.generator.api.PluginAdapter;
5 | import org.mybatis.generator.api.dom.java.*;
6 |
7 | import java.util.List;
8 | import java.util.Properties;
9 |
10 | /**
11 | * Example类和model类实现序列化插件
12 | * Created by shuzheng on 2017/1/1.
13 | */
14 | public class SerializablePlugin extends PluginAdapter {
15 | private FullyQualifiedJavaType serializable = new FullyQualifiedJavaType("java.io.Serializable");
16 | private FullyQualifiedJavaType gwtSerializable = new FullyQualifiedJavaType("com.google.gwt.user.client.rpc.IsSerializable");
17 | private boolean addGWTInterface;
18 | private boolean suppressJavaInterface;
19 |
20 | public SerializablePlugin() {
21 | }
22 |
23 | @Override
24 | public boolean validate(List warnings) {
25 | return true;
26 | }
27 |
28 | @Override
29 | public void setProperties(Properties properties) {
30 | super.setProperties(properties);
31 | this.addGWTInterface = Boolean.valueOf(properties.getProperty("addGWTInterface")).booleanValue();
32 | this.suppressJavaInterface = Boolean.valueOf(properties.getProperty("suppressJavaInterface")).booleanValue();
33 | }
34 |
35 | @Override
36 | public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
37 | this.makeSerializable(topLevelClass, introspectedTable);
38 | return true;
39 | }
40 |
41 | @Override
42 | public boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
43 | this.makeSerializable(topLevelClass, introspectedTable);
44 | return true;
45 | }
46 |
47 | @Override
48 | public boolean modelRecordWithBLOBsClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
49 | this.makeSerializable(topLevelClass, introspectedTable);
50 | return true;
51 | }
52 |
53 | protected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
54 | if(this.addGWTInterface) {
55 | topLevelClass.addImportedType(this.gwtSerializable);
56 | topLevelClass.addSuperInterface(this.gwtSerializable);
57 | }
58 |
59 | if(!this.suppressJavaInterface) {
60 | topLevelClass.addImportedType(this.serializable);
61 | topLevelClass.addSuperInterface(this.serializable);
62 | Field field = new Field();
63 | field.setFinal(true);
64 | field.setInitializationString("1L");
65 | field.setName("serialVersionUID");
66 | field.setStatic(true);
67 | field.setType(new FullyQualifiedJavaType("long"));
68 | field.setVisibility(JavaVisibility.PRIVATE);
69 | this.context.getCommentGenerator().addFieldComment(field, introspectedTable);
70 | topLevelClass.addField(field);
71 | }
72 |
73 | }
74 |
75 | /**
76 | * 添加给Example类序列化的方法
77 | * @param topLevelClass
78 | * @param introspectedTable
79 | * @return
80 | */
81 | @Override
82 | public boolean modelExampleClassGenerated(TopLevelClass topLevelClass,IntrospectedTable introspectedTable){
83 | makeSerializable(topLevelClass, introspectedTable);
84 |
85 | for (InnerClass innerClass : topLevelClass.getInnerClasses()) {
86 | if ("GeneratedCriteria".equals(innerClass.getType().getShortName())) {
87 | innerClass.addSuperInterface(serializable);
88 | }
89 | if ("Criteria".equals(innerClass.getType().getShortName())) {
90 | innerClass.addSuperInterface(serializable);
91 | }
92 | if ("Criterion".equals(innerClass.getType().getShortName())) {
93 | innerClass.addSuperInterface(serializable);
94 | }
95 | }
96 |
97 | return true;
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/AESPasswordEncoder.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security;
2 |
3 | import cn.luvletter.util.AESUtil;
4 | import org.springframework.security.crypto.password.PasswordEncoder;
5 |
6 | /**
7 | * @author Zephyr Ji
8 | * @ Description: AES加密和比较
9 | * @ Date 2018/2/10
10 | */
11 | public class AESPasswordEncoder implements PasswordEncoder{
12 | @Override
13 | public String encode(CharSequence rawPassword) {
14 | return AESUtil.AESEncode(rawPassword.toString());
15 | }
16 |
17 | @Override
18 | public boolean matches(CharSequence rawPassword, String encodedPassword) {
19 | return AESUtil.checkpw(rawPassword.toString(),encodedPassword);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/MyAccessDecisionManager.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security;
2 |
3 | import org.springframework.security.access.AccessDecisionManager;
4 | import org.springframework.security.access.AccessDeniedException;
5 | import org.springframework.security.access.ConfigAttribute;
6 | import org.springframework.security.authentication.InsufficientAuthenticationException;
7 | import org.springframework.security.core.Authentication;
8 | import org.springframework.security.core.GrantedAuthority;
9 | import org.springframework.stereotype.Component;
10 | import org.springframework.stereotype.Service;
11 |
12 | import java.util.Collection;
13 | import java.util.Iterator;
14 |
15 | /**
16 | * @author Zephyr Ji
17 | * @ Description: 判定用户是否拥有指定url权限
18 | * @ Date 2018/2/10
19 | */
20 | @Component
21 | public class MyAccessDecisionManager implements AccessDecisionManager {
22 |
23 | @Override
24 | public void decide(Authentication authentication, Object o, Collection configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
25 | if(null== configAttributes || configAttributes.size() <=0) {
26 | return;
27 | }
28 | ConfigAttribute c;
29 | String needRole;
30 | for (ConfigAttribute configAttribute : configAttributes) {
31 | c = configAttribute;
32 | needRole = c.getAttribute();
33 | for (GrantedAuthority ga : authentication.getAuthorities()) {
34 | if (needRole.trim().equals(ga.getAuthority().toLowerCase())) {
35 | return;
36 | }
37 | }
38 | }
39 | throw new AccessDeniedException("权限不足!");
40 | }
41 |
42 | @Override
43 | public boolean supports(ConfigAttribute configAttribute) {
44 | return true;
45 | }
46 |
47 | @Override
48 | public boolean supports(Class> aClass) {
49 | return true;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/URLFilterSecurityInterceptor.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.beans.factory.annotation.Qualifier;
5 | import org.springframework.security.access.SecurityMetadataSource;
6 | import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
7 | import org.springframework.security.access.intercept.InterceptorStatusToken;
8 | import org.springframework.security.web.FilterInvocation;
9 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
10 | import org.springframework.stereotype.Component;
11 |
12 | import javax.servlet.*;
13 | import java.io.IOException;
14 |
15 | /**
16 | * @author Zephyr Ji
17 | * @ Description: TODO
18 | * @ Date 2018/2/10
19 | */
20 | @Component
21 | public class URLFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter{
22 |
23 | @Autowired
24 | private FilterInvocationSecurityMetadataSource securityMetadataSource;
25 |
26 | @Autowired
27 | public void setMyAccessDecisionManager(MyAccessDecisionManager myAccessDecisionManager) {
28 | super.setAccessDecisionManager(myAccessDecisionManager);
29 | }
30 |
31 | @Override
32 | public void init(FilterConfig filterConfig) throws ServletException {
33 |
34 | }
35 |
36 | @Override
37 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
38 | FilterInvocation fi = new FilterInvocation(request, response, chain);
39 | invoke(fi);
40 | }
41 |
42 | private void invoke(FilterInvocation fi) throws IOException, ServletException {
43 | InterceptorStatusToken token = super.beforeInvocation(fi);
44 | try {
45 | fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
46 | } finally {
47 | super.afterInvocation(token, null);
48 | }
49 | }
50 |
51 |
52 | @Override
53 | public void destroy() {
54 |
55 | }
56 |
57 | @Override
58 | public Class> getSecureObjectClass() {
59 | return FilterInvocation.class;
60 | }
61 |
62 | @Override
63 | public SecurityMetadataSource obtainSecurityMetadataSource() {
64 | return this.securityMetadataSource;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/URLInvocationSecurityMetadataSourceService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security;
2 |
3 |
4 |
5 | import cn.luvletter.bean.AuthBean;
6 | import cn.luvletter.constant.SqlConstant;
7 | import cn.luvletter.util.JdbcUtil;
8 | import org.slf4j.Logger;
9 | import org.slf4j.LoggerFactory;
10 | import org.springframework.security.access.ConfigAttribute;
11 | import org.springframework.security.access.SecurityConfig;
12 | import org.springframework.security.web.FilterInvocation;
13 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
14 | import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
15 | import org.springframework.stereotype.Component;
16 |
17 |
18 | import javax.servlet.http.HttpServletRequest;
19 | import java.sql.SQLException;
20 | import java.util.*;
21 |
22 | /**
23 | * @author Zephyr Ji
24 | * @ Description: 添加全部url权限信息
25 | * @ Date 2018/2/10
26 | */
27 | @Component
28 | public class URLInvocationSecurityMetadataSourceService implements FilterInvocationSecurityMetadataSource {
29 | private Logger log = LoggerFactory.getLogger(URLInvocationSecurityMetadataSourceService.class);
30 |
31 | private Map> urlMap =null;
32 |
33 |
34 | private void loadResourceDefine() throws SQLException {
35 | List authBeans = JdbcUtil.newInstance().selectBean(SqlConstant.SELECT_ALL_AUTH, null, AuthBean.class);
36 | Collection array;
37 | ConfigAttribute cfg;
38 | urlMap = new HashMap<>();
39 | for(AuthBean authBean : authBeans){
40 | String url = authBean.getUrl();
41 | if(urlMap.containsKey(url)){
42 | cfg = new SecurityConfig(authBean.getName());
43 | urlMap.get(url).add(cfg);
44 | continue;
45 | }
46 | array = new ArrayList<>();
47 | cfg = new SecurityConfig(authBean.getName());
48 | array.add(cfg);
49 | urlMap.put(url,array);
50 | }
51 | log.debug("load Permission Resource Define\n"+urlMap.toString());
52 | }
53 |
54 |
55 | @Override
56 | public Collection getAttributes(Object object) throws IllegalArgumentException {
57 | if(urlMap == null || urlMap.isEmpty()) {
58 | try {
59 | loadResourceDefine();
60 | } catch (SQLException e) {
61 | e.printStackTrace();
62 | }
63 | }
64 | HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
65 | log.debug("Request '" + request.getMethod() + " " + request.getServletPath()+request.getPathInfo() + "'" + " start match database url '");
66 | AntPathRequestMatcher matcher;
67 | String resUrl;
68 | for (String s : urlMap.keySet()) {
69 | resUrl = s;
70 | matcher = new AntPathRequestMatcher(resUrl);
71 | if (matcher.matches(request)) {
72 | return urlMap.get(resUrl);
73 | }
74 | }
75 | return null;
76 | }
77 |
78 | @Override
79 | public Collection getAllConfigAttributes() {
80 | return null;
81 | }
82 |
83 | @Override
84 | public boolean supports(Class> aClass) {
85 | return true;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/handler/AjaxAccessDeniedHandler.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security.handler;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.util.ResponseUtil;
5 | import org.springframework.security.access.AccessDeniedException;
6 | import org.springframework.security.web.access.AccessDeniedHandler;
7 | import org.springframework.stereotype.Component;
8 |
9 | import javax.servlet.ServletException;
10 | import javax.servlet.http.HttpServletRequest;
11 | import javax.servlet.http.HttpServletResponse;
12 | import java.io.IOException;
13 |
14 | /**
15 | * @author Zephyr Ji
16 | * @ Description: TODO
17 | * @ Date 2018/2/24
18 | */
19 | @Component
20 | public class AjaxAccessDeniedHandler implements AccessDeniedHandler {
21 | @Override
22 | public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
23 | httpServletResponse.setStatus(HttpServletResponse.SC_OK);
24 |
25 | ApiResult apiResult = new ApiResult().isFalse();
26 | apiResult.setMessage(e.getMessage());
27 |
28 | ResponseUtil.returnJson(httpServletResponse,apiResult);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/handler/AjaxAuthFailHandler.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security.handler;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.util.ResponseUtil;
5 | import org.springframework.security.core.Authentication;
6 | import org.springframework.security.core.AuthenticationException;
7 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
8 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
9 | import org.springframework.stereotype.Component;
10 |
11 | import javax.servlet.ServletException;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 | import java.io.IOException;
15 |
16 | /**
17 | * @author Zephyr Ji
18 | * @ Description: 登陆失败返回程序
19 | * @ Date 2018/2/11
20 | */
21 | @Component
22 | public class AjaxAuthFailHandler extends SimpleUrlAuthenticationFailureHandler {
23 |
24 | @Override
25 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
26 | response.setStatus(HttpServletResponse.SC_OK);
27 |
28 | ApiResult apiResult = new ApiResult().isFalse();
29 | apiResult.setMessage("登陆失败,失败原因:"+exception.getMessage());
30 |
31 | ResponseUtil.returnJson(response,apiResult);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/handler/AjaxAuthSuccessHandler.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security.handler;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.bean.AuthenticationBean;
5 | import cn.luvletter.exception.ApplicationException;
6 | import cn.luvletter.security.service.OprtService;
7 | import cn.luvletter.util.JWTUtil;
8 | import cn.luvletter.util.ResponseUtil;
9 | import cn.luvletter.util.WMSUtil;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.data.redis.core.HashOperations;
12 | import org.springframework.data.redis.core.RedisTemplate;
13 | import org.springframework.security.core.Authentication;
14 | import org.springframework.security.core.userdetails.User;
15 | import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
16 | import org.springframework.stereotype.Component;
17 |
18 | import javax.servlet.ServletException;
19 | import javax.servlet.http.HttpServletRequest;
20 | import javax.servlet.http.HttpServletResponse;
21 | import java.io.IOException;
22 | import java.io.UnsupportedEncodingException;
23 |
24 | /**
25 | * @author Zephyr Ji
26 | * @ Description: 登陆成功返回程序
27 | * @ Date 2018/2/11
28 | */
29 | @Component
30 | public class AjaxAuthSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
31 |
32 | @Autowired
33 | private JWTUtil jwtUtil;
34 |
35 | @Override
36 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
37 | response.setStatus(HttpServletResponse.SC_OK);
38 | User user = (User) authentication.getPrincipal();
39 | String username = user.getUsername();
40 | AuthenticationBean authenticationBean = OprtService.loadOprt(username);
41 | if(authenticationBean == null){
42 | throw new ApplicationException("username:"+username+"not found");
43 | }
44 | authenticationBean.setRoleNo(JWTUtil.authenticationToString(authentication.getAuthorities()));
45 | authenticationBean.setIdAddr(WMSUtil.getIpAddr(request));
46 | //redis添加refreshToken
47 | jwtUtil.addRedisRefreshToken(authenticationBean.getAccount());
48 | //header添加accessToken
49 | String token = JWTUtil.addAuthentication(response,authenticationBean);
50 | ApiResult apiResult = new ApiResult();
51 | apiResult.setMessage("登陆成功");
52 | apiResult.setData(token);
53 | ResponseUtil.returnJson(response,apiResult);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/handler/AjaxAuthenticationEntryPoint.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security.handler;
2 |
3 | import cn.luvletter.bean.ApiResult;
4 | import cn.luvletter.util.ResponseUtil;
5 | import org.springframework.security.authentication.InsufficientAuthenticationException;
6 | import org.springframework.security.core.AuthenticationException;
7 | import org.springframework.security.web.AuthenticationEntryPoint;
8 | import org.springframework.stereotype.Component;
9 |
10 | import javax.servlet.ServletException;
11 | import javax.servlet.http.HttpServletRequest;
12 | import javax.servlet.http.HttpServletResponse;
13 | import java.io.IOException;
14 |
15 | /**
16 | * @author Zephyr
17 | * @Description: 权限验证失败
18 | * @Date 2018/4/16
19 | */
20 | @Component
21 | public class AjaxAuthenticationEntryPoint implements AuthenticationEntryPoint {
22 | @Override
23 | public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
24 | httpServletResponse.setStatus(HttpServletResponse.SC_OK);
25 |
26 | ApiResult apiResult = new ApiResult().isFalse();
27 | String msg = e.getMessage();
28 | if(e instanceof InsufficientAuthenticationException){
29 | msg = "认证失败!";
30 | }
31 | apiResult.setMessage(msg);
32 |
33 | ResponseUtil.returnJson(httpServletResponse,apiResult);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/security/service/OprtService.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.security.service;
2 |
3 | import cn.luvletter.bean.AuthenticationBean;
4 | import cn.luvletter.constant.SqlConstant;
5 | import cn.luvletter.util.JdbcUtil;
6 |
7 | import java.util.Arrays;
8 | import java.util.List;
9 |
10 | /**
11 | * @author Zephyr Ji
12 | * @ Description: TODO
13 | * @ Date 2018/2/24
14 | */
15 |
16 | public class OprtService {
17 | /**
18 | * @Description: 根据人员账号查询人员
19 | * @Date: 21:28 2018/2/24
20 | */
21 | public static AuthenticationBean loadOprt(String no) {
22 | List authenticationBeans = JdbcUtil.newInstance().selectBean(SqlConstant.SELECT_OPRT_BY_NO, Arrays.asList(no),AuthenticationBean.class);
23 | if(authenticationBeans!=null && authenticationBeans.size()!=0){
24 | return authenticationBeans.get(0);
25 | }
26 | return null;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/ActiveUserUtil.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.util;
2 |
3 | import org.springframework.security.core.context.SecurityContextHolder;
4 | import org.springframework.security.core.userdetails.UserDetails;
5 | import org.springframework.security.web.authentication.WebAuthenticationDetails;
6 |
7 | /**
8 | * @author Zephyr Ji
9 | * @ Description: 获取当前用户信息
10 | * @ Date 2018/2/11
11 | */
12 | public class ActiveUserUtil {
13 |
14 | public static String getAccount() {
15 | UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext()
16 | .getAuthentication()
17 | .getPrincipal();
18 | return userDetails.getUsername();
19 | }
20 |
21 | public static String getIp() {
22 | WebAuthenticationDetails wauth = (WebAuthenticationDetails) SecurityContextHolder.getContext()
23 | .getAuthentication()
24 | .getDetails();
25 | return wauth.getRemoteAddress();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/BeanUtils.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.util;
2 |
3 | import java.lang.reflect.InvocationTargetException;
4 | import java.util.Map;
5 |
6 | /**
7 | * @author Zephyr Ji
8 | * @ Description: bean工具类
9 | * @ Date 2018/2/23
10 | */
11 | public class BeanUtils {
12 | /**
13 | * @Description: map 转 bean
14 | * @Date: 21:24 2018/2/24
15 | */
16 | public static T map2Bean(Map map, Class clazz) {
17 | T bean = null;
18 | try {
19 | bean = clazz.newInstance();
20 | org.apache.commons.beanutils.BeanUtils.populate(bean,map);
21 | } catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
22 | e.printStackTrace();
23 | }
24 | return bean;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.util;
2 |
3 | import org.apache.commons.lang.time.DateUtils;
4 |
5 | import java.util.Date;
6 |
7 | /**
8 | * @author Zephyr Ji
9 | * @ Description: TODO
10 | * @ Date 2018/2/24
11 | */
12 | public class DateUtil extends DateUtils {
13 | public static Date now(){
14 | return new Date(System.currentTimeMillis());
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/JdbcUtil.java:
--------------------------------------------------------------------------------
1 | package cn.luvletter.util;
2 |
3 |
4 |
5 | import cn.luvletter.exception.ApplicationException;
6 |
7 | import java.sql.*;
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.List;
11 | import java.util.Map;
12 |
13 | /**
14 | * JDBC工具类
15 | * Created by ZhangShuzheng on 2017/1/10.
16 | */
17 | public class JdbcUtil {
18 |
19 | // 定义数据库的链接
20 | private Connection conn;
21 | // 定义sql语句的执行对象
22 | private PreparedStatement pstmt;
23 | // 定义查询返回的结果集合
24 | private ResultSet rs;
25 |
26 | private static JdbcUtil jdbcUtil;
27 |
28 | public static JdbcUtil newInstance(){
29 | if(jdbcUtil == null){
30 | jdbcUtil = new JdbcUtil(PropertyUtil.getProperty("driver"),
31 | PropertyUtil.getProperty("url"),
32 | PropertyUtil.getProperty("username"),
33 | PropertyUtil.getProperty("password"));
34 | }
35 | return jdbcUtil;
36 | }
37 | // 初始化
38 | private JdbcUtil(String driver, String url, String username, String password) {
39 | try {
40 | Class.forName(driver);
41 | conn = DriverManager.getConnection(url, username, password);
42 | System.out.println("数据库连接成功");
43 | } catch (Exception e) {
44 | e.printStackTrace();
45 | }
46 | }
47 |
48 | // 更新数据
49 | public boolean updateByParams(String sql, List params) throws SQLException {
50 | // 影响行数
51 | int result = -1;
52 | pstmt = conn.prepareStatement(sql);
53 | int index = 1;
54 | // 填充sql语句中的占位符
55 | if (null != params && !params.isEmpty()) {
56 | for (int i = 0; i < params.size(); i ++) {
57 | pstmt.setObject(index ++, params.get(i));
58 | }
59 | }
60 | result = pstmt.executeUpdate();
61 | return result > 0 ? true : false;
62 | }
63 |
64 | // 查询多条记录
65 | public List