📄 frm_kaoqihesuan2.frm
字号:
bgnwktm3 = CStr(d) & " " & Mid(adoPrimaryRS3.Fields("bgnwktm3").Value, 11)
bgntm3 = CStr(d) & " " & Mid(adoPrimaryRS3.Fields("bgntm3").Value, 11)
endtm3 = CStr(d) & " " & Mid(adoPrimaryRS3.Fields("endtm3").Value, 11)
endwktm3 = CStr(d) & " " & Mid(adoPrimaryRS3.Fields("endwktm3").Value, 11)
bgntm11 = DateAdd("n", 60, bgntm1)
bgntm22 = DateAdd("n", 60, bgntm2)
Dim bgntm111 As Date
bgntm111 = DateAdd("n", 180, bgntm1)
fromD = bgnwktm1
toD = DateAdd("d", 1, fromD)
' Debug.Print bgnwktm1
' Debug.Print bgntm1
' Debug.Print endtm1
' Debug.Print endwktm1
Dim Dtmp As Date
Dim iDtmp As Long
Dtmp = "00:00:00"
Maxid = Maxid + 1
adoPrimaryRS5.AddNew
adoPrimaryRS5.Fields("ID").Value = Maxid
adoPrimaryRS5.Fields("dptid").Value = .Fields("dptid").Value
adoPrimaryRS5.Fields("dptname").Value = .Fields("dptname").Value
adoPrimaryRS5.Fields("emplyid").Value = .Fields("emplyid").Value
adoPrimaryRS5.Fields("emplyname").Value = .Fields("emplyname").Value
adoPrimaryRS5.Fields("caldate").Value = d
adoPrimaryRS5.Fields("wktmid").Value = adoPrimaryRS3.Fields("wktmid").Value
adoPrimaryRS5.Fields("wktmname").Value = adoPrimaryRS3.Fields("wktmdecs").Value '''班次名称
adoPrimaryRS5.Fields("standwktm").Value = adoPrimaryRS3.Fields("hours").Value '''标准工时
adoPrimaryRS5.Fields("wktmbg1").Value = d '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg1").Value = "00:00:00" ''''上班刷卡
adoPrimaryRS5.Fields("latertime1").Value = 0 '''' 迟到时间
'adoPrimaryRS5.Fields("wktmbg1dec").Value = 上班描述
adoPrimaryRS5.Fields("wktmend1").Value = d ''''下班时间
adoPrimaryRS5.Fields("drawtmend1").Value = "00:00:00" '''下班刷卡
adoPrimaryRS5.Fields("earlytime1").Value = 0 '''' 早退时间
'adoPrimaryRS5.Fields("wktmend1dec").Value = 下班描述
adoPrimaryRS5.Fields("wktmbg2").Value = d '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg2").Value = "00:00:00" ''''上班刷卡
adoPrimaryRS5.Fields("latertime2").Value = 0 '''' 迟到时间
'adoPrimaryRS5.Fields("wktmbg2dec").Value = 上班描述
adoPrimaryRS5.Fields("wktmend2").Value = d ''''下班时间
adoPrimaryRS5.Fields("drawtmend2").Value = "00:00:00" '''下班刷卡
adoPrimaryRS5.Fields("earlytime2").Value = 0 '''' 早退时间
'adoPrimaryRS5.Fields("wktmend2dec").Value = 下班描述
adoPrimaryRS5.Fields("wktmbg3").Value = d '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg3").Value = "00:00:00" ''''上班刷卡
adoPrimaryRS5.Fields("latertime3").Value = 0 '''' 迟到时间
'adoPrimaryRS5.Fields("wktmbg3dec").Value = 上班描述
adoPrimaryRS5.Fields("wktmend3").Value = d ''''下班时间
adoPrimaryRS5.Fields("drawtmend3").Value = "00:00:00" '''下班刷卡
adoPrimaryRS5.Fields("earlytime3").Value = 0 '''' 早退时间
'adoPrimaryRS5.Fields("wktmend3dec").Value = 下班描述
adoPrimaryRS5.Fields("wktmbg4").Value = d '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg4").Value = "00:00:00" ''''上班刷卡
adoPrimaryRS5.Fields("latertime4").Value = 0 '''' 迟到时间
'adoPrimaryRS5.Fields("wktmbg4dec").Value = 上班描述
adoPrimaryRS5.Fields("wktmend4").Value = d ''''下班时间
adoPrimaryRS5.Fields("drawtmend4").Value = "00:00:00" '''下班刷卡
adoPrimaryRS5.Fields("earlytime4").Value = 0 '''' 早退时间
'adoPrimaryRS5.Fields("wktmend4dec").Value = 下班描述
adoPrimaryRS5.Fields("bgnovertime").Value = "00:00:00" ''''加班开始时间
adoPrimaryRS5.Fields("endovertime").Value = "00:00:00" ''''加班结束时间
adoprimaryRS4.Filter = "emplyid='" & .Fields("emplyid").Value & "' and cdatetime>'" & fromD & "' and cdatetime<'" & toD & "'"
'Debug.Print adoPrimaryRS4.RecordCount
If adoprimaryRS4.RecordCount Then '''''每人每天的刷卡记录数
iJS = adoprimaryRS4.RecordCount
n = 0
adoprimaryRS4.MoveFirst
For JJ = 0 To adoprimaryRS4.RecordCount - 1
iDtmp = DateDiff("n", Dtmp, adoprimaryRS4.Fields("cdatetime").Value)
If iDtmp > iFen And iDtmp < 10 Then
''n = n + 1
'GoTo Goto2
End If
n = n + 1
'Dim indexN As Integer
'Dim Dtime As Date
'If adoPrimaryRS4.Fields("cdatetime").Value > endtm1 And n = 1 Then
'n = 3
'End If
Dim b1 As Boolean '''''''有上午上班记录;
Dim b11 As Boolean '''''''上午上班迟到;
Dim b2 As Boolean
Dim b22 As Boolean
Dim b3 As Boolean
Dim b33 As Boolean
Dim b4 As Boolean
Dim b44 As Boolean
Dim b5 As Boolean
Dim b55 As Boolean
Dim b6 As Boolean
Dim b66 As Boolean
Dim tmpMemo As String
Dim bw1 As Boolean '''''''无上午上班记录;
Dim bw2 As Boolean '''''''无下午上班记录;
Dim bw23 As Boolean ''''早晚两次刷卡
Dim by As Boolean ''''中午和晚两次刷卡(因为早上无刷卡,中午(下班,下午上班)均记为上午下班;如果下午下班有刷卡,即记下午工时;)
Dim gs_ZG As Single
Dim gs_SJ As Single
Dim gs_SJJB As Single
Dim iLaterT As Integer
Dim iEarlyT As Integer
GoTo1:
iLaterT = 0
iEarlyT = 0
Select Case n
'''''''''''''\\\\\\\\\\\\\\\******************/////////////////////////
'''''''''''''\\\\\\\\\\\\\\\******************/////////////////////////
Case 1
If adoprimaryRS4.Fields("cdatetime").Value > bgntm111 Then
n = n + 1
bw1 = True
b1 = False
tmpMemo = tmpMemo & "未刷1;"
GoTo GoTo1
End If
If adoprimaryRS4.Fields("cdatetime").Value <= bgntm1 Then
''''1
adoPrimaryRS5.Fields("wktmbg1").Value = bgntm1 '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg1").Value = adoprimaryRS4.Fields("cdatetime").Value ''''上班刷卡
adoPrimaryRS5.Fields("latertime1").Value = 0 '''' 迟到时间
'adoPrimaryRS5.Fields("wktmbg1dec").Value = 上班描述
'adoPrimaryRS5.Fields("wktmend1").Value = 下班时间
'adoPrimaryRS5.Fields("drawtmend1").Value = 下班刷卡
'adoPrimaryRS5.Fields("wktmend1dec").Value = 下班描述
'adoPrimaryRS5.Fields("earlytime1").Value = 早退时间
b1 = True
b11 = False
bw1 = False
''''2
''''3
ElseIf adoprimaryRS4.Fields("cdatetime").Value > bgntm1 And adoprimaryRS4.Fields("cdatetime").Value < endtm1 Then
adoPrimaryRS5.Fields("wktmbg1").Value = bgntm1 '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg1").Value = adoprimaryRS4.Fields("cdatetime").Value ''''上班刷卡
iLaterT = DateDiff("n", bgntm1, adoprimaryRS4.Fields("cdatetime").Value) '''' 迟到时间
If iLaterT > tChiDao Then
adoPrimaryRS5.Fields("latertime1").Value = iLaterT '''' DateDiff("n", bgntm1, adoprimaryRS4.Fields("cdatetime").Value) '''' 迟到时间
adoPrimaryRS5.Fields("wktmbg1dec").Value = "迟到"
b1 = True
b11 = True ''''迟到
Else
adoPrimaryRS5.Fields("latertime1").Value = 0 '''' 迟到时间
b1 = True
b11 = False ''''迟到
End If
bw1 = False
ElseIf adoprimaryRS4.Fields("cdatetime").Value > endtm1 Then
adoPrimaryRS5.Fields("wktmbg1").Value = bgntm1 '''' 上班时间
adoPrimaryRS5.Fields("drawtmbg1").Value = "00:00:00" ''''上班刷卡
adoPrimaryRS5.Fields("latertime1").Value = 0 '''' 迟到时间
adoPrimaryRS5.Fields("wktmbg1dec").Value = "无刷卡"
b1 = False
b11 = False
bw1 = True
tmpMemo = tmpMemo & "无刷卡1;"
n = n + 1
GoTo GoTo1
End If
'''''''''''''\\\\\\\\\\\\\\\******************/////////////////////////
'''''''''''''\\\\\\\\\\\\\\\******************/////////////////////////
Case 2
If adoprimaryRS4.Fields("cdatetime").Value < bgntm11 Then
n = n - 2
GoTo Goto2
End If
'''''''''''''''''''''*****************************************
If adoprimaryRS4.Fields("cdatetime").Value >= endtm2 Then
'If adoprimaryRS4.Fields("cdatetime").Value >= DateAdd("n", -60, endtm2) Then
tmpMemo = tmpMemo & "无刷卡2、3;"
bw23 = True
n = 4
GoTo GoTo1
End If
'''''''''''''''''''''*****************************************
'''''''''''''''''''''*****************************************
If adoprimaryRS4.Fields("cdatetime").Value >= DateAdd("n", 30, endtm1) Then
tmpMemo = tmpMemo & "无刷卡2;"
n = 3
GoTo GoTo1
End If
'''''''''''''''''''''*****************************************
If b1 Then
If adoprimaryRS4.Fields("cdatetime").Value < endtm1 Then '''' 早退
''''1
adoPrimaryRS5.Fields("wktmend1").Value = endtm1 ''''下班时间
adoPrimaryRS5.Fields("drawtmend1").Value = adoprimaryRS4.Fields("cdatetime").Value '''下班刷卡
iEarlyT = DateDiff("n", adoprimaryRS4.Fields("cdatetime").Value, endtm1) '''' 早退时间
If iEarlyT > tZaoTui Then
adoPrimaryRS5.Fields("earlytime1").Value = iEarlyT ''''DateDiff("n", adoprimaryRS4.Fields("cdatetime").Value, endtm1) '''' 早退时间
adoPrimaryRS5.Fields("wktmend1dec").Value = "早退"
Else
adoPrimaryRS5.Fields("earlytime1").Value = 0
End If
If bw1 Then
gs_SJ = gs_SJ + 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -