package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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.annotation.IgnoreAuth;
import com.entity.JiashiyuanEntity;
import com.entity.view.JiashiyuanView;
import com.service.JiashiyuanService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 驾驶员
* 后端接口
* @author
* @email
* @date 2021-03-29 23:57:48
*/
@RestController
@RequestMapping("/jiashiyuan")
public class JiashiyuanController {
@Autowired
private JiashiyuanService jiashiyuanService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
JiashiyuanEntity user = jiashiyuanService.selectOne(new EntityWrapper<JiashiyuanEntity>().eq("zhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"jiashiyuan", "驾驶员" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody JiashiyuanEntity jiashiyuan){
//ValidatorUtils.validateEntity(jiashiyuan);
JiashiyuanEntity user = jiashiyuanService.selectOne(new EntityWrapper<JiashiyuanEntity>().eq("zhanghao", jiashiyuan.getZhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
jiashiyuan.setId(uId);
jiashiyuanService.insert(jiashiyuan);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
JiashiyuanEntity user = jiashiyuanService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
JiashiyuanEntity user = jiashiyuanService.selectOne(new EntityWrapper<JiashiyuanEntity>().eq("zhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
jiashiyuanService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,JiashiyuanEntity jiashiyuan,
HttpServletRequest request){
EntityWrapper<JiashiyuanEntity> ew = new EntityWrapper<JiashiyuanEntity>();
PageUtils page = jiashiyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiashiyuan), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,JiashiyuanEntity jiashiyuan, HttpServletRequest request){
EntityWrapper<JiashiyuanEntity> ew = new EntityWrapper<JiashiyuanEntity>();
PageUtils page = jiashiyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiashiyuan), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiashiyuanEntity jiashiyuan){
EntityWrapper<JiashiyuanEntity> ew = new EntityWrapper<JiashiyuanEntity>();
ew.allEq(MPUtil.allEQMapPre( jiashiyuan, "jiashiyuan"));
return R.ok().put("data", jiashiyuanService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiashiyuanEntity jiashiyuan){
EntityWrapper< JiashiyuanEntity> ew = new EntityWrapper< JiashiyuanEntity>();
ew.allEq(MPUtil.allEQMapPre( jiashiyuan, "jiashiyuan"));
JiashiyuanView jiashiyuanView = jiashiyuanService.selectView(ew);
return R.ok("查询驾驶员成功").put("data", jiashiyuanView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiashiyuanEntity jiashiyuan = jiashiyuanService.selectById(id);
return R.ok().put("data", jiashiyuan);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiashiyuanEntity jiashiyuan = jiashiyuanService.selectById(id);
return R.ok().put("data", jiashiyuan);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiashiyuanEntity jiashiyuan, HttpServletRequest request){
jiashiyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiashiyuan);
JiashiyuanEntity user = jiashiyuanService.selectOne(new EntityWrapper<JiashiyuanEntity>().eq("zhanghao", jiashiyuan.getZhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
jiashiyuan.setId(new Date().getTime());
jiashiyuanService.insert(jiashiyuan);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiashiyuanEntity jiashiyuan, HttpServletRequest request){
jiashiyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiashiyuan);
JiashiyuanEntity user = jiashiyuanService.selectOne(new EntityWrapper<JiashiyuanEntity>().eq("zhanghao", jiashiyuan.getZhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
jiashiyuan.setId(new Date().getTime());
jiashiyuanService.insert(jiashiyuan);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiashiyuanEntity jiashiyuan, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiashiyuan);
jiashiyuanService.updateById(jiashiyuan);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiashiyuanService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Spring Boot开发的停车场收费管理系统是一个用于管理停车场车辆进出和计费的应用程序。以下是该系统的主要特点和实现方式的介绍: 特点 车辆进出管理:记录车辆的进入和离开时间,管理停车场的停车位数量和使用情况。 计费管理:根据车辆停留时间和收费规则,自动计算停车费用,并提供多种计费方式和优惠策略。 支付管理:支持多种支付方式,如现金、刷卡、移动支付等,确保交易安全和便捷性。 数据统计与报表:提供数据统计和报表功能,包括每日收入、车流量、空余停车位等信息,帮助管理人员进行业务分析和决策。 实现方式 使用Spring Boot框架开发后端服务,提供与前端界面的交互和数据处理。 设计数据库模型,包括车辆信息、停车位状态、收费记录等相关数据的存储。 开发停车场管理功能,包括车辆进出记录、停车位状态管理、收费规则设置等。 实现计费算法,根据车辆停留时间和收费规则计算停车费用。 提供支付接口,集成第三方支付服务,处理车辆缴费操作。 设计前端页面,使用HTML、CSS、JavaScript等技术实现与后端的交互和数据展示。 部署系统并进行测试,确保系统的稳定性和功能完整性。 需要注意的是,
资源推荐
资源详情
资源评论
收起资源包目录
Java毕业设计-基于Springboot开发的停车场收费管理系统(源码+数据库).zip文件 (656个子文件)
main.css.bak 63KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
index.2d26d90a.css 79KB
icon.css 70KB
main.css 64KB
global-restaurant.css 7KB
animation.css 3KB
.factorypath 15KB
.gitignore 364B
index.html 1KB
index.html 552B
favicon.ico 4KB
maven-wrapper.jar 50KB
JiashiyuanController.java 9KB
CommonController.java 8KB
CheliangweizhangController.java 7KB
CheliangyunyingController.java 7KB
CheliangyidongController.java 7KB
CheliangbaofeiController.java 7KB
CheliangweixiuController.java 7KB
CheliangdanganController.java 7KB
CheliangshiguController.java 7KB
JiangfaxinxiController.java 7KB
ChexinghaoController.java 6KB
NewsController.java 6KB
CheliangdanganEntity.java 6KB
MPUtil.java 5KB
UserController.java 5KB
CheliangweizhangEntity.java 5KB
MavenWrapperDownloader.java 5KB
CheliangweixiuEntity.java 5KB
JiangfaxinxiEntity.java 5KB
CheliangdanganModel.java 5KB
CheliangdanganVO.java 5KB
CheliangshiguEntity.java 5KB
CheliangyidongEntity.java 4KB
JiashiyuanEntity.java 4KB
CheliangyunyingEntity.java 4KB
CheliangweizhangModel.java 4KB
CheliangweizhangVO.java 4KB
CheliangbaofeiEntity.java 4KB
CheliangweixiuModel.java 4KB
JiangfaxinxiModel.java 4KB
CheliangweixiuVO.java 4KB
JiangfaxinxiVO.java 4KB
BaiduUtil.java 4KB
FileController.java 4KB
CheliangshiguModel.java 3KB
CheliangshiguVO.java 3KB
AuthorizationInterceptor.java 3KB
CheliangyidongModel.java 3KB
JiashiyuanModel.java 3KB
CheliangyidongVO.java 3KB
ConfigController.java 3KB
JiashiyuanVO.java 3KB
CheliangyunyingModel.java 3KB
CheliangyunyingVO.java 3KB
NewsEntity.java 3KB
Query.java 3KB
CheliangbaofeiModel.java 3KB
CheliangbaofeiVO.java 2KB
TokenServiceImpl.java 2KB
TokenEntity.java 2KB
CheliangweizhangServiceImpl.java 2KB
CheliangyunyingServiceImpl.java 2KB
CheliangdanganServiceImpl.java 2KB
CheliangweixiuServiceImpl.java 2KB
CheliangyidongServiceImpl.java 2KB
CheliangbaofeiServiceImpl.java 2KB
ChexinghaoEntity.java 2KB
CheliangshiguServiceImpl.java 2KB
JiangfaxinxiServiceImpl.java 2KB
PageUtils.java 2KB
ChexinghaoServiceImpl.java 2KB
JiashiyuanServiceImpl.java 2KB
NewsServiceImpl.java 2KB
NewsModel.java 1KB
InterceptorConfig.java 1KB
NewsVO.java 1KB
UserServiceImpl.java 1KB
CommonServiceImpl.java 1KB
UserEntity.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
CheliangweizhangService.java 1KB
CheliangyunyingService.java 1KB
CheliangyidongService.java 1KB
CheliangbaofeiService.java 1KB
CheliangdanganService.java 1KB
CheliangweixiuService.java 1KB
CheliangweizhangDao.java 1KB
SQLFilter.java 1KB
CheliangshiguService.java 1KB
CheliangyunyingDao.java 1KB
JiangfaxinxiService.java 1KB
CheliangyidongDao.java 1KB
共 656 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- 张濑光2023-12-16非常有用的资源,有一定的参考价值,受益匪浅,值得下载。
- 程序届的一只源2023-12-13超级好的资源,很值得参考学习,对我启发很大,支持!
- 艾櫟雅米蘇2024-05-28终于找到了超赞的宝藏资源,果断冲冲冲,支持!
- AABBytz2024-04-06资源质量不错,和资源描述一致,内容详细,对我很有用。
- 2301_774810552024-03-12感谢大佬,让我及时解决了当下的问题,解燃眉之急,必须支持!
荒野大飞
- 粉丝: 1w+
- 资源: 2582
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功