企业微信打卡统计员工考勤

【第一步】调用企业微信的api接口获取当天的打卡记录

(获取的打卡记录是根据自己提交的时间戳来获取的,我只获取当天的打卡记录,是因为设置了定时器,每天11点自动调用接口插入到数据库)

企业微信api地址
在这里插入图片描述

获取数据并分析

分析每一条打卡记录对应什么状态,迟到,早退,未打卡,未连接wifi打卡,外出打卡等。我这里获取了用户id,打卡类型,异常类型,打卡时间,打卡地点,打卡地点详情,打卡wifi名称,打卡规则名称,并且做了判断数据库只存在一个员工当天2条打卡记录,取最早打卡和最晚打卡。

在这里插入图片描述

最后呈现的效果如下

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

由于数据量大,计算有点复杂,导致加载时间需要15s左右,数据由sql存储过程计算获得。
sql代码如下
USE [easyOA]
GO
/****** Object:  StoredProcedure [dbo].[_rqv_p_get_attabel_by_page]    Script Date: 2020/8/13 10:33:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO




ALTER proc [dbo].[_rqv_p_get_attabel_by_page]
	@at_date datetime,
	@page int,
	@rows int,
	@rowcount int output	

as
begin
	if object_id('tempdb..#tmp_lv_re') is not null
begin
    drop table #tmp_lv_re
end
create table #tmp_lv_re(
	at_userid nvarchar(100),
	zc_day int,
	at_leavetime float,
	at_leavedata nvarchar(max),
	w_sdk    int,
	w_xdk    int,
	w_sxdk   int,
	at_cdx	 int,
	at_cdd	 int,
	at_ztx	 int,
	at_ztd	 int,
	a1_1 datetime,
	s1_1 int, 
	a1_2 datetime,
	s1_2 int,
	a2_1 datetime,
	s2_1 int,
	a2_2 datetime,
	s2_2 int,
	a3_1 datetime,
	s3_1 int,
	a3_2 datetime,
	s3_2 int,
	a4_1 datetime,
	s4_1 int,
	a4_2 datetime,
	s4_2 int,
	a5_1 datetime,
	s5_1 int,
	a5_2 datetime,
	s5_2 int,
	a6_1 datetime,
	s6_1 int,
	a6_2 datetime,
	s6_2 int,
	a7_1 datetime,
	s7_1 int,
	a7_2 datetime,
	s7_2 int,
	a8_1 datetime,
	s8_1 int,
	a8_2 datetime,
	s8_2 int,
	a9_1 datetime,
	s9_1 int,
	a9_2 datetime,
	s9_2 int,
	a10_1 datetime,
	s10_1 int,
	a10_2 datetime,
	s10_2 int,
	a11_1 datetime,
	s11_1 int,
	a11_2 datetime,
	s11_2 int,
	a12_1 datetime,
	s12_1 int,
	a12_2 datetime,
	s12_2 int,
	a13_1 datetime,
	s13_1 int,
	a13_2 datetime,
	s13_2 int,
	a14_1 datetime,
	s14_1 int,
	a14_2 datetime,
	s14_2 int,
	a15_1 datetime,
	s15_1 int,
	a15_2 datetime,
	s15_2 int,
	a16_1 datetime,
		s16_1 int,
	a16_2 datetime,
		s16_2 int,
	a17_1 datetime,
		s17_1 int,
	a17_2 datetime,
		s17_2 int,
	a18_1 datetime,
	s18_1 int,
	a18_2 datetime,
	s18_2 int,
	a19_1 datetime,
	s19_1 int,
	a19_2 datetime,
	s19_2 int,
	a20_1 datetime,
	s20_1 int,
	a20_2 datetime,
	s20_2 int,
	a21_1 datetime,
	s21_1 int,
	a21_2 datetime,
	s21_2 int,
	a22_1 datetime,
	s22_1 int,
	a22_2 datetime,
	s22_2 int,
	a23_1 datetime,
	s23_1 int,
	a23_2 datetime,
	s23_2 int,
	a24_1 datetime,
	s24_1 int,
	a24_2 datetime
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值