OPenQQ在群发信息时会导致服务端出现错误,导致所有人断线,有办法解决吗?至少在出错后服务端能自动重启吗?
If MainTable.Name = ("下单表") Then
If qqclient.Ready = True Then
If user.Roles Like "*管理*" OrElse user.Roles Like "*订单计划员*" Then
Dim dt As DataTable = DataTables("下单表")
For Each dr As DataRow In dt.DataRows
Dim p As String = IIF(dr.RowState = DataRowState.Added, "A#",IIF(dr.RowState = DataRowState.Modified, "U#", ""))
dr.Save()
'一定要在保存后合成信息,因为新增行的主键在保存后才生成
Dim msg As String = p & "生产跟进" & "#" & dr("_Identify")
Dim msg2 As String
If p = "A#" Then
msg2 = Date.Now & user.Group & user.Name & "新增了[" & dr("生产部") & "][" & dr("分类") & "]分类,款号[" & dr("款号") & "]的[" & dr("色号称") & "]色订单,请注意查看!"
If dr("生产组长") = Nothing AndAlso dr("生产跟单") = Nothing AndAlso dr("生产理单") = Nothing AndAlso dr("生产主管") = Nothing Then
If dr("生产部") = "生产一部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产一部*" Then
QQClient.Send(bd.name, msg)
QQClient.SendChatMessage(bd.name, msg2)
End If
Next
ElseIf dr("生产部") = "生产二部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产二部*" Then
QQClient.Send(bd.name, msg)
QQClient.SendChatMessage(bd.name, msg2)
End If
Next
End If
Else
If dr("生产组长") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产组长"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产组长"), msg2)
End If
If dr("生产理单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产理单"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产理单"), msg2)
End If
If dr("生产跟单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产跟单"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产跟单"), msg2)
End If
If dr("生产主管") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产主管"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产主管"), msg2)
End If
If dr("辅料员") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("辅料员"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("辅料员"), msg2)
End If
End If
ElseIf p = "U#" Then
' Dim aa As String = dr.SQLGetValue("记录").toString
If dr("记录") <> Nothing
msg2 = "[" & dr("分类") & "]分类款号[" & dr("款号") & "]的[" & dr("色号称") & "]色订单有修改:" & vbcrlf & dr("记录")
If dr("生产组长") = Nothing AndAlso dr("生产跟单") = Nothing AndAlso dr("生产理单") = Nothing AndAlso dr("生产主管") = Nothing Then
If dr("生产部") = "生产一部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产一部*" Then
QQClient.Send(bd.name, msg)
QQClient.SendChatMessage(bd.name, msg2)
End If
Next
ElseIf dr("生产部") = "生产二部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产二部*" Then
QQClient.Send(bd.name, msg)
QQClient.SendChatMessage(bd.name, msg2)
End If
Next
End If
Else
If dr("生产组长") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产组长"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产组长"), msg2)
End If
If dr("生产理单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产理单"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产理单"), msg2)
End If
If dr("生产跟单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产跟单"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产跟单"), msg2)
End If
If dr("生产主管") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产主管"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("生产主管"), msg2)
End If
If dr("辅料员") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("辅料员"), msg)
QQClient.SendChatMessage(dr("生产部") & "." & dr("辅料员"), msg2)
End If
End If
Else
If dr("生产组长") = Nothing AndAlso dr("生产跟单") = Nothing AndAlso dr("生产理单") = Nothing AndAlso dr("生产主管") = Nothing Then
If dr("生产部") = "生产一部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产一部*" Then
QQClient.Send(bd.name, msg)
End If
Next
ElseIf dr("生产部") = "生产二部"
For Each bd As QQBuddy In QQClient.Buddies
If bd.Name Like "*生产二部*" Then
QQClient.Send(bd.name, msg)
End If
Next
End If
Else
If dr("生产组长") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产组长"), msg)
End If
If dr("生产理单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产理单"), msg)
End If
If dr("生产跟单") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产跟单"), msg)
End If
If dr("生产主管") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("生产主管"), msg)
End If
If dr("辅料员") <> Nothing Then
QQClient.Send(dr("生产部") & "." & dr("辅料员"), msg)
End If
End If
End If
End If
Next
End If
End If
End If