浏览代码

adding cleanup and details for finish

pull/8/head
Daniel Covington 9 个月前
父节点
当前提交
51ade5311c
共有 4 个文件被更改,包括 89 次插入54 次删除
  1. +1
    -1
      App/DomainModels/SnailWorksRepository.asp
  2. +62
    -39
      Data/Label_Report.rep
  3. +6
    -1
      Data/Proofs.rep
  4. +20
    -13
      ImportService/TrackingDataImport.vbs

+ 1
- 1
App/DomainModels/SnailWorksRepository.asp 查看文件

@@ -105,7 +105,7 @@ Class SnailWorksRepository_Class
Private Function GetSnailWorksHeaderByKitId(id) Private Function GetSnailWorksHeaderByKitId(id)


Dim Header:Set Header = New SnailWorksExportHeaderModel_Class Dim Header:Set Header = New SnailWorksExportHeaderModel_Class
dim sql : sql = "SELECT ""H"" as RecordType,""5.1"" as Version, ""KCI"" as UserId,[Jcode] as ClientName,"""" as ParentClientName," &_
dim sql : sql = "SELECT ""H"" as RecordType,""5.1"" as Version, ""KCI2024Type2FTPUser"" as UserId,[Jcode] as ClientName,"""" as ParentClientName," &_
"""Tracking Kit - "" & [JobNumber] as JobName,"""" as JobDescription,"""" as SplitName,"""" as SplitDescription,""L"" as PieceType," &_ """Tracking Kit - "" & [JobNumber] as JobName,"""" as JobDescription,"""" as SplitName,"""" as SplitDescription,""L"" as PieceType," &_
"Year(Now()) & ""/"" & RIGHT(""0"" & Month(Now()),2) & ""/"" & RIGHT(""0"" & Day(Now()),2) as MailDate,""N"" as UploadType,"""" as TrackedQuanity," &_ "Year(Now()) & ""/"" & RIGHT(""0"" & Month(Now()),2) & ""/"" & RIGHT(""0"" & Day(Now()),2) as MailDate,""N"" as UploadType,"""" as TrackedQuanity," &_
""""" as PiecesMailed,"""" as TargetInHomeDateStart,"""" as TargetInHomeDateEnd,"""" as ConfirmationEmail,"""" as JobId," &_ """"" as PiecesMailed,"""" as TargetInHomeDateStart,"""" as TargetInHomeDateEnd,"""" as ConfirmationEmail,"""" as JobId," &_


+ 62
- 39
Data/Label_Report.rep 查看文件

