基于ssm车库智能管理平台源码和论文092
开发工具:idea
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
选题的根据:1)说明本选题的理论、实际意义
2)综述国内外有关本选题的研究动态和自己的见解
随着经济的增长及城市化进程的加快,小汽车进入家庭,私人车拥有量越来越多。因为车辆的增长,实有的停车泊位越来越不能满足停车需求,车辆的任意停放给交通的安全和畅通带来了很大的影响,也给交通控制工作带来了很多不便,因此,停车控制开始受到人们的重视。所以,汽车停车场的数量将随之增加,规模不断扩大,这给各停车场的管理提出了新的挑战,停车场的自动化管理系统或智能化管理系统的停车场很少,这类管理系统产品也很少。为使停车场安全、快捷运转,必须配备一套综合收费及管理的平台。而现代化停车场系统的投资与管理不但是一种形式,也是一种低投入,高回报的商业行为。
Tomcat是一个轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选。当在一台机器上配置好Apache 服务器,可利用它响应对HTML 页面的访问请求。实际上Tomcat部分是Apache 服务器的扩展,但它是独立运行的,所以当你 Apache Tomcat运行tomcat 时,它实际上作为一个与Apache独立的进程单独运行的。与此同时,Tomcat服务器还支持负载平衡与邮件服务等开发应用系统常用的功能。Tomcat服务器使用Tomcat系统,所具有的优点也很鲜明,首先它具有免费的开源代码,其次是Tomcat系统技术先进并且性能也是相当的稳定,最后Tomcat服务器具有良好的扩展性和安全性,很适合一些中小企业使用。
该平台为客户和业主提供等信息服务平台的运营方,管理方,如何通过车库平台建立实现优化管理的方法提供参考。能够实现在一个相对广阔的地域内(例如一座城市)的多个停车场的随意停车。管理平台会统一调度车位资源,自动进行交易结算。需要停车车库客户在家中通过网络就可以预定停车车库,在线支付停车费用,查询出行目的地的各类车库信息。这种新型预约停车场管理方式适应了网络在人们日常生活中越来越重要的现状,使车库智能管理平台的作用范围和功能得到了极大的扩展和延伸。
package com.controller;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.entity.YonghuEntity;
import com.entity.YuyvejiluEntity;
import com.service.YonghuService;
import com.service.YuyvejiluService;
import org.apache.commons.lang3.StringUtils;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ChekuEntity;
import com.service.ChekuService;
import com.utils.PageUtils;
import com.utils.R;
/**
* 洗衣机
* 后端接口
* @author
* @email
* @date 2021-03-16
*/
@RestController
@Controller
@RequestMapping("/cheku")
public class ChekuController {
private static final Logger logger = LoggerFactory.getLogger(ChekuController.class);
@Autowired
private ChekuService chekuService;
@Autowired
private YonghuService yonghuService;
@Autowired
private YuyvejiluService yuyvejiluService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",page方法");
PageUtils page = null;
if(request.getSession().getAttribute("role").equals("车库主人")){
params.put("ryTypes",request.getSession().getAttribute("userId"));
}
page = chekuService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("Controller:"+this.getClass().getName()+",info方法");
ChekuEntity cheku = chekuService.selectById(id);
if(cheku!=null){
return R.ok().put("data", cheku);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ChekuEntity cheku, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",save");
Wrapper<ChekuEntity> queryWrapper = new EntityWrapper<ChekuEntity>()
.eq("name", cheku.getName())
.eq("location", cheku.getLocation())
.eq("ry_types", cheku.getRyTypes())
.eq("garageSize", cheku.getGarageSize())
.eq("money", cheku.getMoney())
.eq("ckzt_types", cheku.getCkztTypes())
.eq("matter_content", cheku.getMatterContent())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChekuEntity chekuEntity = chekuService.selectOne(queryWrapper);
if("".equals(cheku.getImgPhoto()) || "null".equals(cheku.getImgPhoto())){
cheku.setImgPhoto(null);
}
if(chekuEntity==null){
cheku.setCkztTypes(2);
chekuService.insert(cheku);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ChekuEntity cheku, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",update");
//根据字段查询是否有相同数据
Wrapper<ChekuEntity> queryWrapper = new EntityWrapper<ChekuEntity>()
.notIn("id",cheku.getId())
.eq("name", cheku.getName())
.eq("location", cheku.getLocation())
.eq("ry_types", cheku.getRyTypes())
.eq("garageSize", cheku.getGarageSize())
.eq("money", cheku.getMoney())
.eq("ckzt_types", cheku.getCkztTypes())
.eq("matter_content", cheku.getMatterContent())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ChekuEntity chekuEntity = chekuService.selectOne(queryWrapper);
if("".equals(cheku.getImgPhoto()) || "null".equals(cheku.getImgPhoto())){
cheku.setImgPhoto(null);
}
if(chekuEntity==null){
chekuService.updateById(cheku);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/renting")
public R renting(Integer id,Integer day, HttpServletRequest request){
Long u = (Long) request.getSession().getAttribute("userId");
Integer userId = Integer.parseInt(String.valueOf(u));
if(day == null){
return R.error("使用时间不能为空");
}
if(day > 30){
return R.error("使用时间不能大于30天");
}
ChekuEntity cheku = chekuService.selectById(id);
if(cheku == null){
return R.error();
}
if(cheku.getCkztTypes() == 1){
return R.error("这个车库已经出租");
}
//算账
YonghuEntity yonghu = yonghuService.selectById(userId);
YonghuEntity user = yonghuService.selectById(cheku.getRyTypes());
if(user == null){
return R.error();
}
if(yonghu == null){
return R.error();
}
YuyvejiluEntity yuyvejilu = new YuyvejiluEntity();
yuyvejilu.setCreateTime(new Date());
yuyvejilu.setCkTypes(id);
yuyvejilu.setYhTypes(userId);
yuyvejilu.setRyTypes(cheku.getRyTypes());
yuyvejilu.setDay(day);
yuyvejilu.setLocation(cheku.getLocation());
Integer max = day * cheku.getMoney();
yuyvejilu.setDayMax(max);
if(yonghu.getMoney() < max){
return R.error("余额不足请充值");
}
yonghu.setMoney(yonghu.getMoney()-max);
user.setMoney(user.getMoney()+max);
Wrapper<YuyvejiluEntity> queryWrapper = new EntityWrapper<YuyvejiluEntity>()
.eq("ck_types", yuyvejilu.getCkTypes())
.eq("yh_types", yuyvejilu.getYhTypes())
.eq("ry_types", yuyvejilu.getRyTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YuyvejiluEntity yuyvejiluEntity = yuyvejiluService.selectOne(queryWrapper);
if(yuyvejiluEntity==null){
cheku.setCkztTypes(1);
chekuService.updateById(cheku);
yonghuService.updateById(yonghu);
yonghuService.updateById(user);
yuyvejiluService.insert(yuyvejilu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/thumbsupnumClick")
public R thumbsupnumClick(Integer ids){
ChekuEntity cheku = chekuService.selectById(ids);
if(cheku == null){
return R.error();
}
if(cheku.getThumbsupnum() < 0 || cheku.getThumbsupnum()== null){
cheku.setThumbsupnum(0);
}
cheku.setThumbsupnum(cheku.getThumbsupnum()+1);
chekuService.updateById(cheku);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/crazilynumClick")
public R crazilynumClick(Integer ids){
ChekuEntity cheku = chekuService.selectById(ids);
if(cheku == null){
return R.error();
}
if(cheku.getCrazilynum() < 0 || cheku.getCrazilynum()== null){
cheku.setCrazilynum(0);
}
cheku.setCrazilynum(cheku.getCrazilynum()+1);
chekuService.updateById(cheku);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
logger.debug("Controller:"+this.getClass().getName()+",delete");
chekuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
package com.controller;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.annotation.IgnoreAuth;
import com.entity.YonghuEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import org.apache.commons.lang3.StringUtils;
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.YonghuEntity;
import com.service.YonghuService;
import com.utils.PageUtils;
import com.utils.R;
/**
* 用户表
* 后端接口
* @author
* @email
* @date 2021-03-16
*/
@RestController
@Controller
@RequestMapping("/yonghu")
public class YonghuController {
private static final Logger logger = LoggerFactory.getLogger(YonghuController.class);
@Autowired
private YonghuService yonghuService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password,String role, HttpServletRequest request) {
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(!user.getRole().equals(role)){
return R.error("账号、密码或权限不正确");
}
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(Long.valueOf(user.getId()),user.getName(), "users", user.getRole());
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YonghuEntity user){
// ValidatorUtils.validateEntity(user);
if(yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
yonghuService.insert(user);
return R.ok();
}
/**
* 退出
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
yonghuService.update(user,null);
return R.ok("密码已重置为:123456");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
YonghuEntity user = yonghuService.selectById(id);
return R.ok().put("data", user);
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params){
logger.debug("Controller:"+this.getClass().getName()+",page方法");
PageUtils page = yonghuService.queryPage(params);
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("Controller:"+this.getClass().getName()+",info方法");
YonghuEntity yonghu = yonghuService.selectById(id);
if(yonghu!=null){
return R.ok().put("data", yonghu);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",save");
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("money", yonghu.getMoney())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getImgPhoto()) || "null".equals(yonghu.getImgPhoto())){
yonghu.setImgPhoto(null);
}
if(yonghuEntity==null){
yonghuService.insert(yonghu);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
logger.debug("Controller:"+this.getClass().getName()+",update");
//根据字段查询是否有相同数据
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.notIn("id",yonghu.getId())
.eq("name", yonghu.getName())
.eq("username", yonghu.getUsername())
.eq("password", yonghu.getPassword())
.eq("sex_types", yonghu.getSexTypes())
.eq("phone", yonghu.getPhone())
.eq("money", yonghu.getMoney())
.eq("role", yonghu.getRole())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
if("".equals(yonghu.getImgPhoto()) || "null".equals(yonghu.getImgPhoto())){
yonghu.setImgPhoto(null);
}
if(yonghuEntity==null){
yonghuService.updateById(yonghu);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
logger.debug("Controller:"+this.getClass().getName()+",delete");
yonghuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}