├── .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 | 36 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 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 | 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> selectByParams(String sql, List params) { 66 | List> list = new ArrayList<> (); 67 | int index = 1; 68 | try { 69 | pstmt = conn.prepareStatement(sql); 70 | if (null != params && !params.isEmpty()) { 71 | for (int i = 0; i < params.size(); i++) { 72 | pstmt.setObject(index++, params.get(i)); 73 | } 74 | } 75 | rs = pstmt.executeQuery(); 76 | ResultSetMetaData metaData = rs.getMetaData(); 77 | int cols_len = metaData.getColumnCount(); 78 | while (rs.next()) { 79 | Map map = new HashMap<>(); 80 | for (int i = 0; i < cols_len; i++) { 81 | String cols_name = metaData.getColumnLabel(i + 1); 82 | Object cols_value = rs.getObject(cols_name); 83 | if (null == cols_value) { 84 | cols_value = ""; 85 | } 86 | map.put(cols_name, cols_value); 87 | } 88 | list.add(map); 89 | } 90 | }catch (SQLException e){ 91 | e.printStackTrace(); 92 | throw new ApplicationException(e.getMessage()); 93 | } 94 | return list; 95 | } 96 | /** 97 | * @Description: 查询多条记录,并转换为bean 98 | * @Date: 21:25 2018/2/24 99 | */ 100 | public List selectBean(String sql, List params, Class clazz) { 101 | List> list = this.selectByParams(sql,params); 102 | List resultList = new ArrayList(); 103 | 104 | for(Map var2:list){ 105 | T bean = BeanUtils.map2Bean(var2, clazz); 106 | resultList.add(bean); 107 | } 108 | return resultList; 109 | } 110 | 111 | // 释放连接 112 | public void release() { 113 | try { 114 | if (null != rs) { 115 | rs.close(); 116 | } 117 | if (null != pstmt) { 118 | pstmt.close(); 119 | } 120 | if (null != conn) { 121 | conn.close(); 122 | } 123 | } catch (SQLException e) { 124 | e.printStackTrace(); 125 | } 126 | System.out.println("释放数据库连接"); 127 | } 128 | 129 | 130 | } 131 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/PropertyUtil.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.util; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.util.Properties; 7 | 8 | /** 9 | * @author Zephyr Ji 10 | * @ Description: TODO 11 | * @ Date 2018/2/10 12 | */ 13 | public class PropertyUtil { 14 | private static Properties props; 15 | static{ 16 | loadProps(); 17 | } 18 | 19 | synchronized static private void loadProps(){ 20 | props = new Properties(); 21 | InputStream in = null; 22 | try { 23 | in = PropertyUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"); 24 | //in = PropertyUtil.class.getResourceAsStream("/jdbc.properties"); 25 | props.load(in); 26 | } catch (FileNotFoundException e) { 27 | e.printStackTrace(); 28 | } catch (IOException e) { 29 | e.printStackTrace(); 30 | } finally { 31 | try { 32 | if(null != in) { 33 | in.close(); 34 | } 35 | } catch (IOException e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | } 40 | 41 | public static String getProperty(String key){ 42 | if(null == props) { 43 | loadProps(); 44 | } 45 | return props.getProperty(key); 46 | } 47 | 48 | public static String getProperty(String key, String defaultValue) { 49 | if(null == props) { 50 | loadProps(); 51 | } 52 | return props.getProperty(key, defaultValue); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/RedisUtil.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.util; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.data.redis.core.HashOperations; 5 | import org.springframework.data.redis.core.RedisTemplate; 6 | import org.springframework.data.redis.core.ValueOperations; 7 | import org.springframework.data.redis.core.ZSetOperations; 8 | import org.springframework.stereotype.Component; 9 | 10 | import javax.annotation.Resource; 11 | import java.util.concurrent.TimeUnit; 12 | 13 | /** 14 | * @author Zephyr Ji 15 | * @ Description: Redis工具类 16 | * @ Date 2018/3/5 17 | */ 18 | @Component 19 | @SuppressWarnings("unchecked") 20 | public class RedisUtil { 21 | @Resource 22 | private RedisTemplate redisTemplate; 23 | /** 24 | * @Description: 存储map 25 | * @Date: 9:29 2018/3/28 26 | */ 27 | public void hmSet(Object name, Object key, Object value){ 28 | HashOperations hashOperations = redisTemplate.opsForHash(); 29 | hashOperations.put(name, key, value); 30 | } 31 | /** 32 | * @Description: 根据map name 和 key 获取value 33 | * @Date: 9:29 2018/3/28 34 | */ 35 | public Object hGet(Object name, Object key){ 36 | if(name == null || key == null){ 37 | return null; 38 | } 39 | HashOperations hashOperations = redisTemplate.opsForHash(); 40 | return hashOperations.get(name, key); 41 | } 42 | /** 43 | * @Description: 根据map name 判断 这个map中是否有这个key 44 | * @Date: 9:30 2018/3/28 45 | */ 46 | public boolean hContainKey(Object name, Object key){ 47 | HashOperations ops = redisTemplate.opsForHash(); 48 | return ops.hasKey(name, key); 49 | } 50 | /** 51 | * @Description: 移除name的map中为key的值 52 | * @Date: 9:30 2018/3/28 53 | */ 54 | public long hRemoveByKey(Object name, Object key){ 55 | HashOperations ops = redisTemplate.opsForHash(); 56 | return ops.delete(name, key); 57 | } 58 | /** 59 | * @Description: 存储str,有效时间单位为秒 60 | * @Date: 15:22 2018/4/16 61 | */ 62 | public void strSet(Object key, Object value, long validTime){ 63 | ValueOperations ops = redisTemplate.opsForValue(); 64 | ops.set(key,value,validTime, TimeUnit.SECONDS); 65 | } 66 | /** 67 | * @Description: 根据key拿到str 68 | * @Date: 15:28 2018/4/16 69 | */ 70 | public Object strGet(Object key){ 71 | ValueOperations ops = redisTemplate.opsForValue(); 72 | return ops.get(key); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/ResponseUtil.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.util; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.JSONObject; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | import java.io.IOException; 8 | import java.io.PrintWriter; 9 | 10 | /** 11 | * @author Zephyr Ji 12 | * @ Description: TODO 13 | * @ Date 2018/2/11 14 | */ 15 | public class ResponseUtil { 16 | 17 | public static void returnJson(HttpServletResponse response, Object o){ 18 | JSONObject jsonObject = (JSONObject) JSON.toJSON(o); 19 | response.setCharacterEncoding("UTF-8"); 20 | 21 | response.setContentType("application/json; charset=utf-8"); 22 | PrintWriter out = null; 23 | try { 24 | out = response.getWriter(); 25 | out.append(jsonObject.toJSONString()); 26 | }catch (IOException e){ 27 | e.printStackTrace(); 28 | }finally { 29 | if(out!=null){ 30 | out.close(); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/java/cn/luvletter/util/VelocityUtil.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.util; 2 | 3 | import org.apache.commons.io.output.FileWriterWithEncoding; 4 | import org.apache.commons.lang.StringUtils; 5 | import org.apache.velocity.Template; 6 | import org.apache.velocity.VelocityContext; 7 | import org.apache.velocity.app.Velocity; 8 | import org.apache.velocity.app.VelocityEngine; 9 | 10 | import java.io.File; 11 | import java.util.Properties; 12 | 13 | /** 14 | * Velocity工具类 15 | * Created by ZhangShuzheng on 2017/1/10. 16 | */ 17 | public class VelocityUtil { 18 | 19 | /** 20 | * 根据模板生成文件 21 | * @param inputVmFilePath 模板路径 22 | * @param outputFilePath 输出文件路径 23 | * @param context 24 | * @throws Exception 25 | */ 26 | public static void generate(String inputVmFilePath, String outputFilePath, VelocityContext context) throws Exception { 27 | try { 28 | Properties properties = new Properties(); 29 | properties.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, getPath(inputVmFilePath)); 30 | Velocity.init(properties); 31 | //VelocityEngine engine = new VelocityEngine(); 32 | Template template = Velocity.getTemplate(getFile(inputVmFilePath), "utf-8"); 33 | File outputFile = new File(outputFilePath); 34 | FileWriterWithEncoding writer = new FileWriterWithEncoding(outputFile, "utf-8"); 35 | template.merge(context, writer); 36 | writer.close(); 37 | } catch (Exception ex) { 38 | throw ex; 39 | } 40 | } 41 | 42 | /** 43 | * 根据文件绝对路径获取目录 44 | * @param filePath 45 | * @return 46 | */ 47 | public static String getPath(String filePath) { 48 | String path = ""; 49 | if (StringUtils.isNotBlank(filePath)) { 50 | path = filePath.substring(0, filePath.lastIndexOf("/") + 1); 51 | } 52 | return path; 53 | } 54 | 55 | /** 56 | * 根据文件绝对路径获取文件 57 | * @param filePath 58 | * @return 59 | */ 60 | public static String getFile(String filePath) { 61 | String file = ""; 62 | if (StringUtils.isNotBlank(filePath)) { 63 | file = filePath.substring(filePath.lastIndexOf("/") + 1); 64 | } 65 | return file; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/resources/generator.properties: -------------------------------------------------------------------------------- 1 | generator.jdbc.driver=com.mysql.jdbc.Driver 2 | generator.jdbc.url=jdbc:mysql://127.0.0.1:3306/luv_wms 3 | generator.jdbc.username=root 4 | generator.jdbc.password=123456 5 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/resources/generatorConfig.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 | 27 | 28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 |
63 |
64 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/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-wms-parent/wms-common/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 -------------------------------------------------------------------------------- /luv-wms-parent/wms-common/src/main/resources/template/generatorConfig.vm: -------------------------------------------------------------------------------- 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 | 27 | ## 28 | 29 | ## 30 | 31 | 37 | ## 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | #foreach($table in $tables) 65 | #if($last_insert_id_tables.containsKey($!table.table_name) == true) 66 | 67 | 68 |
69 | #else 70 |
71 | #end 72 | #end 73 |
74 |
75 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/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-service 14 | 15 | 16 | 17 | cn.luvletter 18 | wms-api 19 | 1.0-SNAPSHOT 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/base/impl/StorageLocationServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.base.impl; 2 | 3 | import cn.luvletter.base.StorageLocationService; 4 | import cn.luvletter.base.dao.StorageLocationMapper; 5 | import cn.luvletter.base.model.StorageLocation; 6 | import cn.luvletter.base.model.StorageLocationExample; 7 | import cn.luvletter.base.vo.StorageLocationVo; 8 | import cn.luvletter.bean.ApiResult; 9 | import cn.luvletter.util.DateUtil; 10 | import cn.luvletter.util.WMSUtil; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Service; 15 | 16 | import javax.servlet.http.HttpServletRequest; 17 | import java.util.List; 18 | 19 | /** 20 | * @author Zephyr Ji 21 | * @ Description: 库位Serviceimpl 22 | * @ Date 2018/3/6 23 | */ 24 | @Service 25 | public class StorageLocationServiceImpl implements StorageLocationService { 26 | private final Logger logger = LoggerFactory.getLogger(StorageLocationServiceImpl.class); 27 | @Autowired 28 | private StorageLocationMapper storageLocationMapper; 29 | @Autowired 30 | private WMSUtil wmsUtil; 31 | @Override 32 | public ApiResult getStorageLocation(HttpServletRequest httpServletRequest) { 33 | final String currWNo = wmsUtil.getCurrWNo(httpServletRequest); 34 | final ApiResult apiResult = new ApiResult(); 35 | String start = wmsUtil.getStart(httpServletRequest); 36 | String limit = wmsUtil.getLimit(httpServletRequest); 37 | StorageLocationExample storageLocationExample = new StorageLocationExample(); 38 | storageLocationExample.setStart(start); 39 | storageLocationExample.setLimit(limit); 40 | storageLocationExample.createCriteria().andWarehouseNoEqualTo(currWNo); 41 | List storageLocations = storageLocationMapper.selectByExample(storageLocationExample); 42 | apiResult.setData(storageLocations); 43 | apiResult.setTotal(storageLocationMapper.countByExample(storageLocationExample)); 44 | return apiResult; 45 | } 46 | 47 | @Override 48 | public ApiResult delById(String id, HttpServletRequest httpServletRequest) { 49 | final ApiResult apiResult = new ApiResult(); 50 | final String currUser = wmsUtil.getCurrUser(httpServletRequest); 51 | Long lId = Long.valueOf(id); 52 | StorageLocation storageLocation = storageLocationMapper.selectByPrimaryKey(lId); 53 | if(storageLocation == null){ 54 | apiResult.isFalse().setMessage("系统未找到此库位"); 55 | return apiResult; 56 | } 57 | int i = storageLocationMapper.deleteByPrimaryKey(lId); 58 | if(i == 1){ 59 | logger.info("删除库位:id:"+id+"用户:"+currUser); 60 | apiResult.setMessage("删除成功"); 61 | }else { 62 | apiResult.isFalse().setMessage("删除失败"); 63 | } 64 | return apiResult; 65 | } 66 | 67 | @Override 68 | public ApiResult sava(StorageLocationVo storageLocationVo, HttpServletRequest httpServletRequest) { 69 | //todo 批量新增库位 70 | return null; 71 | } 72 | 73 | @Override 74 | public ApiResult update(StorageLocation storageLocation, HttpServletRequest httpServletRequest) { 75 | final ApiResult apiResult = new ApiResult(); 76 | Long id = storageLocation.getId(); 77 | if(id == null || id == 0){ 78 | apiResult.isFalse().setMessage("id不能为空"); 79 | return apiResult; 80 | } 81 | storageLocation.setGmtModified(DateUtil.now()); 82 | storageLocationMapper.updateByPrimaryKeySelective(storageLocation); 83 | apiResult.setMessage("更新成功"); 84 | return apiResult; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/base/impl/WarehouseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.base.impl; 2 | 3 | import cn.luvletter.base.WarehouseService; 4 | import cn.luvletter.base.model.Warehouse; 5 | import cn.luvletter.bean.ApiResult; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * @author Zephyr Ji 10 | * @ Description: TODO 11 | * @ Date 2018/3/6 12 | */ 13 | @Service 14 | public class WarehouseServiceImpl implements WarehouseService { 15 | @Override 16 | public ApiResult getStorageArea() { 17 | return null; 18 | } 19 | 20 | @Override 21 | public ApiResult delById(String id) { 22 | return null; 23 | } 24 | 25 | @Override 26 | public ApiResult sava(Warehouse warehouse) { 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/main/dao/DictionaryMapper.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.main.dao; 2 | 3 | import cn.luvletter.main.model.Dictionary; 4 | import cn.luvletter.main.vo.SelectDSVo; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author Zephyr 12 | * @Description: 13 | * @Date 2018/4/2 14 | */ 15 | @Repository 16 | public interface DictionaryMapper { 17 | 18 | List selectByParaId(@Param("pid") String pid, @Param("value") String value); 19 | 20 | List selectByPid(@Param("pid") String pid); 21 | 22 | List selectDictionaryByPid(@Param("pid") String pid); 23 | 24 | int updateByPrimaryKeySelective(Dictionary dictionary); 25 | 26 | Dictionary selectByPrimaryKey(Long id); 27 | 28 | int deleteByPrimaryKey(Long id); 29 | 30 | int insertSelective(Dictionary dictionary); 31 | } 32 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/main/impl/MainServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.main.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.constant.WMSConstant; 5 | import cn.luvletter.main.MainService; 6 | import cn.luvletter.main.dao.DictionaryMapper; 7 | import cn.luvletter.main.model.Dictionary; 8 | import cn.luvletter.main.vo.SelectDSVo; 9 | import org.apache.commons.lang.StringUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.cache.annotation.Cacheable; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author Zephyr 18 | * @Description: 19 | * @Date 2018/4/2 20 | */ 21 | @Service 22 | public class MainServiceImpl implements MainService { 23 | @Autowired 24 | private DictionaryMapper dictionaryMapper; 25 | @Override 26 | @Cacheable(value = WMSConstant.REDIS_CACHE_NAME) 27 | public ApiResult getComboBox(String pid,String value) { 28 | ApiResult apiResult = new ApiResult(); 29 | List dictionaries = dictionaryMapper.selectByParaId(pid, value); 30 | if(dictionaries == null || dictionaries.isEmpty()){ 31 | apiResult.isFalse(); 32 | return apiResult; 33 | } 34 | apiResult.setData(dictionaries.get(0)); 35 | return apiResult; 36 | } 37 | 38 | @Override 39 | @Cacheable(value = WMSConstant.REDIS_CACHE_NAME) 40 | public ApiResult getSelectDS(String pid) { 41 | ApiResult apiResult = new ApiResult(); 42 | List selectDSVos = dictionaryMapper.selectByPid(pid); 43 | if(selectDSVos == null || selectDSVos.isEmpty()){ 44 | apiResult.isFalse(); 45 | return apiResult; 46 | } 47 | apiResult.setData(selectDSVos); 48 | return apiResult; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/order/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.order.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.in.model.InStock; 5 | import cn.luvletter.in.model.InStockDtlExample; 6 | import cn.luvletter.order.OrderService; 7 | import cn.luvletter.order.dao.OrderDtlMapper; 8 | import cn.luvletter.order.dao.OrderMapper; 9 | import cn.luvletter.order.model.Order; 10 | import cn.luvletter.order.model.OrderDtl; 11 | import cn.luvletter.order.model.OrderDtlExample; 12 | import cn.luvletter.order.model.OrderExample; 13 | import cn.luvletter.util.WMSUtil; 14 | import org.apache.commons.lang.StringUtils; 15 | import org.apache.commons.lang.math.NumberUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Service; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import java.util.List; 21 | 22 | /** 23 | * @author Zephyr 24 | * @Description: 25 | * @Date 2018/4/3 26 | */ 27 | @Service 28 | public class OrderServiceImpl implements OrderService { 29 | @Autowired 30 | private WMSUtil wmsUtil; 31 | @Autowired 32 | private OrderMapper orderMapper; 33 | @Autowired 34 | private OrderDtlMapper orderDtlMapper; 35 | @Override 36 | public ApiResult getOrder(HttpServletRequest httpServletRequest) { 37 | final String currWNo = wmsUtil.getCurrWNo(httpServletRequest); 38 | String orderNo = httpServletRequest.getParameter("orderNo"); 39 | String orderStatus = httpServletRequest.getParameter("orderStatus"); 40 | String start = wmsUtil.getStart(httpServletRequest); 41 | String limit = wmsUtil.getLimit(httpServletRequest); 42 | OrderExample orderExample = new OrderExample(); 43 | OrderExample.Criteria criteria = orderExample.createCriteria(); 44 | if(StringUtils.isNotBlank(orderNo)){ 45 | criteria.andOrderNoLike("%"+orderNo+"%"); 46 | } 47 | if(StringUtils.isNotBlank(orderStatus)){ 48 | criteria.andOrderStatusEqualTo(orderStatus); 49 | } 50 | criteria.andWarehouseNoEqualTo(currWNo); 51 | orderExample.setStart(start); 52 | orderExample.setLimit(limit); 53 | List orders = orderMapper.selectByExample(orderExample); 54 | ApiResult apiResult = new ApiResult(); 55 | apiResult.setData(orders); 56 | apiResult.setTotal(orderMapper.countByExample(orderExample)); 57 | return apiResult; 58 | } 59 | 60 | @Override 61 | public ApiResult getOrderDtl(String id, HttpServletRequest httpServletRequest) { 62 | ApiResult apiResult = new ApiResult(); 63 | if(StringUtils.isBlank(id)|| !NumberUtils.isDigits(id)){ 64 | apiResult.isFalse().setMessage("id不能为空"); 65 | return apiResult; 66 | } 67 | OrderExample orderExample = new OrderExample(); 68 | orderExample.createCriteria().andIdEqualTo(Long.valueOf(id)); 69 | List orders = orderMapper.selectByExample(orderExample); 70 | if(orders == null || orders.size()==0){ 71 | apiResult.isFalse().setMessage("系统未找到此订单详情"); 72 | return apiResult; 73 | } 74 | String start = wmsUtil.getStart(httpServletRequest); 75 | String limit = wmsUtil.getLimit(httpServletRequest); 76 | String orderNo = orders.get(0).getOrderNo(); 77 | OrderDtlExample orderDtlExample = new OrderDtlExample(); 78 | orderDtlExample.createCriteria().andOrderNoEqualTo(orderNo); 79 | orderDtlExample.setStart(start); 80 | orderDtlExample.setLimit(limit); 81 | List orderDtls = orderDtlMapper.selectByExample(orderDtlExample); 82 | apiResult.setData(orderDtls); 83 | apiResult.setTotal(orderDtlMapper.countByExample(orderDtlExample)); 84 | return apiResult; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/out/impl/OutStockServiceimpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.out.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.in.model.InStock; 5 | import cn.luvletter.in.model.InStockDtl; 6 | import cn.luvletter.in.model.InStockDtlExample; 7 | import cn.luvletter.out.OutStockService; 8 | import cn.luvletter.out.dao.OutStockDtlMapper; 9 | import cn.luvletter.out.dao.OutStockMapper; 10 | import cn.luvletter.out.model.OutStock; 11 | import cn.luvletter.out.model.OutStockDtl; 12 | import cn.luvletter.out.model.OutStockDtlExample; 13 | import cn.luvletter.out.model.OutStockExample; 14 | import cn.luvletter.util.WMSUtil; 15 | import org.apache.commons.lang.StringUtils; 16 | import org.apache.commons.lang.math.NumberUtils; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.stereotype.Service; 19 | 20 | import javax.servlet.http.HttpServletRequest; 21 | import java.util.List; 22 | 23 | /** 24 | * @author Zephyr 25 | * @Description: 26 | * @Date 2018/3/29 27 | */ 28 | @Service 29 | public class OutStockServiceimpl implements OutStockService { 30 | @Autowired 31 | private OutStockMapper outStockMapper; 32 | @Autowired 33 | private OutStockDtlMapper outStockDtlMapper; 34 | @Autowired 35 | private WMSUtil wmsUtil; 36 | @Override 37 | public ApiResult getOutStock(HttpServletRequest httpServletRequest) { 38 | final String currWNo = wmsUtil.getCurrWNo(httpServletRequest); 39 | String outStockNo = httpServletRequest.getParameter("outStockNo"); 40 | String start = wmsUtil.getStart(httpServletRequest); 41 | String limit = wmsUtil.getLimit(httpServletRequest); 42 | OutStockExample outStockExample = new OutStockExample(); 43 | OutStockExample.Criteria criteria = outStockExample.createCriteria(); 44 | if(StringUtils.isNotBlank(outStockNo)){ 45 | criteria.andOutStockNoEqualTo(outStockNo); 46 | } 47 | criteria.andWarehouseNoEqualTo(currWNo); 48 | outStockExample.setStart(start); 49 | outStockExample.setLimit(limit); 50 | List outStocks = outStockMapper.selectByExample(outStockExample); 51 | ApiResult apiResult = new ApiResult(); 52 | apiResult.setData(outStocks); 53 | return apiResult; 54 | } 55 | 56 | @Override 57 | public ApiResult getOutStockDtl(String id, HttpServletRequest httpServletRequest) { 58 | ApiResult apiResult = new ApiResult(); 59 | if(StringUtils.isBlank(id)|| !NumberUtils.isDigits(id)){ 60 | apiResult.isFalse().setMessage("id不能为空"); 61 | return apiResult; 62 | } 63 | String start = wmsUtil.getStart(httpServletRequest); 64 | String limit = wmsUtil.getLimit(httpServletRequest); 65 | OutStockExample outStockExample = new OutStockExample(); 66 | outStockExample.createCriteria().andIdEqualTo(Long.valueOf(id)); 67 | List outStocks = outStockMapper.selectByExample(outStockExample); 68 | if(outStocks == null || outStocks.size()==0){ 69 | apiResult.isFalse().setMessage("系统未找到此出库单详情"); 70 | return apiResult; 71 | } 72 | String outStockNo = outStocks.get(0).getOutStockNo(); 73 | OutStockDtlExample outStockDtlExample = new OutStockDtlExample(); 74 | outStockDtlExample.createCriteria().andOutStockNoEqualTo(outStockNo); 75 | List outStockDtls = outStockDtlMapper.selectByExample(outStockDtlExample); 76 | apiResult.setData(outStockDtls); 77 | return apiResult; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/stock/impl/StockServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.stock.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.out.model.OutStock; 5 | import cn.luvletter.out.model.OutStockDtlExample; 6 | import cn.luvletter.stock.StockService; 7 | import cn.luvletter.stock.dao.StockDtlMapper; 8 | import cn.luvletter.stock.dao.StockMapper; 9 | import cn.luvletter.stock.model.Stock; 10 | import cn.luvletter.stock.model.StockDtl; 11 | import cn.luvletter.stock.model.StockDtlExample; 12 | import cn.luvletter.stock.model.StockExample; 13 | import cn.luvletter.stock.vo.StockVo; 14 | import cn.luvletter.util.WMSUtil; 15 | import org.apache.commons.lang.StringUtils; 16 | import org.apache.commons.lang.math.NumberUtils; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.stereotype.Service; 19 | 20 | import javax.servlet.http.HttpServletRequest; 21 | import java.util.HashMap; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * @author Zephyr 27 | * @Description: 库存 28 | * @Date 2018/4/9 29 | */ 30 | @Service 31 | public class StockServiceImpl implements StockService { 32 | @Autowired 33 | private StockMapper stockMapper; 34 | @Autowired 35 | private StockDtlMapper stockDtlMapper; 36 | @Autowired 37 | private WMSUtil wmsUtil; 38 | @Override 39 | public ApiResult getStock(HttpServletRequest httpServletRequest) { 40 | final String currWNo = wmsUtil.getCurrWNo(httpServletRequest); 41 | String goodsName = httpServletRequest.getParameter("goodsName"); 42 | String start = wmsUtil.getStart(httpServletRequest); 43 | String limit = wmsUtil.getLimit(httpServletRequest); 44 | Map params = new HashMap<>(); 45 | if(StringUtils.isNotBlank(goodsName)){ 46 | params.put("goodsName",goodsName); 47 | } 48 | params.put("warehouseNo",currWNo); 49 | params.put("start",start); 50 | params.put("limit",limit); 51 | List stockVoList = stockMapper.selectStockVo(params); 52 | ApiResult apiResult = new ApiResult(); 53 | apiResult.setData(stockVoList); 54 | apiResult.setTotal(stockMapper.countStockVo(params)); 55 | return apiResult; 56 | } 57 | 58 | @Override 59 | public ApiResult getStockDtl(String id, HttpServletRequest httpServletRequest) { 60 | ApiResult apiResult = new ApiResult(); 61 | if(StringUtils.isBlank(id)|| !NumberUtils.isDigits(id)){ 62 | apiResult.isFalse().setMessage("id不能为空"); 63 | return apiResult; 64 | } 65 | String start = wmsUtil.getStart(httpServletRequest); 66 | String limit = wmsUtil.getLimit(httpServletRequest); 67 | StockExample stockExample = new StockExample(); 68 | stockExample.createCriteria().andIdEqualTo(Long.valueOf(id)); 69 | List stocks = stockMapper.selectByExample(stockExample); 70 | if(stocks == null || stocks.isEmpty()){ 71 | apiResult.isFalse().setMessage("系统未找到此库存详情"); 72 | return apiResult; 73 | } 74 | String goodsNo = stocks.get(0).getGoodsNo(); 75 | StockDtlExample stockDtlExample = new StockDtlExample(); 76 | stockDtlExample.createCriteria().andGoodsNoEqualTo(goodsNo); 77 | stockDtlExample.setStart(start); 78 | stockDtlExample.setLimit(limit); 79 | List stockDtls = stockDtlMapper.selectByExample(stockDtlExample); 80 | apiResult.setData(stockDtls); 81 | apiResult.setTotal(stockDtlMapper.countByExample(stockDtlExample)); 82 | return apiResult; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/OperatorMapper.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.dao; 2 | 3 | import cn.luvletter.sys.model.Operator; 4 | import cn.luvletter.sys.model.OperatorExample; 5 | import java.util.List; 6 | 7 | import cn.luvletter.sys.vo.OperatorVo; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Repository; 10 | 11 | @Repository 12 | public interface OperatorMapper { 13 | int countByExample(OperatorExample example); 14 | 15 | int deleteByExample(OperatorExample example); 16 | 17 | int deleteByPrimaryKey(Long id); 18 | 19 | int insert(Operator record); 20 | 21 | int insertSelective(Operator record); 22 | 23 | List selectByExample(OperatorExample example); 24 | 25 | Operator selectByPrimaryKey(Long id); 26 | 27 | int updateByExampleSelective(@Param("record") Operator record, @Param("example") OperatorExample example); 28 | 29 | int updateByExample(@Param("record") Operator record, @Param("example") OperatorExample example); 30 | 31 | int updateByPrimaryKeySelective(Operator record); 32 | 33 | int updateByPrimaryKey(Operator record); 34 | 35 | List selectByExampleAndJoinRole(OperatorExample operatorExample); 36 | 37 | List selectByNo(String no); 38 | } -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/OprtRoleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.dao; 2 | 3 | import cn.luvletter.sys.model.OprtRole; 4 | import cn.luvletter.sys.model.OprtRoleExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.stereotype.Repository; 8 | 9 | @Repository 10 | public interface OprtRoleMapper { 11 | int countByExample(OprtRoleExample example); 12 | 13 | int deleteByExample(OprtRoleExample example); 14 | 15 | int deleteByPrimaryKey(Integer id); 16 | 17 | int insert(OprtRole record); 18 | 19 | int insertSelective(OprtRole record); 20 | 21 | List selectByExample(OprtRoleExample example); 22 | 23 | OprtRole selectByPrimaryKey(Integer id); 24 | 25 | int updateByExampleSelective(@Param("record") OprtRole record, @Param("example") OprtRoleExample example); 26 | 27 | int updateByExample(@Param("record") OprtRole record, @Param("example") OprtRoleExample example); 28 | 29 | int updateByPrimaryKeySelective(OprtRole record); 30 | 31 | int updateByPrimaryKey(OprtRole record); 32 | } -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.dao; 2 | 3 | import cn.luvletter.sys.model.Permission; 4 | import cn.luvletter.sys.model.PermissionTree; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @author Zephyr Ji 14 | * @ Description: TODO 15 | * @ Date 2018/2/10 16 | */ 17 | @Repository 18 | public interface PermissionMapper { 19 | 20 | List findAll(); 21 | 22 | List findByOperatorNo(@Param("no") String no); 23 | 24 | int delById(@Param("id") String id); 25 | 26 | List findTree(); 27 | 28 | List findByPid(@Param("key") String key); 29 | 30 | int decideIsRole(@Param("permissionNo")String permissionNo,@Param("key") String key); 31 | } 32 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.dao; 2 | 3 | import cn.luvletter.sys.model.Role; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Zephyr 10 | * @Description: 11 | * @Date 2018/4/17 12 | */ 13 | @Repository 14 | public interface RoleMapper { 15 | List findAll(); 16 | } 17 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/mapper/PermissionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | DELETE FROM sys_permission 20 | WHERE id = #{id} 21 | 22 | 25 | 36 | 40 | 44 | 53 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/dao/mapper/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/impl/DictionaryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.impl; 2 | 3 | import cn.luvletter.base.impl.StorageLocationServiceImpl; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.main.dao.DictionaryMapper; 6 | import cn.luvletter.main.model.Dictionary; 7 | import cn.luvletter.main.vo.SelectDSVo; 8 | import cn.luvletter.sys.api.DictionaryService; 9 | import cn.luvletter.util.DateUtil; 10 | import cn.luvletter.util.WMSUtil; 11 | import org.apache.commons.lang.StringUtils; 12 | import org.slf4j.Logger; 13 | import org.slf4j.LoggerFactory; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.stereotype.Service; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | /** 22 | * @author Zephyr 23 | * @Description: 数据字典 24 | * @Date 2018/4/21 25 | */ 26 | @Service 27 | public class DictionaryServiceImpl implements DictionaryService { 28 | private final Logger logger = LoggerFactory.getLogger(StorageLocationServiceImpl.class); 29 | @Autowired 30 | private DictionaryMapper dictionaryMapper; 31 | @Autowired 32 | private WMSUtil wmsUtil; 33 | 34 | @Override 35 | public ApiResult getDictionary(HttpServletRequest httpServletRequest) { 36 | String pid = httpServletRequest.getParameter("pid"); 37 | ApiResult apiResult = new ApiResult(); 38 | if(StringUtils.isEmpty(pid)){ 39 | return apiResult; 40 | } 41 | List dictionarys = dictionaryMapper.selectDictionaryByPid(pid); 42 | apiResult.setData(dictionarys); 43 | return apiResult; 44 | } 45 | 46 | @Override 47 | public ApiResult update(Dictionary dictionary, HttpServletRequest httpServletRequest) { 48 | final ApiResult apiResult = new ApiResult(); 49 | Long id = dictionary.getId(); 50 | if(id == null || id == 0L){ 51 | apiResult.isFalse().setMessage("id不能为空"); 52 | return apiResult; 53 | 54 | } 55 | dictionary.setGmtModified(DateUtil.now()); 56 | dictionaryMapper.updateByPrimaryKeySelective(dictionary); 57 | apiResult.setMessage("更新成功"); 58 | return apiResult; 59 | } 60 | 61 | @Override 62 | public ApiResult delById(String id, HttpServletRequest httpServletRequest) { 63 | final ApiResult apiResult = new ApiResult(); 64 | final String currUser = wmsUtil.getCurrUser(httpServletRequest); 65 | Long lId = Long.valueOf(id); 66 | Dictionary dictionary = dictionaryMapper.selectByPrimaryKey(lId); 67 | if(dictionary == null){ 68 | apiResult.isFalse().setMessage("系统未找到此字典数据"); 69 | return apiResult; 70 | } 71 | int i = dictionaryMapper.deleteByPrimaryKey(lId); 72 | if(i == 1){ 73 | logger.info("删除字典:id:"+id+"用户:"+currUser); 74 | apiResult.setMessage("删除成功"); 75 | }else { 76 | apiResult.isFalse().setMessage("删除失败"); 77 | } 78 | return apiResult; 79 | } 80 | 81 | @Override 82 | public ApiResult sava(Dictionary dictionary, HttpServletRequest httpServletRequest) { 83 | final ApiResult apiResult = new ApiResult(); 84 | final String currUser = wmsUtil.getCurrUser(httpServletRequest); 85 | dictionary.setGmtCreate(DateUtil.now()); 86 | int i = dictionaryMapper.insertSelective(dictionary); 87 | if(i == 1){ 88 | logger.info("新增字典:"+dictionary.toString()+"用户:"+currUser); 89 | apiResult.setMessage("新增成功"); 90 | }else { 91 | apiResult.isFalse().setMessage("新增失败"); 92 | } 93 | return apiResult; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/impl/OperatorServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.impl; 2 | 3 | import cn.luvletter.base.impl.StorageLocationServiceImpl; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.constant.WMSConstant; 6 | import cn.luvletter.sys.api.OperatorService; 7 | import cn.luvletter.sys.dao.OperatorMapper; 8 | import cn.luvletter.sys.model.Operator; 9 | import cn.luvletter.sys.model.OperatorExample; 10 | import cn.luvletter.sys.vo.OperatorVo; 11 | import cn.luvletter.util.AESUtil; 12 | import cn.luvletter.util.DateUtil; 13 | import cn.luvletter.util.WMSUtil; 14 | import org.slf4j.Logger; 15 | import org.slf4j.LoggerFactory; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Service; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import java.util.List; 21 | 22 | /** 23 | * @author Zephyr 24 | * @Description: 25 | * @Date 2018/4/20 26 | */ 27 | @Service 28 | public class OperatorServiceImpl implements OperatorService { 29 | private final Logger logger = LoggerFactory.getLogger(OperatorServiceImpl.class); 30 | @Autowired 31 | private OperatorMapper operatorMapper; 32 | @Autowired 33 | private WMSUtil wmsUtil; 34 | @Override 35 | public ApiResult getOperators(HttpServletRequest httpServletRequest) { 36 | final ApiResult apiResult = new ApiResult(); 37 | String start = wmsUtil.getStart(httpServletRequest); 38 | String limit = wmsUtil.getLimit(httpServletRequest); 39 | OperatorExample operatorExample = new OperatorExample(); 40 | operatorExample.setStart(start); 41 | operatorExample.setLimit(limit); 42 | List operators = operatorMapper.selectByExampleAndJoinRole(operatorExample); 43 | apiResult.setData(operators); 44 | apiResult.setTotal(operatorMapper.countByExample(operatorExample)); 45 | return apiResult; 46 | } 47 | 48 | @Override 49 | public ApiResult update(Operator operator, HttpServletRequest httpServletRequest) { 50 | return null; 51 | } 52 | 53 | @Override 54 | public ApiResult delById(String id, HttpServletRequest httpServletRequest) { 55 | final ApiResult apiResult = new ApiResult(); 56 | final String currUser = wmsUtil.getCurrUser(httpServletRequest); 57 | Long lId = Long.valueOf(id); 58 | Operator operator = operatorMapper.selectByPrimaryKey(lId); 59 | if(operator == null){ 60 | apiResult.isFalse().setMessage("系统未找到此人员信息"); 61 | return apiResult; 62 | } 63 | int i = operatorMapper.deleteByPrimaryKey(lId); 64 | if(i == 1){ 65 | logger.info("删除人员信息:id:"+id+"用户:"+currUser); 66 | apiResult.setMessage("删除成功"); 67 | }else { 68 | apiResult.isFalse().setMessage("删除失败"); 69 | } 70 | return apiResult; 71 | } 72 | 73 | @Override 74 | public ApiResult sava(Operator operator, HttpServletRequest httpServletRequest) { 75 | final ApiResult apiResult = new ApiResult(); 76 | final String currUser = wmsUtil.getCurrUser(httpServletRequest); 77 | operator.setPassword(AESUtil.AESEncode(WMSConstant.DEFAULT_PWD)); 78 | operator.setOprtName(currUser); 79 | operator.setOprtTime(DateUtil.now()); 80 | int i = operatorMapper.insertSelective(operator); 81 | if(i == 1){ 82 | logger.info("新增人员信息,new operator :"+operator.toString()+"用户:"+currUser); 83 | apiResult.setMessage("新增成功"); 84 | }else { 85 | apiResult.isFalse().setMessage("新增失败"); 86 | } 87 | return apiResult; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/impl/PermisssionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.constant.WMSConstant; 5 | import cn.luvletter.sys.api.PermissionService; 6 | import cn.luvletter.sys.dao.PermissionMapper; 7 | import cn.luvletter.sys.model.Permission; 8 | import cn.luvletter.sys.model.PermissionTree; 9 | import org.apache.commons.lang.StringUtils; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author Zephyr 17 | * @Description: 18 | * @Date 2018/4/17 19 | */ 20 | @Service 21 | public class PermisssionServiceImpl implements PermissionService { 22 | @Autowired 23 | private PermissionMapper permissionMapper; 24 | @Override 25 | public ApiResult getPermission(String key) { 26 | ApiResult apiResult = new ApiResult(); 27 | if(StringUtils.isEmpty(key)){ 28 | return apiResult; 29 | } 30 | List permissionTrees = permissionMapper.findTree(); 31 | if(permissionTrees == null ||permissionTrees.isEmpty()){ 32 | return apiResult; 33 | } 34 | for(PermissionTree permissionTree : permissionTrees){ 35 | List permissionChild = permissionTree.getPermissionChild(); 36 | if(permissionMapper.decideIsRole(permissionTree.getPermissionNo(),key)>0){ 37 | permissionTree.setCheck(WMSConstant.YES); 38 | }else{ 39 | permissionTree.setCheck(WMSConstant.NO); 40 | } 41 | for(Permission permission : permissionChild){ 42 | if(permissionMapper.decideIsRole(permission.getPermissionNo(),key)>0){ 43 | permission.setCheck(WMSConstant.YES); 44 | }else{ 45 | permission.setCheck(WMSConstant.NO); 46 | } 47 | } 48 | } 49 | apiResult.setData(permissionTrees); 50 | return apiResult; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/impl/RoleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.sys.api.RoleService; 5 | import cn.luvletter.sys.dao.RoleMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * @author Zephyr 11 | * @Description: 12 | * @Date 2018/4/17 13 | */ 14 | @Service 15 | public class RoleServiceImpl implements RoleService { 16 | @Autowired 17 | private RoleMapper roleMapper; 18 | @Override 19 | public ApiResult getRule() { 20 | ApiResult apiResult = new ApiResult(); 21 | apiResult.setData(roleMapper.findAll()); 22 | return apiResult; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/main/java/cn/luvletter/sys/impl/SettingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys.impl; 2 | 3 | import cn.luvletter.bean.ApiResult; 4 | import cn.luvletter.sys.api.SettingService; 5 | import cn.luvletter.sys.dao.PermissionMapper; 6 | import cn.luvletter.sys.model.Permission; 7 | import cn.luvletter.util.JWTUtil; 8 | import org.apache.commons.lang.StringUtils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | /** 13 | * @author Zephyr Ji 14 | * @ Description: 系统设置 15 | * @ Date 2018/3/1 16 | */ 17 | @Service 18 | public class SettingServiceImpl implements SettingService { 19 | 20 | @Autowired 21 | private PermissionMapper permissionMapper; 22 | 23 | @Override 24 | public ApiResult getNavigation() { 25 | ApiResult apiResult = new ApiResult(); 26 | apiResult.setData(permissionMapper.findAll()); 27 | return apiResult; 28 | } 29 | 30 | @Override 31 | public ApiResult delNavigation(String id) { 32 | if(StringUtils.isEmpty(id)){ 33 | return new ApiResult("id不能为空!"); 34 | } 35 | permissionMapper.delById(id); 36 | return new ApiResult("删除成功"); 37 | } 38 | 39 | @Override 40 | public ApiResult saveNavigation(Permission permission) { 41 | return null; 42 | } 43 | 44 | @Override 45 | public ApiResult updateNavigation(Permission permission) { 46 | return null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/test/java/AuthTest.java: -------------------------------------------------------------------------------- 1 | import cn.luvletter.bean.AuthBean; 2 | import cn.luvletter.constant.SqlConstant; 3 | import cn.luvletter.util.JdbcUtil; 4 | import org.apache.commons.lang.StringUtils; 5 | import org.junit.Test; 6 | import org.springframework.security.access.ConfigAttribute; 7 | import org.springframework.security.access.SecurityConfig; 8 | 9 | import java.util.*; 10 | import java.util.stream.Collector; 11 | import java.util.stream.Collectors; 12 | 13 | /** 14 | * @author Zephyr 15 | * @Description: 16 | * @Date 2018/4/24 17 | */ 18 | public class AuthTest { 19 | @Test 20 | public void test01(){ 21 | List authBeans = JdbcUtil.newInstance().selectBean(SqlConstant.SELECT_ALL_AUTH, null, AuthBean.class); 22 | Collection array; 23 | ConfigAttribute cfg; 24 | Map> authMap = new HashMap<>(); 25 | for(AuthBean authBean : authBeans){ 26 | String url = authBean.getUrl(); 27 | if(authMap.containsKey(url)){ 28 | cfg = new SecurityConfig(authBean.getName()); 29 | authMap.get(url).add(cfg); 30 | continue; 31 | } 32 | array = new ArrayList<>(); 33 | cfg = new SecurityConfig(authBean.getName()); 34 | array.add(cfg); 35 | authMap.put(url,array); 36 | } 37 | System.out.println(authMap); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-service/src/test/java/JUnit4ClassRunner.java: -------------------------------------------------------------------------------- 1 | import org.junit.runners.model.InitializationError; 2 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 3 | import org.springframework.util.Log4jConfigurer; 4 | 5 | import java.io.FileNotFoundException; 6 | 7 | /** 8 | * @author Zephyr 9 | * @Description: 10 | * @Date 2018/4/19 11 | */ 12 | public class JUnit4ClassRunner extends SpringJUnit4ClassRunner { 13 | static { 14 | try { 15 | Log4jConfigurer.initLogging("D:\\code\\JAVA\\毕业设计\\WMS\\luv-server\\src\\main\\resources\\log4j.properties"); 16 | } catch (FileNotFoundException ex) { 17 | System.err.println("Cannot Initialize log4j"); 18 | } 19 | } 20 | public JUnit4ClassRunner(Class clazz) throws InitializationError { 21 | super(clazz); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/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-web 14 | 15 | 16 | 17 | cn.luvletter 18 | wms-service 19 | 1.0-SNAPSHOT 20 | 21 | 22 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/base/GoodsController.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 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.validation.BindingResult; 8 | import org.springframework.validation.annotation.Validated; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | /** 14 | * @author Zephyr Ji 15 | * @ Description: 商品 16 | * @ Date 2018/3/28 17 | */ 18 | @RestController 19 | @RequestMapping("/goods") 20 | public class GoodsController extends BaseController { 21 | @Autowired 22 | private GoodsService goodsService; 23 | @GetMapping("/list") 24 | public ApiResult getData(GoodsSerarchVo serarchVo, HttpServletRequest httpServletRequest){ 25 | return goodsService.getGoods(serarchVo,httpServletRequest); 26 | } 27 | @PutMapping("/list") 28 | public ApiResult update(@Validated @RequestBody Goods goods, BindingResult br, HttpServletRequest httpServletRequest){ 29 | ApiResult apiResult = new ApiResult(); 30 | if(br.hasErrors()){ 31 | apiResult.isFalse().setMessage(br.getFieldErrors()); 32 | return apiResult; 33 | } 34 | return goodsService.update(goods, httpServletRequest); 35 | } 36 | @DeleteMapping("/list/{id}") 37 | public ApiResult delById(@PathVariable("id")String id, HttpServletRequest httpServletRequest){ 38 | return goodsService.delById(id,httpServletRequest); 39 | } 40 | @PostMapping("/create") 41 | public ApiResult save(@Validated @RequestBody Goods goods, BindingResult br, HttpServletRequest httpServletRequest){ 42 | ApiResult apiResult = new ApiResult(); 43 | if(br.hasErrors()){ 44 | apiResult.isFalse().setMessage(br.getFieldErrors()); 45 | return apiResult; 46 | } 47 | return goodsService.sava(goods,httpServletRequest); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/base/StorageAreaController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.base; 2 | 3 | import cn.luvletter.base.model.StorageArea; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.validation.BindingResult; 7 | import org.springframework.validation.annotation.Validated; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | /** 13 | * @author Zephyr 14 | * @ Description: 库区 15 | * @ Date 2018/3/6 16 | */ 17 | @RestController 18 | @RequestMapping("/sys/storageArea") 19 | public class StorageAreaController extends BaseController{ 20 | @Autowired 21 | private StorageAreaService storageAreaService; 22 | @GetMapping 23 | public ApiResult getData(HttpServletRequest httpServletRequest){ 24 | return storageAreaService.getStorageArea(httpServletRequest); 25 | } 26 | @PutMapping 27 | public ApiResult update(@RequestBody StorageArea storageArea, HttpServletRequest httpServletRequest){ 28 | return storageAreaService.update(storageArea, httpServletRequest); 29 | } 30 | @DeleteMapping("/{id}") 31 | public ApiResult delById(@PathVariable("id")String id, HttpServletRequest httpServletRequest){ 32 | return storageAreaService.delById(id,httpServletRequest); 33 | } 34 | @PostMapping 35 | public ApiResult save(@Validated @RequestBody StorageArea storageArea, BindingResult br, HttpServletRequest httpServletRequest){ 36 | ApiResult apiResult = new ApiResult(); 37 | if(br.hasErrors()){ 38 | apiResult.isFalse().setMessage(br.getFieldErrors()); 39 | return apiResult; 40 | } 41 | return storageAreaService.sava(storageArea,httpServletRequest); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/base/StorageLocationController.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 org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.validation.BindingResult; 8 | import org.springframework.validation.annotation.Validated; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | /** 14 | * @author Zephyr 15 | * @ Description: 库位 16 | * @ Date 2018/3/6 17 | */ 18 | @RestController 19 | @RequestMapping("/sys/storageLocation") 20 | public class StorageLocationController extends BaseController{ 21 | @Autowired 22 | private StorageLocationService storageLocationService; 23 | @GetMapping 24 | public ApiResult getData(HttpServletRequest httpServletRequest){ 25 | return storageLocationService.getStorageLocation(httpServletRequest); 26 | } 27 | @PutMapping 28 | public ApiResult update(@RequestBody StorageLocation storageLocation, HttpServletRequest httpServletRequest){ 29 | return storageLocationService.update(storageLocation, httpServletRequest); 30 | } 31 | @DeleteMapping("/{id}") 32 | public ApiResult delById(@PathVariable("id")String id, HttpServletRequest httpServletRequest){ 33 | return storageLocationService.delById(id,httpServletRequest); 34 | } 35 | @PostMapping 36 | public ApiResult save(@Validated @RequestBody StorageLocationVo storageLocationVo, BindingResult br, HttpServletRequest httpServletRequest){ 37 | ApiResult apiResult = new ApiResult(); 38 | if(br.hasErrors()){ 39 | apiResult.isFalse().setMessage(br.getFieldErrors()); 40 | return apiResult; 41 | } 42 | return storageLocationService.sava(storageLocationVo,httpServletRequest); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/base/WarehouseController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.base; 2 | 3 | import cn.luvletter.base.model.Warehouse; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.*; 7 | 8 | /** 9 | * @author Zephyr 10 | * @ Description: 仓库 11 | * @ Date 2018/3/6 12 | */ 13 | @RestController 14 | @RequestMapping("/warehouse") 15 | public class WarehouseController extends BaseController{ 16 | @Autowired 17 | private WarehouseService warehouseService; 18 | @GetMapping 19 | public ApiResult getData(){ 20 | return warehouseService.getStorageArea(); 21 | } 22 | @DeleteMapping("/{id}") 23 | public ApiResult delById(@PathVariable("id")String id){ 24 | return warehouseService.delById(id); 25 | } 26 | @PostMapping 27 | public ApiResult save(@RequestBody Warehouse warehouse){ 28 | return warehouseService.sava(warehouse); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/in/InStockController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.in; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.*; 7 | import org.springframework.web.multipart.MultipartFile; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | 11 | /** 12 | * @author Zephyr Ji 13 | * @ Description: TODO 14 | * @ Date 2018/3/29 15 | */ 16 | @RestController 17 | @RequestMapping("/inStock") 18 | public class InStockController extends BaseController { 19 | @Autowired 20 | private InStockService inStockService; 21 | /** 22 | * @Description: 获取入库单列表 23 | * @Date: 11:14 2018/3/29 24 | */ 25 | @GetMapping("/list") 26 | public ApiResult getData(HttpServletRequest httpServletRequest){ 27 | return inStockService.getInStock(httpServletRequest); 28 | } 29 | /** 30 | * @Description: 根据id获取入库单明细 31 | * @Date: 11:14 2018/3/29 32 | */ 33 | @GetMapping("/list/{id}") 34 | public ApiResult getDtl(@PathVariable String id, HttpServletRequest httpServletRequest){ 35 | return inStockService.getInDtl(id, httpServletRequest); 36 | } 37 | @PostMapping("/list") 38 | public ApiResult uploadInStock(@RequestParam("file") MultipartFile file, HttpServletRequest httpServletRequest){ 39 | return inStockService.uploadInStock(file, httpServletRequest); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/main/CommonController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.main; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.util.WMSUtil; 6 | import org.apache.commons.lang.StringUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.access.method.P; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | /** 16 | * @author Zephyr Ji 17 | * @ Description: TODO 18 | * @ Date 2018/2/9 19 | */ 20 | @Controller 21 | @RequestMapping("/common") 22 | public class CommonController extends BaseController { 23 | @Autowired 24 | private WMSUtil wmsUtil; 25 | @Autowired 26 | private MainService mainService; 27 | /** 28 | * @Description: 根据文件名获取七牛上传凭证 29 | * @Date: 17:02 2018/3/28 30 | */ 31 | @GetMapping("/upToken") 32 | @ResponseBody 33 | public ApiResult getUpToken(@RequestParam String fileName){ 34 | final ApiResult apiResult = new ApiResult(); 35 | if(StringUtils.isBlank(fileName)||!fileName.contains(".jpg")){ 36 | apiResult.isFalse().setMessage("文件名格式不正确"); 37 | return apiResult; 38 | } 39 | String qiuNiuUpToken = wmsUtil.getQiuNiuUpToken(fileName); 40 | apiResult.setData(qiuNiuUpToken); 41 | return apiResult; 42 | } 43 | /** 44 | * @Description: 列表字段翻译 45 | * @Date: 15:07 2018/4/2 46 | */ 47 | @GetMapping("/comboBox") 48 | @ResponseBody 49 | public ApiResult comboBox(@RequestParam("value") String value, 50 | @RequestParam("pid") String pid){ 51 | ApiResult apiResult = new ApiResult(); 52 | if(StringUtils.isBlank(value) || StringUtils.isBlank(pid)){ 53 | apiResult.isFalse(); 54 | return apiResult; 55 | } 56 | apiResult = mainService.getComboBox(pid, value); 57 | return apiResult; 58 | } 59 | /** 60 | * @Description: 获取下拉框选项 61 | * @Date: 15:07 2018/4/2 62 | */ 63 | @GetMapping("/selectDS") 64 | @ResponseBody 65 | public ApiResult selectDS(@RequestParam("pid") String pid){ 66 | ApiResult apiResult = new ApiResult(); 67 | if(StringUtils.isBlank(pid)){ 68 | apiResult.isFalse(); 69 | return apiResult; 70 | } 71 | apiResult = mainService.getSelectDS(pid); 72 | return apiResult; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/order/OrderController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.order; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | /** 14 | * @author Zephyr 15 | * @Description: 订单 16 | * @Date 2018/4/3 17 | */ 18 | @RestController 19 | @RequestMapping("/outStock/orders") 20 | public class OrderController extends BaseController{ 21 | 22 | @Autowired 23 | private OrderService orderService; 24 | 25 | /** 26 | * @Description: 获取订单列表 27 | * @Date: 10:45 2018/4/3 28 | */ 29 | @GetMapping 30 | public ApiResult getData(HttpServletRequest httpServletRequest){ 31 | return orderService.getOrder(httpServletRequest); 32 | } 33 | /** 34 | * @Description:获取订单明细 35 | * @Date: 10:46 2018/4/3 36 | */ 37 | @GetMapping("/{id}") 38 | public ApiResult getDtl(@PathVariable String id, HttpServletRequest httpServletRequest){ 39 | return orderService.getOrderDtl(id, httpServletRequest); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/out/OutStockController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.out; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.omg.CORBA.PUBLIC_MEMBER; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | /** 15 | * @author Zephyr 16 | * @Description: 出库 17 | * @Date 2018/3/29 18 | */ 19 | @RestController 20 | @RequestMapping("/outStock/list") 21 | public class OutStockController extends BaseController{ 22 | @Autowired 23 | private OutStockService outStockService; 24 | 25 | /** 26 | * @Description: 获取库存表头 27 | * @Date: 16:43 2018/4/9 28 | */ 29 | @GetMapping 30 | public ApiResult getData(HttpServletRequest httpServletRequest){ 31 | return outStockService.getOutStock(httpServletRequest); 32 | } 33 | 34 | /** 35 | * @Description: 获取库存表明细 36 | * @Date: 16:43 2018/4/9 37 | */ 38 | @GetMapping("/{id}") 39 | public ApiResult getData(@PathVariable String id, HttpServletRequest httpServletRequest){ 40 | return outStockService.getOutStockDtl(id,httpServletRequest); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/stock/StockController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.stock; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | /** 14 | * @author Zephyr 15 | * @Description: 库存 16 | * @Date 2018/4/9 17 | */ 18 | @RestController 19 | @RequestMapping("/stock") 20 | public class StockController extends BaseController{ 21 | @Autowired 22 | private StockService stockService; 23 | @GetMapping("/list") 24 | public ApiResult getData(HttpServletRequest httpServletRequest){ 25 | return stockService.getStock(httpServletRequest); 26 | } 27 | @GetMapping("/list/{id}") 28 | public ApiResult getData(@PathVariable String id, HttpServletRequest httpServletRequest){ 29 | return stockService.getStockDtl(id,httpServletRequest); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/sys/AuthController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.bean.AuthenticationBean; 6 | import cn.luvletter.sys.api.SysService; 7 | import cn.luvletter.sys.model.Operator; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | /** 15 | * @author Zephyr Ji 16 | * @ Description: TODO 17 | * @ Date 2018/2/22 18 | */ 19 | @RestController 20 | @RequestMapping("/auth") 21 | public class AuthController extends BaseController { 22 | @Autowired 23 | private SysService sysService; 24 | 25 | @PostMapping("/login") 26 | public ApiResult login(@RequestBody AuthenticationBean authenticationBean, HttpServletResponse response){ 27 | return sysService.login(authenticationBean,response); 28 | } 29 | @PostMapping("/register") 30 | public ApiResult register(@RequestBody Operator operator){ 31 | return sysService.register(operator); 32 | } 33 | 34 | @GetMapping() 35 | public ApiResult getAuth(){ 36 | return sysService.getAuth(); 37 | } 38 | 39 | @GetMapping("/nav") 40 | public ApiResult getNav(@RequestParam("operatorNo") String operatorNo){ 41 | return sysService.getNav(operatorNo); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/sys/DictionaryController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.main.model.Dictionary; 6 | import cn.luvletter.sys.api.DictionaryService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.validation.BindingResult; 9 | import org.springframework.validation.annotation.Validated; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | /** 15 | * @author Zephyr 16 | * @Description: 数据字典 17 | * @Date 2018/4/21 18 | */ 19 | @RestController 20 | @RequestMapping("/sys/dictionary") 21 | public class DictionaryController extends BaseController { 22 | @Autowired 23 | private DictionaryService dictionaryService; 24 | @GetMapping 25 | public ApiResult getData(HttpServletRequest httpServletRequest){ 26 | return dictionaryService.getDictionary(httpServletRequest); 27 | } 28 | @PutMapping 29 | public ApiResult update(@RequestBody Dictionary dictionary, HttpServletRequest httpServletRequest){ 30 | return dictionaryService.update(dictionary, httpServletRequest); 31 | } 32 | @DeleteMapping("/{id}") 33 | public ApiResult delById(@PathVariable("id")String id, HttpServletRequest httpServletRequest){ 34 | return dictionaryService.delById(id,httpServletRequest); 35 | } 36 | @PostMapping 37 | public ApiResult save(@Validated @RequestBody Dictionary dictionary, BindingResult br, HttpServletRequest httpServletRequest){ 38 | ApiResult apiResult = new ApiResult(); 39 | if(br.hasErrors()){ 40 | apiResult.isFalse().setMessage(br.getFieldErrors()); 41 | return apiResult; 42 | } 43 | return dictionaryService.sava(dictionary,httpServletRequest); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/sys/OperatorController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.sys.api.OperatorService; 6 | import cn.luvletter.sys.model.Operator; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.validation.BindingResult; 9 | import org.springframework.validation.annotation.Validated; 10 | import org.springframework.web.bind.annotation.*; 11 | import org.springframework.web.multipart.MultipartFile; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | 15 | /** 16 | * @author Zephyr 17 | * @Description: 人员 18 | * @Date 2018/4/20 19 | */ 20 | @RestController 21 | @RequestMapping("/authority/operator") 22 | public class OperatorController extends BaseController { 23 | 24 | @Autowired 25 | private OperatorService operatorService; 26 | 27 | /** 28 | * @Description: 获取人员列表 29 | * @Date: 11:14 2018/3/29 30 | */ 31 | @GetMapping 32 | public ApiResult getData(HttpServletRequest httpServletRequest){ 33 | return operatorService.getOperators(httpServletRequest); 34 | } 35 | @PutMapping 36 | public ApiResult update(@RequestBody Operator operator, HttpServletRequest httpServletRequest){ 37 | return operatorService.update(operator, httpServletRequest); 38 | } 39 | @DeleteMapping("/{id}") 40 | public ApiResult delById(@PathVariable("id")String id, HttpServletRequest httpServletRequest){ 41 | return operatorService.delById(id,httpServletRequest); 42 | } 43 | @PostMapping 44 | public ApiResult save(@Validated @RequestBody Operator operator, BindingResult br, HttpServletRequest httpServletRequest){ 45 | ApiResult apiResult = new ApiResult(); 46 | if(br.hasErrors()){ 47 | apiResult.isFalse().setMessage(br.getFieldErrors()); 48 | return apiResult; 49 | } 50 | return operatorService.sava(operator,httpServletRequest); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/sys/RoleAssianmentController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.sys.api.PermissionService; 6 | import cn.luvletter.sys.api.RoleService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | /** 14 | * @author Zephyr 15 | * @Description: 16 | * @Date 2018/4/17 17 | */ 18 | @RestController 19 | @RequestMapping("/roleAssianment") 20 | public class RoleAssianmentController extends BaseController{ 21 | @Autowired 22 | private RoleService roleService; 23 | @Autowired 24 | private PermissionService permissionService; 25 | @GetMapping("/role") 26 | public ApiResult getRuleData(){ 27 | return roleService.getRule(); 28 | } 29 | @GetMapping("/tree") 30 | public ApiResult getTreeData(@RequestParam("key") String key){ 31 | return permissionService.getPermission(key); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /luv-wms-parent/wms-web/src/main/java/cn/luvletter/sys/SettingController.java: -------------------------------------------------------------------------------- 1 | package cn.luvletter.sys; 2 | 3 | import cn.luvletter.base.BaseController; 4 | import cn.luvletter.bean.ApiResult; 5 | import cn.luvletter.sys.api.SettingService; 6 | import cn.luvletter.sys.model.Permission; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | /** 11 | * @author Zephyr Ji 12 | * @ Description: 系统设置控制层 13 | * @ Date 2018/3/1 14 | */ 15 | @RestController 16 | @RequestMapping("/setting") 17 | public class SettingController extends BaseController { 18 | @Autowired 19 | private SettingService settingService; 20 | @GetMapping("/navigation") 21 | public ApiResult getNavigation(){ 22 | return settingService.getNavigation(); 23 | } 24 | @DeleteMapping("/navigation/{id}") 25 | public ApiResult delNavigation(@PathVariable("id") String id){ 26 | return settingService.delNavigation(id); 27 | } 28 | @PostMapping("/navigation") 29 | public ApiResult saveNavigation(@RequestBody Permission permission){ 30 | return settingService.saveNavigation(permission); 31 | } 32 | @PutMapping("/navigation") 33 | public ApiResult updateNavigation(@RequestBody Permission permission){ 34 | return settingService.updateNavigation(permission); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 |

仓储管理系统

3 |

4 | 5 |

6 | 7 | --- 8 | 基于SSM的前后端分离的仓储管理系统,前后端交互遵循Restful接口原则。 9 | 10 | 线上地址 :[wms.luvletter.cn](http://wms.luvletter.cn/) 账号:admin 密码:1 11 | ## 技术栈 12 | ### 后端 13 | * Spring+SpringMVC+MyBatis 14 | * 缓存使用Redis,并使用Spring Cache的缓存注解,可以直接应用到方法上。 15 | --- 16 | @Cacheable(value = WMSConstant.REDIS_CACHE_NAME) 17 | public ApiResult getComboBox(String pid,String value) { 18 | ApiResult apiResult = new ApiResult(); 19 | List dictionaries = dictionaryMapper.selectByParaId(pid, value); 20 | if(dictionaries == null || dictionaries.isEmpty()){ 21 | apiResult.isFalse(); 22 | return apiResult; 23 | } 24 | apiResult.setData(dictionaries.get(0)); 25 | return apiResult; 26 | } 27 | ### 前端 28 | * 使用阿里巴巴开源的Iceworks构建 29 | ###### (前端代码[在这里](https://github.com/J2ephyr/LUVWMS_React)) 30 | ### 权限管理 31 | * Spring Security+JWT (可以细化到url的权限管理) 32 | --- 33 | #### 关键代码 34 | //在身份验证前添加token验证 35 | http.addFilterBefore(jwtAuthenticationTokenFilter,UsernamePasswordAuthenticationFilter.class); 36 | //替换身份验证过滤器 37 | http.addFilterAt(customAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class); 38 | //在权限筛选前添加自定义的url方式筛选 39 | http.addFilterBefore(urlFilterSecurityInterceptor,FilterSecurityInterceptor.class); 40 | ## 系统功能图 41 | ![系统功能图](http://cdn.luvletter.cn/wms%E5%8A%9F%E8%83%BD%E5%9B%BE1.png) 42 | ## 部分系统截图 43 | ### 首页 44 | ![首页](http://cdn.luvletter.cn/%E9%A6%96%E9%A1%B5.jpg) 45 | ### 商品列表 46 | ![商品列表](http://cdn.luvletter.cn/%E5%95%86%E5%93%81%E5%88%97%E8%A1%A8.jpg) 47 | ### 人员维护 48 | ![人员维护](http://cdn.luvletter.cn/%E4%BA%BA%E5%91%98%E7%BB%B4%E6%8A%A4.jpg) 49 | ### 角色权限维护 50 | ![角色权限维护](http://cdn.luvletter.cn/%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90%E7%BB%B4%E6%8A%A4.jpg) 51 | ## 本地部署项目 52 | 1. clone项目到本地 53 | 2. 执行mysql脚本 54 | 3. 数据库配置文件在luv-server中resources的jdbc.properties和wms-common中resources的jdbc.propertieste 55 | 4. 安装Redis,并配置luv-server下resources的redis.properties 56 | 4. 用Intellij IDEA打开项目,Maven加入luv-comm、luv-server、luv-wms-parent,并依次执行mvn clean install 57 | 5. 配置tomcat,就可以运行了。 58 | 59 | 60 | --------------------------------------------------------------------------------