@@ -33,6 +33,11 @@ object TRpReport
'NER JOIN Kit ON KitLabels.KitId = Kit.ID) INNER JOIN Jurisdictio' + 'NER JOIN Kit ON KitLabels.KitId = Kit.ID) INNER JOIN Jurisdictio' +
'n ON Kit.Jcode = Jurisdiction.JCode'#13#10'WHERE KitLabels.KITId=PBKIT' + 'n ON Kit.Jcode = Jurisdiction.JCode'#13#10'WHERE KitLabels.KITId=PBKIT' +
'ID'#13#10'ORDER BY SetNumber;' 'ID'#13#10'ORDER BY SetNumber;'
end
item
Alias = 'ELECTIONDATE'
DatabaseAlias = 'TRACKINGKITLABELS'
SQL = 'SELECT [Value] FROM Settings Where [Name] = '#39'Electiondate'#39
end> end>
DatabaseInfo = < DatabaseInfo = <
item item
@@ -53,7 +58,7 @@ object TRpReport
item item
Name = 'PBKITID' Name = 'PBKITID'
AllowNulls = False AllowNulls = False
Value = '84'
Value = '132'
Datasets.Strings = ( Datasets.Strings = (
'LABLES' 'LABLES'
'KITLABELS') 'KITLABELS')
@@ -106,9 +111,6 @@ object TRpReport
item item
Component = TRpExpression2 Component = TRpExpression2
end end
item
Component = TRpLabel0
end
item item
Component = TRpLabel1 Component = TRpLabel1
end end
@@ -130,9 +132,6 @@ object TRpReport
item item
Component = TRpExpression7 Component = TRpExpression7
end end
item
Component = TRpLabel3
end
item item
Component = TRpExpression8 Component = TRpExpression8
end end
@@ -144,6 +143,12 @@ object TRpReport
end end
item item
Component = TRpExpression11 Component = TRpExpression11
end
item
Component = TRpExpression12
end
item
Component = TRpExpression13
end> end>
ExternalTable = 'REPMAN_REPORTS' ExternalTable = 'REPMAN_REPORTS'
ExternalField = 'REPORT' ExternalField = 'REPORT'
@@ -1202,36 +1207,6 @@ object TRpReport
AgIniValue = '0' AgIniValue = '0'
ExportExpression = '' ExportExpression = ''
end end
object TRpLabel0: TRpLabel
Width = 1440
Height = 240
PosX = 5760
PosY = 360
Type1Font = poHelvetica
FontSize = 7
Alignment = 2
PrintCondition = ''
DoBeforePrint = ''
DoAfterPrint = ''
WFontName = 'Arial'
LFontName = 'Helvetica'
WideText = '5/7/2024'
end
object TRpLabel3: TRpLabel
Width = 1440
Height = 240
PosX = 5760
PosY = 1380
Type1Font = poHelvetica
FontSize = 7
Alignment = 2
PrintCondition = ''
DoBeforePrint = ''
DoAfterPrint = ''
WFontName = 'Arial'
LFontName = 'Helvetica'
WideText = '5/7/2024'
end
object TRpExpression8: TRpExpression object TRpExpression8: TRpExpression
Width = 2640 Width = 2640
Height = 240 Height = 240
@@ -1349,8 +1324,56 @@ object TRpReport
WFontName = 'Arial' WFontName = 'Arial'
LFontName = 'Helvetica' LFontName = 'Helvetica'
Expression = Expression =
#39'Code Expires on 8/5/2024 '#39' +'#13#10#39'Destroy Unused Lables '#39' +'#13#10#39'afte' +
'r election'#39
#39'Code Expires on '#39' + ELECTIONDATE.Value +'#13#10#39' Destroy Unused Labl' +
'es '#39' +'#13#10#39'after election'#39
DisplayFormat = ''
ExportDisplayFormat = ''
AgIniValue = '0'
ExportExpression = ''
end
object TRpExpression12: TRpExpression
Width = 1440
Height = 240
PosX = 5760
PosY = 360
Type1Font = poHelvetica
FontSize = 7
Alignment = 2
AutoExpand = False
AutoContract = False
ExportPosition = 0
ExportSize = 1
ExportDoNewLine = False
PrintCondition = ''
DoBeforePrint = ''
DoAfterPrint = ''
WFontName = 'Arial'
LFontName = 'Helvetica'
Expression = 'ELECTIONDATE.Value'
DisplayFormat = ''
ExportDisplayFormat = ''
AgIniValue = '0'
ExportExpression = ''
end
object TRpExpression13: TRpExpression
Width = 1440
Height = 240
PosX = 5760
PosY = 1380
Type1Font = poHelvetica
FontSize = 7
Alignment = 2
AutoExpand = False
AutoContract = False
ExportPosition = 0
ExportSize = 1
ExportDoNewLine = False
PrintCondition = ''
DoBeforePrint = ''
DoAfterPrint = ''
WFontName = 'Arial'
LFontName = 'Helvetica'
Expression = 'ELECTIONDATE.Value'
DisplayFormat = '' DisplayFormat = ''
ExportDisplayFormat = '' ExportDisplayFormat = ''
AgIniValue = '0' AgIniValue = '0'


+ 6
- 1
Data/Proofs.rep 查看文件

@@ -57,6 +57,11 @@ object TRpReport
Alias = 'CONTACTS' Alias = 'CONTACTS'
DatabaseAlias = 'WEBDATA' DatabaseAlias = 'WEBDATA'
SQL = 'SELECT * FROM [Contacts] WHERE JURISCODE = PBJCODE' SQL = 'SELECT * FROM [Contacts] WHERE JURISCODE = PBJCODE'
end
item
Alias = 'ELECTIONDATE'
DatabaseAlias = 'WEBDATA'
SQL = 'SELECT [Value] FROM Settings Where [Name] = '#39'Electiondate'#39
end> end>
DatabaseInfo = < DatabaseInfo = <
item item
@@ -4363,7 +4368,7 @@ object TRpReport
DoAfterPrint = '' DoAfterPrint = ''
WFontName = 'Arial' WFontName = 'Arial'
LFontName = 'Helvetica' LFontName = 'Helvetica'
Expression = #39'8/5/2024'#39
Expression = 'ELECTIONDATE.Value'
DisplayFormat = '' DisplayFormat = ''
ExportDisplayFormat = '' ExportDisplayFormat = ''
AgIniValue = '0' AgIniValue = '0'


