springboot搭建访客管理系统

项目介绍

springboot搭建的访客管理系统,针对高端基地作严格把控来访人员信息管理,用户后端能够设置多个管理员账号,给予不一样部门的管理层使用,用户管理能够增长/修改内部成员的基本信息,须要到访的人员必须经过进入程序,在访客预定里面提交预定申请,预定后管理员可查询预定记录以及访客出入记录。mysql

项目适用人群

正在作毕设的学生,或者须要项目实战练习的Java学习者spring

开发环境

  1. jdk 8
  2. intellij idea
  3. tomcat 8.5.40
  4. mysql 5.7

所用技术

  1. springboot
  2. mybatis
  3. layUi
  4. JSP

项目访问地址

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

项目截图

  • 登陆sql

    springboot搭建访客管理系统

  • 子帐号管理后端

    springboot搭建访客管理系统

  • 新增成员

springboot搭建访客管理系统

  • 预定列表

springboot搭建访客管理系统

  • 历史预定

springboot搭建访客管理系统

  • 出入影像记录

springboot搭建访客管理系统

  • 表格导出

springboot搭建访客管理系统

  • 访客预定申请

springboot搭建访客管理系统

关键代码:

  1. 用户信息tomcat

    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;
    }
  2. 添加访客记录springboot

    @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);//查无一人
    }
    }
  3. 访客记录导出
    @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();
    }
    }
4.过时预定作定时清理
```diff
@Scheduled(cron = "0 0/1 * * * ?")
private void configureTasks() {
    List<Visitor>  list=visitorService.findVisitorList("");
    if(list.size()>0){
        for(Visitor v:list){
            Long now=Long.valueOf(DateUtils.getTime2());
            Long appointmentTime=Long.valueOf(v.getAppointmentTime().replaceAll("-","").replaceAll(" ",""));
            if(appointmentTime-now<=0){
                VisitorRecord visitorRecord=new VisitorRecord();
                BeanUtils.copyProperties(v,visitorRecord);
                visitorRecordService.save(visitorRecord);
                visitorService.deleteUserById(Long.valueOf(v.getId()));
            }
        }
    }
}

注意事项

  1. 预定地址须要有管理端分享地址给房主,由房主分享给到访的作预定登记
  2. 后期增长房主端,新增房主查看记录
    备注: 基础版作的比较简单,有条件的同窗能够对接硬件设备,跑完总体流程,程序有问题联系程序帮
相关文章
相关标签/搜索