Java项目:SSM校园共享自行车出租管理系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

管理员角色包含以下功能:
管理员登录,用户管理,服务点管理,共享单车管理,车辆分类管理,学生管理,自行车租赁管理,统计信息,密码修改等功能。

居民角色包含以下功能:
居民登录,基本信息查看等功能。

环境需要

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版本;

6.是否Maven项目:是;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:JSP+EasyUI+BootStrap+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置;

4. 运行项目,输入localhost:8080/ 登录

运行截图

 

 

 

 

 

 

 

相关代码

 管理员控制器

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.enums.ResultEnum;
import com.webike.pojo.Admin;
import com.webike.pojo.Place;
import com.webike.service.AdminService;
import com.webike.utils.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.List;

/**管理员controller
 * Created by Ming on 2018/2/8.
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    //跳转到首页
    @RequestMapping("/index")
    public String index(){
        return "index";
    }


    //验证登陆
    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public String login(Admin admin, Model model, HttpSession session){
        String message = adminService.checkUserPwd(admin);
        if("成功".equals(message)) {
            //注入Session
            Admin realAdmin = adminService.findByUsername(admin.getaUsername());

            session.setAttribute("admin",realAdmin);
            //更新登陆的时间
            admin.setaLoginTime(new Date());
            admin.setaUpdateTime(new Date());
            admin.setaPassword(null);
            adminService.upDate(admin);
            return "redirect:index";
        }

        model.addAttribute("msg",message);
        return "forward:/login.jsp";
    }
    //退出登陆
    @RequestMapping("/logout")
    public String logout(HttpSession session){
        session.invalidate();
        return "redirect:/login.jsp";
    }

    //跳转到修改密码的页面
    @RequestMapping("/rePassword")
    public String rePassword(){
        return "rePassword";
    }
    //修改提交的密码
    @RequestMapping("/submitResetPwd")
    @ResponseBody
    public JsonResult submitResetPwd(String password, String newPassword,HttpSession httpSession){
        Admin admin = (Admin) httpSession.getAttribute("admin");
        if(!admin.getaPassword().equals(MD5Util.getMD5(password)))
            return new JsonResult(false,ResultEnum.OLD_PASSWORD_ERROR);
        admin.setaPassword(MD5Util.getMD5(newPassword));
        admin.setaUpdateTime(new Date());
        boolean isSuccess = adminService.upDate(admin);
        if(isSuccess) return new JsonResult(isSuccess, ResultEnum.UPDATE_SUCCESS);
        return new JsonResult(isSuccess, ResultEnum.UPDATE_FAIL);
    }

    //跳转到用户管理页面

    @RequestMapping("/adminManage")
    public String adminMange(){
        return "admin";
    }


    //显示用户页面
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Admin> showAll(Integer page, Integer rows){
        return adminService.findAllToPage(page,rows);
    }

    //删除用户
    @RequestMapping("/remove")
    @ResponseBody
    public JsonResult remove(Integer aid){
        return adminService.deleteById(aid);
    }

    // 加载服务点到表单下拉框 loadPlace
    @RequestMapping("/loadPlace")
    @ResponseBody
    public List<Place> loadPlace(){
        return adminService.loadPlace();
    }


    //回显用户表单
    @RequestMapping("/loadForm")
    @ResponseBody
    public Admin loadForm(String username){
        Admin admin = adminService.findByUsername(username);
        return admin;
    }


    //addOrUpdate
    @RequestMapping("/addOrUpdate")
    @ResponseBody
    public JsonResult addOrUpdate(MultipartFile adminIcon, Admin admin, HttpServletRequest request){
        if(admin.getAid() == null) return adminService.add(adminIcon,admin,request);
        return adminService.update(adminIcon,admin,request);

    }


}

自行车控制器

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.pojo.Bike;
import com.webike.pojo.Category;
import com.webike.pojo.Student;
import com.webike.service.BikeService;
import com.webike.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * Created by Ming on 2018/2/10.
 */
@Controller
@RequestMapping("/bike")
public class BikeController {

    @Autowired
    private BikeService bikeService;

    @Autowired
    private CategoryService categoryService;



    //跳转到 bike管理页面
    @RequestMapping("/bikeManage")
    public String bikeManage(){
        return "bike";
    }

