——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven进销存系统wms(java+ssm+bootstrap+shiro+maven+mysql)
功能介绍
系统操作权限管理。系统提供基本的登入登出功能,同时系统包含两个角色:系统超级管理员和普通管理员,超级管理员具有最高的操作权限,而普通管理员仅具有最基本的操作权限,而且仅能操作自己被指派的仓库。
请求URL鉴权。对于系统使用者登陆后进行操作发送请求的URL,后台会根据当前用户的角色判断是否拥有请求该URL的权限。 基础数据信息管理。对包括:货物信息、供应商信息、客户信息、仓库信息在内的基础数据信息进行管理,提供的操作有:添加、删除、修改、条件查询、导出为Excel和到从Excel导入。 仓库管理员管理。对仓库管理员信息CRUD操作,或者为指定的仓库管理员指派所管理的仓库。上述中的仓库管理员可以以普通管理员身份登陆到系统。 库存信息管理。对库存信息的CRUD操作,导入导出操作,同时查询的时候可以根据仓库以及商品ID等信息进行多条件查询。 基本仓库事务操作。执行货物的入库与出库操作。 系统登陆日志查询。超级管理员可以查询某一用户在特定时间段内的系统登陆日志。
系统操作日志查询。超级管理员可以查询某一用户在特定时间段内对系统进行操作的操作记录
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本;
技术栈
Apache POI MyBatis Spring Framework Spring MVC Apache Shiro Ehcache Apache Commons Log4j Slf4j Jackson C3P0 Junit MySQL-Connector jQuery Bootstrap
使用说明
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行; 3. 将项目中config/DBConfig.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录 超级管理员账号:1001 密码:123456 普通管理员账号:1018 或者 1019 密码:123456
——————————CodeStart——————————
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 32 33 34 35 36 37 38 39 40 41 42 43 switch (searchType) { case SEARCH_ALL: queryResult = repositoryAdminManageService.selectAll(offset, limit); break ; case SEARCH_BY_ID: if (StringUtils.isNumeric(keyWord)) queryResult = repositoryAdminManageService.selectByID(Integer.valueOf(keyWord)); break ; case SEARCH_BY_NAME: queryResult = repositoryAdminManageService.selectByName(offset, limit, keyWord); break ; case SEARCH_BY_REPOSITORY_ID: if (StringUtils.isNumeric(keyWord)) queryResult = repositoryAdminManageService.selectByRepositoryID(Integer.valueOf(keyWord)); break ; default : break ; } return queryResult; } @SuppressWarnings("unchecked") @RequestMapping(value = "getRepositoryAdminList", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getRepositoryAdmin (@RequestParam("searchType") String searchType, @RequestParam("keyWord") String keyWord, @RequestParam("offset") int offset, @RequestParam("limit") int limit) throws RepositoryAdminManageServiceException { Response responseContent = ResponseFactory.newInstance();
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 32 33 34 35 36 37 HttpServletResponse response) throws SupplierManageServiceException, IOException { String fileName = "supplierInfo.xlsx" ; List<Supplier> suppliers = null ; Map<String, Object> queryResult; queryResult = query(searchType, keyWord, -1 , -1 ); if (queryResult != null ) { suppliers = (List<Supplier>) queryResult.get("data" ); } File file = supplierManageService.exportSupplier(suppliers); if (file != null ) { response.addHeader("Content-Disposition" , "attachment;filename=" + fileName); FileInputStream inputStream = new FileInputStream(file); OutputStream outputStream = response.getOutputStream(); byte [] buffer = new byte [8192 ]; int len; while ((len = inputStream.read(buffer, 0 , buffer.length)) > 0 ) { outputStream.write(buffer, 0 , len); outputStream.flush(); } inputStream.close(); outputStream.close(); } } }
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 32 33 34 35 36 37 38 39 40 41 42 43 Serializable sessionId = session.getId(); Deque<Serializable> deque = cache.get(userName); if (deque == null ) { deque = new LinkedList<>(); cache.put(userName, deque); } if (!deque.contains(sessionId) && session.getAttribute("kickOut" ) == null ) { deque.push(sessionId); } while (deque.size() > maxSessionNum) { Serializable kickOutSessionId; if (kickOutAfter) { kickOutSessionId = deque.removeFirst(); } else { kickOutSessionId = deque.removeLast(); } try { Session kickOutSession = sessionManager.getSession(new DefaultSessionKey(kickOutSessionId)); if (kickOutSession != null ) { kickOutSession.setAttribute("kickOut" , true ); } } catch (Exception e) { e.printStackTrace(); } } if (session.getAttribute("kickOut" ) != null && Boolean.TRUE.equals(session.getAttribute("kickOut" ))) { try { subject.logout(); HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
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 32 33 34 35 36 37 38 39 40 41 42 Integer customerID = Integer.valueOf(customerIDStr); String result = customerManageService.deleteCustomer(customerID) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR; responseContent.setResponseResult(result); } else responseContent.setResponseResult(Response.RESPONSE_RESULT_ERROR); return responseContent.generateResponse(); } @RequestMapping(value = "importCustomer", method = RequestMethod.POST) public @ResponseBody Map<String, Object> importCustomer (@RequestParam("file") MultipartFile file) throws CustomerManageServiceException { Response responseContent = ResponseFactory.newInstance(); String result = Response.RESPONSE_RESULT_SUCCESS; int total = 0 ; int available = 0 ; if (file == null ) result = Response.RESPONSE_RESULT_ERROR; Map<String, Object> importInfo = customerManageService.importCustomer(file); if (importInfo != null ) { total = (int ) importInfo.get("total" ); available = (int ) importInfo.get("available" ); } responseContent.setResponseResult(result); responseContent.setResponseTotal(total); responseContent.setCustomerInfo("available" , available); return responseContent.generateResponse();
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 32 33 34 35 36 37 38 39 @Controller @RequestMapping(value = "/**/storageManage") public class StorageManageHandler { @Autowired private StorageManageService storageManageService; @Autowired private StockRecordManageService stockRecordManageService; private static final String SEARCH_BY_GOODS_ID = "searchByGoodsID" ; private static final String SEARCH_BY_GOODS_NAME = "searchByGoodsName" ; private static final String SEARCH_BY_GOODS_TYPE = "searchByGoodsType" ; private static final String SEARCH_ALL = "searchAll" ; private Map<String, Object> query (String searchType, String keyword, String repositoryBelong, int offset, int limit) throws StorageManageServiceException { Map<String, Object> queryResult = null ; switch (searchType) { case SEARCH_ALL: if (StringUtils.isNumeric(repositoryBelong)) { Integer repositoryID = Integer.valueOf(repositoryBelong); queryResult = storageManageService.selectAll(repositoryID, offset, limit); } else {
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 total = (long ) importInfo.get("total" ); available = (long ) importInfo.get("available" ); result = Response.RESPONSE_RESULT_SUCCESS; } } responseContent.setResponseResult(result); responseContent.setResponseTotal(total); responseContent.setCustomerInfo("available" , available); return responseContent.generateResponse(); } @SuppressWarnings("unchecked") @RequestMapping(value = "exportRepositoryAdmin", method = RequestMethod.GET) public void exportRepositoryAdmin (@RequestParam("searchType") String searchType, @RequestParam("keyWord") String keyWord, HttpServletResponse response) throws RepositoryAdminManageServiceException, IOException { String fileName = "repositoryAdminInfo.xlsx" ; List<RepositoryAdmin> repositoryAdmins; Map<String, Object> queryResult = query(keyWord, searchType, -1 , -1 ); if (queryResult != null ) repositoryAdmins = (List<RepositoryAdmin>) queryResult.get("data" ); else repositoryAdmins = new ArrayList<>(); File file = repositoryAdminManageService.exportRepositoryAdmin(repositoryAdmins); if (file != null ) { response.addHeader("Content-Disposition" , "attachment;filename=" + fileName); FileInputStream inputStream = new FileInputStream(file); OutputStream outputStream = response.getOutputStream(); byte [] buffer = new byte [8192 ]; int len; while ((len = inputStream.read(buffer, 0 , buffer.length)) > 0 ) { outputStream.write(buffer, 0 , len);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=551422322105200lg https://javayms.pages.dev?id=551422322105200lg