Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

suvorina_tv_razrabotka-podsistemy-monitoringa-sistemy-elektronnogo-dokumentooborota-companymedia-4x_31656

.pdf
Скачиваний:
11
Добавлен:
14.01.2018
Размер:
1.35 Mб
Скачать

NotesDocument, out As DocumentProcessor)

On Error Goto ErrH

Dim nss As New NotesSession Dim setv As NotesView

Dim ssdb As New NotesDatabase("","")

Dim col As NotesDocumentCollection

Dim curdb As NotesDatabase Dim doc As NotesDocument Dim workdoc As NotesDocument Dim ndAbout As NotesDocument Dim dbytv As NotesView

Dim dcol As NotesViewEntryCollection

Dim dnote As NotesViewEntry Dim flag As Boolean

Set setv=db.GetView("(Settings)")

If Not ssdb.OpenByReplicaID(db.Server,setv.GetF irstDocument.SSRepID(0)) Then Error 1000,"НеудалосьоткрытьБДСС"

Set col=ssdb.Search({((FORM="otmet"|form="(o tmet)")&(met!="1")) &replicaid="}&db.ReplicaID &{"& @IsUnavailable($Conflict)},Nothing,0)

Set doc=col.GetFirstDocument

While Not doc Is Nothing

Set doc=col.GetNextDocument(doc)

Wend

Exit Sub

ErrH:

Error Err, Error$ & Chr(10) & Getthreadinfo(1) & " (l." & Erl & ")"

End Sub

Public Sub Report_01(db As NotesDatabase, dbType As String, paramNote As NotesDocument, out As DocumentProcessor)

On Error Goto ErrH

Dim ns As New NotesSession Dim doc As NotesDocument Dim ViewError As NotesView Dim Server As NotesName Dim Flag As Boolean

Dim coll As NoteasDocumentCollection

Dim d As NotesDocument

Dim nd As NotesDocument

Dim t15 As New NotesDateTime("") Dim t30 As New NotesDateTime("") Dim lastmod As NotesDateTime Dim paramtDoc As Integer

Dim paramtProf As Integer

If Isnumeric(paramNote.GetItemValue("LastM odifDoc.Text")(0)) Then

paramtDoc=Cint(paramNote.GetIte

mValue("LastModifDoc.Text")(0)) Else

paramtDoc=0

End If If

Isnumeric(paramNote.GetItemValue("LastM odifProf.Text")(0)) Then

paramtProf=Cint(paramNote.GetIte

mValue("LastModifProf.Text")(0)) Else

paramtProf=0

End If

Flag=False

Call t15.SetNow Call t30.SetNow

If paramtDoc>0 Then

Call t15.AdjustMinute(-

paramtDoc) Else

Call t15.AdjustMinute(-15)

End If

If paramtProf>0 Then

Call t30.AdjustMinute(-

paramtProf) Else

Call t30.AdjustMinute(-30)

End If

Set doc=ns.CurrentDatabase.CreateDocument

doc.ReplicaID=db.ReplicaID Set

Server=ns.CreateName(db.Server)

doc.Server=Server.Canonical

doc.Title=db.Title

Set

ViewError=db.GetView("ConvertationError")

If Not ViewError Is Nothing Then

doc.ViewID=ViewError.UniversalID

71

 

 

End Sub Public Sub Report_02(db As

ViewError.AutoUpdate=False

 

NotesDatabase,

dbType

As

String,

Set

 

paramNote As NotesDocument, out As

d=ViewError.GetFirstDocument

 

DocumentProcessor)

 

 

While Not d Is Nothing

 

On Error Goto ErrH

 

 

Set

 

Dim ns As New NotesSession

 

nd=ViewError.GetNextDocument(d)

 

Dim

coll

 

As

Set

 

NotesDocumentCollection

 

 

d=InvalidDocToNothing(d)

 

Dim doc As NotesDocument

 

If Not d Is Nothing

Dim ndoc As NotesDocument

 

Then

 

Dim PStart As String

 

 

If

 

Dim PEnd As String

 

 

d.form(0)="profile" Then

 

Dim search As String

 

 

 

Set

Dim paramSearch As String

 

lastmod=New

 

'Set

 

 

 

NotesDateTime(d.LastModified)

 

Coll=ns.CurrentDatabase.FTSearch("[_Crea

 

If

tionDate]>=14.04.2014

 

and

lastmod.TimeDifference(t30)<0

Then

[_CreationDate]<=21.04.2014 and [Request]

'Профильизменялсяболееминут30

 

Contains cm and [Request] Contains prvz

назад

 

and [Request] Contains service",0)

 

Flag=True

 

 

 

 

 

Goto label_1

 

 

 

 

 

End If

 

PStart=paramNote.GetItemValue("I

Else

Set

nterval.start")(0)

 

 

 

lastmod=New

PEnd=paramNote.GetItemValue("Int

 

NotesDateTime(d.LastModified)

If

erval.end")(0)

 

 

 

 

 

 

 

 

lastmod.TimeDifference(t15)<0

Then

paramSearch=paramNote.GetItemV

'Докуизменболееминутялся15

 

alue("Search.Text")(0)

 

 

назад

 

search={[_CreationDate]>=}& PStart

 

 

& { and [_CreationDate]<=} & PEnd &{ }

Flag=True

 

search=search & paramSearch

Goto label_1

 

Set coll=db.FTSearch(search,0)

 

End

Print coll.Count

 

 

If

 

Set doc=coll.GetFirstDocument

End If

 

While Not doc Is Nothing

 

End If

 

 

Set

 

 

Set d=nd

 

ndoc=coll.GetNextDocument(doc)

 

Wend

 

 

Set

 

 

Else

 

doc=InvalidDocToNothing(doc)

 

 

'Отсутствуетвид

 

 

If Not doc Is Nothing Then

Flag=True

 

 

Call

 

 

doc.ViewID=""

 

out.ProcessDocument (doc)

 

 

End If

 

 

 

 

 

label_1:

 

 

End If

 

 

If Flag Then

 

 

Set doc=ndoc

 

 

Call out.ProcessDocument

Wend

 

 

 

(doc)

 

 

 

 

 

End If

 

Exit Sub

 

 

 

 

ErrH:

 

 

 

Exit Sub

 

Error Err, Error & Chr(10) &

ErrH:

 

Getthreadinfo(1)встроке} & Erl{

 

 

Error Err, Error & Chr(10) &

End Sub

 

 

 

Getthreadinfo(1)встроке} & Erl & {

 

 

 

 

 

72