⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmfullunpack.frm

📁 一个完整的非接触IC卡会员管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
'''''                !Operate_id = psRybh
''''                !Mac = "ABCDDBCA"
''''                !bussinesstype = piBusinessType
''''                .Update
''''            End With
''''            poAddmoney_tmp.Close
''''            strRecordSum.Caption = Val(strRecordSum.Caption) + 1
''''        End If
''''
''''        ''''''''''''''''''''''''''''''''''''''''''对已解包记录做标记
''''        pssql = "update LinkAddmoneyBuffer set R_send='09' where M1_CardID='" & plCardID & "' and M1_Cdate='" & plCdate & "' and M1_Ctime='" & plCtime & "'"
''''        maSys_db.Execute pssql
''''
''''        rs.MoveNext
''''    Loop
''''''    '根据后缀名解不同的包
''''''    If Right(File1.FileName, 3) = "ful" Or Right(File1.FileName, 3) = "dat" Then
''''''
''''''        If Right(File1.FileName, 3) = "ful" Then GoTo doforful '
''''''        On Error GoTo err1
''''''        Open psPathFile For Binary Access Read Lock Read As #1
''''''        'Get #1, , pbIn '充值包
''''''        'psFileHead = hex_to_char(pbIn(), 28)
''''''        Dim iABCD As Integer
''''''        Do While Not EOF(1)
''''''            Get #1, , pbIn
''''''            piRet = MWactiveX1.Hex_To_Asc(pbIn(0), psIn, 28)
''''''            Select Case pbIn(9)
''''''                Case 80, 87 '钱包交易
''''''                    plCardNO = pbIn(3) * L * L * L + pbIn(2) * L * L + pbIn(1) * L + pbIn(0)
''''''                    plOrderId = pbIn(7) * L * L * L + pbIn(6) * L * L + pbIn(5) * L + pbIn(4)
''''''                    piCardType = pbIn(8)
''''''                    piBusinessType = pbIn(9)
''''''                    'piTotleBusinessTimes = pbIn(11) * L + pbIn(10)
''''''                    plOldMoney = pbIn(12) + pbIn(13) * L + pbIn(14) * L * L + pbIn(15) * L * L * L
''''''                    plBusinessMoney = pbIn(16) + pbIn(17) * L + pbIn(18) * L * L
''''''                    pdDatetime = Mid(psIn, 39, 4) + "-" + Mid(psIn, 43, 2) + "-" + Mid(psIn, 45, 2) + " " + Mid(psIn, 47, 2) + ":" + Mid(psIn, 49, 2) + ":" + Mid(psIn, 51, 2)
''''''
''''''                    With poAddmoney_tmp
''''''                        .AddNew
''''''                        !Motorist_id = plCardNO
''''''                        !Ic_id = piCardType
''''''                        !Consume_date = pdDatetime
''''''                        !DEPT_ID = psDept_id
''''''                        !EQUIP_ID = Mid(psFileHead, 15, 9)
''''''                        If pbIn(9) = 80 Then
''''''                           !add_MONEY = plBusinessMoney / 100
''''''                           !Balance = (plOldMoney + plBusinessMoney) / 100
''''''                        Else
''''''                           !add_MONEY = -plBusinessMoney / 100
''''''                           !Balance = (plOldMoney - plBusinessMoney) / 100
''''''                        End If
''''''                        !CONSUME_NUM = 0
''''''                        !SURPLUS_NUM = 0
''''''                        !VALID = "2050-12-31"
''''''                        !balance_oid = 0
''''''                        !Operate_id = psRybh
''''''                        !Mac = Space(8)
''''''                        !bussinesstype = piBusinessType
''''''                        !PCName = ComputerName
''''''                        .Update
''''''                    End With
''''''                Case 100, 101 '员工卡任一次数
''''''                    plCardNO = pbIn(3) * L * L * L + pbIn(2) * L * L + pbIn(1) * L + pbIn(0)
''''''                    plOrderId = pbIn(7) * L * L * L + pbIn(6) * L * L + pbIn(5) * L + pbIn(4)
''''''                    piCardType = pbIn(8)
''''''                    piBusinessType = pbIn(9)
''''''                    'piTotleBusinessTimes = pbIn(11) * L + pbIn(10) '
''''''                    plOldTimes = pbIn(12) + pbIn(13) * L + pbIn(14) * L * L + pbIn(15) * L * L * L
''''''                    plBusinessTimes = pbIn(16) + pbIn(17) * L + pbIn(18) * L * L
''''''                    pdDatetime = Mid(psIn, 39, 4) + "-" + Mid(psIn, 43, 2) + "-" + Mid(psIn, 45, 2) + " " + Mid(psIn, 47, 2) + ":" + Mid(psIn, 49, 2) + ":" + Mid(psIn, 51, 2)
''''''                    pdValidityDate = Format(Mid(psIn, 53, 2) + "-" + Mid(psIn, 55, 2) + "-" + "01", "yyyy-mm-dd")
''''''                    With poAddmoney_tmp
''''''                        .AddNew
''''''                        !Ic_id = piCardType
''''''                        !Motorist_id = plCardNO
''''''                        !Consume_date = pdDatetime
''''''                        !DEPT_ID = psDept_id
''''''                        !EQUIP_ID = Mid(psFileHead, 15, 9)
''''''                        !add_MONEY = 0
''''''                        If pbIn(9) = 100 Then
''''''                            !CONSUME_NUM = plBusinessTimes
''''''                            !SURPLUS_NUM = plBusinessTimes + plOldTimes
''''''                        Else
''''''                            !CONSUME_NUM = -plBusinessTimes
''''''                            !SURPLUS_NUM = plBusinessTimes - plOldTimes
''''''                        End If
''''''                        !Balance = 0
''''''                        !VALID = pdValidityDate
''''''                        !balance_oid = 0
''''''                        !Operate_id = psRybh
''''''                        !Mac = Space(8)
''''''                        !bussinesstype = piBusinessType
''''''                        !PCName = ComputerName
''''''                        .Update
''''''                    End With
''''''
''''''
''''''                Case 81, 88 '月票交易
''''''                    plCardNO = pbIn(3) * L * L * L + pbIn(2) * L * L + pbIn(1) * L + pbIn(0)
''''''                    plOrderId = pbIn(7) * L * L * L + pbIn(6) * L * L + pbIn(5) * L + pbIn(4)
''''''                    piCardType = pbIn(8)
''''''                    piBusinessType = pbIn(9)
''''''                    'piTotleBusinessTimes = pbIn(11) * L + pbIn(10) '
''''''                    plOldTimes = pbIn(12) + pbIn(13) * L + pbIn(14) * L * L + pbIn(15) * L * L * L
''''''                    plBusinessTimes = pbIn(16) + pbIn(17) * L + pbIn(18) * L * L
''''''                    pdDatetime = Mid(psIn, 39, 4) + "-" + Mid(psIn, 43, 2) + "-" + Mid(psIn, 45, 2) + " " + Mid(psIn, 47, 2) + ":" + Mid(psIn, 49, 2) + ":" + Mid(psIn, 51, 2)
''''''                    pdValidityDate = Format(Mid(psIn, 53, 2) + "-" + Mid(psIn, 55, 2) + "-" + "01", "yyyy-mm-dd")
''''''                    With poAddmoney_tmp
''''''                        .AddNew
''''''                        !Ic_id = piCardType
''''''                        !Motorist_id = plCardNO
''''''                        !Consume_date = pdDatetime
''''''                        !DEPT_ID = psDept_id
''''''                        !EQUIP_ID = Mid(psFileHead, 15, 9)
''''''                        !add_MONEY = 0
''''''                        If pbIn(9) = 81 Then
''''''                            !CONSUME_NUM = plBusinessTimes
''''''                            !SURPLUS_NUM = plBusinessTimes + plOldTimes
''''''                        Else
''''''                            !CONSUME_NUM = -plBusinessTimes
''''''                            !SURPLUS_NUM = plBusinessTimes - plOldTimes
''''''                        End If
''''''                        !Balance = 0
''''''                        !VALID = pdValidityDate
''''''                        !balance_oid = 0
''''''                        !Operate_id = psRybh
''''''                        !Mac = Space(8)
''''''                        !bussinesstype = piBusinessType
''''''                        !PCName = ComputerName
''''''                        .Update
''''''                    End With
''''''
''''''                Case 82 '售卡交易
''''''                    plCardNO = pbIn(3) * L * L * L + pbIn(2) * L * L + pbIn(1) * L + pbIn(0)
''''''                    plOrderId = pbIn(7) * L * L * L + pbIn(6) * L * L + pbIn(5) * L + pbIn(4)
''''''                    piCardType = pbIn(8)
''''''                    piBusinessType = pbIn(9)
''''''                    'piTotleBusinessTimes = pbIn(11) * L + pbIn(10)
''''''                    plOldMoney = pbIn(12) + pbIn(13) * L + pbIn(14) * L * L + pbIn(15) * L * L * L
''''''                    plBusinessMoney = pbIn(16) + pbIn(17) * L + pbIn(18) * L * L
''''''                    pdDatetime = Mid(psIn, 39, 4) + "-" + Mid(psIn, 43, 2) + "-" + Mid(psIn, 45, 2) + " " + Mid(psIn, 47, 2) + ":" + Mid(psIn, 49, 2) + ":" + Mid(psIn, 51, 2)
''''''                    pdValidityDate = CStr(2000 + pbIn(26) \ 12) + "-" + CStr(1 + pbIn(26) Mod 12) + "-" + CStr(pbIn(27))
''''''
''''''                    With poSellIC_tmp
''''''                        .AddNew
''''''                        !Motorist_id = plCardNO
''''''                        !BUY_DATE = pdDatetime
''''''                        !END_DATE = "2050-12-31"
''''''                        !ic_id1 = piCardType
''''''                        !valid1 = pdValidityDate
''''''                        !ic_id2 = piCardType
''''''                        !valid2 = pdValidityDate
''''''                        !DEPOSIT = plBusinessMoney / 100
''''''                        !approve = ""
''''''                        !IC_NUM = 1
''''''                        !Operate_id = psRybh
''''''                        !PCName = ComputerName
''''''                        .Update
''''''                    End With
''''''
''''''                Case 86 '充值员登记
''''''                    plFullNO = Left(psIn, 8) '(pbIn(3) * L * L * L + pbIn(2) * L * L + pbIn(1) * L + pbIn(0)
''''''                    poEmp.Open "select proposer from controlic_dict where controlic_id='" & plFullNO & "' and state_date=(select max(state_date) from controlic_dict where controlic_id='" & plFullNO & "')", cn, adOpenStatic, adLockPessimistic
''''''                    If Not poEmp.EOF And Not poEmp.BOF Then
''''''                        psRybh = poEmp!proposer
''''''                    End If
''''''                    poEmp.Close
''''''                    poEmp.Open "select dept_id from operate_dict where operate_id='" & psRybh & "'", cn, adOpenStatic, adLockPessimistic
''''''                    If Not poEmp.EOF And Not poEmp.BOF Then
''''''                        psDept_id = poEmp!DEPT_ID
''''''                    End If
''''''                    poEmp.Close
''''''            End Select
''''''
''''''            iABCD = iABCD + 1
''''''            If iABCD = 223 Then
''''''                iABCD = 223
''''''            End If
''''''        Loop
''''''        Close #1
''''''        On Error GoTo err2
''''''        cn.Execute "pSellDateUnpack '" & ComputerName & "'", 64
''''''doforful:
''''''        On Error GoTo err1
''''''        If Option3 Then
''''''           FileCopy psPathFile, goComm.bf_tod_ful_path + File1.FileName
''''''        Else
''''''           FileCopy psPathFile, goComm.bf_his_fh_path + File1.FileName
''''''        End If
''''''        Kill psPathFile
''''''        Exit Sub
''''''err1:
''''''        MsgBox err.Description, vbCritical, "系统提示"
''''''        Close #1
''''''        Me.MousePointer = 0
''''''        Exit Sub
''''''err2:
''''''        MsgBox err.Description, vbCritical, "系统提示"
''''''        If Option3 Then
''''''           FileCopy psPathFile, goComm.err_tod_ful_path + File1.FileName
''''''        Else
''''''           FileCopy psPathFile, goComm.err_his_fh_path + File1.FileName
''''''        End If
''''''        Kill psPathFile
''''''        Close #1
''''''        Exit Sub
''''''
''''''Else
''''''    Dim rs As New ADODB.Recordset
''''''    Dim rsTemp As New ADODB.Recordset
''''''    Dim piRecordLine As Integer
''''''    Dim strRecord(7) As String
''''''    Dim MyRecord As String
''''''
''''''    rs.Open "select * from UserInfo_dict where 1>2", cn, 3, 3
''''''
''''''
''''''    Open psPathFile For Input As #110
''''''    Do While Not EOF(110)
''''''        iIndex = 0
''''''        piRecordLine = piRecordLine + 1
''''''        Line Input #110, MyRecord
''''''        For i = 1 To Len(MyRecord)
''''''            Select Case Mid(MyRecord, i, 1)
''''''            Case vbTab
''''''                strRecord(iIndex) = Record
''''''                Record = ""
''''''                iIndex = iIndex + 1
''''''            Case Else
''''''                Record = Record + Mid(MyRecord, i, 1)
''''''            End Select
''''''        Next i
''''''
''''''        strRecord(iIndex) = Record
''''''
''''''        If piRecordLine < 2 Then
''''''            rsTemp.Open "select top 1 * from userinfo_dict where motorist_id='" & strRecord(0) & "' and Consume_date='" & strRecord(4) & "' and state='售卡' ", cn, 1, 1
''''''            If rsTemp.RecordCount > 0 Then
''''''                rsTemp.Close
''''''                GoTo exitRecord
''''''            End If
''''''            rsTemp.Close
''''''        End If
''''''       '卡号(8),卡类(2),姓名(14),住址(25),时间(2004-12-27 16:44:23),证件号(18),充值员号(8)
''''''        With rs
''''''            .AddNew
''''''            !Motorist_id = strRecord(0)
''''''            !Ic_id = strRecord(1)
''''''            !Name = Trim(strRecord(2))
''''''            !Address = Trim(strRecord(3))
''''''            !Consume_date = strRecord(4)
''''''            !Company = ""
''''''            !School = ""
''''''            !Paper_id = Trim(strRecord(5))
''''''            !State = "售卡"
''''''            !Operate_id = strRecord(6)
''''''            .Update
''''''        End With
''''''    Loop
''''''    Close #110
''''''    rs.Close
''''''
''''''exitRecord:
''''''    If Option3 Then
''''''       FileCopy psPathFile, goComm.bf_tod_ful_path + File1.FileName
''''''    Else
''''''       FileCopy psPathFile, goComm.bf_his_fh_path + File1.FileName
''''''    End If
''''''    Kill psPathFile
''''''    Close #110
''''''    Exit Sub
''''''End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
If Timer1.Enabled = True Then
      MsgBox "就餐状态,要先暂停后才能关闭!", vbCritical + vbOKOnly, "警告"
      Cancel = 1
      
End If
quit
End Sub

Private Sub Timer1_Timer()
Me.MousePointer = 11
Call FullUnpack
Me.MousePointer = 0
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -