电话
058-155768809
项目先容springboot搭建的访客治理系统,针对高端基地做严格把控来访人员信息治理,用户后端可以设置多个治理员帐号,给予差别部门的治理层使用,用户治理可以增加/修改内部成员的基本信息,需要到访的人员必须通过进入法式,在访客预约内里提交预约申请,预约后治理员可查询预约记载以及访客收支记载。项目适用人群正在做毕设的学生,或者需要项目实战训练的Java学习者开发情况jdk 8intellij ideatomcat 8.5.40mysql 5.7所用技术springbootmybatislayUiJSP项目会见地址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(); }}4.逾期预约做定时清理@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())); } } }}注意事项预约地址需要有治理端分享地址给房主,由房主分享给到访的做预约挂号后期增加房主端,新增房主检察记载泉源:https://www.tuicool.com/articles/viAN7fA。
本文来源:澳门网站游戏电子平台-www.hongshulinart.com