• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

springboot搭建访客管理系统的实现示例

springboot 搞代码 4年前 (2022-01-09) 23次浏览 已收录 0个评论

项目介绍

springboot搭建的访客管理系统,针对高端基地做严格把控来访人员信息管理,用户后端可以设置多个管理员帐号,给予不同部门的管理层使用,用户管理可以增加/修改内部成员的基本文来源gaodaimacom搞#代%码@网-本信息,需要到访的人员必须通过进入程序,在访客预约里面提交预约申请,预约后管理员可查询预约记录以及访客出入记录。

项目适用人群

正在做毕设的学生,或者需要项目实战练习的Java学习者

开发环境

  • jdk 8
  • intellij idea
  • tomcat 8.5.40
  • mysql 5.7

所用技术

  • springboot
  • mybatis
  • layUi
  • JSP

项目访问地址

http://localhost:8090
帐号:admin 密码:admin

项目截图

登录

子账号管理

新增成员

预约列表

历史预约

出入影像记录

表格导出

访客预约申请

关键代码:

用户信息

public class SmartUser {
 @ApiModelProperty(value="用户编号",dataType="String",name="password")
 private Long id;
 @ApiModelProperty(value="登录帐号",dataType="String",name="account")
 private String account;
 @ApiModelProperty(value="用户名称",dataType="String",name="name")
 private String name;
 @ApiModelProperty(value="用户年龄",dataType="Integer",name="age")
 private int age;
 @ApiModelProperty(value="手机号",dataType="String",name="phone")
 private String phone;
 @ApiModelProperty(value="密码",dataType="String",name="password")
 private String password;
 @ApiModelProperty(value="mac",dataType="String",name="mac")
 private String mac;
 @ApiModelProperty(value="备注",dataType="String",name="remark")
 private String remark ;
 @ApiModelProperty(value="创建时间",dataType="String",name="createTime")
 private String createTime;
 private String headPic;
}

添加访客记录

@ApiOperation(value="添加预约",notes="添加预约")
@ResponseBody
@PostMapping("/addVisitor")
public Response<String> addVisitor(Visitor visitor){
 SmartUser smartUser=new SmartUser();
 smartUser.setPhone(visitor.getUserPhone());
 smartUser.setName(visitor.getUserName());
 smartUser=smartUserService.login(smartUser);
 if(null!=smartUser){
  return visitorService.saveOrUpdate(visitor);
 }else{
  return Response.error(300);//查无一人
 }
}

访客记录导出

@GetMapping("/exportExcel")
public void exportExcel(HttpServletResponse response) {
 try{
  List<List<String>> rows =new ArrayList<>();
  List<String> row1 = CollUtil.newArrayList("访客姓名", "访客手机号", "被访人姓名", "被访人电话", "预约日期", "访问事由");
  rows.add(row1);
  List<VisitorRecord> list=smartUserService.getAll();
  for(VisitorRecord vr:list){
   rows.add(CollUtil.newArrayList(vr.getVisitorName(), vr.getPhone(),vr.getUserPhone(),vr.getUserName(),vr.getAppointmentTime(),vr.getReasons()));
  }
  ExcelWriter writer = ExcelUtil.getWriter();
  writer.write(rows);
  response.setContentType("application/vnd.ms-excel;charset=utf-8");
  response.setHeader("Content-Disposition","attachment;filename="+ DateUtils.getTime3()+"visitorRecord.xls");
  ServletOutputStream out=response.getOutputStream();
  writer.flush(out);
  writer.close();
  IoUtil.close(out);
 }catch (Exception e){
  e.printStackTrace();
 }
}

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:springboot搭建访客管理系统的实现示例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址