基于Java的智能停车场管理系统设计与实现(源码+lw+部署文档+讲解等)

发布时间:2023-11-19 17:33:33

(文章目录)

截图的具体实现

主要功能:基于SSM智能停车场管理系统

系统分为两个角色:用户和管理员

用户的主要功能有:1。用户注册和登录系统2。用户查看停车位信息,在线申请停车位租赁3。用户查看系统公告通知4。用户在线沟通,查看帖子,回复帖子,发布帖子5。用户和客户服务在线沟通6。用户个人中心修改个人信息,修改密码7。用户查看租赁停车位信息,在线租赁,支付8。用户在线报告车辆非法生产信息9。退出登录

管理员的主要功能有:1。管理员输入账户登录背景2。个人中心:管理员修改密码和账户信息3。用户管理:添加、删除、修改和查询注册用户信息4。停车位管理:添加、查询、修改和删除停车场停车位5。停车位租赁管理:查看用户的停车位租赁信息,并对其进行审核和修改,删除6。停车位租赁管理:审查、修改和删除用户停车位租赁信息。7.非法报告管理:审查、修改和删除用户发布的非法报告。8.论坛交流管理:添加、修改、删除和查询用户发布的交流信息。9.公告管理:添加、修改和删除系统公告,查询10.在线客服:在线回复用户发布的交流。11.轮播图管理:添加、修改和删除系统的轮播图。查询12.退出系统jdk版本:1.8 以上ide工具:IDEA数据库: mysql5.7 (必须5.7)编程语言: Javatomcat: 8.0 以上java框架:SSMmaven: 3.6.1前端:layui详细技术:HTML+CSS+JS+JSP+JAVA+SSM+MYSQL+JQUERY+MAVENImageImageImageImageImageImage

论文参考详细视频演示

请联系我获取更详细的演示视频

代码参考
@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {   UsersEntity user = userService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));   if(user==null || !user.getPassword().equals(password)) {      return R.error("帐户或密码不正确");   }   String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());   return R.ok().put("token", token);}@Overridepublic String generateToken(Long userid,String username, String tableName, String role) {TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));String token = CommonUtil.getRandomString(32);Calendar cal = Calendar.getInstance();       cal.setTime(new Date());       cal.add(Calendar.HOUR_OF_DAY, 1);if(tokenEntity!=null) {tokenEntity.setToken(token);tokenEntity.setExpiratedtime(cal.getTime());this.updateById(tokenEntity);} else {this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));}return token;}/** * 权限(Token)验证 */@Componentpublic class AuthorizationInterceptor implements HandlerInterceptor {    public static final String LOGIN_TOKEN_KEY = "Token";    @Autowired    private TokenService tokenService;    @Override    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {//支持跨域请求        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");        response.setHeader("Access-Control-Max-Age", "3600");        response.setHeader("Access-Control-Allow-Credentials", "true");        response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");        response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));// OPTIONS请求将首先发送到跨域,在这里,我们要求OPTIONS直接返回正常状态 (request.getMethod().equals(RequestMethod.OPTIONS.name())) {        response.setStatus(HttpStatus.OK.value());            return false;        }                IgnoreAuth annotation;        if (handler instanceof HandlerMethod) {            annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);        } else {            return true;        }        ///从header中获取token        String token = request.getHeader(LOGIN_TOKEN_KEY);                /**         * 不需要验证权限的方法可以直接放过         */        if(annotation!=null) {        return true;        }                TokenEntity tokenEntity = null;        if(StringUtils.isNotBlank(token)) {        tokenEntity = tokenService.getTokenEntity(token);        }                if(tokenEntity != null) {        request.getSession().setAttribute("userId", tokenEntity.getUserid());        request.getSession().setAttribute("role", tokenEntity.getRole());        request.getSession().setAttribute("tableName", tokenEntity.getTablename());        request.getSession().setAttribute("username", tokenEntity.getUsername());        return true;        }        PrintWriter writer = null;response.setCharacterEncoding("UTF-8");response.setContentType("application/json; charset=utf-8");try {    writer = response.getWriter();    writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));} finally {    if(writer != null){        writer.close();    }}//throw new EIException("请先登录", 401);return false;    }}
数据库参考
-- ------------------------------ Table structure for token-- ----------------------------DROP TABLE IF EXISTS `token`;CREATE TABLE `token` (  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',  `userid` bigint(20) NOT NULL COMMENT 用户id,  `username` varchar(100) NOT NULL COMMENT 用户名,  `tablename` varchar(100) DEFAULT NULL COMMENT '表名',  `role` varchar(100) DEFAULT NULL COMMENT '角色',  `token` varchar(200) NOT NULL COMMENT '密码',  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT "新时间",  `expiratedtime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT “过期时间”,  PRIMARY KEY (`id`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT="token表";-- ------------------------------ Records of token-- ----------------------------INSERT INTO `token` VALUES ('9', '23', 'cd01', 'xuesheng', '学生', ‘al6svx5qkei1wljry5onpswhdpqcpcg', '2023-02-23 21:46:45', '2023-03-15 14:01:36');INSERT INTO `token` VALUES ('10', '11', 'xh01', 'xuesheng', '学生', fahmrd9bkhqy04sq0fzrl4h9m86cu6kx, '2023-02-27 18:33:52', '2023-03-17 18:27:42');INSERT INTO `token` VALUES ('11', '17', 'ch01', 'xuesheng', '学生', u5km44scxvzuv5yumdah2lhva0gp4393, '2023-02-27 18:46:19', '2023-02-27 19:48:58');INSERT INTO `token` VALUES ('12', '1', 'admin', 'users', 管理员, “h1pqzsb9bldh93m92j9m2sljy9bt1wdh”, '2023-02-27 19:37:01', '2023-03-17 18:23:02');INSERT INTO `token` VALUES ('13', '21', 'xiaohao', 'shezhang', '社长', zdm7j8h1wnfe27pkyiuzvxy27ykl2a', '2023-02-27 19:38:07', '2023-03-17 18:25:20');INSERT INTO `token` VALUES ('14', '27', "djy01", 'xuesheng', '学生', g3teq435pe21nwuj2sqqoabqomm, '2023-03-15 12:56:17', '2023-03-15 14:00:16');INSERT INTO `token` VALUES ('15', '29', 'dajiyue', 'shezhang', '社长', '0vb1x9xn7riewlp5dma5ro7lp4u8m9j, '2023-03-15 12:58:08', '2023-03-15 14:03:48');

上一篇 基于Java的智能停车场管理系统设计与实现(源码+lw+部署文档+讲解等)
下一篇 返回列表

文章素材均来源于网络,如有侵权,请联系管理员删除。

标签: Java教程Java基础Java编程技巧面试题Java面试题