——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven药店信息管理系统(java+ssm+jsp+layui+maven+mysql)
一、项目简述 环境配置:
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 42 currentUser); } public String getAccess () { return access; } public void setAccess (String access) { this .access = access; } public String getUrl () { return url; } public void setUrl (String url) { this .url = url; } public String getMethod () { return method; } public void setMethod (String method) { this .method = (method != null ) ? method.toUpperCase() : null ; } @SuppressWarnings({ "unchecked", "rawtypes" }) private SecurityExpressionHandler<FilterInvocation> getExpressionHandler () throws IOException { ServletContext sc = getServletContext(); String attrName = FrameworkServlet.SERVLET_CONTEXT_PREFIX + "dispatcherServlet" ; ApplicationContext appContext = (ApplicationContext) sc.getAttribute(attrName); Map<String, SecurityExpressionHandler> handlers = appContext .getBeansOfType(SecurityExpressionHandler.class); for (SecurityExpressionHandler h : handlers.values()) { if (FilterInvocation.class.equals(GenericTypeResolver.resolveTypeArgument( h.getClass(), SecurityExpressionHandler.class))) {
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 } else if (StringUtils.hasText(getUrl())) { isAuthorized = authorizeUsingUrlCheck(); } else { isAuthorized = false ; } return isAuthorized; } public boolean authorizeUsingAccessExpression () throws IOException { if (SecurityContextHolder.getContext().getAuthentication() == null ) { return false ; } SecurityExpressionHandler<FilterInvocation> handler = getExpressionHandler(); Expression accessExpression; try { accessExpression = handler.getExpressionParser().parseExpression(getAccess()); } catch (ParseException e) { IOException ioException = new IOException(); ioException.initCause(e); throw ioException; } return ExpressionUtils.evaluateAsBoolean(accessExpression, createExpressionEvaluationContext(handler)); } protected EvaluationContext createExpressionEvaluationContext (
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 "No visible WebInvocationPrivilegeEvaluator instance could be found in the application " + "context. There must be at least one in order to support the use of URL access checks in 'authorize' tags." ); } return (WebInvocationPrivilegeEvaluator) wipes.values().toArray()[0 ]; } } @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @EnableWebSecurity public class WebApplicationSecurityConfig extends WebSecurityConfigurerAdapter {
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 * 器械前端控制器 * @E -mail suzeping10@126. com */ @Slf4j @RestController @RequestMapping("/instrument") public class DrugInstrumentController { @Autowired private DrugInstrumentService instrumentService; @PostMapping("/get/page.json") public ResultEntity<PageInfo<DrugInstrument>> getPageInfo( @RequestParam(value = "instrumentName",defaultValue = "") String instrumentName, @RequestParam(value = "pageNum",defaultValue = "1") String pageNum, @RequestParam(value = "pageSize",defaultValue = "5") String pageSize ){ return instrumentService.getPageInfo(instrumentName, pageNum, pageSize); } @PostMapping("/save.json") public ResultEntity<Integer> saveInstrument (DrugInstrument instrument) { return instrumentService.saveInstrument(instrument); } @PostMapping("/edit.json") public ResultEntity<String> editInstrument (DrugInstrument instrument) { return instrumentService.editInstrument(instrument); }
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 @ControllerAdvice public class DrugExceptionResolver { @ExceptionHandler(AccountEditDuplicateKeyException.class) public ModelAndView resolveAccountEditDuplicateKeyException (AccountEditDuplicateKeyException exception, HttpServletRequest request, HttpServletResponse response) throws IOException { String viewName = "system-error" ; return commonResolve(viewName, exception, request, response); } @ExceptionHandler(AccountAddDuplicateKeyException.class) public ModelAndView resolveAccountAddDuplicateKeyException (AccountAddDuplicateKeyException exception, HttpServletRequest request, HttpServletResponse response) throws IOException { String viewName = "admin-add" ; return commonResolve(viewName, exception, request, response); }
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 * @param pageNum * @param pageSize * @return */ @PostMapping("/get/page.json") public ResultEntity<PageInfo<DrugSellPage>> getPageInfo( @RequestParam(value = "sellName",defaultValue = "") String sellName, @RequestParam(value = "otherName",defaultValue = "") String otherName, @RequestParam(value = "pageNum",defaultValue = "1") String pageNum, @RequestParam(value = "pageSize",defaultValue = "5") String pageSize ){ return sellService.getPageInfo(sellName, otherName, pageNum, pageSize); } @PostMapping("/save.json") public ResultEntity<Map<String,Object>> saveSell(DrugSell sell){ return sellService.saveSell(sell); } @PostMapping("/del.json") public ResultEntity<String> removeSell (@RequestParam("sellId") String sellId) { return sellService.removeSell(sellId); } }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=431422292105200fo https://javayms.pages.dev?id=431422292105200fo