——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SSM+Maven仓库管理系统(java+ssm+maven+bootstrap+mysql)
功能:
- 系统操作权限管理。系统提供基本的登入登出功能,同时系统包含两个角色:系统超级管理员和普通管理员,超级管理员具有最高的操作权限,而普通管理员仅具有最基本的操作权限,而且仅能操作自己被指派的仓库。 * 请求URL鉴权。对于系统使用者登陆后进行操作发送请求的URL,后台会根据当前用户的角色判断是否拥有请求该URL的权限。 * 基础数据信息管理。对包括:货物信息、供应商信息、客户信息、仓库信息在内的基础数据信息进行管理,提供的操作有:添加、删除、修改、条件查询、导出为Excel和到从Excel导入。 * 仓库管理员管理。对仓库管理员信息CRUD操作,或者为指定的仓库管理员指派所管理的仓库。上述中的仓库管理员可以以普通管理员身份登陆到系统。 * 库存信息管理。对库存信息的CRUD操作,导入导出操作,同时查询的时候可以根据仓库以及商品ID等信息进行多条件查询。 * 基本仓库事务操作。执行货物的入库与出库操作。 * 系统登陆日志查询。超级管理员可以查询某一用户在特定时间段内的系统登陆日志。 * 系统操作日志查询。超级管理员可以查询某一用户在特定时间段内对系统进行操作的操作记录。、 * 密码修改。
使用到的框架和库:
- Apache POI * MyBatis * Spring Framework * Spring MVC * Apache Shiro * Ehcache * Apache Commons * Log4j * Slf4j * Jackson * C3P0 * Junit * MySQL-Connector * jQuery * Bootstrap
——————————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
| * */ @Controller @RequestMapping("/commons/fileSource") public class FileSourceHandler {
@RequestMapping(value = "download/{fileName:.+}", method = RequestMethod.GET) public void fileDownload(@PathVariable("fileName") String fileName, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (fileName == null) return;
ServletContext context = request.getServletContext(); String directory = context.getRealPath("/WEB-INF/download"); Path file = Paths.get(directory, fileName); if (Files.exists(file)) { response.addHeader("Content-Disposition", "attachment;filename=" + file.getFileName()); Files.copy(file, response.getOutputStream()); response.getOutputStream().flush(); } } } package com.ken.wms.security.controller;
@RequestMapping("/") @Controller public class PageForwardHandler {
|
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
| }
@SuppressWarnings("unchecked") @RequestMapping(value = "getStorageList", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getStorageList(@RequestParam("keyword") String keyword, @RequestParam("searchType") String searchType, @RequestParam("offset") int offset, @RequestParam("limit") int limit, HttpServletRequest request) throws StorageManageServiceException { Response responseContent = ResponseFactory.newInstance();
List<Storage> rows = null; long total = 0;
HttpSession session = request.getSession(); UserInfoDTO userInfo = (UserInfoDTO) session.getAttribute("userInfo"); Integer repositoryID = userInfo.getRepositoryBelong(); if (repositoryID > 0) { Map<String, Object> queryResult = query(searchType, keyword, repositoryID.toString(), offset, limit); if (queryResult != null) { rows = (List<Storage>) queryResult.get("data"); total = (long) queryResult.get("total"); } }
if (rows == null) rows = new ArrayList<>();
responseContent.setCustomerInfo("rows", rows); responseContent.setResponseTotal(total); 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 40 41
|
@RequestMapping(value = "/**/supplierManage") @Controller public class SupplierManageHandler {
@Autowired private SupplierManageService supplierManageService;
private static final String SEARCH_BY_ID = "searchByID"; private static final String SEARCH_BY_NAME = "searchByName"; private static final String SEARCH_ALL = "searchAll";
private Map<String, Object> query(String searchType, String keyWord, int offset, int limit) throws SupplierManageServiceException { Map<String, Object> queryResult = null;
switch (searchType) { case SEARCH_BY_ID: if (StringUtils.isNumeric(keyWord)) { queryResult = supplierManageService.selectById(Integer.valueOf(keyWord)); } break; case SEARCH_BY_NAME: queryResult = supplierManageService.selectByName(offset, limit, keyWord); break; case SEARCH_ALL: queryResult = supplierManageService.selectAll(offset, limit); break; default:
|
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
| Goods goods = null; Map<String, Object> queryResult = goodsManageService.selectById(goodsID); if (queryResult != null) { goods = (Goods) queryResult.get("data"); if (goods != null) { result = Response.RESPONSE_RESULT_SUCCESS; } }
responseContent.setResponseResult(result); responseContent.setResponseData(goods); return responseContent.generateResponse(); }
@RequestMapping(value = "updateGoods", method = RequestMethod.POST) public @ResponseBody Map<String, Object> updateGoods(@RequestBody Goods goods) throws GoodsManageServiceException { Response responseContent = ResponseFactory.newInstance();
String result = goodsManageService.updateGoods(goods) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
responseContent.setResponseResult(result); return responseContent.generateResponse(); }
@RequestMapping(value = "deleteGoods", method = RequestMethod.GET) public @ResponseBody Map<String, Object> deleteGoods(@RequestParam("goodsID") Integer goodsID) throws GoodsManageServiceException { 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 38 39 40 41 42 43 44 45 46 47 48 49 50
| if (startDateFormatCheck && endDateFormatCheck && userIDCheck) { Integer userID = -1; if (StringUtils.isNumeric(userIDStr)) userID = Integer.valueOf(userIDStr); Map<String, Object> queryResult = systemLogService.selectAccessRecord(userID, accessType, startDateStr, endDateStr, offset, limit); if (queryResult != null) { rows = (List<AccessRecordDO>) queryResult.get("data"); total = (long) queryResult.get("total"); } } else response.setResponseMsg("Request Argument Error");
if (rows == null) rows = new ArrayList<>(0);
response.setCustomerInfo("rows", rows); response.setResponseTotal(total); return response.generateResponse(); }
@SuppressWarnings("unchecked") @RequestMapping(value = "getUserOperationRecords") public @ResponseBody Map<String, Object> selectUserOperationRecords(@RequestParam("userID") String userIDStr, @RequestParam("startDate") String startDateStr, @RequestParam("endDate") String endDateStr, @RequestParam("offset") int offset, @RequestParam("limit") int limit) throws SystemLogServiceException { Response response = ResponseFactory.newInstance(); List<UserOperationRecordDTO> rows = null; long total = 0;
String regex = "([0-9]{4})-([0-9]{2})-([0-9]{2})"; boolean startDateFormatCheck = (StringUtils.isEmpty(startDateStr) || startDateStr.matches(regex));
|
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
| * @param keyWord 查询关键字 * @param offset 分页偏移值 * @param limit 分页大小 * @return 返回一个 Map ,包含所有符合要求的查询结果,以及记录的条数 */ private Map<String, Object> query(String searchType, String keyWord, int offset, int limit) throws GoodsManageServiceException { Map<String, Object> queryResult = null;
switch (searchType) { case SEARCH_BY_ID: if (StringUtils.isNumeric(keyWord)) queryResult = goodsManageService.selectById(Integer.valueOf(keyWord)); break; case SEARCH_BY_NAME: queryResult = goodsManageService.selectByName(keyWord); break; case SEARCH_ALL: queryResult = goodsManageService.selectAll(offset, limit); break; default: break; }
return queryResult; }
@SuppressWarnings("unchecked") @RequestMapping(value = "getGoodsList", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getGoodsList(@RequestParam("searchType") String searchType, @RequestParam("offset") int offset, @RequestParam("limit") int limit, @RequestParam("keyWord") String keyWord) throws GoodsManageServiceException { Response responseContent = ResponseFactory.newInstance(); List<Supplier> rows = null; long total = 0;
Map<String, Object> queryResult = query(searchType, keyWord, offset, limit);
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=351422302105200gn
https://javayms.pages.dev?id=351422302105200gn