滑雪场管理系统的设计与实现
摘要
近年来,信息化管理行业的不断兴起,使得人们的日常生活越来越离不开计算机和互联网技术。首先,根据收集到的用户需求分析,对设计系统有一个初步的认识与了解,确定滑雪场管理系统的总体功能模块。然后,详细设计系统的主要功能模块,通过数据库设计过程将相关的数据信息存储到数据库中,再通过使用关键的开发工具,如IDEA开发平台、AJAX技术等,编码设计相关的功能模块。接着,主要采用功能测试的方式对系统进行测试,找出系统在运行过程中存在的问题,以及解决问题的方法,不断地改进和完善系统的设计。最后,总结本文介绍的系统的设计和实现过程,并且针对于系统的开发提出未来的展望工作。本系统的研发具有重大的意义,在安全性方面,用户使用浏览器访问网站时,采用注册和密码等相关的保护措施,提高系统的可靠性,维护用户的个人信息和财产的安全。在方便性方面,促进了滑雪场管理系统的信息化建设,极大的方便了相关的工作人员对滑雪场管理系统信息进行管理。
关键词:滑雪场管理系统管理;Java语言;VUE;AJAX技术;系统测试
基于springboot滑雪场管理系统源码和论文554
演示视频:
<iframe allowfullscreen="true" data-mediaembed="bilibili" frameborder="0" id="P0hfAnxO-1720518780676" src="https://player.bilibili.com/player.html?aid=1350329744"></iframe>基于springboot滑雪场管理系统源码和论文
Abstract
In recent years, the continuous rise of information management industry makes people's daily life more and more inseparable from computer and Internet technology. First of all, according to the collected user needs analysis, we have a preliminary understanding and understanding of the design system, and determine the overall function module of the hotel room management system. Then, the main functional modules of the system are designed in detail, and the relevant data information is stored in the database through the process of database design, and then the relevant functional modules of coding design are coded by using key development tools, such as IDEA development platform, JSP technology, etc. Then, the system is tested by functional testing to find out the problems existing in the operation of the system, as well as the methods to solve the problems, and to continuously improve and improve the design of the system. Finally, this paper summarizes the design and implementation process of the system, and puts forward the future prospect for the development of the system. The research and development of this system is of great significance. In terms of security, when users use browsers to visit websites, they adopt registration and password protection measures to improve the reliability of the system and maintain the security of users' personal information and property. In terms of convenience, it promotes the information construction of hotel room management industry, and greatly facilitates the management of hotel room information by relevant staff.
Key words: hotel room management; Java language; VUE model; JSP technology; System testing
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 赛道预约
* 后端接口
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/saidaoYuyue")
public class SaidaoYuyueController {
private static final Logger logger = LoggerFactory.getLogger(SaidaoYuyueController.class);
private static final String TABLE_NAME = "saidaoYuyue";
@Autowired
private SaidaoYuyueService saidaoYuyueService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private GonggaoService gonggaoService;//公告
@Autowired
private JiaolianService jiaolianService;//教练
@Autowired
private JiaolianYuyueService jiaolianYuyueService;//教练预约
@Autowired
private LiuyanService liuyanService;//留言板
@Autowired
private QijuService qijuService;//滑雪器具
@Autowired
private QijuCollectionService qijuCollectionService;//器具收藏
@Autowired
private QijuCommentbackService qijuCommentbackService;//器具评价
@Autowired
private QijuOrderService qijuOrderService;//器具订单
@Autowired
private SaidaoService saidaoService;//赛道
@Autowired
private SaidaoCollectionService saidaoCollectionService;//赛道收藏
@Autowired
private SaidaoLiuyanService saidaoLiuyanService;//赛道留言
@Autowired
private YonghuService yonghuService;//用户
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
else if("教练".equals(role))
params.put("jiaolianId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = saidaoYuyueService.queryPage(params);
//字典表数据转换
List<SaidaoYuyueView> list =(List<SaidaoYuyueView>)page.getList();
for(SaidaoYuyueView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
SaidaoYuyueEntity saidaoYuyue = saidaoYuyueService.selectById(id);
if(saidaoYuyue !=null){
//entity转view
SaidaoYuyueView view = new SaidaoYuyueView();
BeanUtils.copyProperties( saidaoYuyue , view );//把实体数据重构到view中
//级联表 赛道
//级联表
SaidaoEntity saidao = saidaoService.selectById(saidaoYuyue.getSaidaoId());
if(saidao != null){
BeanUtils.copyProperties( saidao , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setSaidaoId(saidao.getId());
}
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(saidaoYuyue.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody SaidaoYuyueEntity saidaoYuyue, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,saidaoYuyue:{}",this.getClass().getName(),saidaoYuyue.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
saidaoYuyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<SaidaoYuyueEntity> queryWrapper = new EntityWrapper<SaidaoYuyueEntity>()
.eq("saidao_id", saidaoYuyue.getSaidaoId())
.eq("yonghu_id", saidaoYuyue.getYonghuId())
.eq("saidao_yuyue_time", new SimpleDateFormat("yyyy-MM-dd").format(saidaoYuyue.getSaidaoYuyueTime()))
.in("saidao_yuyue_yesno_types", new Integer[]{1,2})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
SaidaoYuyueEntity saidaoYuyueEntity = saidaoYuyueService.selectOne(queryWrapper);
if(saidaoYuyueEntity==null){
saidaoYuyue.setInsertTime(new Date());
saidaoYuyue.setSaidaoYuyueYesnoTypes(1);
saidaoYuyue.setCreateTime(new Date());
saidaoYuyueService.insert(saidaoYuyue);
return R.ok();
}else {
if(saidaoYuyueEntity.getSaidaoYuyueYesnoTypes()==1)
return R.error(511,"有相同的待审核的数据");
else if(saidaoYuyueEntity.getSaidaoYuyueYesnoTypes()==2)
return R.error(511,"有相同的审核通过的数据");
else
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody SaidaoYuyueEntity saidaoYuyue, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,saidaoYuyue:{}",this.getClass().getName(),saidaoYuyue.toString());
SaidaoYuyueEntity oldSaidaoYuyueEntity = saidaoYuyueService.selectById(saidaoYuyue.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// saidaoYuyue.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(saidaoYuyue.getSaidaoYuyueText()) || "null".equals(saidaoYuyue.getSaidaoYuyueText())){
saidaoYuyue.setSaidaoYuyueText(null);
}
if("".equals(saidaoYuyue.getSaidaoYuyueYesnoText()) || "null".equals(saidaoYuyue.getSaidaoYuyueYesnoText())){
saidaoYuyue.setSaidaoYuyueYesnoText(null);
}
saidaoYuyueService.updateById(saidaoYuyue);//根据id更新
return R.ok();
}
/**
* 审核
*/
@RequestMapping("/shenhe")
public R shenhe(@RequestBody SaidaoYuyueEntity saidaoYuyueEntity, HttpServletRequest request){
logger.debug("shenhe方法:,,Controller:{},,saidaoYuyueEntity:{}",this.getClass().getName(),saidaoYuyueEntity.toString());
SaidaoYuyueEntity oldSaidaoYuyue = saidaoYuyueService.selectById(saidaoYuyueEntity.getId());//查询原先数据
if(saidaoYuyueEntity.getSaidaoYuyueYesnoTypes() == 2){//通过
SaidaoYuyueEntity saidaoYuyueEntity1 = saidaoYuyueService.selectOne(new EntityWrapper<SaidaoYuyueEntity>()
.eq("saidao_id", oldSaidaoYuyue.getSaidaoId())
.eq("saidao_yuyue_time", new SimpleDateFormat("yyyy-MM-dd").format(oldSaidaoYuyue.getSaidaoYuyueTime()))
.eq("saidao_yuyue_yesno_types", 2)
);
if(saidaoYuyueEntity1 != null)
return R.error("该赛道该天已经被预约,不能通过此次预约了");
}else if(saidaoYuyueEntity.getSaidaoYuyueYesnoTypes() == 3){//拒绝
YonghuEntity yonghuEntity = yonghuService.selectById(oldSaidaoYuyue.getYonghuId());
if(yonghuEntity==null){
return R.error("查不到用户");
}
SaidaoEntity saidaoEntity = saidaoService.selectById(oldSaidaoYuyue.getSaidaoId());
if(saidaoEntity==null){
return R.error("查不到赛道");
}
double balance = yonghuEntity.getNewMoney() + saidaoEntity.getSaidaoNewMoney();
yonghuEntity.setNewMoney(balance);
yonghuService.updateById(yonghuEntity);
}
saidaoYuyueEntity.setSaidaoYuyueShenheTime(new Date());//审核时间
saidaoYuyueService.updateById(saidaoYuyueEntity);//审核
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<SaidaoYuyueEntity> oldSaidaoYuyueList =saidaoYuyueService.selectBatchIds(Arrays.asList(ids));//要删除的数据
saidaoYuyueService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 批量上传
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
try {
List<SaidaoYuyueEntity> saidaoYuyueList = new ArrayList<>();//上传的东西
Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
dataList.remove(0);//删除第一行,因为第一行是提示
for(List<String> data:dataList){
//循环
SaidaoYuyueEntity saidaoYuyueEntity = new SaidaoYuyueEntity();
// saidaoYuyueEntity.setSaidaoYuyueUuidNumber(data.get(0)); //申请编号 要改的
// saidaoYuyueEntity.setSaidaoId(Integer.valueOf(data.get(0))); //赛道 要改的
// saidaoYuyueEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// saidaoYuyueEntity.setSaidaoYuyueText(data.get(0)); //申请缘由 要改的
// saidaoYuyueEntity.setSaidaoYuyueTime(sdf.parse(data.get(0))); //预约日期 要改的
// saidaoYuyueEntity.setInsertTime(date);//时间
// saidaoYuyueEntity.setSaidaoYuyueYesnoTypes(Integer.valueOf(data.get(0))); //申请状态 要改的
// saidaoYuyueEntity.setSaidaoYuyueYesnoText(data.get(0)); //审核回复 要改的
// saidaoYuyueEntity.setSaidaoYuyueShenheTime(sdf.parse(data.get(0))); //审核时间 要改的
// saidaoYuyueEntity.setCreateTime(date);//时间
saidaoYuyueList.add(saidaoYuyueEntity);
//把要查询是否重复的字段放入map中
//申请编号
if(seachFields.containsKey("saidaoYuyueUuidNumber")){
List<String> saidaoYuyueUuidNumber = seachFields.get("saidaoYuyueUuidNumber");
saidaoYuyueUuidNumber.add(data.get(0));//要改的
}else{
List<String> saidaoYuyueUuidNumber = new ArrayList<>();
saidaoYuyueUuidNumber.add(data.get(0));//要改的
seachFields.put("saidaoYuyueUuidNumber",saidaoYuyueUuidNumber);
}
}
//查询是否重复
//申请编号
List<SaidaoYuyueEntity> saidaoYuyueEntities_saidaoYuyueUuidNumber = saidaoYuyueService.selectList(new EntityWrapper<SaidaoYuyueEntity>().in("saidao_yuyue_uuid_number", seachFields.get("saidaoYuyueUuidNumber")));
if(saidaoYuyueEntities_saidaoYuyueUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(SaidaoYuyueEntity s:saidaoYuyueEntities_saidaoYuyueUuidNumber){
repeatFields.add(s.getSaidaoYuyueUuidNumber());
}
return R.error(511,"数据库的该表中的 [申请编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
saidaoYuyueService.insertBatch(saidaoYuyueList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = saidaoYuyueService.queryPage(params);
//字典表数据转换
List<SaidaoYuyueView> list =(List<SaidaoYuyueView>)page.getList();
for(SaidaoYuyueView c:list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
return R.ok().put("data", page);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Integer id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
SaidaoYuyueEntity saidaoYuyue = saidaoYuyueService.selectById(id);
if(saidaoYuyue !=null){
//entity转view
SaidaoYuyueView view = new SaidaoYuyueView();
BeanUtils.copyProperties( saidaoYuyue , view );//把实体数据重构到view中
//级联表
SaidaoEntity saidao = saidaoService.selectById(saidaoYuyue.getSaidaoId());
if(saidao != null){
BeanUtils.copyProperties( saidao , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setSaidaoId(saidao.getId());
}
//级联表
YonghuEntity yonghu = yonghuService.selectById(saidaoYuyue.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "username", "password", "newMoney", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody SaidaoYuyueEntity saidaoYuyue, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,saidaoYuyue:{}",this.getClass().getName(),saidaoYuyue.toString());
Wrapper<SaidaoYuyueEntity> queryWrapper = new EntityWrapper<SaidaoYuyueEntity>()
.eq("saidao_id", saidaoYuyue.getSaidaoId())
.eq("yonghu_id", saidaoYuyue.getYonghuId())
.in("saidao_yuyue_yesno_types", new Integer[]{1})
// .notIn("saidao_yuyue_types", new Integer[]{102})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
SaidaoYuyueEntity saidaoYuyueEntity = saidaoYuyueService.selectOne(queryWrapper);
if(saidaoYuyueEntity==null){
YonghuEntity yonghuEntity = yonghuService.selectById(saidaoYuyue.getYonghuId());
if(yonghuEntity==null){
return R.error("查不到用户");
}
SaidaoEntity saidaoEntity = saidaoService.selectById(saidaoYuyue.getSaidaoId());
if(saidaoEntity==null){
return R.error("查不到赛道");
}
double balance = yonghuEntity.getNewMoney() - saidaoEntity.getSaidaoNewMoney();
if(balance<0)
return R.error("账户余额不够支付,请充值后再预约");
yonghuEntity.setNewMoney(balance);
yonghuService.updateById(yonghuEntity);
saidaoYuyue.setInsertTime(new Date());
saidaoYuyue.setSaidaoYuyueYesnoTypes(1);
saidaoYuyue.setCreateTime(new Date());
saidaoYuyueService.insert(saidaoYuyue);
return R.ok();
}else {
if(saidaoYuyueEntity.getSaidaoYuyueYesnoTypes()==1)
return R.error(511,"有该赛道的预约,请等待审核后再预约");
else
return R.error(511,"表中有相同数据");
}
}
}
标签:return,springboot,saidaoYuyueEntity,滑雪场,源码,new,import,saidaoYuyue,id
From: https://blog.csdn.net/qq_25345405/article/details/140301517