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





基于javaweb的SSM+Maven在线旅游系统(java+jsp+ssm+spring+mysql+maven)
一、项目简述
功能:用户的登录注册,旅游景点的展示,旅游预订,收藏,购买,以及酒店住宿留言等等,后台管理员,订单管理,景点管理,留言管理,分类管理吗,以及系统管理等等。
二、项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Idea2019(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 43 44 45 46 47
| }
@RequestMapping("/delete.do") @PreAuthorize("hasAnyAuthority('/routes/delete.do')") public String delete(Integer rid) throws Exception{ routeService.delete(rid); return "redirect:findAll.do"; }
@RequestMapping("/update.do") @PreAuthorize("hasAnyAuthority('/routes/update.do')") public String update(Route route) throws Exception{ if (route.getRimageStr().getSize()!=0&&route.getRimageStr()!=null){ String filename = Upload.uploadImg(RIMAGE,route.getRimageStr()); route.setRimage("img/product/small/"+filename); routeService.update(route); }else{ routeService.update(route); } return "redirect:findAll.do"; }
@RequestMapping("/findByRid.do") @PreAuthorize("hasAnyAuthority('/routes/findByRid.do')") public ModelAndView findByRid(Integer rid) throws Exception{ ModelAndView mv = new ModelAndView(); Route route = routeService.findByRid(rid); mv.addObject("routeInfo",route); List<Category> clist = categoryService.findAllCName(); List<Seller> slist = sellerService.findAll(); mv.addObject("CList",clist); mv.addObject("SList",slist); mv.setViewName("route-update"); return mv; }
@RequestMapping("/findAll.do") @PreAuthorize("hasAnyAuthority('/routes/findAll.do')") public ModelAndView findAll( @RequestParam(name="page",required = true, defaultValue = "1") Integer page, @RequestParam(name="size",required = true, defaultValue = "10") Integer size, @RequestParam(name="rname",required = true, defaultValue = "") String rname ) throws Exception{
|
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
| List<Permission> otherPermissions = roleService.findOtherPermissions(roleId); mv.addObject("role", role); mv.addObject("permissionList", otherPermissions); mv.setViewName("role-permission-add"); return mv; } } package com.admin.controller;
@Component @Aspect public class LogAop {
@Autowired private HttpServletRequest request;
@Autowired private ISysLogService sysLogService;
private Date visitTime; private Class clazz; private Method method;
public void doBefore(JoinPoint jp) throws NoSuchMethodException { visitTime = new Date(); clazz = jp.getTarget().getClass(); String methodName = jp.getSignature().getName(); Object[] args = jp.getArgs();
|
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 53 54
| @RequestMapping("/addRoleToUser.do") @PreAuthorize("hasAnyAuthority('/users/addRoleToUser.do')") public String addRoleToUser(@RequestParam(name = "userId", required = true) Integer userId, @RequestParam(name = "ids", required = true) int[] roleIds) throws Exception { userService.addRoleToUser(userId, roleIds); return "redirect:findAll.do"; }
@RequestMapping("/findUserByIdAndAllRole.do") @PreAuthorize("hasAnyAuthority('/users/findUserByIdAndAllRole.do')") public ModelAndView findUserByIdAndAllRole(@RequestParam(name = "id", required = true) Integer uid) throws Exception { ModelAndView mv = new ModelAndView(); User user = userService.findByUid(uid); List<Role> otherRoles = userService.findOtherRoles(uid); mv.addObject("user", user); mv.addObject("roleList", otherRoles); mv.setViewName("user-role-add"); return mv; }
@RequestMapping("/findRoleByUserId.do") @PreAuthorize("hasAnyAuthority('/users/findRoleByUserId.do')") public ModelAndView findRoleByUserId(Integer userId) throws Exception{ ModelAndView mv = new ModelAndView(); User user = userService.findByUid(userId); List<Role> roleList = userService.findRoleByUserId(userId); mv.addObject("user", user); mv.addObject("roleList", roleList); mv.setViewName("user-role-rmove"); return mv; }
@RequestMapping("/removeRole.do") @PreAuthorize("hasAnyAuthority('/users/removeRole.do')") public String removeRole( @RequestParam(name = "userId") Integer userId, @RequestParam(name = "ids") int[] roleIds) throws Exception{ userService.removeRole(userId,roleIds); return "redirect:findAll.do"; }
@RequestMapping("/save.do") @PreAuthorize("hasAnyAuthority('/users/save.do')") public String save(User user) throws Exception { userService.save(user); return "redirect:findAll.do"; }
@RequestMapping("/delete.do") @PreAuthorize("hasAnyAuthority('/users/delete.do')")
|
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
| @RequestMapping("/findByCid.do") public ModelAndView findByCid(Integer cid) throws Exception { ModelAndView mv = new ModelAndView(); Category cate = categoryService.findByCid(cid); mv.addObject("cateInfo",cate); mv.setViewName("cate-update"); return mv; }
@RequestMapping("/findAll.do") public ModelAndView findAll( @RequestParam(name="page",required = true, defaultValue = "1") Integer page, @RequestParam(name="size",required = true, defaultValue = "10") Integer size, @RequestParam(name="cname",required = true, defaultValue = "") String cname ) throws Exception{ ModelAndView mv = new ModelAndView(); List<Category> list = categoryService.findAll(page,size,"%"+cname+"%"); PageInfo pageInfo = new PageInfo(list); mv.addObject("pageInfo",pageInfo); mv.setViewName("cate-list"); return mv; } } package com.admin.controller;
@Controller @RequestMapping("/images") public class ImageController {
@Autowired
|
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
| response.addCookie(user_cookie); pswd_cookie.setMaxAge(0); pswd_cookie.setPath("/"); response.addCookie(pswd_cookie); reme_cookie.setMaxAge(0); reme_cookie.setPath("/"); response.addCookie(reme_cookie); } if (!checkCodeMethod(request,response)){ return; } request.getSession().setAttribute("user",u); info.setFlag(true); } writeValue(info,response); }
public void findOne(HttpServletRequest request, HttpServletResponse response) throws IOException { Object user = request.getSession().getAttribute("user"); writeValue(user,response); }
public void exit(HttpServletRequest request, HttpServletResponse response) throws IOException { request.getSession().invalidate(); response.sendRedirect(request.getContextPath()+"/login.jsp"); } }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=561422272105200by
https://javayms.pages.dev?id=561422272105200by