基于javaweb+mysql的ssm失物招领管理系统(java+ssm+html+javascript+jsp+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM失物招领管理系统(java+ssm+html+javascript+jsp+mysql)
项目介绍
主要功能包括: 用户发布失物,或者招领失物,管理员对用户,失物信息进行增删改查。
环境需要
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.数据库:MySql 5.7版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
public String centerUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center";
@RequestMapping("/centerEditUI")
public String centerEditUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center-edit";
@RequestMapping("/centerEdit")
@ResponseBody
public Result centerEdit(Model model, User user) {
return userCenterService.centerEdit(user);
private SystemService systemService;
@RequestMapping("")
public String loginUI() {
return "system/login/login";
@RequestMapping("/login")
@ResponseBody
public Result login(SysUser sysUser, HttpServletResponse response) {
return systemService.login(sysUser,response);
@RequestMapping("/userListUI")
public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<User> page = systemService.getUserPage(pageable);
return "system/attractions/list";
@RequestMapping("/getAttractionsById")
@ResponseBody
public Result getAttractionsById(String id) {
return ResultGenerator.genSuccessResult(systemService.getAttractionsById(id));
@RequestMapping("/updateAttractionsStatus")
@ResponseBody
public Result updateAttractionsStatus(String id) {
return systemService.updateAttractionsStatus(id);
@RequestMapping("/saveAttractions")
@ResponseBody
public Result saveAttractions(Attractions attractions) {
return systemService.saveAttractions(attractions);
@RequestMapping("/saveTravelRoute")
@ResponseBody
public Result saveTravelRoute(TravelRoute travelRoute) {
return systemService.saveTravelRoute(travelRoute);
@RequestMapping("/travelStrategyListUI")
public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
model.addAttribute("page", page);
return "system/strategy/list";
@RequestMapping("/getTravelStrategyById")
@ResponseBody
return "center/user-center";
@RequestMapping("/centerEditUI")
public String centerEditUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center-edit";
@RequestMapping("/centerEdit")
@ResponseBody
public Result centerEdit(Model model, User user) {
return userCenterService.centerEdit(user);
@RequestMapping("/centerEditPWUI")
public String centerEditPWUI(Model model, HttpServletRequest request) {
@RequestMapping("/attractionsListUI")
public String attractionsListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<Attractions> page = systemService.getAttractionsPage(pageable);
model.addAttribute("page", page);
return "system/attractions/list";
@RequestMapping("/getAttractionsById")
@ResponseBody
public Result getAttractionsById(String id) {
return ResultGenerator.genSuccessResult(systemService.getAttractionsById(id));
@RequestMapping("/updateAttractionsStatus")
@ResponseBody
public Result updateAttractionsStatus(String id) {
return systemService.updateAttractionsStatus(id);
@RequestMapping("/userListUI")
public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<User> page = systemService.getUserPage(pageable);
model.addAttribute("page",page);
return "system/user/list";
@RequestMapping("/saveUser")
@ResponseBody
public Result saveUser(User user) {
return systemService.saveUser(user);
@RequestMapping("/getUserById")
@ResponseBody
public Result getUserById(String id) {
return ResultGenerator.genSuccessResult(systemService.getUserById(id));
@RequestMapping("/getTravelRouteById")
@ResponseBody
public Result getTravelRouteById(String id) {
return ResultGenerator.genSuccessResult(systemService.getTravelRouteById(id));
@RequestMapping("/updateTravelRouteStatus")
@ResponseBody
public Result updateTravelRouteStatus(String id) {
return systemService.updateTravelRouteStatus(id);
@RequestMapping("/saveTravelRoute")
@ResponseBody
public Result saveTravelRoute(TravelRoute travelRoute) {
private UserCenterService userCenterService;
@RequestMapping("/centerUI")
public String centerUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center";
@RequestMapping("/centerEditUI")
public String centerEditUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center-edit";
@RequestMapping("/centerEdit")
@ResponseBody
return systemService.saveTravelRoute(travelRoute);
@RequestMapping("/travelStrategyListUI")
public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
model.addAttribute("page", page);
return "system/strategy/list";
@RequestMapping("/getTravelStrategyById")
@ResponseBody
public Result getTravelStrategyById(String id) {
return ResultGenerator.genSuccessResult(systemService.getTravelStrategyById(id));
@RequestMapping("/updateTravelStrategyStatus")
@ResponseBody
public Result updateTravelStrategyStatus(String id) {
return systemService.updateTravelStrategyStatus(id);
private LoginService loginService;
@RequestMapping("/loginUI")
public String loginUI() {
return "login/index-login";
@RequestMapping("/login")
@ResponseBody
public Result login(Model model, User user, HttpServletResponse response) {
return loginService.login(user, response);
@RequestMapping("/logout")
public String logout(HttpServletRequest request, HttpServletResponse response) {
@RequestMapping("/updateTravelRouteStatus")
@ResponseBody
public Result updateTravelRouteStatus(String id) {
return systemService.updateTravelRouteStatus(id);
@RequestMapping("/saveTravelRoute")
@ResponseBody
public Result saveTravelRoute(TravelRoute travelRoute) {
return systemService.saveTravelRoute(travelRoute);
@RequestMapping("/travelStrategyListUI")
public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
model.addAttribute("page", page);
return "system/strategy/list";
@ResponseBody
public Result saveTravelStrategy(HttpServletRequest request,TravelStrategy travelStrategy) {
return systemService.saveTravelStrategy(request,travelStrategy);
登录管理控制层:
@Controller
public class LoginController {
@Autowired
private LoginService loginService;
@RequestMapping("/loginUI")
public String loginUI() {
return "login/index-login";
@RequestMapping("/login")
@ResponseBody
@RequestMapping("/centerEditPWUI")
public String centerEditPWUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("id", user.getId());
return "center/user-center-editpw";
@RequestMapping("/centerEditPW")
@ResponseBody
public Result centerEditPW(HttpServletRequest request, HttpServletResponse response, Model model, @RequestParam("id") String id, @RequestParam("oldPassword") String oldPassword, @RequestParam("newPassword") String newPassword) {
return userCenterService.centerEditPW(request, response, id, oldPassword, newPassword);
系统管理控制层:
@Controller
@RequestMapping("/system")
private SystemService systemService;
@RequestMapping("")
public String loginUI() {
return "system/login/login";
@RequestMapping("/login")
@ResponseBody
public Result login(SysUser sysUser, HttpServletResponse response) {
return systemService.login(sysUser,response);
@RequestMapping("/userListUI")
public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<User> page = systemService.getUserPage(pageable);
model.addAttribute("page",page);
return ResultGenerator.genSuccessResult(systemService.getTravelStrategyById(id));
@RequestMapping("/updateTravelStrategyStatus")
@ResponseBody
public Result updateTravelStrategyStatus(String id) {
return systemService.updateTravelStrategyStatus(id);
@RequestMapping("/saveTravelStrategy")
@ResponseBody
public Result saveTravelStrategy(HttpServletRequest request,TravelStrategy travelStrategy) {
return systemService.saveTravelStrategy(request,travelStrategy);
登录管理控制层:
@Controller
public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
model.addAttribute("page", page);
return "system/strategy/list";
@RequestMapping("/getTravelStrategyById")
@ResponseBody
public Result getTravelStrategyById(String id) {
return ResultGenerator.genSuccessResult(systemService.getTravelStrategyById(id));
@RequestMapping("/updateTravelStrategyStatus")
@ResponseBody
public Result updateTravelStrategyStatus(String id) {