    //添加或更新bike
    @RequestMapping(value = "/addOrUpdate",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult addOrUpdate(MultipartFile bikeIcon, Bike bike, HttpServletRequest request,Integer bCount){
        if(bCount != null) return bikeService.add(bikeIcon,bike,request,bCount);
            return bikeService.update(bikeIcon,bike,request);
    }

    //showAll bike
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Bike> show(Integer page, Integer rows){
        return bikeService.findAllToPage(page,rows);
    }

    //删除单车和更新单车的分类
    @RequestMapping(value = "/remove",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult remove(String bids,String cids){
        return bikeService.deleteById(bids,cids);
    }
    //点击修改回显bike弹出表单
    @RequestMapping("/loadForm")
    @ResponseBody
    public Bike loadForm(Integer bid){
        return bikeService.findById(bid);
    }

    //回显bike分类
    @RequestMapping(value = "/loadCategory",method = RequestMethod.POST)
    @ResponseBody
    public List<Category> loadCategory(){
        return categoryService.findAll();
    }



}

分类控制器

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.enums.ResultEnum;
import com.webike.pojo.Category;
import com.webike.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Ming on 2018/2/11.
 */
@Controller
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;


    //跳转到category页面
    @RequestMapping("/categoryManage")
    public String categoryMange(){
        return "category";
    }

    //显示所有分类
    @RequestMapping("/showAll")
    @ResponseBody
    public List<Category> showAll(){
       return categoryService.findAll();
    }

    //添加或更新分类 addOrUpdate
    @RequestMapping(value = "/addOrUpdate",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult addOrUpdate(Category category){
        if(category == null) return new JsonResult(false, ResultEnum.SYSTEM_ERROR);
        if(category.getCid() == null ) return categoryService.add(category);
        return categoryService.update(category);
    }

    //删除分类
    @RequestMapping(value = "/remove",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult remove(Integer cid){
        return categoryService.deleteById(cid);
    }


    //回显分类的表单数据
    @RequestMapping("/loadForm")
    @ResponseBody
    public Category loadForm(Integer cid){
        return categoryService.findById(cid);
    }



}

订单控制器

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.pojo.Orders;
import com.webike.pojo.Student;
import com.webike.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Ming on 2018/2/13.
 */
@Controller
@RequestMapping("/orders")
public class OrdersController {


    @Autowired
    OrdersService ordersService;

    //跳转到租赁管理页面
    @RequestMapping("/ordersManage")
    public  String ordersMange(){
        return "orders";
    }

    //添加或修改订单
    @RequestMapping("/addOrUpdate")
    @ResponseBody
    public JsonResult addOrUpdate(Orders orders){
        if(orders.getOid() == null) return ordersService.add(orders);
            return ordersService.update(orders);
    }


    //点击修改按钮,加载订单表单
    @RequestMapping("/loadForm")
    @ResponseBody
    public Orders loadForm(Integer oid){
        return ordersService.findById(oid);
    }


    //显示所有的订单
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Orders> show(Integer page, Integer rows){
        return ordersService.findAllToPage(page,rows);
    }

    //删除订单
    @RequestMapping("/remove")
    @ResponseBody
    public JsonResult remove(Integer oid,Integer oBid,String oState){
        return ordersService.deleteById(oid,oBid,oState);
    }


}

学生控制器

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.pojo.Student;
import com.webike.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Ming on 2018/2/9.
 */
@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    //跳转到student管理 jsp页面
    @RequestMapping("/studentManage")
    public String studentManage(){
        return "student";
    }

    //添加或更新一个学生
    @RequestMapping(value = "/addOrUpdate",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult add(MultipartFile studentIcon, Student student, HttpServletRequest request){
        if(student.getSid() == null || "".equals(student.getSid()))
        return studentService.add(studentIcon,student,request);
        return studentService.update(studentIcon,student,request);
    }

    //显示所有的学生
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Student> show(Integer page,Integer rows){
        return studentService.findAllToPage(page,rows);
    }

    //删除一个学生
    @RequestMapping(value = "/remove",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult remove( Integer sid){
        return studentService.removeById(sid);
    }

    //回显 指定一个student数据到student页面的弹出框表单中
    @RequestMapping("/loadForm")
    @ResponseBody
    public Student loadForm(Integer sid){
        return studentService.findById(sid);
    }

}

如果也想学习本系统,下面领取。关注并回复:170ssm 

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
"SSM服装出租服装店租赁服装管理系统" 是一个基于Java项目。该系统旨在帮助服装店有效管理其库存、租赁流程和顾客信息,以提升运营效率。 该系统的主要功能包括库存管理,租赁管理和顾客管理。首先,库存管理模块允许店主添加、删除和更新服装的详细信息,包括服装名称、类型、尺码和价格等。店主可以通过该模块随时了解实时库存情况,并及时补充库存。其次,租赁管理模块允许店主记录租赁订单,包括租赁日期、租赁时长和顾客信息等。系统可以自动计算租赁费用并生成相应的发票。最后,顾客管理模块允许店主维护顾客的基本信息,并记录顾客的租赁历史以及积累的租赁次数和会员等级。 为了提高系统的稳定性和安全性,该项目采用SSM(Spring+Spring MVC+MyBatis)框架进行开发。Spring作为业务层框架,负责处理系统的业务逻辑;Spring MVC作为视图层框架,负责接收用户请求和展示数据;MyBatis作为持久层框架,负责与数据库进行交互。此外,项目还使用MySQL作为数据库,保证数据的可靠存储和快速检索。 该项目的优势在于提高了服装店的管理效率。通过系统化的库存管理和租赁管理,店主可以实时掌握库存情况和租赁订单,避免了重复和遗漏,提高了工作效率。而顾客管理模块的引入,使店主能够更好地了解顾客的需求和偏好,从而提供个性化的服务,增加顾客的满意度和忠诚度。 综上所述,SSM服装出租服装店租赁服装管理系统是一个基于Java开发的项目,旨在提高服装店的库存管理、租赁管理和顾客管理效率。该系统通过SSM框架和MySQL数据库的应用,保证了系统的稳定性和安全性。它的优势在于提高了店主的工作效率和顾客满意度,帮助服装店实现更好的运营表现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值