博主介绍:✌在职Java研发工程师、专注于程序设计、源码分享、技术交流、专注于Java技术领域和毕业设计✌
[
项目名称
SpringBoot+微信小程序篮球馆场地在线预约系统的设计与实现
下载地址
SpringBoot+微信小程序篮球馆场地在线预约系统的设计与实现](https://ym.maptoface.com/archives/57226)
视频演示
SpringBoot+微信小程序篮球馆场地在线预约系统的设计与实现哔哩_bilibili
系统介绍
摘 要
近年来随着身体健康问题逐渐被社会大众所重视,运动健身成为了全民追捧的热潮。俗话说得好“生命在于运动”,体育运动是全民健康的一项重要指标。篮球运动在中国已经有很长的历史,而校园篮球运动的发展也是不断壮大的。随着体育教育的不断发展和普及,越来越多的学校开始重视篮球运动的发展。现在,各大学校都设有篮球队,并且有专门的校园篮球比赛。此外,很多城市还有针对中小学生的校园篮球联赛,许多职业篮球俱乐部也开始将目光转向青少年篮球市场
有些运动是需要一定的场地限制的,比如说足球、羽毛球、篮球、乒乓球等等运动,所以就需要去专门的篮球馆进行专项运动,以往是需要提前前往场馆进行收工预约的,这样就会耗费人们大量的精力和时间,并且对于篮球馆的管理员而言也是难于管理的。
为了更好地解决人们篮球馆场地预约困难,篮球馆场地管理员人员管理预约信息困难的问题,开发本套基于微信小程序的篮球馆场地在线预约系统。本系统将会使用Spring Boot后台开发框架、微信小程序技术、MySQL关系型数据库技术进行开发,系统角色分为电脑后台的管理员人员以及小程序端的用户进行系统使用。主要功能包括了用户管理、项目管理、场地管理、订单管理以及用户小程序端的场馆预约功能,系统目的就是为了方便用户预约篮球馆场地并且方便场地管理人员进行场地预约管理。
关键词:篮球馆场地,微信小程序,SpringBoot,在线预约
3.5 系统用例图
篮球馆场地在线预约系统是为了方面人们在微信小程序端对篮球馆场地的运动项目进行提前的预约,并且方面管理人员对场馆的所有信息进行管理的系统。该系统应该分为用户角色和管理员这两个角色,他们都拥有不同的功能权限。
3.5.1管理员用例
在篮球馆场地在线预约系统中,管理员作为系统的后台管理者,负责对各项功能数据进行管理和维护。管理员可以通过电脑后台访问系统,实现以下功能:
管理员可以进行统计分析功能,通过查看数据报表和图表,了解系统的运行情况,包括预约量、收入统计、用户活跃度等,从而为运营决策提供有力支持。
管理员可以进行用户管理,包括查看用户信息、添加新用户、修改用户信息、删除用户等,以确保系统中的用户数据准确且完整。
管理员可以进行场地管理,负责对篮球场地的信息进行维护,如添加新场地、修改场地信息、删除场地等,以满足预约需求。
管理员还负责订单管理,包括查看订单详情、修改订单状态、取消订单等,确保预约流程的顺利进行。
广告管理则使管理员可以发布和管理广告内容,如添加广告、修改广告信息、删除广告等,以提高系统的商业价值。
项目管理功能则允许管理员对预约项目进行管理,如添加项目、修改项目信息、删除项目等,以满足不同用户的需求。
场馆管理功能使管理员能够对整个场馆进行管理,包括场馆信息的维护、场馆设施的管理等,确保场馆运营的正常进行。
管理员管理功能允许对管理员账户进行管理,如添加新管理员、修改管理员信息、删除管理员等,以确保系统后台的安全和稳定运行。
综上所述,管理员在篮球馆场地在线预约系统中扮演着关键角色,通过对各项功能数据的管理,确保系统的正常运行和良好用户体验。
系统中管理员的用例图如下图3-1所示:
图3-1 管理员用户用例图
3.5.2用户用例
在篮球馆场地在线预约系统中,普通用户通过微信小程序完成各种操作,提供便捷的篮球场地预约服务。系统为普通用户提供以下功能:
普通用户可以查看场馆的基本信息,包括场馆地址、联系方式、开放时间等,以便用户了解场馆情况并进行预约。
普通用户可以查看项目列表信息,了解场馆提供的各种预约项目,如五人制篮球、三人制篮球等,方便用户根据自己的需求进行选择。
用户可以查看预约时间,了解场地在不同时间段的预约情况,从而选择合适的预约时间。
在选择好预约时间后,用户可以预约具体时间以及场地,系统将为用户生成相应的订单信息。
为保障用户信息安全,系统提供登录操作功能,用户需通过微信授权登录,方可使用预约功能。
在个人信息模块中,用户可以查看和修改自己的基本信息,如联系方式、性别等,以确保信息准确无误。
订单信息模块则允许用户查看自己的预约订单详情,包括订单状态、预约时间、场地信息等,方便用户了解预约情况。
用户可以执行退出操作,安全地退出系统,保护个人信息。
篮球馆场地在线预约系统为普通用户提供了丰富的功能,使得预约篮球场地变得轻松便捷,大大提高了用户体验。普通用户的用例图如下图3-2所示:
图3-2 普通用户用例图
第4章 系统设计
4.1 系统功能设计
该系统分为用户的小程序端作为用户的注册、登录、浏览场馆、日常场地预约界面使用,以及电脑后台的管理端作为场地管理员进行场地管理的功能界面进行使用。该系统的旨在为学生提供一个良好的预约运动场地的平台,更为了使学校统一管理学校场地,服务学生,了解学生的运动爱好,促进学生积极向上,强身健体的日常,系统的设计和划分使系统的核心研究问题,以确定整体结构和功能模块。系统功能模块图如图4-3所示。
图4-1 系统功能模块图
通过设计的管理端功能非常全面地包含了场馆的所有预约数据项,针对用户的预约需求拆分为场馆、项目、时间、场地、订单多个管理项目进行详细化管理。
编辑
编辑
编辑
编辑
环境需要
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项目:否;
技术栈
- 后端:Spring+SpringMVC+Mybatis
- 前端:JSP+CSS+JavaScript+jQuery
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
- 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; - 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置;
- 运行项目,在浏览器中输入http://localhost:8080/ 登录
运行截图
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
编辑
用户管理控制层:
package com.houserss.controller;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang3.StringUtils;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.houserss.common.Const;
import com.houserss.common.Const.Role;
import com.houserss.common.ServerResponse;
import com.houserss.pojo.User;
import com.houserss.service.IUserService;
import com.houserss.service.impl.UserServiceImpl;
import com.houserss.util.MD5Util;
import com.houserss.util.TimeUtils;
import com.houserss.vo.DeleteHouseVo;
import com.houserss.vo.PageInfoVo;
/**
- Created by admin
*/
@Controller
@RequestMapping("/user/")
public class UserController {
@Autowired
private IUserService iUserService;
/**
* 用户登录
* @param username
* @param password
* @param session
* @return
*/
@RequestMapping(value = "login.do",method = RequestMethod.POST)
@ResponseBody
public ServerResponse<User> login(User user,String uvcode, HttpSession session){
String code = (String)session.getAttribute("validationCode");
if(StringUtils.isNotBlank(code)) {
if(!code.equalsIgnoreCase(uvcode)) {
return ServerResponse.createByErrorMessage("验证码不正确");
}
}
ServerResponse<User> response = iUserService.login(user.getUsername(),user.getPassword());
if(response.isSuccess()){
session.setAttribute(Const.CURRENT_USER,response.getData());
}
return response;
}
}
管理员管理控制层:
package com.sxl.controller.admin;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.sxl.controller.MyController;
@Controller("adminController")
@RequestMapping(value = "/admin")
public class AdminController extends MyController {
@RequestMapping(value = "/index")
public String frame(Model model, HttpServletRequest request)throws Exception {
return "/admin/index";
}
@RequestMapping(value = "/main")
public String main(Model model, HttpServletRequest request)throws Exception {
return "/admin/main";
}
@RequestMapping(value = "/tj1")
public String tj1(Model model, HttpServletRequest request)throws Exception {
String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d') desc";
List<Map> list = db.queryForList(sql);
model.addAttribute("list", list);
System.out.println(list);
return "/admin/tj/tj1";
}
@RequestMapping(value = "/password")
public String password(Model model, HttpServletRequest request)throws Exception {
return "/admin/password";
}
@RequestMapping(value = "/changePassword")
public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
Map admin = getAdmin(request);
if(oldPassword.equals(admin.get("password").toString())){
String sql="update t_admin set password=? where id=?";
db.update(sql, new Object[]{newPassword,admin.get("id")});
return renderData(true,"1",null);
}else{
return renderData(false,"1",null);
}
}
}
修改密码业务逻辑:
package com.sxl.controller.admin;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.sxl.controller.MyController;
@Controller("userController")
@RequestMapping(value = "/user")
public class UserController extends MyController {
@RequestMapping(value = "/index")
public String frame(Model model, HttpServletRequest request)throws Exception {
return "/user/index";
}
@RequestMapping(value = "/main")
public String main(Model model, HttpServletRequest request)throws Exception {
return "/user/main";
}
@RequestMapping(value = "/password")
public String password(Model model, HttpServletRequest request)throws Exception {
return "/user/password";
}
@RequestMapping(value = "/changePassword")
public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception {
Map user = getUser(request);
if(oldPassword.equals(user.get("password").toString())){
String sql="update t_user set password=? where id=?";
db.update(sql, new Object[]{newPassword,user.get("id")});
return renderData(true,"1",null);
}else{
return renderData(false,"1",null);
}
}
@RequestMapping(value = "/mine")
public String mine(Model model, HttpServletRequest request)throws Exception {
Map user =getUser(request);Map map = db.queryForMap("select * from t_user where id=?",new Object[]{user.get("id")});model.addAttribute("map", map); return "/user/mine";
}
@RequestMapping(value = "/mineSave")
public ResponseEntity<String> mineSave(Model model,HttpServletRequest request,Long id
,String username,String password,String name,String gh,String mobile) throws Exception{
int result = 0;
String sql="update t_user set name=?,gh=?,mobile=? where id=?";
result = db.update(sql, new Object[]{name,gh,mobile,id});
if(result==1){
return renderData(true,"操作成功",null);
}else{
return renderData(false,"操作失败",null);
}
}
}
通用管理模块:
package com.sxl.controller;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import com.sxl.util.JacksonJsonUtil;
import com.sxl.util.StringUtil;
import com.sxl.util.SystemProperties;
public class BaseController {
public static final Long EXPIRES_IN = 1000 * 3600 * 24 * 1L;// 1天
@Autowired
private SystemProperties systemProperties;
/**
* 获得配置文件内容
*/
public String getConfig(String key) {
return systemProperties.getProperties(key);
}
/**
* 返回服务器地址 like http://192.168.1.1:8441/UUBean/
*/
public String getHostUrl(HttpServletRequest request) {
String hostName = request.getServerName();
Integer hostPort = request.getServerPort();
String path = request.getContextPath();
if (hostPort == 80) {
return "http://" + hostName + path + "/";
} else {
return "http://" + hostName + ":" + hostPort + path + "/";
}
}
/***
* 获取当前的website路径 String
*/
public static String getWebSite(HttpServletRequest request) {
String returnUrl = request.getScheme() + "://"
+ request.getServerName();
if (request.getServerPort() != 80) {
returnUrl += ":" + request.getServerPort();
}
returnUrl += request.getContextPath();
return returnUrl;
}
/**
* 初始化HTTP头.
*
* @return HttpHeaders
*/
public HttpHeaders initHttpHeaders() {
HttpHeaders headers = new HttpHeaders();
MediaType mediaType = new MediaType("text", "html",
Charset.forName("utf-8"));
headers.setContentType(mediaType);
return headers;
}
/**
* 返回 信息数据
*
* @param status
* @param msg
* @return
*/
public ResponseEntity<String> renderMsg(Boolean status, String msg) {
if (StringUtils.isEmpty(msg)) {
msg = "";
}
String str = "{\"status\":\"" + status + "\",\"msg\":\"" + msg + "\"}";
ResponseEntity<String> responseEntity = new ResponseEntity<String>(str,
initHttpHeaders(), HttpStatus.OK);
return responseEntity;
}
/**
* 返回obj数据
*
* @param status
* @param msg
* @param obj
* @return
*/
public ResponseEntity<String> renderData(Boolean status, String msg,
Object obj) {
if (StringUtils.isEmpty(msg)) {
msg = "";
}
StringBuffer sb = new StringBuffer();
sb.append("{");
sb.append("\"status\":\"" + status + "\",\"msg\":\"" + msg + "\",");
sb.append("\"data\":" + JacksonJsonUtil.toJson(obj) + "");
sb.append("}");
ResponseEntity<String> responseEntity = new ResponseEntity<String>(
sb.toString(), initHttpHeaders(), HttpStatus.OK);
return responseEntity;
}
/***
* 获取IP(如果是多级代理,则得到的是一串IP值)
*/
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
if (ip != null && ip.length() > 0) {
String[] ips = ip.split(",");
for (int i = 0; i < ips.length; i++) {
if (!"unknown".equalsIgnoreCase(ips[i])) {
ip = ips[i];
break;
}
}
}
return ip;
}
/**
* 国际化获得语言内容
*
* @param key
* 语言key
* @param args
* @param argsSplit
* @param defaultMessage
* @param locale
* @return
*/
public static String getLanguage(String key, String args, String argsSplit,
String defaultMessage, String locale) {
String language = "zh";
String contry = "cn";
String returnValue = defaultMessage;
if (!StringUtil.isEmpty(locale)) {
try {
String[] localeArray = locale.split("_");
language = localeArray[0];
contry = localeArray[1];
} catch (Exception e) {
}
}
try {
ResourceBundle resource = ResourceBundle.getBundle("lang.resource",
new Locale(language, contry));
returnValue = resource.getString(key);
if (!StringUtil.isEmpty(args)) {
String[] argsArray = args.split(argsSplit);
for (int i = 0; i < argsArray.length; i++) {
returnValue = returnValue.replace("{" + i + "}",
argsArray[i]);
}
}
} catch (Exception e) {
}
return returnValue;
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。