📄 fmkqfx.frm
字号:
Password = ""
RecordSource = ""
Caption = "Adckq"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 3720
TabIndex = 2
Top = 4680
Width = 735
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1080
TabIndex = 1
Top = 4680
Width = 735
End
Begin MSComctlLib.ProgressBar PBar2
Height = 255
Left = 1200
TabIndex = 8
Top = 3960
Width = 6015
_ExtentX = 10610
_ExtentY = 450
_Version = 393216
Appearance = 1
End
Begin MSComctlLib.ProgressBar PBar1
Height = 255
Left = 1200
TabIndex = 9
Top = 3600
Width = 6015
_ExtentX = 10610
_ExtentY = 450
_Version = 393216
Appearance = 1
End
Begin VB.Label Label4
Caption = "总体进度"
Height = 255
Left = 360
TabIndex = 11
Top = 3960
Width = 735
End
Begin VB.Label Label3
Caption = "处理进度"
Height = 255
Left = 360
TabIndex = 10
Top = 3600
Width = 735
End
Begin VB.Label Label2
Caption = "结束日期"
BeginProperty Font
Name = "楷体_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 7
Top = 600
Width = 975
End
Begin VB.Label Label1
Caption = "输入开始日期"
BeginProperty Font
Name = "仿宋_GB2312"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 0
Top = 600
Width = 1575
End
End
Attribute VB_Name = "Fmkqfx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim response
Private Sub Command1_Click()
Dim vzgid, vbanl, vbmid, vbid, vdate1, vdate2, vdate3, vdate
Dim i, j, count, vdays, vbstime, vbetime, vstime, vetime, vbanlid, mtime
Dim vweek, vfast, vlast As Integer
If Textdate1.Text = "" Or Textdate2.Text = "" Then
response = MsgBox("请输入日期", vbOKOnly, "没有输入日期")
If response = vbOK Then
Textdate1.SetFocus
End If
Else
vdate1 = CDate(Textdate1.Text) '读取日期
vdate3 = CDate(Textdate2.Text)
vdays = vdate3 - vdate1 + 1
Adczg.RecordSource = "select * from TZG where jobcid<10"
Adczg.Refresh
count = Adczg.Recordset.RecordCount
PBar2.Max = count
PBar2.Min = 0
PBar2.Value = 0
j = 0
Do While Not (Adczg.Recordset.EOF)
vzgid = Adczg.Recordset.Fields("zgid").Value
vbmid = Adczg.Recordset.Fields("bmid").Value
vbanlid = Adczg.Recordset.Fields("banlid").Value
vdate1 = CDate(Textdate1.Text) '读取日期
PBar1.Max = vdays
PBar1.Min = 0
PBar1.Value = 0
i = 0
Do While vdate1 <= vdate3 '日期正确性检查
'Adcbanstype.RecordSource = "select * from banstype where banlid='01'"
'Adcbanstype.Refresh
'If Not Adcbanstype.Recordset.EOF Then
'vbid = Adcbanstype.Recordset.Fields("bid").Value
'vbstime = Adcbanstype.Recordset.Fields("bstime").Value
'vbetime = Adcbanstype.Recordset.Fields("betime").Value
'End If
Adckq.RecordSource = "select * from kqrecord where kqdate='" & vdate1 & "'and zgid='" & vzgid & "'order by kqtime "
Adckq.Refresh
vstime = 0
vetime = 0
If Not Adckq.Recordset.EOF Then '如果存在记录
If vbanlid = "01" Then '属于白班类
If Adckq.Recordset.RecordCount > 1 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
Adckq.Recordset.MoveLast
vetime = Adckq.Recordset.Fields("kqtime").Value
End If
If Adckq.Recordset.RecordCount = 1 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
End If
vbid = "A01"
End If
If vbanlid = "02" Then
If Adckq.Recordset.RecordCount > 1 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
Adckq.Recordset.MoveLast
vetime = Adckq.Recordset.Fields("kqtime").Value
vbid = "B01"
End If
If Adckq.Recordset.RecordCount = 1 Then
If Adckq.Recordset.Fields("timeh").Value < 12 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "B01"
Else
vdate = vdate1 + 1
Adodc1.RecordSource = "select * from kqrecord where kqdate='" & vdate & "'and zgid='" & vzgid & "'and timeh<6 order by kqtime"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = Adodc1.Recordset.Fields("kqtime").Value
vbid = "B02"
Else
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "B02"
End If
End If
End If
End If
If vbanlid = "03" Then
If Adckq.Recordset.RecordCount > 1 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
Adckq.Recordset.MoveLast
vetime = Adckq.Recordset.Fields("kqtime").Value
If vstime < 720 Then
vbid = "C01"
Else
vbid = "C02"
End If
End If
If Adckq.Recordset.RecordCount = 1 Then
If Adckq.Recordset.Fields("timeh").Value < 22 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "C01"
Else
vdate = vdate1 + 1
Adodc1.RecordSource = "select * from kqrecord where kqdate='" & vdate & "'and zgid='" & vzgid & "'and timeh<8 order by kqtime"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = Adodc1.Recordset.Fields("kqtime").Value
vbid = "C03"
Else
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "C03"
End If
End If
End If
End If
If vbanlid = "04" Then
If Adckq.Recordset.RecordCount > 1 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
Adckq.Recordset.MoveLast
vetime = Adckq.Recordset.Fields("kqtime").Value
vbid = "D01"
End If
If Adckq.Recordset.RecordCount = 1 Then
If Adckq.Recordset.Fields("timeh").Value < 12 Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "D01"
Else
vdate = vdate1 + 1
Adodc1.RecordSource = "select * from kqrecord where kqdate='" & vdate & "'and zgid='" & vzgid & "'and timeh<9 order by kqtime"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = Adodc1.Recordset.Fields("kqtime").Value
vbid = "D02"
Else
vstime = Adckq.Recordset.Fields("kqtime").Value
vetime = vstime
vbid = "D02"
End If
End If
End If
End If
Adcfx.RecordSource = "select * from worktime where workdate='" & vdate1 & "' and zgid='" & vzgid & "'"
Adcfx.Refresh
If Adcfx.Recordset.EOF Then
Adcfx.Recordset.AddNew
Adcfx.Recordset.Fields("zgid").Value = vzgid
Adcfx.Recordset.Fields("bmid").Value = vbmid
Adcfx.Recordset.Fields("starttime").Value = vstime
Adcfx.Recordset.Fields("endtime").Value = vetime
Adcfx.Recordset.Fields("bid").Value = vbid
Adcbanstype.RecordSource = "select * from banstype where bid='" & vbid & "'"
Adcbanstype.Refresh
If Not Adcbanstype.Recordset.EOF Then
vbstime = Adcbanstype.Recordset.Fields("bstime").Value
vbetime = Adcbanstype.Recordset.Fields("bendtime").Value
End If
If vstime = vetime Then
Adcfx.Recordset.Fields("losskqid").Value = 1
Else
Adcfx.Recordset.Fields("losskqid").Value = 0
End If
Adcfx.Recordset.Fields("workdate").Value = vdate1
Adcfx.Recordset.Fields("bstime").Value = vbstime
Adcfx.Recordset.Fields("bendtime").Value = vbetime
vweek = Weekday(vdate1, 2)
If vweek <> 6 And vweek <> 7 Then
If vstime > vbstime Then
vlast = 1
Else
vlast = 0
End If
If vetime < vbetime Then
vfast = 1
Else
vfast = 0
End If
End If
Adcfx.Recordset.Fields("klast").Value = vlast
Adcfx.Recordset.Fields("kfast").Value = vfast
Adcfx.Recordset.Fields("kweek").Value = vweek
Adcfx.Recordset.Update
End If
End If
vdate1 = vdate1 + 1
i = i + 1
PBar1.Value = i
Loop
Adczg.Recordset.MoveNext
j = j + 1
PBar2.Value = j
Loop
End If
End Sub
Private Sub Textdate11_Change()
End Sub
Private Sub Textdate11_KeyPress(KeyAscii As Integer)
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Dim vdate1, vdate2, vdate
Dim vcount, j
Dim vzgid, vtime, vstime, vetime, vastime, vaetime, vh
If Not IsDate(Textdate1.Text) Or Not IsDate(Textdate2.Text) Then
response = MsgBox("请输入日期", vbOKOnly, "没有输入日期")
If response = vbOK Then
Textdate1.SetFocus
End If
Else
vdate1 = CDate(Textdate1.Text) '读取日期
vdate2 = CDate(Textdate2.Text)
Adcwrite.RecordSource = "select * from kqwrite where wdate>='" & vdate1 & "' and wdate<='" & vdate2 & "'and (kqlid='A1' OR kqlid='A2' OR kqlid='A3' )"
Adcwrite.Refresh
vcount = 1
vcount = Adcwrite.Recordset.RecordCount
PBar2.Max = vcount
PBar2.Min = 0
PBar2.Value = 0
j = 0
Do While Not Adcwrite.Recordset.EOF
vzgid = Adcwrite.Recordset.Fields("zgid").Value
vdate = Adcwrite.Recordset.Fields("wdate").Value
Adcfx.RecordSource = "select * from worktime where zgid='" & vzgid & "' and workdate='" & vdate & "'"
Adcfx.Refresh
If Not Adcfx.Recordset.EOF Then
vstime = Adcfx.Recordset.Fields("starttime").Value
vetime = Adcfx.Recordset.Fields("endtime").Value
vastime = Adcwrite.Recordset.Fields("stime").Value
vaetime = Adcwrite.Recordset.Fields("etime").Value
If vstime <= vastime And vetime >= vaetime Then
Adcfx.Recordset.Fields("atime").Value = Adcwrite.Recordset.Fields("ctime").Value '加班时,考勤类
Adcfx.Recordset.Fields("kqlid").Value = Adcwrite.Recordset.Fields("kqlid").Value
Adcfx.Recordset.Update
Else
vh = Round((vetime - vstime - vaetime + vastime) / 60, 1)
Adcfx.Recordset.Fields("atime").Value = Adcwrite.Recordset.Fields("ctime").Value - vh
Adcfx.Recordset.Fields("kqlid").Value = Adcwrite.Recordset.Fields("kqlid").Value
Adcfx.Recordset.Update
End If
End If
Adcwrite.Recordset.MoveNext
j = j + 1
PBar2.Value = j
Loop
End If
End Sub
Private Sub Textdate1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textdate2.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -