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




基于javaweb的SSM+Maven仓库管理系统(java+ssm+jsp+mysql+maven)
一、项目简述
功能包括: 仓库管理,出入库管理,仓库人员管理,基本信息管理, 供应商信息,系统管理等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
——————————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
| if (stockRecordManageService.stockInOperation(supplierID, goodsID, repositoryID, number, personInCharge)) { result = Response.RESPONSE_RESULT_SUCCESS; } }
responseContent.setResponseResult(result); return responseContent.generateResponse(); }
@SuppressWarnings({"SingleStatementInBlock", "unchecked"}) @RequestMapping(value = "searchStockRecord", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getStockRecord(@RequestParam("searchType") String searchType, @RequestParam("repositoryID") String repositoryIDStr, @RequestParam("startDate") String startDateStr, @RequestParam("endDate") String endDateStr, @RequestParam("limit") int limit, @RequestParam("offset") int offset) throws ParseException, StockRecordManageServiceException { Response responseContent = ResponseFactory.newInstance(); List<StockRecordDTO> rows = null; long total = 0;
String regex = "([0-9]{4})-([0-9]{2})-([0-9]{2})"; boolean startDateFormatCheck = (StringUtils.isEmpty(startDateStr) || startDateStr.matches(regex)); boolean endDateFormatCheck = (StringUtils.isEmpty(endDateStr) || endDateStr.matches(regex)); boolean repositoryIDCheck = (StringUtils.isEmpty(repositoryIDStr) || StringUtils.isNumeric(repositoryIDStr));
|
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
|
@SuppressWarnings("unchecked") @RequestMapping(value = "exportGoods", method = RequestMethod.GET) public void exportGoods(@RequestParam("searchType") String searchType, @RequestParam("keyWord") String keyWord, HttpServletResponse response) throws GoodsManageServiceException, IOException {
String fileName = "goodsInfo.xlsx";
List<Goods> goodsList = null; Map<String, Object> queryResult = query(searchType, keyWord, -1, -1);
if (queryResult != null) { goodsList = (List<Goods>) queryResult.get("data"); }
File file = goodsManageService.exportGoods(goodsList);
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();
} } } package com.ken.wms.security.controller;
|
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 52
| @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);
if (queryResult != null) { rows = (List<Supplier>) queryResult.get("data"); total = (long) queryResult.get("total"); }
responseContent.setCustomerInfo("rows", rows); responseContent.setResponseTotal(total); return responseContent.generateResponse(); }
@RequestMapping(value = "addGoods", method = RequestMethod.POST) public @ResponseBody Map<String, Object> addGoods(@RequestBody Goods goods) throws GoodsManageServiceException { Response responseContent = ResponseFactory.newInstance();
String result = goodsManageService.addGoods(goods) ? Response.RESPONSE_RESULT_SUCCESS : Response.RESPONSE_RESULT_ERROR;
responseContent.setResponseResult(result);
return responseContent.generateResponse(); }
@RequestMapping(value = "getGoodsInfo", method = RequestMethod.GET) public
|
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
| responseContent.setResponseResult(result); return responseContent.generateResponse(); }
@RequestMapping(value = "getRepositoryInfo", method = RequestMethod.GET) public @ResponseBody Map<String, Object> getRepositoryInfo(@RequestParam("repositoryID") Integer repositoryID) throws RepositoryManageServiceException { Response responseContent = ResponseFactory.newInstance(); String result = Response.RESPONSE_RESULT_ERROR;
Repository repository = null; Map<String, Object> queryResult = repositoryService.selectById(repositoryID); if (queryResult != null) { repository = (Repository) queryResult.get("data"); if (repository != null) result = Response.RESPONSE_RESULT_SUCCESS; }
responseContent.setResponseResult(result); responseContent.setResponseData(repository); 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
| Response response = ResponseFactory.newInstance();
Subject currentSubject = SecurityUtils.getSubject(); if (currentSubject != null && currentSubject.isAuthenticated()) { currentSubject.logout(); response.setResponseResult(Response.RESPONSE_RESULT_SUCCESS); } else { response.setResponseResult(Response.RESPONSE_RESULT_ERROR); response.setResponseMsg("did not login"); }
return response.generateResponse(); }
@RequestMapping(value = "passwordModify", method = RequestMethod.POST) public @ResponseBody Map<String, Object> passwordModify(@RequestBody Map<String, Object> passwordInfo, HttpServletRequest request) { Response responseContent = ResponseFactory.newInstance();
String errorMsg = null; String result = Response.RESPONSE_RESULT_ERROR;
HttpSession session = request.getSession(); UserInfoDTO userInfo = (UserInfoDTO) session.getAttribute("userInfo"); Integer userID = userInfo.getUserID();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| 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(); } } } package com.ken.wms.common.controller;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=341422302105200gm
https://javayms.pages.dev?id=341422302105200gm