+ 20
- 13
ImportService/TrackingDataImport.vbs 查看文件

@@ -62,7 +62,7 @@ Function ExportInkjetFile(KitID)
" KitLabels.INBOUNDIMBPNG, KitLabels.SetNumber" &_ " KitLabels.INBOUNDIMBPNG, KitLabels.SetNumber" &_
" FROM InkjetRecords" &_ " FROM InkjetRecords" &_
" LEFT JOIN [KitLabels] ON InkjetRecords.KitLabelID = KitLabels.ID" & _ " LEFT JOIN [KitLabels] ON InkjetRecords.KitLabelID = KitLabels.ID" & _
" WHERE InkjetRecords.KitID =" & KitID & " Order by PRECINCT & Clng(BALLOT_NUMBER) Desc;")
" WHERE InkjetRecords.KitID =" & KitID & " Order by PRECINCT Desc, Clng(BALLOT_NUMBER) Desc;")
Dim JurisdictionRs:Set JurisdictionRs = oConn.Execute("SELECT * FROM Jurisdiction WHERE JCode ='" & KitRs("Jcode").Value & "';") Dim JurisdictionRs:Set JurisdictionRs = oConn.Execute("SELECT * FROM Jurisdiction WHERE JCode ='" & KitRs("Jcode").Value & "';")
Dim ContactRs:Set ContactRs = oConn.Execute("SELECT * FROM Contacts WHERE [JURISCODE] ='" & KitRs("Jcode").Value & "';") Dim ContactRs:Set ContactRs = oConn.Execute("SELECT * FROM Contacts WHERE [JURISCODE] ='" & KitRs("Jcode").Value & "';")
Dim ExportFileName:ExportFileName = objFSO.GetBaseName(KitRs("Filename")) & ".csv" Dim ExportFileName:ExportFileName = objFSO.GetBaseName(KitRs("Filename")) & ".csv"
@@ -228,8 +228,8 @@ Function CreateExportForSnailWorks(KitID)
Dim objExportFile:set objExportFile = objFSO.CreateTextFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName,2) Dim objExportFile:set objExportFile = objFSO.CreateTextFile(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ExportFileName,2)
With objExportFile With objExportFile
.Write("""H"",") 'Record Type Required value must be = "H" (Header) .Write("""H"",") 'Record Type Required value must be = "H" (Header)
.Write(Truncate("5.1",5)) 'Version Required value must be ="5.1" for current release
.Write(Truncate("KCI",50)) 'UserId Required
.Write(Truncate("5.2",5)) 'Version Required value must be ="5.2" for current release
.Write(Truncate("KCIHotFolder2024FTPUser",50)) 'UserId Required
.Write(Truncate(KitRs("Jcode").Value,50)) 'Client Name Required (will create new subaccount if not already defined) - We decideded to make this the juriscode .Write(Truncate(KitRs("Jcode").Value,50)) 'Client Name Required (will create new subaccount if not already defined) - We decideded to make this the juriscode
.Write(Truncate("",50)) 'Parent Client Name Optional (use if 3-tier account structure) .Write(Truncate("",50)) 'Parent Client Name Optional (use if 3-tier account structure)
.Write(Truncate("Purple envelope - " & KitRs("JobNumber").Value,50)) 'Job Name Required .Write(Truncate("Purple envelope - " & KitRs("JobNumber").Value,50)) 'Job Name Required
@@ -244,7 +244,7 @@ Function CreateExportForSnailWorks(KitID)
.Write(Truncate("",8)) 'PiecesMailed Optional – shown as Estimated Quantity .Write(Truncate("",8)) 'PiecesMailed Optional – shown as Estimated Quantity
.Write(Truncate("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD) .Write(Truncate("",10)) 'Target InHomeDateStart Optional (YYYY/MM/DD)
.Write(Truncate("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD) .Write(Truncate("",10)) 'Target InHomeDateEnd Optional (YYYY/MM/DD)
.Write(Truncate("",100)) 'ConfirmationEmail Optional
.Write(Truncate("danielc@kentcommunications.com",100)) 'ConfirmationEmail Optional
.Write(Truncate("",9)) 'JobId (SW) Optional for previously created jobs SWJobId .Write(Truncate("",9)) 'JobId (SW) Optional for previously created jobs SWJobId
.Write(Truncate("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId .Write(Truncate("",4)) 'SplitId (SW) Optional for previously created jobs SWJobId
.Write(Truncate(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1)) 'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip .Write(Truncate(Choice(IsNull(KitRs("InboundSTID")),"O","R"),1)) 'TypeofTracking Required Values: O- Outbound Only I-Inbound Only R-Round Trip
@@ -315,24 +315,31 @@ Dim KitLabelRs
Dim Mid:Mid = GetSetting("MailingID") Dim Mid:Mid = GetSetting("MailingID")
Dim Step : If KitRs("InboundSTID") <> "" Then : Step = 2 : Else Step = 1 Dim Step : If KitRs("InboundSTID") <> "" Then : Step = 2 : Else Step = 1
serialStart = PadLeft(serialStart + CLng(Counter),9,"0") serialStart = PadLeft(serialStart + CLng(Counter),9,"0")
Dim oRsKitLabels : Set oRsKitLabels = CreateObject("ADODB.Recordset"):oRsKitLabels.Open "Select * FROM [KitLabels] Where KitID =" & KitID & ";",oConn,3,3
While Not InkjetRs.EOF While Not InkjetRs.EOF

oRsKitLabels.AddNew
KitLabelID = oRsKitLabels("ID").value
If Step = 1 Then If Step = 1 Then
oConn.Execute("INSERT INTO KitLabels (KitID,OutboundSerial,OutboundIMBDigits) " &_
"VALUES(" & KitID & ",'" & serialStart & "','" & KitRs("OutBoundSTID").Value & Mid & serialStart & "');")

Else
oConn.Execute "INSERT INTO KitLabels (KitID,OutboundSerial,InBoundSerial,OutboundIMBDigits,InBoundIMBDigits) " &_
"VALUES(" & KitID & ",'" & serialStart & "','" & serialStart + 1 & "','" & KitRs("OutBoundSTID").Value & Mid & serialStart & "','" & KitRs("InboundSTID").Value & serialStart + 1 & Jcode & "');"
oRsKitLabels("KitID") = KitID
oRsKitLabels("OutboundSerial") = serialStart
oRsKitLabels("OutboundIMBDigits") = KitRs("OutBoundSTID").Value & Mid & serialStart
Else
oRsKitLables.AddNew
oRsKitLabels("KitID") = KitID
oRsKitLabels("OutboundSerial") = serialStart
oRsKitLables("InBoundSerial") = serialStart + 1
oRsKitLabels("OutboundIMBDigits") = KitRs("OutBoundSTID").Value & Mid & serialStart
oRsKitLables("InBoundIMBDigits") = KitRs("InboundSTID").Value & serialStart + 1 & Jcode
End If End If
Set KitLabelRs = oConn.Execute("SELECT TOP 1 [ID] FROM KitLabels ORDER BY ID DESC"):KitLabelID = KitLabelRs("ID").Value
oRsKitLabels.Update
oConn.Execute("UPDATE InkjetRecords Set [KitLabelID]=" & KitLabelID & " WHERE ID=" & InkjetRs("ID") & ";") oConn.Execute("UPDATE InkjetRecords Set [KitLabelID]=" & KitLabelID & " WHERE ID=" & InkjetRs("ID") & ";")
Counter = Counter + Step Counter = Counter + Step
serialStart = serialStart + Step serialStart = serialStart + Step


InkjetRs.MoveNext InkjetRs.MoveNext
Wend Wend
oRsKitLabels.Update
oRsKitLabels.Close
oConn.Execute("UPDATE Settings Set [Value]='" & serialOffset + Counter & "' WHERE [Name] = 'SerialOffset';") oConn.Execute("UPDATE Settings Set [Value]='" & serialOffset + Counter & "' WHERE [Name] = 'SerialOffset';")
oConn.Execute("UPDATE Kit Set [Status]='Ready For Export', LabelsPrinted=#" & Now() & "# WHERE [ID] =" & KitID &";") oConn.Execute("UPDATE Kit Set [Status]='Ready For Export', LabelsPrinted=#" & Now() & "# WHERE [ID] =" & KitID &";")
oConn.Close oConn.Close


正在加载...
取消
保存

Powered by TurnKey Linux.