{ ============================================================================== 方法名稱:ZipMainFile 引用相依:FileExists, LoadFromFile 方法描述:將案件的主要圖檔與所有中繼資料檔案打包壓縮為 ZIP。流程如下: 1. 遍歷影像清單 (ContextList) 與附件清單 (AttContextList) 加入實體圖 檔。 2. 自動偵測並加入多種系統紀錄檔,包含索引檔 (Context.dat)、掃瞄清單 (s canlist.dat)、縮放紀錄 (ReSize.dat)、案件分類資訊 (CaseDocNo_Copies.da t) 及跨案引用設定 (UseCase.ini) 等。 3. 檢查是否存在特殊壓縮檔 (FirstImg.zip) 並併入。 4. 呼叫 ExeCuteZip 執行壓縮作業,確保上傳時案件資料的完整性。 ============================================================================== } Procedure TCB_IMGPSScanX.ZipMainFile(SoPath,DePath,ZipName:String); var ZipFileList : TStringlist; n : Integer; begin ZipFileList := TStringlist.Create; try if fileExists(DePath+ZipName) then DeleteFile(DePath+ZipName); {if FileExists(SoPath+'ReSize.dat') then DeleteFile(SoPath+'ReSize.dat');} //Showmessage(SoPath+#13+ContextList.Text); for n := 0 to ContextList.Count - 1 do begin {WriteResize(SoPath+ContextList.Strings[n],SoPath+'ReSize.dat');} ZipFileList.Add(SoPath+ContextList.Strings[n]); if FileExists(SoPath+'@'+ContextList.Strings[n]) then ZipFileList.Add(SoPath+'@'+ContextList.Strings[n]); end; if FileExists(SoPath+'Context.dat') then ZipFileList.Add(SoPath+'Context.dat'); AttContextList.Clear; if FileExists(SoPath+'ATTContext.dat') then AttContextList.LoadFromFile(SoPath+'ATTContext.dat'); for n := 0 to AttContextList.Count - 1 do begin ZipFileList.Add(SoPath+AttContextList.Strings[n]); end; if FileExists(SoPath+'ATTContext.dat') then ZipFileList.Add(SoPath+'ATTContext.dat'); if FileExists(SoPath+'Context_DocNo.dat') then ZipFileList.Add(SoPath+'Context_DocNo.dat'); if FileExists(SoPath+'scanlist.dat') then ZipFileList.Add(SoPath+'scanlist.dat'); if FileExists(SoPath+'FormCode_Name.dat') then ZipfileList.Add(SoPath+'FormCode_Name.dat'); if FileExists(SoPath+'DocNo_Name.dat') then ZipfileList.Add(SoPath+'DocNo_Name.dat'); if FileExists(SoPath+'ReSize.dat') then ZipfileList.Add(SoPath+'ReSize.dat'); if FileExists(SoPath+'FormIDReplace.dat') then ZipfileList.Add(SoPath+'FormIDReplace.dat'); if FileExists(SoPath+'AnchorError.dat') then ZipfileList.Add(SoPath+'AnchorError.dat'); if FileExists(SoPath+'CaseDocNo.dat') then ZipfileList.Add(SoPath+'CaseDocNo.dat'); if FileExists(SoPath+'CaseDocNo_Copies.dat') then ZipfileList.Add(SoPath+'CaseDocNo_Copies.dat'); if FileExists(SoPath+'CustomDocNo.ini') then ZipfileList.Add(SoPath+'CustomDocNo.ini'); if FileExists(SoPath+'DocDir.dat') then ZipfileList.Add(SoPath+'DocDir.dat'); if FileExists(SoPath+'In_Wh.dat') then ZipfileList.Add(SoPath+'In_Wh.dat'); if FileExists(SoPath+'UseCase.ini') then ZipfileList.Add(SoPath+'UseCase.ini'); if FileExists(SoPath+'FirstImg.zip') then//20170315 加的 begin ZipfileList.Add(SoPath+'FirstImg.zip'); end; ExeCuteZip(DePath+ZipName,SoPath,ZipFileList,False,False); //Showmessage('111'); finally ZipFileList.Free; end; end; { ============================================================================== 方法名稱:ZipMaskFile 引用相依:FileExists 方法描述:壓縮遮罩影像檔及其相關設定檔。此方法會從指定遮罩路徑 (MarkPath) 收集 與影像索引 (ContextList) 對應的遮罩圖檔,同時併入基本的案件資訊檔(如 Context.dat, scanlist.dat, DocNo_Name.dat)以及系統預設的錯誤與授權圖 檔(Err.jpg, auth.jpg)。最後將這些檔案統一壓縮至目標路徑,供後續遮罩影 像的上傳作業使用。 ============================================================================== } Procedure TCB_IMGPSScanX.ZipMaskFile(SoPath,MarkPath,DePath,ZipName:String); //壓縮遮罩影像檔 var ZipFileList : TStringlist; n : Integer; begin ZipFileList := TStringlist.Create; try if fileExists(DePath+ZipName) then DeleteFile(DePath+ZipName); for n := 0 to ContextList.Count - 1 do begin ZipFileList.Add(MarkPath+ContextList.Strings[n]); end; if FileExists(SoPath+'Context.dat') then ZipFileList.Add(SoPath+'Context.dat'); if FileExists(SoPath+'scanlist.dat') then ZipFileList.Add(SoPath+'scanlist.dat'); if FileExists(SoPath+'FormCode_Name.dat') then ZipfileList.Add(SoPath+'FormCode_Name.dat'); if FileExists(SoPath+'DocNo_Name.dat') then ZipfileList.Add(SoPath+'DocNo_Name.dat'); if FileExists(SoPath+'ReSize.dat') then ZipfileList.Add(SoPath+'ReSize.dat'); if FileExists(SoPath+'Err.jpg') then ZipfileList.Add(SoPath+'Err.jpg'); if FileExists(SoPath+'auth.jpg') then ZipfileList.Add(SoPath+'auth.jpg'); ExeCuteZip(DePath+ZipName,SoPath,ZipFileList,False,False); finally ZipFileList.Free; end; end;