| | |
| | | unit CB_IMGPSScanImp; |
| | | |
| | | //TEST |
| | | {$WARN SYMBOL_PLATFORM OFF} |
| | | |
| | | interface |
| | |
| | | EnDiGrph, { for TDibGraphic } |
| | | EnMisc, { for MinFloat } |
| | | EnTifGr, { for TTifGraphic } |
| | | {$IFDEF Production} |
| | | CB_IMGPSScan_TLB, |
| | | {$ENDIF} |
| | | {$IFDEF Test} |
| | | CB_IMGPSScan_test_TLB, |
| | | {$ENDIF} |
| | | |
| | | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, |
| | | ActiveX, AxCtrls, CB_IMGPSScan_TLB, StdVcl, VCLUnZip, VCLZip, Encryp, |
| | | ActiveX, AxCtrls, StdVcl, VCLUnZip, VCLZip, Encryp, |
| | | ExtCtrls, ComCtrls, Menus, StdCtrls, Gauges, EnImgScr, PJMenuSpeedButtons, |
| | | Buttons, ImgList, SBSimpleSSL, SBHTTPSClient, SBWinCertStorage, SBX509, |
| | | SBCustomCertStorage, SBUtils,mpsBarco,BarcodesFinder,HTTPApp,ErrList, |
| | | Xmltool,inifiles,printers,IdHashMessageDigest, idHash; |
| | | Xmltool,inifiles,printers,IdHashMessageDigest, idHash, LogFile,ShellApi, |
| | | SBSocket,IIS_Ftp, SBSimpleFTPS; |
| | | Type |
| | | TTransMode =(tsHttp,tsFtp,tsNone); |
| | | |
| | | var |
| | | Ch_WriteNote : Boolean; |
| | |
| | | Splitter1: TSplitter; |
| | | Panel3: TPanel; |
| | | Label7: TLabel; |
| | | TreeView1: TTreeView; |
| | | Panel6: TPanel; |
| | | CB1: TCheckBox; |
| | | ScanDuplexCB: TCheckBox; |
| | |
| | | PM402: TMenuItem; |
| | | PM403: TMenuItem; |
| | | PM404: TMenuItem; |
| | | HTTPSClient: TElHTTPSClient; |
| | | ElWinCertStorage: TElWinCertStorage; |
| | | ElMemoryCertStorage: TElMemoryCertStorage; |
| | | Panel5: TPanel; |
| | |
| | | Panel11: TPanel; |
| | | SampleScanBtn: TBitBtn; |
| | | WNoteBtn: TBitBtn; |
| | | Panel13: TPanel; |
| | | CaseHelpBtn: TBitBtn; |
| | | PopupMenu1: TPopupMenu; |
| | | PM101: TMenuItem; |
| | | N12: TMenuItem; |
| | |
| | | Edit1: TEdit; |
| | | PM110: TMenuItem; |
| | | Image1: TImage; |
| | | PrtLb: TLabel; |
| | | UseOldCaseLb: TLabel; |
| | | PM111: TMenuItem; |
| | | SmoothCB: TCheckBox; |
| | |
| | | N2: TMenuItem; |
| | | ISB1: TImageScrollBox; |
| | | Label3: TLabel; |
| | | LogFile1: TLogFile; |
| | | ScanGrayCB: TCheckBox; |
| | | AttFileGB: TGroupBox; |
| | | AttListBox: TListBox; |
| | | Panel20: TPanel; |
| | | AddAttFileLB: TLabel; |
| | | DelAttFileLB: TLabel; |
| | | Splitter2: TSplitter; |
| | | Panel17: TPanel; |
| | | TreeView1: TTreeView; |
| | | Panel13: TPanel; |
| | | PrtLb: TLabel; |
| | | CaseHelpBtn: TBitBtn; |
| | | HTTPSClient: TElHTTPSClient; |
| | | Button5: TButton; |
| | | FTPSClient1: TElSimpleFTPSClient; |
| | | Button6: TButton; |
| | | procedure ActiveFormCreate(Sender: TObject); |
| | | procedure Panel9Resize(Sender: TObject); |
| | | procedure ISB1Click(Sender: TObject); |
| | |
| | | procedure ImageScrollBox1NewGraphic(const Graphic: TDibGraphic); |
| | | procedure SmoothCBClick(Sender: TObject); |
| | | procedure N1Click(Sender: TObject); |
| | | procedure TreeView1MouseEnter(Sender: TObject); |
| | | procedure ScrollBox1MouseEnter(Sender: TObject); |
| | | procedure ScanGrayCBClick(Sender: TObject); |
| | | procedure AddAttFileLBClick(Sender: TObject); |
| | | procedure DelAttFileLBClick(Sender: TObject); |
| | | procedure AttListBoxDblClick(Sender: TObject); |
| | | procedure AttListBoxClick(Sender: TObject); |
| | | procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton; |
| | | Shift: TShiftState; X, Y: Integer); |
| | | procedure HTTPSClientRedirection(Sender: TObject; const OldURL: string; |
| | | var NewURL: string; var AllowRedirection: Boolean); |
| | | procedure Button5Click(Sender: TObject); |
| | | procedure Button6Click(Sender: TObject); |
| | | private |
| | | { Private declarations } |
| | | HotKeyId1,HotKeyId2,HotKeyId3,HotKeyId4 :Integer; |
| | |
| | | FWH_category:string; //Y/N Y是歸類時有區分入庫非入庫文件 N 是不區分 |
| | | ////////傳入參數/////// |
| | | |
| | | TransMode : TTransMode; //用何種方式上傳檔案 |
| | | //********Http參數******** |
| | | HttpErrStr : String; //錯誤訊息 |
| | | //********Http參數******** |
| | | |
| | | //********Ftp參數********* |
| | | FFtpIP : String; |
| | | FFtpID : String; |
| | | FFtpPwd : String; |
| | | FFtpRootPath : String; |
| | | FFtpExtraPath : String; |
| | | FFtpPort : Integer; |
| | | FFtpProtocol : TFtpProtocol; |
| | | //********Ftp參數********* |
| | | |
| | | //********ini參數******** |
| | | DeviceDelete : Boolean; //空白頁刪除啟動 |
| | |
| | | CaseDocNoList : TStringlist; //案件裡的DocNo清單(不重複) |
| | | CaseDocNo_CopiesList : TStringlist; //案件裡的DocNo份數清單 |
| | | ContextList : TStringlist; //案件裡的檔案清單 |
| | | AttContextList : TStringlist; //案件裡的附加檔案清單 |
| | | OMRFileList : TStringList; //要OMR檢核的文件(只檢查每種Form的第一頁) |
| | | Cust_DocNoList : TStringlist; //自行定義文件名稱 |
| | | IN_WH_DocNoList : TStringlist; //入庫的文件清單 |
| | |
| | | LastAddFormidList:TstringList; |
| | | SampleFormIDList:TStringList; //20170627 已存在範本的formid |
| | | ExistImgList:TStringList; //20170724 已經存在的影像list for ESCAN //Img的完整路徑 |
| | | reSizeExistImgList:TstringList; //20171012被縮放的舊圖MD5存入 |
| | | //********清單區******** |
| | | |
| | | //********顯示區******** |
| | |
| | | DocNoLength : Integer; //Docno長度 |
| | | |
| | | PEFileName : String; //掃描時的檔名 |
| | | DownFileErrStr : String; //下載影像時發生的錯誤 |
| | | |
| | | ISB : TImageScrollBox; |
| | | ScanInfo : TScanInfo; |
| | |
| | | NowDivPageFormID:String; |
| | | |
| | | FirstDocDir : String; |
| | | FMaxUploadSize:String;// 上傳zip大小限制 |
| | | FJpgCompression:integer;// 20171211 jpg to tif 的壓縮率 |
| | | |
| | | Draging : Boolean; |
| | | |
| | | MDown : Boolean; //20181210 用來判斷滑鼠右鍵要Popupmenu是否有MouseDonw發生 |
| | | |
| | | FEvents: ICB_IMGPSScanXEvents; |
| | | |
| | |
| | | Function GetFindResult(Col:String):String; |
| | | //*********SQL相關************ |
| | | |
| | | //*********FTP相關************ |
| | | Function GetFtpinfo(CaseID,Action:String):Boolean; |
| | | Procedure SetFtpInfo; //餵入FTP資訊 |
| | | Function FtpCaseComplete(SendData:String):Boolean; |
| | | //*********FTP相關************ |
| | | |
| | | //*******轉換區********* |
| | | Function FindDivFormCode(FormCode:String):Boolean; //找有沒有分案的條碼 |
| | |
| | | Procedure initkscan; //檢查掃描器的功能 |
| | | procedure LoadImgFile; //載入案件 |
| | | procedure LoadImgFile1; //載入案件 |
| | | procedure LoadAttFile(CaseID:String); //載入附加檔案 |
| | | Procedure DistinctFormCode(CaseID:String); //案件裡的FormCode取出第一頁 |
| | | Function OMRCheckCase(CaseID:String):Boolean; //OMR檢核 |
| | | Procedure OMRErr2ini(CaseID,Reason,FileName,Site,RelaFileName,RelaSite,Anchor,Anchor1:String;Del,Ingnore,Display:Boolean); //OMR檢核失敗寫入ini |
| | |
| | | Function Node3FormID(Node3:TTreeNode):String; //MyTreeNode3取FormCode出來 |
| | | Function GetNode2Name(Node2:TTreeNode):String; //取MyTreeNode2的識別字出來(記之前點選用) |
| | | //Function Down_Replace_Img(SPAth,DPath,CaseID:String):Boolean; |
| | | Function DownLoadImage(Path,CaseID:String):Boolean; |
| | | Function Down_Img(Path,CaseID:String):Boolean; |
| | | Function GetNoNameCase(Path:string):String; //取未配號XXXX |
| | | Procedure CaseResort(Path:String); //案件的檔案重新排序(次文件依Docno挑) |
| | |
| | | Procedure SetCaseList(Mode:Char;Index:Integer;text:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetDocNoList(Mode:Char;Index:Integer;CaseNo,DocDir,Copies:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetContextList(Mode:Char;Index:Integer;CaseNo,DocDir,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetAttContextList(Mode:Char;Index:Integer;CaseNo,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | |
| | | |
| | | Function checkCaseOMRDone:Boolean; //檢查案件是否完成OMR檢核 |
| | | Function CheckCaseID_OK:Boolean; //檢查是否有未配號的案件 |
| | | Procedure CreateEmptyCase(Path,CaseID:String); //產生空白案號(重掃件用) |
| | |
| | | Procedure PageReplaceFormID(Path,NowFormID,NewFormID:String); //選取頁更換FormID |
| | | Function ModeNeedCheck(OMRMode,ScanMode:String):Boolean; //掃瞄模式是否要做檢核 |
| | | procedure WMMOUSEWHEEL(var message: TWMMouseWheel); message WM_MOUSEWHEEL; |
| | | Function GetInputMask:String; //取得輸入的保單號碼 |
| | | Function GetCasePage(Path,CaseID:String):Integer; |
| | | Function GetFormIDPage(FileList:TStringlist;FormID:String):Integer; |
| | | Procedure SetFile2Case(CaseID,FileName:String); |
| | |
| | | function DocNoIsExistImg(DocNopath: String): boolean; //2017 刪除前確認 有舊影像嗎 |
| | | function CheckCaseAttach_OK: Boolean; |
| | | function DeleteDocNoFileForESCAN(Path, DocNo: String): Boolean; //2017 確認是否有未歸類文件 |
| | | function CheckRequiredColumnValues(workno,caseno:String) :Boolean; //20171003 此大類下此案是否檢核必填 |
| | | function logTimeString :String; |
| | | procedure ReduceLogFile ; |
| | | function FindLastestDocDirForPage(CaseID, DocNo, formid: String): String; |
| | | function OMRErrini2ListForLog(CaseID: String):String; |
| | | protected |
| | | { Protected declarations } |
| | | procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override; |
| | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.WMMOUSEWHEEL(var message: TWMMouseWheel); |
| | | var |
| | | I: Integer; |
| | | iISB : TImageScrollBox; |
| | | begin |
| | | inherited; |
| | | //lb1.Caption:=IntToStr(message.Keys); |
| | | if (message.WheelDelta = WHEEL_DELTA) Then |
| | | begin |
| | | |
| | | if (message.WheelDelta = WHEEL_DELTA) Then begin |
| | | if Edit1.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL, SB_LINEUP, 0); |
| | | end |
| | | else if DisplayISB.Focused then |
| | | begin |
| | | DisplayISB.VertScrollBar.Increment := 50; |
| | | DisplayISB.Perform(WM_VSCROLL, SB_LINEUP, 0); |
| | | end; |
| | | end else if (message.WheelDelta = -WHEEL_DELTA) then begin |
| | | if Edit1.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL, SB_LINEDOWN, 0); |
| | | end |
| | | else if DisplayISB.Focused then |
| | | begin |
| | | DisplayISB.VertScrollBar.Increment := 50; |
| | | DisplayISB.Perform(WM_VSCROLL, SB_LINEDOWN, 0); |
| | | end; |
| | | if ScrollBox1.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL,SB_Lineup,0); |
| | | end; |
| | | if DisplayISB <> nil then |
| | | begin |
| | | if (DisplayISB.Focused) and (message.Keys=0) then |
| | | begin |
| | | DisplayISB.VertScrollBar.Increment := 50; |
| | | DisplayISB.Perform(WM_VSCROLL,SB_Lineup,0); |
| | | end; |
| | | |
| | | if (DisplayISB.Focused) and (message.Keys=50) then |
| | | begin |
| | | DisplayISB.ZoomMode := zmPercent; |
| | | if DisplayISB.ZoomPercent < 90 then |
| | | DisplayISB.ZoomPercent := DisplayISB.ZoomPercent+10; |
| | | end; |
| | | |
| | | end; |
| | | i:=0; |
| | | while FindComponent(ISBName+inttostr(i)) <> nil do |
| | | begin |
| | | iISB := TImageScrollBox(FindComponent(ISBName+inttostr(i))); |
| | | if iISB.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL,SB_Lineup,0); |
| | | end; |
| | | inc(i); |
| | | end; |
| | | |
| | | end |
| | | else if (message.WheelDelta = -WHEEL_DELTA) then |
| | | begin |
| | | |
| | | if ScrollBox1.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL, SB_LINEDOWN, 0); |
| | | end; |
| | | if DisplayISB <> nil then |
| | | begin |
| | | if (DisplayISB.Focused) and (message.Keys=0) then |
| | | begin |
| | | DisplayISB.VertScrollBar.Increment := 50; |
| | | DisplayISB.Perform(WM_VSCROLL,SB_LINEDOWN,0); |
| | | end; |
| | | if (DisplayISB.Focused) and (message.Keys=50) then |
| | | begin |
| | | DisplayISB.ZoomMode := zmPercent; |
| | | if DisplayISB.ZoomPercent > 10 then |
| | | DisplayISB.ZoomPercent := DisplayISB.ZoomPercent-10; |
| | | end; |
| | | |
| | | |
| | | end; |
| | | |
| | | i:=0; |
| | | while FindComponent(ISBName+inttostr(i)) <> nil do |
| | | begin |
| | | iISB := TImageScrollBox(FindComponent(ISBName+inttostr(i))); |
| | | if iISB.Focused then |
| | | begin |
| | | ScrollBox1.VertScrollBar.Increment := 50; |
| | | ScrollBox1.Perform(WM_VSCROLL,SB_Lineup,0); |
| | | end; |
| | | inc(i); |
| | | end; |
| | | |
| | | end; |
| | | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.WNoteBtnClick(Sender: TObject); |
| | |
| | | ST1,ST2,ST3,ST4:TStringList; |
| | | i,j,k:Integer; |
| | | begin |
| | | //ShowMessage('casepath='+casepath); |
| | | |
| | | ST1:=TStringList.Create; |
| | | ST2:=TStringList.Create; |
| | | ST3:=TStringList.Create; |
| | | |
| | | //FImgDelete:='Y'; |
| | | {if FileExists(casepath+'CaseDocNo.dat') then |
| | | begin |
| | | ST1.LoadFromFile(casepath+'CaseDocNo.dat'); |
| | | for I := 0 to ST1.Count - 1 do |
| | | begin |
| | | ST2.LoadFromFile(casepath+ST1.Strings[i]+'\Context.dat'); |
| | | for j := 0 to ST2.Count - 1 do |
| | | begin |
| | | ExistImgList.Add(casepath+ST1.Strings[i]+'\'+ST2.Strings[j]) |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | if FileExists(casepath+'S_Attach\Context.dat') then |
| | | begin |
| | | ST3.LoadFromFile(casepath+'S_Attach\Context.dat'); |
| | | for I := 0 to ST3.Count - 1 do |
| | | begin |
| | | ExistImgList.Add(casepath+'S_Attach\'+ST3.Strings[i]) |
| | | end; |
| | | end; |
| | | |
| | | if FileExists(casepath+'Attach\Context.dat') then |
| | | begin |
| | | ST3.LoadFromFile(casepath+'Attach\Context.dat'); |
| | | for I := 0 to ST3.Count - 1 do |
| | | begin |
| | | ExistImgList.Add(casepath+'Attach\'+ST3.Strings[i]) |
| | | end; |
| | | end; } |
| | | ExistImgList.Clear; |
| | | ST1.LoadFromFile(casepath+'Download\Context.dat'); |
| | | for I := 0 to ST1.Count - 1 do |
| | | begin |
| | | LogFile1.LogToFile(logTimeString+casepath+'Download\'+ST1.Strings[i]+',MD5='+LoadFileGetMD5(casepath+'Download\'+ST1.Strings[i])); |
| | | ExistImgList.Add(LoadFileGetMD5(casepath+'Download\'+ST1.Strings[i])) ; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'ExistImgList.text'+ExistImgList.CommaText); |
| | | |
| | | ST1.Free; |
| | | ST2.Free; |
| | | ST3.Free; |
| | | //ShowMessage('ExistImgList='+ExistImgList.Text); |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.Initialize; |
| | |
| | | NowPage := p+1; |
| | | PageLV.ItemIndex := P; |
| | | end; |
| | | //DisplayISB.SetFocus; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ISB1EndScroll(Sender: TObject); |
| | |
| | | |
| | | procedure TCB_IMGPSScanX.ISB1Enter(Sender: TObject); |
| | | begin |
| | | //ISB1.SetFocus; |
| | | ISB1.SetFocus; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ISB1ImageMouseDown(Sender: TObject; Button: TMouseButton; |
| | |
| | | p : Integer; |
| | | begin |
| | | DisplayISB := TImageScrollBox(Sender); |
| | | //DisplayISB.SetFocus; |
| | | if NowClick<>0 then |
| | | DisplayISB.SetFocus; |
| | | Shape1.Left := TPanel(TImageScrollBox(Sender).Parent).Left - Seg; |
| | | Shape1.Top := TPanel(TImageScrollBox(Sender).Parent).Top - Seg; |
| | | P := strtoint(copy(DisplayISB.Name,4,1)) + ScrollBar1.Position-2; |
| | |
| | | begin |
| | | //Edit1.SetFocus; |
| | | //TImageScrollBox(Sender).SetFocus; |
| | | |
| | | if TImageScrollBox(Sender).FileName = '' then |
| | | begin |
| | | //ShowMessage('AAA'); |
| | | Label3.Caption:='FileName='+TImageScrollBox(Sender).FileName+' time='+FormatDateTime('yyyy/mm/dd HH:MM:SS', now); |
| | | TImageScrollBox(Sender).MouseMode := mmUser |
| | | end |
| | | Else |
| | | begin |
| | | Label3.Caption:='FileName='+TImageScrollBox(Sender).FileName; |
| | | ViewMouseMode(NowClick); |
| | | end; |
| | | |
| | | ISB1.AlwaysShowAnnotations := False; |
| | | |
| | | // if TImageScrollBox(Sender).FileName = '' then |
| | | // begin |
| | | ////ShowMessage('AAA'); |
| | | //Label3.Caption:='FileName='+TImageScrollBox(Sender).FileName+' time='+FormatDateTime('yyyy/mm/dd HH:MM:SS', now); |
| | | // TImageScrollBox(Sender).MouseMode := mmUser |
| | | // end |
| | | // Else |
| | | // begin |
| | | //Label3.Caption:='FileName='+TImageScrollBox(Sender).FileName; |
| | | // ViewMouseMode(NowClick); |
| | | // end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ISB1ImageMouseUp(Sender: TObject; Button: TMouseButton; |
| | |
| | | DocNo_List.Free; //DocNo清單 |
| | | Context_DocnoList.Free; //案件裡的檔案Docno清單 |
| | | ContextList.Free; //案件裡的檔案清單 |
| | | AttContextList.Free; //案件裡的附加檔案清單 |
| | | NowShowFileList.Free; //目前顯示的影像清單 |
| | | NowSelectFileList.Free; //目前被點選的影像清單 |
| | | Cust_DocNoList.Free; //自行定義文件名稱 |
| | |
| | | LastAddFormidList.Free; |
| | | SampleFormIDList.Free; |
| | | ExistImgList.Free; |
| | | reSizeExistImgList.Free; |
| | | //********清單區******** |
| | | if (FMode = 'DSCAN') or (FMode = 'ESCAN') then //重掃件及異動件要只能掃指定編號的件 |
| | | begin |
| | | if ImagePath<>'' then |
| | | _Deltree(ImagePath); |
| | | end; |
| | | |
| | | if FEvents <> nil then FEvents.OnDestroy; |
| | | end; |
| | | |
| | |
| | | iISB : TImageScrollBox; |
| | | GoAtt : Boolean; |
| | | AttLv : Integer; |
| | | ST1 :TStringList; |
| | | begin |
| | | PreNode2Name := ''; |
| | | ST1:=TStringList.Create; |
| | | if TreeView1.Selected.Parent = MyTreeNode1 then |
| | | PreNode2Name:= GetNode2Name(MyTreeNode2); |
| | | ShowText := _Msg('文件歸類中,請稍候'); |
| | | LogFile1.LogToFile(logTimeString+'縮圖 歸類開始'); |
| | | DataLoading(True,True); |
| | | GoAtt := False; |
| | | if (MytreeNode2 <> nil) and (Pos('Attach',MyTreeNode2.Text)>0) then |
| | |
| | | try |
| | | InitialLanguage(DocListForm); //載入多國語言 |
| | | //InitialLanguage(PatchDlg); //載入多國語言 |
| | | DocListForm.CheckBox1.Visible:=False; |
| | | for i := 1 to FORM_INF_List.Count - 1 do |
| | | begin |
| | | FormID := GetSQLData(FORM_INF_List,'T1.FORM_ID',i); |
| | |
| | | begin |
| | | if (Components[i] is TShape) and (copy(Components[i].Name,1,2)='SP') then |
| | | begin |
| | | //Showmessage(Components[i].Name); |
| | | iISBName := ShapeName2PreViewISBName(TShape(Components[i])); |
| | | iISB := TImageScrollBox(FindComponent(iISBName)); |
| | | OldName := ExtractFileName(iISB.FileName); |
| | | Ext := ExtractFileExt(OldName); |
| | | FormID := DocListForm.DocLV.Selected.Caption; |
| | | DocNo := FormCode2DocNo(FormID); |
| | | |
| | | if DocListForm.CheckBox1.Checked then |
| | | begin |
| | | FormID := DocListForm.Edit1.Text; |
| | | DocNo := GetNewCustomDocNo(DisplayPath,FormID); |
| | | end |
| | | else |
| | | begin |
| | | FormID := DocListForm.DocLV.Selected.Caption; |
| | | DocNo := FormCode2DocNo(FormID); |
| | | end; |
| | | |
| | | |
| | | if DocNoDir2DocNo(Path2DocDir(ExtractFilePath(iISB.FileName),NowCaseno)) = DocNo then |
| | | DocDir := Path2DocDir(ExtractFilePath(iISB.FileName),NowCaseNo) |
| | | Else |
| | | DocDir := FindLastestDocDir(NowCaseno,DocNo); |
| | | |
| | | //ShowMessage('DocNoNeedDiv(DocNo)='+BoolToStr(DocNoNeedDiv(DocNo),true)); |
| | | //ShowMessage('DocDir='+DocDir); |
| | | |
| | | if DocNoNeedDiv(DocNo) then //要分份數 |
| | | begin |
| | | if ((FormCode2Page(FormID) = '01') and (GetDocDir_Page(NowCaseno,DocDir)>0)) or (DocDir = '') then |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',DocNo); |
| | | end |
| | | else |
| | | begin //20171016 真對補件影響 所加的判斷 |
| | | ST1.Clear; |
| | | if FileExists(ImageSavePath + NowCaseno+'\'+DocDir+'\Context.dat') then |
| | | begin |
| | | ST1.LoadFromFile(ImageSavePath + NowCaseno+'\'+DocDir+'\Context.dat'); |
| | | if (ST1.Count > 0) and ISExistImg(ImageSavePath + NowCaseno+'\'+DocDir+'\'+ST1.Strings[0]) then //20181210 多增加判斷ST1>0 否則會有機會出現List out of bound Hong |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',DocNo); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else //不分份數 |
| | | begin |
| | |
| | | DocDir:=DocNo2DocNoDir(ImageSavePath+NowCaseno+'\',DocNo); |
| | | SetDocNoList('A',-1,NowCaseno,DocDir); |
| | | end; } |
| | | LogFile1.LogToFile(logTimeString+'縮圖 FormID='+FormID); |
| | | if Not DirectoryExists(ImageSavePath+NowCaseno+'\'+DocDir) then |
| | | Mkdir(ImageSavePath+NowCaseno+'\'+DocDir); |
| | | ContextList.Clear; |
| | |
| | | //ReNameContext(iISB.FileName,OldName,NewName); |
| | | end; |
| | | end; |
| | | //ShowMessage('KKKK'); |
| | | ReSortFileName(ExtractFilePath(iISB.FileName)); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | |
| | | finally |
| | | DataLoading(False,False); |
| | | DocListForm.Free; |
| | | ST1.Free; |
| | | end; |
| | | |
| | | end; |
| | |
| | | GoAtt := True; |
| | | end; |
| | | |
| | | if InputQuery('輸入其他文件名稱','文件名稱',CustomDocName) then |
| | | if InputQuery(_Msg('輸入其他文件名稱'),_Msg('文件名稱'),CustomDocName) then |
| | | begin |
| | | if FindCustomDocName(DisplayPath,CustomDocName) then |
| | | begin |
| | | Showmessage(Format('文件名稱:"%s"己存在',[CustomDocName])); |
| | | Showmessage(Format(_Msg('文件名稱:"%s"己存在'),[CustomDocName])); |
| | | Exit; |
| | | end; |
| | | CustomDocNo := GetNewCustomDocNo(DisplayPath,CustomDocName); |
| | | end; |
| | | if CustomDocNo = '' then Exit; |
| | | DocDir := CustomDocNo; |
| | | LogFile1.LogToFile(logTimeString+'縮圖 歸類自訂文件 DocDir='+DocDir); |
| | | SavePath := ImageSavePath+NowCaseNo+'\'+DocDir+'\'; |
| | | Str2Dir(SavePath); |
| | | SetDocNoList('A',-1,NowCaseNo,DocDir,'1'); |
| | |
| | | iISBName,OldName : String; |
| | | iISB : TImageScrollBox; |
| | | begin |
| | | if MessageDlg('是否確定刪除??',mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | if MessageDlg(_Msg('是否確定刪除??'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | |
| | | for i := 0 to ComponentCount -1 do |
| | | begin |
| | |
| | | // Exit; |
| | | // end; |
| | | // end; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'縮圖刪除 iISB.FileName='+iISB.FileName); |
| | | DeleteImageFile(ExtractFilePath(iISB.FileName),ExtractFileName(iISB.FileName),NowCaseNo); |
| | | end; |
| | | end; |
| | | //ShowMessage('iISB.FileName='+iISB.FileName); |
| | | ReSortFileName(ExtractFilePath(iISB.FileName)); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | | MyTreeNode1.Text := Format('%s-%d'+_Msg('頁'),[NowCaseno,GetCasePage(ImageSavePath,NowCaseNo)]); |
| | | MyTreeNode1.Text := Format(_Msg('%s-%d頁'),[NowCaseno,GetCasePage(ImageSavePath,NowCaseNo)]); |
| | | NewTreeNodeRefresh; |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | TreeView1click(self); |
| | |
| | | var |
| | | mp:string; |
| | | begin |
| | | mp := InputBox('移動頁數','請輸入移入頁碼',''); |
| | | mp := InputBox(_Msg('移動頁數'),_Msg('請輸入移入頁碼'),''); |
| | | if (mp <> '') then |
| | | begin |
| | | MoveImage(DisplayPath+NowDocDir+'\',strtoint(mp)); |
| | |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'掃瞄開始'); |
| | | if (FMode = 'RSCAN') or (FMode = 'ESCAN') or (FMode = 'DSCAN') then |
| | | begin |
| | | if NewTreeNode.Count > 0 then |
| | |
| | | ContextList.Clear; |
| | | Try |
| | | StatrTwainScan; |
| | | LogFile1.LogToFile(logTimeString+'掃瞄結束'); |
| | | Except |
| | | Panel1.Enabled := True; |
| | | Panel2.Enabled := True; |
| | |
| | | P,v,v1,v2,ln,i : Integer; |
| | | iDocDir,iDocNo : String; |
| | | begin |
| | | LogFile1.LogToFile(logTimeString+'Tree 按下刪除'); |
| | | if TreeView1.Selected = NewTreeNode then //全刪 //新掃描件 |
| | | begin |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree 全部刪除'); |
| | | If Messagedlg(_Msg('是否刪除所有案件?'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | |
| | | end |
| | | Else if TreeView1.Selected = MyTreeNode1 then //案件編號 |
| | | begin |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree 案件編號刪除 NowCaseno='+NowCaseno); |
| | | If Messagedlg(Format(_Msg('編號(%s)是否刪除?'),[NowCaseno]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | |
| | | ClearView(1); |
| | | Application.ProcessMessages; |
| | | //ShowMessage(NowDocDir); |
| | | LogFile1.LogToFile(logTimeString+'Tree 文件層號刪除 NowDocDir='+NowDocDir); |
| | | if (Length(NowDocDir)=8) or (NowDocDir=AttName) then |
| | | begin |
| | | //ShowMessage('DeleteDocNoFileForESCAN'); |
| | |
| | | Else if TreeView1.Selected = MyTreeNode3 then //FormID層 |
| | | begin |
| | | If Messagedlg(Format(_Msg('文件(%s)是否刪除?'),[NowFormName]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree FormID層號刪除 NowFormCode='+NowFormCode); |
| | | DeleteFormCodeFile(NowCaseNo,NowDocDir,NowFormCode); |
| | | SetRecordEditedDocDir('A',NowCaseNo,NowDocDir); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | |
| | | begin |
| | | Result:=False; |
| | | ST:=TStringList.Create; |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | //ShowMessage(ST.Text); |
| | | if FileExists(DocNopath+'\Context.dat') then /////20190319 Hong 當有空的Docno目錄時會掛掉,增加這行 |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | for I := 0 to ST.Count - 1 do |
| | | begin |
| | | if ISExistImg(DocNopath+ST.Strings[i]) then |
| | |
| | | if (Treeview1.Selected = NewTreeNode) {or (Treeview1.Selected = MyTreeNode1)} then |
| | | begin |
| | | //ShowMessage('NewScanBtnClick'); |
| | | LogFile1.LogToFile(logTimeString+'Tree NewScanBtnClick'); |
| | | NewScanBtnClick(self) |
| | | end |
| | | Else |
| | | begin |
| | | //ShowMessage('AddScanBtnclick'); |
| | | LogFile1.LogToFile(logTimeString+'Tree AddScanBtnclick'); |
| | | AddScanBtnclick(self); |
| | | end; |
| | | end; |
| | |
| | | SaveStream : TFileStream; |
| | | SaveStreamA:TFileStream; |
| | | SaveStreamB:TFileStream; |
| | | cooom:integer; |
| | | Begin |
| | | OpenDialog1.Filter := 'Image files|*.TIF;*.JPG'; |
| | | OpenDialog1.Filter := 'Image files|*.TIF;*.JPG;*.PNG'; |
| | | If OpenDialog1.Execute Then |
| | | Begin |
| | | ISB := TImageScrollBox.Create(self); |
| | | try |
| | | ShowText := _Msg('檔案加入中,請稍候'); |
| | | LogFile1.LogToFile(logTimeString+'檔案加入中開始'); |
| | | DataLoading(True, True); |
| | | If TreeView1.Selected = Nil Then |
| | | Exit; |
| | |
| | | Begin |
| | | FFileSizeLimit := 5 * 1024; |
| | | End; |
| | | //FFileSizeLimit:=20*5*1024; |
| | | //ShowMessage(IntToStr(FileRec.Size)+','+IntToStr(FFileSizeLimit * 1024)); |
| | | If FileRec.Size > FFileSizeLimit * 1024 Then // 檢查檔案大小 |
| | | Begin |
| | | ShowMessage(Format('%.3f', [FileRec.Size / 1024]) + |
| | | ' KB, file size over limit.'); |
| | | ShowMessage(Format(_Msg('目前檔案大小為 %.3f MB,已超過單一檔案匯入限制%1.f MB'),[FileRec.Size / (1024*1024),FFileSizeLimit/1024])); |
| | | {ShowMessage(Format('目前檔案大小為 %.3f MB', [FileRec.Size / (1024*1024)]) + |
| | | ',已超過單一檔案匯入限制'+Format('%.1f',[FFileSizeLimit/1024])+'MB');} |
| | | FindClose(FileRec); |
| | | DataLoading(false, false); |
| | | Exit; |
| | | End; |
| | | //MessageDlg() |
| | | //cooom:=StrToInt(InputBox('輸入百分比','輸入百分比','')); |
| | | cooom:=FJpgCompression;//20171211彩色tif採jpg壓縮的比例 |
| | | |
| | | FindClose(FileRec); |
| | | CaseID := NowCaseno; |
| | |
| | | P := ISB.ImageCountFromFile(OpenDialog1.FileName); |
| | | For i := 1 To P Do |
| | | Begin |
| | | ShowText := _Msg('檔案加入中,請稍候(' + inttostr(i) + '/' + inttostr(P) + ')'); |
| | | ShowText := Format(_Msg('檔案加入中,請稍候(%d/%d)'),[i,p]); |
| | | //ShowText := _Msg('檔案加入中,請稍候')+'(' + inttostr(i) + '/' + inttostr(P) + ')'; |
| | | DataLoading(True, True); |
| | | ISB.LoadFromFile(FName, i); |
| | | // ISB.SaveToFile('C:\OCX\aaaaaa'+IntToStr(i)+'.tif'); |
| | | DeskewImg(ISB.Graphic); |
| | | // ISB.SaveToFile('C:\OCX\bbbbbb'+IntToStr(i)+'.tif'); |
| | | |
| | | |
| | | ISB_BW.Graphic.Assign(ISB.Graphic); //20180104 |
| | | If ISB.Graphic.ImageFormat <> ifBlackWhite Then //20180104 |
| | | begin |
| | | ConvertToBW(ISB_BW.Graphic); |
| | | end; |
| | | ///ISB_BW.SaveToFile('KKKKKKKK.tif'); |
| | | |
| | | iGraphic_First := TTiffGraphic.Create; |
| | | iGraphic_sec := TTiffGraphic.Create; |
| | | |
| | | |
| | | //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0 黑白 為2 |
| | | |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(ISB.Graphic, MpsBarcodeinf.r180[n]); |
| | | //MpsGetBarcode(iGraphic_First, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | MpsGetBarcode(ISB.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | //有必要的話先把影像轉正 再開始切圖 |
| | | If CheckNeedCrop(iGraphic_First) Then |
| | | Begin |
| | |
| | | iRect.Bottom := ISB.Graphic.Height; |
| | | CropImg(iGraphic_sec, iRect); |
| | | End; |
| | | |
| | | ISB.Graphic.Clear; //20220711 Hong 覺得ISB後面沒有到了,先清掉減少記憶體使用 |
| | | iGraphic := iGraphic_First; |
| | | |
| | | While Not iGraphic.IsEmpty Do |
| | |
| | | (TreeView1.Selected = MyTreeNode1) Then |
| | | Begin |
| | | SaveFilename := ''; |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | ISB_BW.Graphic.Assign(iGraphic); //20180104 |
| | | If iGraphic.ImageFormat <> ifBlackWhite Then //20180104 |
| | | begin |
| | | ConvertToBW(ISB_BW.Graphic); |
| | | end; |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | //ShowMessage(IntToStr(MpsBarcodeinf.Count)); |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[n]); |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | //ShowMessage('XXX '+IntToStr(MpsBarcodeinf.Count)); |
| | | FormID := BarCode2FormID; |
| | | //ShowMessage('FormID='+FormID); |
| | | // 取出FormID |
| | | SaveFilename := FormID; |
| | | If (TreeView1.Selected = NewTreeNode) Then |
| | |
| | | |
| | | DocNo := FormCode2DocNo(FormID); |
| | | DocDir := FindLastestDocDir(CaseID, DocNo); |
| | | if (FMode='ESCAN') and (FModeName=_Msg('補件掃描')) then |
| | | begin |
| | | DocDir := FindLastestDocDirForPage(CaseID, DocNo,FormID); |
| | | //ShowMessage('DocDir='+DocDir); |
| | | end; |
| | | |
| | | If DocNoNeedDiv(DocNo) Then // 要分份數 |
| | | Begin |
| | | If ((FormCode2Page(FormID) = '01') And |
| | | (GetDocDir_Page(CaseID, DocDir) > 0)) Or (DocDir = '') Then |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + CaseID + '\', DocNo); |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + CaseID + '\', DocNo); |
| | | end; |
| | | End |
| | | Else // 不分份數 |
| | | Begin |
| | |
| | | |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[n]); |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | //ShowMessage(IntToStr(iGraphic.Palette.palNumEntries)); |
| | | if iGraphic.ImageFormat = ifBlackWhite then //20200806 出現無法匯入,是因color256無法壓JPEG,待報會後再開啟 |
| | | begin |
| | | SaveFilename := changefileext(SaveFilename,'.tif'); //20240320 Hong 調整黑白存tif |
| | | iGraphic.Compression:=tcGroup4; |
| | | end |
| | | else if iGraphic.ImageFormat= ifColor256 then |
| | | begin |
| | | SaveFilename := changefileext(SaveFilename,'.jpg'); //20240320 Hong 調整Color256存jpg |
| | | ConverttoGray(iGraphic); |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | | end |
| | | else if (iGraphic.ImageFormat = ifTrueColor) or (iGraphic.ImageFormat = ifGray256) then |
| | | begin |
| | | SaveFilename := changefileext(SaveFilename,'.jpg'); //20240320 Hong 調整彩色灰階存jpg |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | | end |
| | | else |
| | | begin |
| | | iGraphic.Compression:=tcLZW; |
| | | end; |
| | | |
| | | {if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 灰階256 //20200806拿掉 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | | end;} |
| | | |
| | | If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then |
| | | Begin |
| | |
| | | SaveStream.Free; |
| | | End; |
| | | End |
| | | Else If LowerCase(ExtractFileExt(SavePath + SaveFilename)) |
| | | = '.jpg' Then |
| | | Else If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.jpg' Then |
| | | Begin |
| | | If FileExists(SavePath + SaveFilename) Then |
| | | DeleteFile(SavePath + SaveFilename); |
| | |
| | | // SaveStream.Free; |
| | | End; |
| | | End; |
| | | |
| | | // Rotate(ISB.Graphic,MpsBarcodeinf.r180[n]); //20170705 加入有條碼就轉正 |
| | | // ISB.SaveToFile(SavePath+SaveFilename); |
| | | |
| | | SetContextList('A', -1, CaseID, DocDir, SaveFilename); |
| | | If (TreeView1.Selected = NewTreeNode) Then |
| | |
| | | Break; |
| | | End; |
| | | End; |
| | | // Rotate(ISB.Graphic,MpsBarcodeinf.r180[n]); //20170705 加入有條碼就轉正 |
| | | |
| | | if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | | end; |
| | | |
| | | If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then |
| | | Begin |
| | |
| | | JpgGr := TJpegGraphic.Create; |
| | | Try |
| | | JpgGr.Assign(iGraphic); |
| | | JpgGr.SaveQuality := 30; |
| | | JpgGr.SaveQuality := cooom; |
| | | // JpgGr.AppendToStream(SaveStream); |
| | | JpgGr.SaveToFile(SavePath + SaveFilename); |
| | | Finally |
| | |
| | | |
| | | finally |
| | | ISB.Free; |
| | | iGraphic_First.Free; |
| | | iGraphic_sec.Free; |
| | | end; |
| | | |
| | | |
| | |
| | | i : Integer; |
| | | DocListForm : TDocListForm; |
| | | OldName,NewName,Ext : String; |
| | | NewFormID,NewFormName : String; |
| | | NewFormID,NewFormName,CustomDocNo : String; |
| | | begin |
| | | DocListForm := TDocListForm.Create(self); |
| | | try |
| | | InitialLanguage(PatchDlg); //載入多國語言 |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類開始'); |
| | | InitialLanguage(DocListForm); //載入多國語言 |
| | | DocListForm.CheckBox1.Visible:=True; |
| | | for i := 1 to FORM_INF_List.Count - 1 do |
| | | begin |
| | | NewFormID := GetSQLData(FORM_INF_List,'T1.FORM_ID',i); |
| | |
| | | end; |
| | | if DocListForm.ShowModal = mrOk then |
| | | begin |
| | | NewFormID := DocListForm.DocLV.Selected.Caption; |
| | | if NowFormCode <> AttName then |
| | | if not (DocListForm.DocLV.Selected=nil) then |
| | | NewFormID := DocListForm.DocLV.Selected.Caption; |
| | | if DocListForm.CheckBox1.Checked then |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[FormCode2FormName(NowCaseNo,NowFormCode),FormCode2FormName(NowCaseNo,NewFormID)]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | //歸類到自訂文件 |
| | | NewFormID:=DocListForm.Edit1.Text; |
| | | |
| | | if Trim(DocListForm.Edit1.Text)='' then |
| | | begin |
| | | Showmessage(_Msg('未輸入文件名稱')); |
| | | Exit; |
| | | end; |
| | | if FindCustomDocName(DisplayPath,NewFormID) then |
| | | begin |
| | | Showmessage(Format(_Msg('文件名稱:"%s"己存在'),[NewFormID])); |
| | | Exit; |
| | | end; |
| | | if NowFormCode <> AttName then |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[FormCode2FormName(NowCaseNo,NowFormCode),NewFormID]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Exit; |
| | | end |
| | | Else |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[_Msg('附件')+MyTreeNode3.Text,FormCode2FormName(NowCaseNo,NewFormID)]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Exit; |
| | | end; |
| | | CustomDocNo := GetNewCustomDocNo(DisplayPath,NewFormID); |
| | | //ShowMessage('CustomDocNo='+CustomDocNo); |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類到自訂文件 CustomDocNo='+CustomDocNo); |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,CustomDocNo+'010101A'); |
| | | end |
| | | Else |
| | | else |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[_Msg('附件')+MyTreeNode3.Text,FormCode2FormName(NowCaseNo,NewFormID)]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Exit; |
| | | //歸類到既有文件 |
| | | if NowFormCode <> AttName then |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[FormCode2FormName(NowCaseNo,NowFormCode),FormCode2FormName(NowCaseNo,NewFormID)]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Exit; |
| | | end |
| | | Else |
| | | begin |
| | | If Messagedlg(Format(_Msg('是否將"%s"的所有影像歸類成"%s"'),[_Msg('附件')+MyTreeNode3.Text,FormCode2FormName(NowCaseNo,NewFormID)]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Exit; |
| | | end; |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | //ShowMessage('NowDocDir='+NowDocDir); |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類到既有文件 NewFormID='+NewFormID); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,NewFormID); |
| | | |
| | | end; |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | //FormIDReplace(DisplayPath,NowFormCode,FormID); |
| | | //ShowFileReplace(DisplayPath,FormID); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,NewFormID); |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | | //DrawDocItem(MytreeNode1,FORM_INF_List,NowCaseno); |
| | | |
| | | DataLoading(False,False); |
| | | TreeView1.Selected := MyTreeNode1; |
| | | TreeView1Click(self); |
| | | end; |
| | | |
| | | finally |
| | | DocListForm.Free; |
| | | end; |
| | |
| | | CustomDocNo : String; |
| | | DocDir : String; |
| | | SavePath : String; |
| | | ST1:TStringList; |
| | | begin |
| | | if InputQuery('輸入其他文件名稱','文件名稱',CustomDocName) then |
| | | if InputQuery(_Msg('輸入其他文件名稱'),_Msg('文件名稱'),CustomDocName) then |
| | | begin |
| | | if CustomDocName <> '' then |
| | | begin |
| | |
| | | Showmessage(Format('文件名稱:"%s"己存在',[CustomDocName])); |
| | | Exit; |
| | | end; |
| | | |
| | | ST1:=TStringList.Create; |
| | | CustomDocNo := GetNewCustomDocNo(DisplayPath,CustomDocName); |
| | | DocDir := CustomDocNo; |
| | | SavePath := ImageSavePath+NowCaseNo+'\'+DocDir+'\'; |
| | |
| | | begin |
| | | oldCopies := GetDocDirCopies(NowCaseno,NowDocDir); |
| | | try |
| | | NewCopies := Strtoint(inputBox('修改份數','請輸入修改後的份數',inttostr(oldCopies))); |
| | | NewCopies := Strtoint(inputBox(_Msg('修改份數'),_Msg('請輸入修改後的份數'),inttostr(oldCopies))); |
| | | except |
| | | Showmessage('輸入錯誤'); |
| | | Showmessage(_Msg('輸入錯誤')); |
| | | Exit; |
| | | end; |
| | | if (NewCopies <= 0) and (NewCopies >= 10000) then |
| | | begin |
| | | Showmessage('輸入範圍錯誤'); |
| | | Showmessage(_Msg('輸入範圍錯誤')); |
| | | Exit; |
| | | end; |
| | | |
| | | if (oldCopies <> NewCopies) and (NewCopies > 0) and (NewCopies < 10000) then |
| | | begin |
| | | if DocNoNeedDiv(NowDocNo) and (NewCopies = 1) and (MessageDlg('修改至1份後此文件將無法再進行份數修改,是否確定??',mtConfirmation,[mbyes,mbcancel],0)= mrcancel) then |
| | | if DocNoNeedDiv(NowDocNo) and (NewCopies = 1) and (MessageDlg(_Msg('修改至1份後此文件將無法再進行份數修改,是否確定??'),mtConfirmation,[mbyes,mbcancel],0)= mrcancel) then |
| | | Exit; |
| | | |
| | | SetDocDirCopies(NowCaseno,NowDocDir,NewCopies); |
| | | SetRecordEditedDocDir('A',NowCaseNo,NowDocDir); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | | Showmessage('修改完成'); |
| | | Showmessage(_Msg('修改完成')); |
| | | end; |
| | | |
| | | end; |
| | |
| | | if DisplayISB.FileName = '' then Exit; |
| | | if (ContextList.Count = 1) and ((FMode = 'NSCAN') or (FMode = 'ASCAN') or (FMode = 'DSCAN') or (FMode = 'ISCAN') or (FMode = 'SSCAN') or (FMode = 'MSCAN') or (FMode = 'RI_SCAN')) then |
| | | begin |
| | | if Messagedlg(_Msg('刪除後(%s)案件無影像,將刪除此案件,是否確定刪除?'),mtconfirmation,[mbyes,mbcancel],0) = mrCancel then Exit; |
| | | if Messagedlg(Format(_Msg('刪除後(%s)案件無影像,將刪除此案件,是否確定刪除?'),[NowCaseno]),mtconfirmation,[mbyes,mbcancel],0) = mrCancel then Exit; |
| | | _DelTree(DisplayPath); |
| | | SetCaseList('D',NewTreeNode.IndexOf(MyTreeNode1),''); |
| | | LoadImgFile; |
| | |
| | | PM104.Visible := True; //檔案加入影像 |
| | | end; |
| | | |
| | | if FModeName='異動件' then |
| | | if FModeName=_Msg('異動件') then |
| | | begin |
| | | PM101.Visible := True; |
| | | end; |
| | |
| | | if FMode='ESCAN' then |
| | | PM101.Visible:=false; |
| | | |
| | | if FModeName='異動件' then |
| | | if FModeName=_Msg('異動件') then |
| | | begin |
| | | PM101.Visible := True; |
| | | end; |
| | |
| | | PM101.Visible:=false; |
| | | end; |
| | | |
| | | if FModeName='異動件' then |
| | | if FModeName=_Msg('異動件') then |
| | | begin |
| | | PM101.Visible := True; |
| | | end; |
| | |
| | | PM101.Visible:=false; |
| | | end; |
| | | |
| | | if FModeName='異動件' then |
| | | if FModeName=_Msg('異動件') then |
| | | begin |
| | | PM101.Visible := True; |
| | | end; |
| | |
| | | PM605.Visible := True; //刪除 |
| | | end; |
| | | |
| | | if FModeName<>'異動件' then |
| | | if FModeName<>_Msg('異動件') then |
| | | begin |
| | | if (FImgDelete='Y') then |
| | | begin |
| | |
| | | if SampleFormIDList.IndexOf(SampleFormID)<>-1 then |
| | | begin |
| | | // Show a custom dialog |
| | | buttonSelected := messagedlg(SampleFormID+'已有範本,是否取代?',mtCustom, |
| | | buttonSelected := messagedlg(SampleFormID+_Msg('已有範本,是否取代?'),mtCustom, |
| | | [mbYes,mbCancel], 0); |
| | | if buttonSelected = mrCancel then |
| | | begin |
| | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ScrollBox1MouseEnter(Sender: TObject); |
| | | begin |
| | | ScrollBox1.SetFocus; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.SelectScanBtnClick(Sender: TObject); |
| | | begin |
| | | Panel1.Enabled := False; |
| | |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AddAttFileLBClick(Sender: TObject); |
| | | var |
| | | i : Integer; |
| | | Addfile : String; |
| | | begin |
| | | OpenDialog1.Filter := 'PDF files|*.pdf'; |
| | | OpenDialog1.Options := [ofAllowMultiSelect]; |
| | | if OpenDialog1.Execute then |
| | | begin |
| | | ShowText :=_Msg('檔案加入中,請稍候'); |
| | | DataLoading(True,True); |
| | | for i := 0 to OpenDialog1.Files.Count - 1 do |
| | | begin |
| | | AddFile := HTTPEncode(UTF8Encode(ExtractFileName(OpenDialog1.Files.Strings[i]))); |
| | | if FileExists(ImageSavePath+NowCaseno+'\'+AddFile) then |
| | | begin |
| | | if Messagedlg(Format(_Msg('%s己存在,是否覆蓋??'),[Addfile]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Continue; |
| | | SetAttContextList('D',-1,NowCaseno,AddFile); |
| | | end; |
| | | // AttFileGB.Visible := True; //附加電子檔窗 //20120207楊玉說不在這加電子檔先拿掉 |
| | | // Splitter2.Visible := True; |
| | | CopyFile(Pchar(OpenDialog1.Files.Strings[i]),Pchar(ImageSavePath+NowCaseno+'\'+AddFile),False); |
| | | SetAttContextList('A',-1,NowCaseno,AddFile); |
| | | LoadAttFile(NowCaseno); |
| | | end; |
| | | end; |
| | | DataLoading(False,False); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AddCredit1RGClick(Sender: TObject); |
| | | begin |
| | | if DisplayPath <> '' then |
| | |
| | | begin |
| | | IF not InitialOk Then |
| | | begin |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Showmessage(_Msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | if MyTreeNode1 = nil then |
| | |
| | | TreeView1Click(self); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AttListBoxClick(Sender: TObject); |
| | | begin |
| | | DelAttFileLB.Enabled := False; |
| | | if AttListBox.ItemIndex >= 0 then |
| | | DelAttFileLB.Enabled := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AttListBoxDblClick(Sender: TObject); |
| | | var |
| | | AttFile : String; |
| | | begin |
| | | if AttListBox.ItemIndex < 0 then Exit; |
| | | |
| | | AttFile := HTTPEncode(UTF8Encode(AttListBox.Items.Strings[AttListBox.ItemIndex])); |
| | | if FileExists(DisplayPath+AttFile) then |
| | | ShellExecute(Application.Handle,'open',PChar(DisplayPath+AttFile),nil,nil,SW_SHOW) |
| | | else |
| | | Showmessage(Format(_Msg('找不到檔案:%s'),[AttFile])); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.BtnMouseEnter(Sender: TObject); |
| | | begin |
| | | AddToolTip(TBitBtn(Sender).Handle,nil,0,Pchar(TBitBtn(Sender).Hint),nil,0,0); |
| | |
| | | //CreateFormID_FormName(DisplayPath); //產生FormID_FormName.dat |
| | | //CreateDocNo_DocName(DisplayPath); //產生DocNo_Name.dat |
| | | //Showmessage(CreateDocNo_Info(DisplayPath)); //產生 Docno,份數,頁數;Docno,份數,頁數 的回傳字串 |
| | | lb1.Caption:='AAAAAAAAAAA'; |
| | | //lb1.Caption:='AAAAAAAAAAA'; |
| | | //Showmessage(CreateDocnoFrom_Info(NowCaseno)); |
| | | //Showmessage(self.CreateCustDocNoFrom_Info(NowCaseno)); |
| | | |
| | | initkscan; |
| | | //ShowMessage('FMaxUploadSize='+FMaxUploadSize); |
| | | //initkscan; |
| | | showmessage('FUrl='+FUrl+#10#13+ |
| | | 'FCaseID='+FCaseID+#10#13+ |
| | | 'FMode='+FMode+#10#13+ |
| | |
| | | 'FImgDelete='+ FImgDelete+#10#13+ |
| | | 'FIsExternal='+ FIsExternal+#10#13+ |
| | | 'FWH_category='+FWH_category+ |
| | | 'FCheck_main_form='+ FCheck_main_form); |
| | | 'FCheck_main_form='+ FCheck_main_form+#10#13+ |
| | | 'FMaxUploadSize='+FMaxUploadSize); |
| | | //FImgDelete:='Y'; |
| | | LoadImgFile; |
| | | { ShowMessage('UpLPoint='+IntToStr(UpLPoint.X)+','+IntToStr(UpLPoint.Y)+#10#13+ |
| | |
| | | // SampleFormIDList.Add('31A00101031706A'); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.Button5Click(Sender: TObject); |
| | | begin |
| | | GetftpInfo(NowCaseno,'upload'); |
| | | SetFtpInfo; |
| | | IIS_Ftp.FtpsConnect; |
| | | |
| | | IIS_Ftp.FtpsToMain(FFtpExtraPath,NowCaseno+'.pdf','d:\1.pdf',display1); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.Button6Click(Sender: TObject); |
| | | begin |
| | | GetftpInfo(NowCaseno,'download'); |
| | | SetFtpInfo; |
| | | IIS_Ftp.FtpsConnect; |
| | | IIS_Ftp.FtpsCWD(IIS_Ftp.FtpPath); |
| | | IIS_Ftp.FtpsReceive(NowCaseNo+'.zip','d:\'+NowCaseNo+'.zip'); |
| | | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.StatrTwainScan; |
| | | var ScanInfo : TScanInfo; |
| | | i : Integer; |
| | |
| | | Try |
| | | Scanner.OpenSource; |
| | | Scanner.Duplex := ScanDuplex; //雙面 |
| | | |
| | | if FMode='SAMPLESCAN' then |
| | | Scanner.Duplex:=False; |
| | | |
| | | //Scanner.FEEDERENABLED := not ScanFlatCB.Checked; // 先拿掉平台 |
| | | If ScanImgSetUse Then |
| | | begin |
| | |
| | | end; |
| | | end; |
| | | pScanInfo^.Graphic.Compression := tcJpeg; |
| | | pScanInfo^.Graphic.JpegQuality := 70; |
| | | pScanInfo^.Graphic.JpegQuality := FJpgCompression; |
| | | end |
| | | else if pScanInfo^.Graphic.ImageFormat = ifColor256 Then |
| | | begin |
| | | //Ext := '.jpg'; |
| | | ConvertToGray(pScanInfo^.Graphic); |
| | | pScanInfo^.Graphic.Compression := tcJpeg; |
| | | pScanInfo^.Graphic.JpegQuality := 70; |
| | | pScanInfo^.Graphic.JpegQuality := FJpgCompression; |
| | | end |
| | | else if pScanInfo^.Graphic.ImageFormat = ifGray256 Then |
| | | begin |
| | |
| | | end; |
| | | end; |
| | | pScanInfo^.Graphic.Compression := tcJpeg; |
| | | pScanInfo^.Graphic.JpegQuality := 70; |
| | | pScanInfo^.Graphic.JpegQuality := FJpgCompression; |
| | | //ShowMessage(IntToStr(pScanInfo^.Graphic.JpegQuality)); |
| | | //if pScanInfo^.Graphic.Compression = tcJpeg then |
| | | //begin |
| | | //ShowMessage('jpg'); |
| | | //end; |
| | | |
| | | end |
| | | else |
| | | begin |
| | |
| | | end; |
| | | //iGraphic.Assign(iGraphic_First); |
| | | iGraphic := iGraphic_First; |
| | | |
| | | if iGraphic.ImageFormat=ifGray256 then //20180104 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | if iGraphic.ImageFormat=ifTrueColor then //20180104 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | |
| | | //ShowMessage('WTF'); |
| | | while not iGraphic.IsEmpty do |
| | | begin |
| | | //Application.ProcessMessages; |
| | |
| | | ImageScrollBox1NewGraphic(ImageScrollBox1.Graphic); |
| | | |
| | | MpsGetBarcode(ISB_BW.Graphic,MpsBarcodeinf); |
| | | For i := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[i] <> 0 Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[i]); |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | if iGraphic.ImageFormat=ifGray256 then //20180104 因此旋轉後變為回packbits 所以要改為jpeg |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | if iGraphic.ImageFormat=ifTrueColor then |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | PageEnd; |
| | | IF PEFileName <> '' Then |
| | | begin |
| | |
| | | JpgGr := TJpegGraphic.Create; |
| | | try |
| | | JpgGr.Assign(iGraphic); |
| | | JpgGr.SaveQuality := 30; |
| | | JpgGr.SaveQuality := FJpgCompression; |
| | | //JpgGr.AppendToStream(SaveStream); |
| | | JpgGr.SaveToFile(PEFileName); |
| | | finally |
| | |
| | | Str2Dir(ScanPath); |
| | | |
| | | ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo); |
| | | //ShowMessage('AA ScanDocDir='+ScanDocDir); |
| | | |
| | | //ShowMessage('BB ScanDocDir='+ScanDocDir); |
| | | if DocNoNeedDiv(DocNo)then //要分份數 |
| | | begin |
| | | //Showmessage(DocNo+#13+FormCode2Page(FormID)+#13+inttostr(GetDocDir_Page(ScanCaseno,ScanDocDir))+#13+ScanDocDir); |
| | |
| | | FormID := NowGuideFormID; |
| | | DocNo := FormCode2DocNo(FormID); |
| | | ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo); |
| | | //ShowMessage('ScanDocDir='+ScanDocDir); |
| | | |
| | | if (FMode='ESCAN') and (FModeName=_Msg('補件掃描')) then //20180207 加入的特殊邏輯 |
| | | begin |
| | | ScanDocDir := FindLastestDocDirForPage(ScanCaseno, DocNo,FormID); |
| | | end; |
| | | |
| | | if (DocNoNeedDiv(DocNo)) then //要分份數 |
| | | begin |
| | | if TreeView1.Selected = MyTreeNode1 then //20170421 掃瞄插頁時選則在案號上才要分份數 選在FormID上就不分份數 |
| | |
| | | DeleteFile(LngPath+'mps.dat'); |
| | | end; |
| | | ////壓zip////// |
| | | Showmessage('匯出完成,匯出檔案:'+LngPath+'mps.zip'); |
| | | Showmessage(_Msg('匯出完成,匯出檔案:')+LngPath+'mps.zip'); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ImportBtClick(Sender: TObject); |
| | |
| | | |
| | | str2dir(ZipPath); |
| | | if not ExecuteUnZip_Pwd(OpenDialog1.FileName,ZipPath,False,'9338430') then |
| | | Showmessage('無法解壓縮'); |
| | | Showmessage(_Msg('無法解壓縮')); |
| | | if not FileExists(ZipPath+'mps.dat') then |
| | | begin |
| | | Showmessage('格式不符,無法匯入'); |
| | | Showmessage(_Msg('格式不符,無法匯入')); |
| | | Exit; |
| | | end; |
| | | S.LoadFromFile(ZipPath+'mps.dat'); |
| | | if (En_DecryptionStr_Base64('D',S.Strings[0],'9338430')<> ServerDate) then |
| | | begin |
| | | Showmessage('檔案過期,無法匯入'); |
| | | Showmessage(_Msg('檔案過期,無法匯入')); |
| | | Exit; |
| | | end; |
| | | |
| | |
| | | S.Free; |
| | | _DelTree(ZipPath); |
| | | end; |
| | | Showmessage('匯入完成'); |
| | | Showmessage(_Msg('匯入完成')); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.HotKeyDown (var Msg : TMessage); |
| | |
| | | begin |
| | | PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i); |
| | | DivPageFormIDList.CommaText := PARA_CONTENT; |
| | | end |
| | | Else if UpperCase(GetSQLData(WORK_INF_List,'PARA_NO',i)) = 'FILE_COMPRESSION' Then //20171211 jpg to tif 壓縮比 |
| | | begin |
| | | PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i); |
| | | FJpgCompression := StrToInt(PARA_CONTENT); |
| | | end |
| | | Else if UpperCase(GetSQLData(WORK_INF_List,'PARA_NO',i)) = 'MAX_UPLOAD_SIZE' Then //取得 上傳大小的限制(MB) |
| | | begin |
| | | PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i); |
| | | FMaxUploadSize := PARA_CONTENT; |
| | | end; |
| | | end; |
| | | ScanDuplex := Def_ScanDuplex; |
| | |
| | | X509Certificate: TElX509Certificate; var Validate: Boolean); |
| | | begin |
| | | Validate := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.HTTPSClientRedirection(Sender: TObject; |
| | | const OldURL: string; var NewURL: string; var AllowRedirection: Boolean); |
| | | begin |
| | | AllowRedirection := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.EnableImage(v:integer;Sender : TObject); |
| | |
| | | |
| | | Result := False; // http://192.168.0.101:8080/fbnp/servlet/CWC01?act=getservertime |
| | | EnCodeDateTime := En_DecryptionStr_Base64('E',ServerDate+GetBalance2Time(Balance),Mpskey); |
| | | |
| | | ColumeStr := 'WORK_NO,DOC_NO,DOC_U_DESC,DOC_TYPE,DOC_VERSION,FORM_PAGES,START_DATE,STOP_DATE,IS_DOC_DIV,IS_IN_WH'; |
| | | //If not ProcessServlet(HTTPSClient,FURL+'servlet/CWC02 ','checktime='+EnCodeDateTime+'&mode=1&col='+Doc_Inf_Colume+'&workno='+FWork_No,FReWrite.Text,Memo1) Then |
| | | |
| | |
| | | StringtoFile(IN_WH_DocNoList.Text,'D:\121.txt');} |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.CheckRequiredColumnValues(workno, caseno:String): Boolean; |
| | | begin |
| | | // |
| | | Result:=False; |
| | | if (workno='HLN') and (caseno[9]='3') then |
| | | Result:=True; |
| | | if (workno='HLN') and (caseno[9]='4') then |
| | | Result:=True; |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.CheckRule2OMRErrInfo; //檢核規則填入OMRErrINFo Record |
| | | var i : Integer; |
| | | CheckNo : String; |
| | |
| | | begin |
| | | if FileName2FormCode(FileList.Strings[i]) = FormID then |
| | | begin |
| | | if (FMode = 'ESCAN') and (FModeName<>'異動件') then |
| | | if (FMode = 'ESCAN') and (FModeName<>_Msg('異動件')) then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\'+DocDir+'\'+FileList.Strings[i]) then |
| | | begin |
| | |
| | | Function TCB_IMGPSScanX.CheckCaseDocNoPage(CaseID,DocNo,Version:String;Pages:Integer):Integer; //取案件裡的文件_版本頁數 |
| | | var |
| | | i,n,Count : integer; |
| | | S : TStringlist; |
| | | S, S2 : TStringlist; |
| | | FormCode,iPage : String; |
| | | docInt,tempInt:integer; |
| | | v,v2:integer; |
| | | begin |
| | | Count := 0; |
| | | docInt:=0; |
| | | tempInt:=0; |
| | | S := TStringlist.Create; |
| | | S2 := TStringlist.Create; |
| | | //ShowMessage('page='+IntToStr(Pages)); |
| | | try |
| | | S.LoadFromFile(ImageSavePath+CaseID+'\upload\Context.dat'); |
| | | S2.LoadFromFile(ImageSavePath+CaseID+'\upload\DocDir.dat'); //2017 1220 改成只承認第一份的 |
| | | |
| | | for I := 1 to pages do //從0到pages-1 改成 1到pages 20170316 這樣可以修改檢核的頁數問題 |
| | | begin |
| | | iPage := Add_Zoo(i,2); |
| | | for n := 0 to S.Count - 1 do |
| | | begin |
| | | |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\upload\'+S.Strings[n]) then |
| | |
| | | Continue; |
| | | end; |
| | | end; |
| | | |
| | | if (Length(S2.Strings[n])>8) and (Pos(DocNo,S2.Strings[n])<>0) then //2017 1220 改成只承認第一份的 |
| | | begin |
| | | //LogFile1.LogToFile(logTimeString+'有進'+docno+','+S2.Strings[n]+IntToStr(Pos(DocNo,S2.Strings[n]))); |
| | | v:=Pos('(',S2.Strings[n]); |
| | | v2:=Pos(')',S2.Strings[n]); |
| | | tempInt:=StrToInt(Copy(S2.Strings[n],v+1,v2-v-1)); |
| | | |
| | | if docInt=0 then |
| | | begin |
| | | docInt:=tempInt; |
| | | end; |
| | | if docInt<>tempInt then |
| | | begin |
| | | //LogFile1.LogToFile(logTimeString+'docInt='+IntToStr(docInt)+',tempInt='+IntToStr(tempInt)); |
| | | Result := Count; |
| | | Break; |
| | | end; |
| | | end; |
| | | |
| | | FormCode := FileName2FormCode(S.Strings[n]); |
| | | //LogFile1.LogToFile(logTimeString+'S.Strings[n]='+S.Strings[n]); |
| | | //Showmessage('1:'+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode)); |
| | | //LogFile1.LogToFile(logTimeString+'FormCode='+FormCode); |
| | | LogFile1.LogToFile(logTimeString+'CheckCaseDocNoPage caseno='+CaseID+','+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode)); |
| | | //ShowMessage(DocNo+','+IntToStr(docInt)+','+IntToStr(tempInt)); |
| | | //LogFile1.LogToFile(logTimeString+'FormCode='+FormCode); |
| | | if (version = FormCode2Version(FormCode)) and (DocNo = FormCode2DocNo(FormCode)) and (ipage = FormCode2Page(FormCode)) then |
| | | begin |
| | | LogFile1.LogToFile(logTimeString+'CheckCaseDocNoPage caseno='+CaseID+','+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode)); |
| | | //Showmessage(version+','+DocNo+',iPage='+iPage); |
| | | //Showmessage(inttostr(Count+1)); |
| | | Inc(Count); |
| | |
| | | end; |
| | | finally |
| | | S.Free; |
| | | S2.free; |
| | | end; |
| | | Result := Count; |
| | | end; |
| | |
| | | SizeStr : String; |
| | | S : TStringlist; |
| | | v,v1:Integer; |
| | | IsRecordMD5:Boolean; |
| | | begin |
| | | IsRecordMD5:=False; |
| | | FormID := FileName2FormCode(FileName); |
| | | if FormID = '' then Exit; |
| | | |
| | |
| | | begin |
| | | //ShowMessage('BBBBBBB'); |
| | | ImageScrollBox1.LoadFromFile(ImageSavePath+CaseID+'\Upload\'+FileName,1); |
| | | |
| | | if (FWH_category='N') and ISExistImg(ImageSavePath+CaseID+'\Upload\'+FileName) then |
| | | begin |
| | | Exit;//20171103 補件 原有的圖不作resize |
| | | end; |
| | | |
| | | //FindPoint(ImageScrollBox1.Graphic,UpLPoint,UpRPoint,DownLPoint,NowW,NowH); |
| | | FindPoint(ISB_BW.Graphic,UpLPoint,UpRPoint,DownLPoint,NowW,NowH,ANCHOR); |
| | | |
| | |
| | | IF (SizeStr <> '') and (Copy(SizeStr,1,v) <> 'ERROR') then |
| | | begin |
| | | //ShowMessage('CCCCC'); |
| | | |
| | | if (ISExistImg(ImageSavePath+CaseID+'\Upload\'+FileName)) and (reSizeExistImgList.IndexOf(LoadFileGetMD5(ImageSavePath+CaseID+'\Upload\'+FileName))=-1) then |
| | | begin |
| | | IsRecordMD5:=True; |
| | | end; |
| | | ImageScrollBox1.SaveToFile(ImageSavePath+CaseID+'\Upload\'+FileName); |
| | | if IsRecordMD5 then |
| | | begin |
| | | reSizeExistImgList.add(LoadFileGetMD5(ImageSavePath+CaseID+'\Upload\'+FileName)); |
| | | end; |
| | | //showmessage(ImageSavePath+CaseID+'\Upload\'+FileName); |
| | | S := TStringlist.Create; ///20110422拿掉 換成上傳才做 |
| | | if FileExists(ImageSavePath+CaseID+'\Upload\ReSize.dat') then |
| | |
| | | In_Doc1,In_Doc2 : String; |
| | | AttachYN : String; //是否有附件 Y:有 N:沒有 |
| | | |
| | | ST1,ST2:TStringList; |
| | | ST1,ST2,ST3:TStringList; |
| | | str1,str2:String; |
| | | must_formidStr :string; |
| | | last_add_formidstr :string; |
| | | ScanListStr:String; |
| | | casepath:String; |
| | | filesizeInt:integer; |
| | | case_page:string; |
| | | Fname:String; |
| | | FileRec:TSearchrec; |
| | | begin |
| | | Result := True; |
| | | TransName := CaseID; |
| | |
| | | ContextList.LoadFromFile(Path+'Context.dat'); |
| | | Context_DocnoList.LoadFromFile(Path+'Context_DocNo.dat'); |
| | | end; |
| | | |
| | | if FileExists(Path+'CustomDocNo.dat') then |
| | | Cust_DocNoList.LoadFromFile(Path+'CustomDocNo.dat'); |
| | | |
| | |
| | | //CaseResort(Path); //檔名照設定排序 |
| | | CreateFormID_FormName(Path,CaseID); //產生FormID_FormName.dat |
| | | CreateDocNo_DocName(Path,CaseID); //產生DocNo_Name.dat |
| | | //ShowMessage('EEEEEEEEEE'); |
| | | Doc_Data := CreateDocNo_Info(CaseID); //產生保管袋文件 Docno,份數,頁數;Docno,份數,頁數 的回傳字串 |
| | | //ShowMessage('1111111111'); |
| | | Doc_Data1 := CreateCustDocNo_Info(CaseID); //產生自定文件 Docname,份數,頁數;Docno,份數,頁數 的回傳字串 |
| | | //ShowMessage('2222222222'); |
| | | In_Doc1 := CreateDocnoFrom_Info(CaseID); //產生被引進的保管袋文件資訊 Docno[tab]份數[tab]案件編號#13#10Docno[tab]份數[tab]案件編號 |
| | | //ShowMessage('333333333333333333'); |
| | | In_Doc2 := CreateCustDocNoFrom_Info(CaseID); //產生被引進的自定文件資訊 Docno[tab]份數[tab]案件編號#13#10Docno[tab]份數[tab]案件編號 |
| | | //ShowMessage('4444444444444'); |
| | | AttachYN := CreateAttach_Info(CaseID); //是否還有附件 Y:有 N:沒有 |
| | | //self.ReadCaseIndex() |
| | | //ShowMessage('555555555555'); |
| | | ReadCaseIndex(Path); |
| | | //ShowMessage('DDDDDDDDDD'); |
| | | //LoanDoc := 'Y'; |
| | | //產生遮罩影像 |
| | | // if FWork_No = 'CW' then |
| | |
| | | //ShowMessage(ST1.Text); |
| | | //ShowMessage(LastInitFormidList.Text); |
| | | ST2:=TStringList.Create; |
| | | ST3:=TStringlist.Create; |
| | | |
| | | for I := 0 to ST1.Count - 1 do |
| | | begin |
| | | if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-11) then |
| | | if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-1) then |
| | | begin |
| | | str1:=Copy(ST1.Strings[i],1,Pos('_',St1.Strings[i])-1); |
| | | ST2.Add(str1); |
| | |
| | | must_formidStr:=Copy(must_formidStr,1,Length(must_formidStr)-3) ; |
| | | //ShowMessage('must_formidStr='+must_formidStr); |
| | | //ShowMessage('AST2='+ST2.Text); |
| | | |
| | | |
| | | for I := 0 to LastInitFormidList.Count - 1 do |
| | | begin |
| | | if ST2.IndexOf(LastInitFormidList.Strings[i]) <> -1 then |
| | |
| | | last_add_formidstr:=last_add_formidstr+ST2.Strings[i]+'@#,'; |
| | | end; |
| | | last_add_formidstr:=Copy(last_add_formidstr,1,Length(last_add_formidstr)-3) ; |
| | | |
| | | ST3.LoadFromFile(path+'scanlist.dat'); |
| | | for I := 0 to ST3.Count - 1 do |
| | | begin |
| | | if ScanListStr = '' then |
| | | ScanListStr := FileName2FormCode(ST3.Strings[i]) |
| | | else |
| | | ScanListStr := Format('%s,%s',[ScanListStr,FileName2FormCode(ST3.Strings[i])]); |
| | | end; |
| | | |
| | | ST1.Free; |
| | | ST2.Free; |
| | | ST3.Free; |
| | | //ShowMessage('last_add_formidstr='+last_add_formidstr); |
| | | ///////必要formid 20170315 end ////////////////////////// |
| | | |
| | |
| | | if HaveMask then |
| | | ZipMaskFile(Path,MaskPath,Path,'MaskImg.zip'); //有遮罩設定的才產生 |
| | | /////壓檔//// |
| | | ////上傳///// |
| | | ///檢查上傳的zip大小//// |
| | | FName :=Path+ 'Img.zip'; |
| | | |
| | | FindFirst(FName, faAnyfile, FileRec); |
| | | |
| | | //FMaxUploadSize |
| | | //ShowMessage(IntToStr(FileRec.Size)); |
| | | //Result:=False; |
| | | //exit; //目前上傳檔案大小為xxMB,已超過50MB,無法上傳 %.3f ,[FileRec.Size / 1048576] |
| | | If FileRec.Size > StrtoInt(FMaxUploadSize) * 1048576 Then // 檢查檔案大小 |
| | | Begin |
| | | ShowMessage(Format(_Msg('%s目前上傳檔案大小為%.3fMB,已超過%sMB,無法上傳'),[caseid,FileRec.Size / 1048576,FMaxUploadSize])); |
| | | //ShowMessage(Format('%s目前上傳檔案大小為%.3fMB,已超過'+FMaxUploadSize+'MB,無法上傳',[caseid,FileRec.Size / 1048576]) ); |
| | | FindClose(FileRec); |
| | | Result := False; |
| | | Exit; |
| | | End; |
| | | FindClose(FileRec); |
| | | ///檢查上傳的zip大小//// |
| | | //ShowMessage('last_add_formidstr='+last_add_formidstr); |
| | | if not GetftpInfo(CaseID,'upload') then //取案件上傳方式 |
| | | begin |
| | | //Showmessage(_Msg()Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason+'.'); |
| | | DownFileErrStr := _Msg('取案件上傳資訊失敗!!')+HttpErrStr; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | SendData:='data='+HTTPEncode(UTF8Encode(FData)) |
| | | +'&verify='+FVerify |
| | | +'&form_id='+UpformID |
| | | +'&loan_doc='+Case_loandoc |
| | | +'&case_no='+TransName |
| | | +'&doc_data='+HTTPEncode(UTF8Encode(Doc_Data)) |
| | | +'&doc_data1='+HTTPEncode(UTF8Encode(Doc_Data1)) |
| | | +'&attach='+AttachYN |
| | | +'&case_page='+case_page |
| | | +'&file_size='+IntToStr(filesizeInt) |
| | | +'&must_formid='+must_formidStr //擁有的 formid |
| | | +'&last_add_formid='+last_add_formidstr //當次新加的 formid |
| | | +'&in_doc1='+HTTPEncode(UTF8Encode(In_Doc1)) |
| | | +'&in_doc2='+HTTPEncode(UTF8Encode(In_Doc2)); |
| | | //ShowMessage('SendData='+SendData); |
| | | //ShowMessage(FData+#10#13+Doc_Data); |
| | | if not upFile(HTTPSClient,FUrl,'service/imgpsc/IMGPSC02/caseupload',SendData,'file',Path+'Img.zip',FReWrite,Memo1,False) then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送案件編號(%s)檔案時,網路發生錯誤!!'+_Msg('錯誤代碼:')),[CaseID])+Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason); |
| | | Result := False; |
| | | Exit; |
| | | +'&verify='+FVerify |
| | | +'&form_id='+UpformID |
| | | +'&loan_doc='+Case_loandoc |
| | | +'&case_no='+TransName |
| | | +'&doc_data='+HTTPEncode(UTF8Encode(Doc_Data)) |
| | | +'&doc_data1='+HTTPEncode(UTF8Encode(Doc_Data1)) |
| | | +'&attach='+AttachYN |
| | | +'&case_page='+case_page |
| | | +'&file_size='+IntToStr(filesizeInt) |
| | | +'&must_formid='+must_formidStr //擁有的 formid |
| | | +'&last_add_formid='+last_add_formidstr //當次新加的 formid |
| | | +'&form_code='+ScanListStr //scanlist.dat 表單代號 |
| | | +'&ftp_image_path='+FFtpExtraPath //加傳FTP目錄 HTTP上傳時會是空白 |
| | | +'&in_doc1='+HTTPEncode(UTF8Encode(In_Doc1)) |
| | | +'&in_doc2='+HTTPEncode(UTF8Encode(In_Doc2)); |
| | | |
| | | case TransMode of |
| | | tsHttp : |
| | | begin |
| | | ////上傳///// |
| | | ShowText := CaseID+_Msg('資料上傳中(Http),請稍候'); |
| | | DataLoading(True,True); |
| | | if not upFile(HTTPSClient,FUrl,'service/imgpsc/IMGPSC02/caseupload',SendData,'file',Path+'Img.zip',FReWrite,Memo1,False) then |
| | | begin |
| | | Showmessage(Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason+'.'); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | if memo1.Lines.Strings[0] = '1' then |
| | | begin |
| | | Showmessage(Format(_Msg('')+_Msg(''),[CaseID])+memo1.Lines.Strings[1]+'。'); |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/IMGPS00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | Showmessage(Format(_Msg('')+_Msg('')+_Msg('閒置過久或被登出,請重新登入'),[CaseID])); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | ////上傳//// |
| | | end; |
| | | tsFtp : |
| | | begin |
| | | ShowText := CaseID+_Msg('資料上傳中(Ftp),請稍候'); |
| | | DataLoading(True,True); |
| | | SetFtpInfo; |
| | | try |
| | | if not IIS_Ftp.FtpsConnect then |
| | | begin |
| | | Showmessage(Format('無法連上Ftp主機,錯誤原因:%s',[FtpErrReason])); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | if not IIS_Ftp.FtpsToMain(FFtpExtraPath,CaseID+'.zip',Path+'Img.zip',display1) then |
| | | begin |
| | | Showmessage(Format(_msg('上傳案件(%s)時,發生錯誤,錯誤原因:%s'),[CaseID,FtpErrStr])); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | |
| | | if not FtpCaseComplete(SendData) then //Ftp上傳後通知完成 |
| | | begin |
| | | Showmessage(Format(_Msg('通知案件(%s)Ftp上傳完成時,發生錯誤!!'),[CaseID])+HttpErrStr); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | finally |
| | | IIS_Ftp.FtpsClose; |
| | | end; |
| | | end; |
| | | |
| | | end; |
| | | if memo1.Lines.Strings[0] = '1' then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送案件編號(%s)檔案時,網路發生錯誤!!')+_Msg('錯誤原因:'),[CaseID])+memo1.Lines.Strings[1]); |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送案件編號(%s)檔案時,網路發生錯誤!!')+_Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入'),[CaseID])); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | ////上傳//// |
| | | |
| | | |
| | | if FMode = 'ESCAN' then //上傳舊件引入檔案 //20140616 原本先搬舊件再搬新件,改為先搬新件再搬舊件 |
| | | begin |
| | |
| | | Exit; |
| | | end; |
| | | end; |
| | | |
| | | |
| | | |
| | | // 呼叫Server完成 ///// |
| | | {If not CaseComplete(Path,CaseID,MainCase) Then |
| | | begin |
| | |
| | | AttFile_Arrange(SPath+'AttFile\',DPath+'AttFile\'); |
| | | end;} |
| | | |
| | | Function TCB_IMGPSScanX.DownLoadImage(Path,CaseID:String):Boolean; |
| | | begin |
| | | Result := True; |
| | | if not GetftpInfo(CaseID,'download') then //取案件下載方式 |
| | | begin |
| | | DownFileErrStr := _Msg('取案件下載資訊失敗,')+HttpErrStr; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | case TransMode of |
| | | tsHttp: |
| | | begin |
| | | ShowText := _Msg('案件下載中(Http),請稍候'); |
| | | DataLoading(True,True); |
| | | If not Down_Img(ImageSavePath+FCaseID+'\Download\',FCaseID) then |
| | | begin |
| | | Showmessage(FCaseID+_msg('載入異動影像時,網路發生錯誤')+HttpErrStr); |
| | | DataLoading(False,False); |
| | | Exit; |
| | | end; |
| | | end; |
| | | tsFtp: |
| | | begin |
| | | ShowText := _Msg('案件下載中(Ftp),請稍候'); |
| | | DataLoading(True,True); |
| | | SetFtpInfo; |
| | | |
| | | if not IIS_Ftp.FtpsConnect then |
| | | begin |
| | | DownFileErrStr := Format(_Msg('無法連上Ftp主機,錯誤原因:%s')+#13+'%s',[FtpErrReason,FTPSClient1.LastReceivedReply]); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | if not IIS_Ftp.FtpsDownloadFile(FFtpExtraPath,CaseID+'.zip',Path+CaseID+'.zip',display1) then |
| | | begin |
| | | DownFileErrStr := Format(_Msg('錯誤原因:%s'),[FtpErrStr]); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | ExecuteUnZip(Path+CaseID+'.zip',Path,False); |
| | | DeleteFile(Path+CaseID+'.zip'); |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | |
| | | Function TCB_IMGPSScanX.Down_Img(Path,CaseID:String):Boolean; |
| | | var |
| | | EnCodeDateTime : String; |
| | |
| | | end; |
| | | if Memo1.Lines.Strings[0] = '1' then |
| | | begin |
| | | HttpErrStr :=_Msg('錯誤原因:')+memo1.Lines.Strings[1]; |
| | | HttpErrStr :=_Msg('錯誤原因:')+memo1.Lines.Strings[1]+'。'; |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | Else if Pos('<script type="text/javascript" src="scripts/IMGPS00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入'); |
| | | Result := False; |
| | |
| | | begin |
| | | if FWH_category='N' then |
| | | begin |
| | | if ISExistImg(Path+S.Strings[i]) then |
| | | if (ISExistImg(Path+S.Strings[i])) or (reSizeExistImgList.IndexOf(LoadFileGetMD5(Path+S.Strings[i]))<>-1) then |
| | | begin |
| | | Continue; |
| | | end; |
| | |
| | | end; |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.SetAttContextList(Mode:Char;Index:Integer;CaseNo,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | var |
| | | i : Integer; |
| | | begin |
| | | AttContextList.Clear; |
| | | if FileExists(ImageSavePath+CaseNo+'\AttContext.dat') then |
| | | AttContextList.LoadFromFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | case Mode of |
| | | 'A':begin |
| | | AttContextList.Add(FileName); |
| | | end; |
| | | 'I':begin |
| | | AttContextList.Insert(Index,FileName); |
| | | end; |
| | | 'E':begin |
| | | AttContextList.Strings[Index] := FileName; |
| | | end; |
| | | 'D':begin |
| | | if Index <> -1 then |
| | | begin |
| | | AttContextList.Delete(Index); |
| | | end |
| | | Else if (text <> '') then |
| | | begin |
| | | for i := 0 to AttContextList.Count - 1 do |
| | | begin |
| | | if FileName = AttContextList.Strings[i] then |
| | | begin |
| | | AttContextList.Delete(i); |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | if AttContextList.Count = 0 then |
| | | DeleteFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | end; |
| | | end; |
| | | if AttContextList.Count > 0 then |
| | | begin |
| | | AttContextList.SaveToFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.checkCaseOMRDone:Boolean; //檢查案件是否完成OMR檢核 |
| | | var |
| | | i : Integer; |
| | |
| | | FormID : String; |
| | | OldFile,NewFile:String; |
| | | Ext : String; |
| | | ST1:TStringList; |
| | | begin |
| | | ST1:=TStringList.Create; |
| | | OldFileList := TStringlist.Create; |
| | | NewFileList := TStringlist.Create; |
| | | try |
| | | NewDocNo := FormCode2DocNo(NewFormID); |
| | | NewDocDir := FindLastestDocDir(CaseID,NewDocNo); |
| | | if NewDocDir = '' then |
| | | NewDocDir := NewDocNo; |
| | | |
| | | /////20190319 Hong 原本的程式判斷怪怪的先Mark在下方,改用這段 |
| | | if DocNoNeedDiv(NewDocNo) then //要分份數 |
| | | begin |
| | | if ((FormCode2Page(NewFormID) = '01') and (GetDocDir_Page(CaseID,NewDocDir)>0)) or (NewDocDir = '') then |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end |
| | | else |
| | | begin //20171016 真對補件影響 所加的判斷 |
| | | ST1.Clear; |
| | | if FileExists(ImageSavePath + CaseID+'\'+NewDocDir+'\Context.dat') then |
| | | begin |
| | | ST1.LoadFromFile(ImageSavePath + CaseID+'\'+NewDocDir+'\Context.dat'); |
| | | if (ST1.Count > 0) and ISExistImg(ImageSavePath + CaseID+'\'+NewDocDir+'\'+ST1.Strings[0]) then //20181210 多增加判斷ST1>0 否則會有機會出現List out of bound Hong |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else //不分份數 |
| | | begin |
| | | if NewDocNo <> '' then |
| | | NewDocDir := NewDocNo |
| | | else //Attach 附件 |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end; |
| | | |
| | | {if NewDocDir = '' then |
| | | begin |
| | | if DocNoNeedDiv(NewDocNo) then |
| | | begin |
| | | NewDocDir:=DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',NewDocNo); |
| | | end |
| | | else |
| | | begin |
| | | NewDocDir := NewDocNo; |
| | | end; |
| | | end; |
| | | //ShowMessage('NewDocDir='+NewDocDir); |
| | | if DocNoNeedDiv(NewDocNo) and (FormCode2Page(NewFormID)='01') then |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath+CaseID+'\',NewDocNo); |
| | | end |
| | | else |
| | | begin |
| | | ST1.Clear; |
| | | if FileExists(ImageSavePath + NowCaseno+'\'+NewDocDir+'\Context.dat') then |
| | | begin |
| | | ST1.LoadFromFile(ImageSavePath + NowCaseno+'\'+NewDocDir+'\Context.dat'); |
| | | if ISExistImg(ImageSavePath + NowCaseno+'\'+NewDocDir+'\'+ST1.Strings[0]) then |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',NewDocNo); |
| | | end; |
| | | end; |
| | | end; } |
| | | if Not DirectoryExists(ImageSavePath+CaseID+'\'+NewDocDir) then |
| | | begin |
| | | MkDir(ImageSavePath+CaseID+'\'+NewDocDir); |
| | |
| | | finally |
| | | OldFileList.Free; |
| | | NewFileList.Free; |
| | | ST1.Free; |
| | | end; |
| | | end; |
| | | |
| | |
| | | Result := True; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.GetInputMask:String; //取得輸入的保單號碼 |
| | | var |
| | | InputMaskForm: TInputMaskForm; |
| | | begin |
| | | Result := ''; |
| | | ShowText := _msg('輸入保單號碼中'); |
| | | DataLoading(True,True); |
| | | InputMaskForm := TInputMaskForm.Create(self); |
| | | try |
| | | InputMaskForm.MaskEdit1.ClearSelection; |
| | | if InputMaskForm.ShowModal = mrOk then |
| | | begin |
| | | Result := Trim(InputMaskForm.MaskEdit1.Text)+Trim(InputMaskForm.MaskEdit2.Text)+Trim(InputMaskForm.MaskEdit3.Text); |
| | | end; |
| | | finally |
| | | InputMaskForm.Free; |
| | | DataLoading(False,False); |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.GetCasePage(Path,CaseID:String):Integer; |
| | | var |
| | | DocDirList,FileList,ST1 :TStringlist; |
| | |
| | | FileList.Delete(FileList.IndexOf(ST1.Strings[n])); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else |
| | | if not DocNoAppear(iDocNo) then Continue; //20180925 Hong覺得應該要加這段 |
| | | end; |
| | | |
| | | |
| | |
| | | begin |
| | | Result := ''; //沒找到 |
| | | iCaseID := ''; |
| | | for i := 1 to MpsBarcodeinf.Count-1 do |
| | | for i := 1 to MpsBarcodeinf.Count do //20180920 拿掉-1 |
| | | begin |
| | | if (Length(MpsBarcodeinf.text[i]) = CaseIDLength) then |
| | | begin |
| | |
| | | |
| | | end; |
| | | |
| | | |
| | | procedure TCB_IMGPSScanX.ReduceLogFile; //20171011 必免log檔掌太大 |
| | | var |
| | | ST1:TStringlist; |
| | | I:integer; |
| | | begin |
| | | ST1:=TStringList.Create; |
| | | if FileExists(LngPath+'IMGPSCheck.log') then |
| | | begin |
| | | ST1.LoadFromFile(LngPath+'IMGPSCheck.log'); |
| | | if ST1.count>100000 then |
| | | begin |
| | | for I := 0 to 10000 do |
| | | begin |
| | | ST1.Delete(0); |
| | | end; |
| | | ST1.SaveToFile(LngPath+'IMGPSCheck.log'); |
| | | end; |
| | | end; |
| | | ST1.Free; |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.ClearCaseIndex; |
| | | begin |
| | |
| | | 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 |
| | |
| | | //R_W_ScanIni('W'); //user要求改成預設後不能改 |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ScanGrayCBClick(Sender: TObject); |
| | | begin |
| | | |
| | | if ScanGrayCB.Checked then |
| | | begin |
| | | ScanColor:=ifGray256; |
| | | end |
| | | else |
| | | begin |
| | | if FScanColor = 0 then |
| | | begin |
| | | ScanColor := ifBlackWhite; |
| | | end; |
| | | |
| | | if FScanColor = 1 then |
| | | begin |
| | | //ScanColor := ifGray256 ; |
| | | ScanColor := ifBlackWhite; // |
| | | end; |
| | | |
| | | |
| | | if FScanColor = 2 then |
| | | begin |
| | | ScanColor := ifTrueColor ; |
| | | end; |
| | | end; |
| | | |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.GetFormatID(CaseID: string):String; |
| | | Var |
| | | S : TStringlist; |
| | |
| | | begin |
| | | if Mode = 'ID' then |
| | | begin |
| | | Result := '自行輸入'; |
| | | Result := _Msg('自行輸入'); |
| | | for i := 0 to ID_S.Count - 1 do |
| | | begin |
| | | if Str = ID_S.Strings[i] then |
| | |
| | | if Col =RCol then |
| | | Result := RValue; |
| | | end; |
| | | |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.DataLoading(Loading:Boolean;UseTimer:Boolean); //資料載入中要停止點選的動作 |
| | |
| | | begin |
| | | ShowText := _Msg('處理檢核失敗中,請稍候'); |
| | | DataLoading(True,True); |
| | | LogFile1.LogToFile(logTimeString+'處理檢核失敗中開始'); |
| | | ErrlistForm := TErrlistForm.Create(Self); |
| | | RejectCase := False; |
| | | S := TStringlist.Create; |
| | | try |
| | | InitialLanguage(ErrlistForm); |
| | | Application.ProcessMessages; |
| | | ErrlistForm.LogFile1.LogFile:=LogFile1.LogFile; |
| | | ErrlistForm.DeleteBt.Caption := ErrlistForm.DeleteBt.Caption+'(&D)'; |
| | | ErrlistForm.iniPath := ImageSavePath + NowCaseNo+'\upload\'; |
| | | OMRErrini2List(NowCaseno,ErrlistForm); |
| | |
| | | end; |
| | | CaseHelpBtn.Visible := False; |
| | | LoadImgFile; |
| | | Showmessage(NowCaseNo+_Msg('傳送完成')); |
| | | if (FMode='NSCAN') or (FMode='DSCAN') then |
| | | begin |
| | | Showmessage(NowCaseNo+_Msg('影像上傳完成。此案已進入下一流程。')); |
| | | end; |
| | | |
| | | if FMode='ESCAN' then |
| | | begin |
| | | Showmessage(NowCaseNo+_Msg('影像已補件完成。')); |
| | | end; |
| | | |
| | | DataLoading(False,False); |
| | | end |
| | | Else |
| | |
| | | CaseDocNo_CopiesList := TStringlist.Create; |
| | | StrList := TStringlist.Create; |
| | | ST1:=TStringList.Create; |
| | | LogFile1.LogToFile(logTimeString+'產文件樹開始'); |
| | | try |
| | | CaseNode.ImageIndex := 1; |
| | | CaseNode.SelectedIndex := 1; |
| | |
| | | FileList.LoadFromFile(ImageSavePath+Caseno+'\'+CaseDocNoList.Strings[i]+'\Context.dat'); |
| | | iDocNo := DocNoDir2DocNo(CaseDocNoList.Strings[i]); |
| | | ST1.Clear; |
| | | //ShowMessage(FileList.Text); |
| | | |
| | | LogFile1.LogToFile(logTimeString+'FileList.Text='+FileList.CommaText); |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | for n := 0 to FileList.Count - 1 do |
| | |
| | | ST1.Add(FileList.Strings[n]); |
| | | end; |
| | | end; |
| | | |
| | | for n := 0 to ST1.Count - 1 do |
| | | begin |
| | | if (FileList.IndexOf(ST1.Strings[n])<>-1) and (not DocNoIs_In_WH(iDocNo)) then |
| | |
| | | FileList.Delete(FileList.IndexOf(ST1.Strings[n])); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else |
| | | if not DocNoAppear(iDocNo) then Continue; //20180925 Hong覺得應該加這段 |
| | | |
| | | |
| | | |
| | | LogFile1.LogToFile(logTimeString+'WH_category='+FWH_category+',Is_In_Wh='+FIs_In_Wh+',FileList.Text='+FileList.CommaText); |
| | | if FileList.Count=0 then Continue; |
| | | |
| | | |
| | | //Showmessage('aaa '+FileList.Text); |
| | | DocNoCopies := Strtoint(CaseDocNo_CopiesList.Strings[i]); |
| | | DocNoPage := FileList.Count; |
| | | iDocNo := DocNoDir2DocNo(CaseDocNoList.Strings[i]); |
| | |
| | | |
| | | //DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('頁'),[CaseDocNoList.Strings[i],DocNo2DocName(Caseno,iDocNo),DocNoPage])); |
| | | //DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[CaseDocNoList.Strings[i],DocNo2DocName(Caseno,iDocNo),DocNoCopies])); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[DocNo2DocName(Caseno,iDocNo),CaseDocNoList.Strings[i],DocNoCopies])); |
| | | //ShowMessage('iDocNo='+iDocNo); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format(_Msg('%s{%s}-%d份'),[DocNo2DocName(Caseno,iDocNo),CaseDocNoList.Strings[i],DocNoCopies])); |
| | | |
| | | if GetUseCase('F',ImageSavePath+Caseno+'\',CaseDocNoList.Strings[i]) <> '' Then |
| | | begin |
| | |
| | | FormPage := GetFormIDPage(FileList,FormID); |
| | | FormName := FormCode2FormName(Caseno,FormID); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormID+'{'+FormName+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,Format(_Msg('%s{%s}-%d頁'),[FormName,FormID,FormPage])); |
| | | FormNode.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | | DocNode.AlphaSort(True); |
| | |
| | | FormPage := GetFormIDPage(FileList,FormID); |
| | | FormName := FormCode2FormName(Caseno,FormID); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormID+'{'+FormName+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,Format(_Msg('%s{%s}-%d頁'),[FormName,FormID,FormPage])); |
| | | FormNode.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | | DocNode.AlphaSort(True); |
| | |
| | | FormPage := GetFormIDPage(FileList,FormID); |
| | | FormName := FormCode2FormName(Caseno,FormID); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormID+'{'+FormName+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,Format(_Msg('%s{%s}-%d頁'),[FormName,FormID,FormPage])); |
| | | FormNode.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | | DocNode.AlphaSort(True); |
| | |
| | | DocNoPage := FileList.Count; |
| | | iDocNo := DocNoDir2DocNo(AttName); |
| | | //DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[AttName,DocNo2DocName(Caseno,iDocNo),1])); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[DocNo2DocName(Caseno,iDocNo),AttName,1])); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format(_Msg('%s{%s}-%d份'),[DocNo2DocName(Caseno,iDocNo),AttName,1])); |
| | | DocNode.ImageIndex := 2; |
| | | DocNode.SelectedIndex := 2; |
| | | for n := 0 to FileList.Count - 1 do |
| | |
| | | FormPage := GetFormIDPage(FileList,FormID); |
| | | FormName := FormCode2FormName(Caseno,FormID); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormID+'{'+FormName+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,Format(_Msg('%s{%s}-%d頁'),[FormName,FormID,FormPage])); |
| | | FormNode.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | | end; |
| | |
| | | DocNoPage := FileList.Count; |
| | | iDocNo := DocNoDir2DocNo(AttName); |
| | | //DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[AttName,DocNo2DocName(Caseno,iDocNo),1])); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[DocNo2DocName(Caseno,iDocNo),'Attach',1])); |
| | | //DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[DocNo2DocName(Caseno,iDocNo),'Attach',1])); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format(_Msg('%s{%s}-%d份'),[DocNo2DocName(Caseno,iDocNo),'Attach',1])); |
| | | |
| | | DocNode.ImageIndex := 2; |
| | | DocNode.SelectedIndex := 2; |
| | | for n := 0 to FileList.Count - 1 do |
| | |
| | | FormPage := GetFormIDPage(FileList,FormID); |
| | | FormName := FormCode2FormName(Caseno,FormID); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormID+'{'+FormName+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | //FormNode := TreeView1.Items.AddChild(DocNode,FormName+'{'+FormID+'}-'+inttostr(FormPage)+_msg('頁')); |
| | | FormNode := TreeView1.Items.AddChild(DocNode,Format(_Msg('%s{%s}-%d頁'),[FormName,FormID,FormPage])); |
| | | |
| | | FormNode.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'產文件樹結束'); |
| | | Finally |
| | | FileList.Free; |
| | | CaseDocNoList.Free; |
| | |
| | | if FScanColor = 1 then |
| | | begin |
| | | ScanColor := ifGray256 ; |
| | | ScanGrayCB.Checked:=True; |
| | | end; |
| | | |
| | | if FScanColor = 2 then |
| | |
| | | PrtDialog : TPrintDialog; |
| | | S : String; |
| | | begin |
| | | ShowText := '列印中,請稍候'; |
| | | ShowText := _Msg('列印中,請稍候'); |
| | | DataLoading(True,True); |
| | | Case2upload(NowCaseNo); //產生原影像結構 |
| | | |
| | |
| | | if PrintForm.CheckListBox1.Checked[i] then |
| | | begin |
| | | if S = '' then |
| | | S := S+FileList.Strings[i] |
| | | S := S+PrintForm.CheckListBox1.Items[i] |
| | | Else |
| | | S := S+#13+FileList.Strings[i]; |
| | | S := S+#13+PrintForm.CheckListBox1.Items[i]; |
| | | end; |
| | | end; |
| | | if S = '' then |
| | |
| | | OldCaseInfoForm.IN_WH_DocNoList := TStringlist.Create; |
| | | OldCaseInfoForm.OldCopiesList := TStringlist.Create; |
| | | try |
| | | InitialLanguage(OldCaseInfoForm); //載入多國語言 |
| | | OldCaseInfoForm.Notebook1.ActivePage := 'CaseInfo'; |
| | | OldCaseInfoForm.ImageSavePath := ImageSavePath; |
| | | OldCaseInfoForm.CaseID := NowCaseNo; |
| | |
| | | Year := Caseinfolist.Strings[1]; |
| | | BS_No := Caseinfolist.Strings[2]; |
| | | IS_Old := Caseinfolist.Strings[3]; |
| | | With OldCaseInfoForm.ListView1.Items.Add do |
| | | With OldCaseInfoForm.OldCaseLV.Items.Add do |
| | | begin |
| | | Caption := CaseID; |
| | | SubItems.Add(Year); |
| | |
| | | iDocNoList.SaveToFile(NewPath+'CaseDocNo.dat'); |
| | | iDocNo_CopiesList.SaveToFile(NewPath+'CaseDocNo_Copies.dat'); |
| | | DrawDocItem2(MyTreeNode1,NowCaseNo); |
| | | MyTreeNode1.Text := Format('%s-%d'+_Msg('頁'),[NowCaseno,GetCasePage(ImageSavePath,NowCaseNo)]); |
| | | //MyTreeNode1.Text := Format('%s-%d'+_Msg('頁'),[NowCaseno,GetCasePage(ImageSavePath,NowCaseNo)]); |
| | | MyTreeNode1.Text := Format(_Msg('%s-%d頁'),[NowCaseno,GetCasePage(ImageSavePath,NowCaseNo)]); |
| | | NewTreeNodeRefresh; |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | end; |
| | |
| | | ST1.LoadFromFile(path+'FormCode_Name.dat'); |
| | | for I := 0 to ST1.Count - 1 do |
| | | begin |
| | | if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-11) then |
| | | if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-1) then |
| | | begin |
| | | str1:=Copy(ST1.Strings[i],1,Pos('_',St1.Strings[i])-1); |
| | | LastInitFormidList.Add(str1); |
| | |
| | | begin |
| | | ClearView(1); |
| | | PageLV.Clear; |
| | | AttListBox.Items.Clear; |
| | | AddAttFileLB.Enabled := False; |
| | | DelAttFileLB.Enabled := False; |
| | | DisplayPath := ''; |
| | | ClearCaseIndex; |
| | | CaseHelpBtn.Visible := False; |
| | |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.LoadAttFile(CaseID:String); //載入附加檔案 |
| | | var |
| | | AttContextList : TStringlist; |
| | | i : Integer; |
| | | begin |
| | | AttListBox.Clear; |
| | | AttContextList := TStringlist.Create; |
| | | try |
| | | if FileExists(ImageSavePath+CaseID+'\AttContext.dat') then |
| | | begin |
| | | AttContextList.LoadFromFile(ImageSavePath+CaseID+'\AttContext.dat'); |
| | | end; |
| | | for i := 0 to AttContextList.Count - 1 do |
| | | begin |
| | | AttListBox.Items.Add(UTF8Decode(HTTPDEcode(AttContextList.Strings[i]))); |
| | | end; |
| | | finally |
| | | AttContextList.Free; |
| | | end; |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.logTimeString: String; |
| | | begin |
| | | Result:=FormatDateTime('yyyymmdd hh:mm:ss',now) +' caseNo='+NowCaseno+' '; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.FindDivFormCode(FormCode:String):Boolean; //找有沒有分案的條碼 |
| | | var |
| | | i : Integer; |
| | |
| | | if FileExists(LngPath+'MPSLIC_SCAN.lic') then |
| | | DeleteFile(LngPath+'MPSLIC_SCAN.lic'); |
| | | if LegalDate = '' then |
| | | StatusBar1.Panels[4].Text := '註冊號:'+MacID+' 剩餘註冊數:'+inttostr(Totalcount-Nowcount); |
| | | StatusBar1.Panels[4].Text := Format(_Msg('註冊號:%s 剩餘註冊數:%s'),[MacID,inttostr(Totalcount-Nowcount)]); |
| | | if LegalDate <> '' then |
| | | StatusBar1.Panels[4].Text := '*註冊號:'+MacID+'('+inttostr(Lic_Idx)+')'+' 剩餘註冊數:'+inttostr(Totalcount-Nowcount); |
| | | StatusBar1.Panels[4].Text := '*'+Format(_Msg('註冊號:%s 剩餘註冊數:%s'),[MacID+'('+inttostr(Lic_Idx)+')',inttostr(Totalcount-Nowcount)]); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.SmoothCBClick(Sender: TObject); |
| | |
| | | Anchor := FormID2Anchor(FormID); |
| | | //ParserPoint(CropMpsV.FindPoint(Anchor)); |
| | | FindPoint(ImageScrollBox1.Graphic,UpLPoint,UpRPoint,DownLPoint,Anchor); |
| | | if FileExists(CheckXmlPath+FormID+'.xml') then //沒有Xml就不用遮罩 |
| | | if FileExists(CheckXmlPath+FWork_no+'\'+FormID+'.xml') then //沒有Xml就不用遮罩 |
| | | begin |
| | | XT.LoadFromFile(CheckXmlPath+FormID+'.xml'); |
| | | XT.LoadFromFile(CheckXmlPath+FWork_no+'\'+FormID+'.xml'); |
| | | if XT.SubNodes['/form/settype10/'].First then |
| | | Repeat |
| | | ColEName := XT.SubNodes['/form/settype10/'].NodeName; |
| | |
| | | if FIs_In_Wh <> 'Y' then //不是入庫文件 |
| | | DocNo := 'YYYYY'+Add_Zoo(Ct,3); |
| | | |
| | | if (FMode='ESCAN') and (FWH_category='N') then //20170914 補件下改成非入庫的自定文件 |
| | | if (FMode='ESCAN') and (FWH_category='N') then //20170914 補件下改成非入庫的自定文件 |
| | | begin |
| | | DocNo := 'YYYYY'+Add_Zoo(Ct,3); |
| | | end; |
| | |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.DelAttFileLBClick(Sender: TObject); |
| | | var |
| | | AttFile : String; |
| | | SelectCount : Integer; |
| | | i : Integer; |
| | | begin |
| | | SelectCount := 0; |
| | | for i := 0 to AttListBox.Items.Count - 1 do |
| | | begin |
| | | if AttListBox.Selected[i] then |
| | | inc(SelectCount); |
| | | end; |
| | | if SelectCount = 0 then |
| | | begin |
| | | Showmessage(_Msg('請選擇要刪除的電子檔')); |
| | | Exit; |
| | | end; |
| | | |
| | | if SelectCount > 0 then |
| | | begin |
| | | if Messagedlg(Format(_Msg('是否刪除這%d筆??'),[SelectCount]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | for i := 0 to AttListBox.Items.Count - 1 do |
| | | begin |
| | | if AttListBox.Selected[i] then |
| | | begin |
| | | AttFile := HTTPEncode(UTF8Encode(AttListBox.Items.Strings[i])); |
| | | DeleteFile(ImageSavePath+NowCaseNo+'\'+AttFile); |
| | | SetAttContextList('D',-1,NowCaseno,AttFile); |
| | | end; |
| | | end; |
| | | end; |
| | | LoadAttFile(NowCaseNo); |
| | | Showmessage(_msg('刪除完成')); |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.DeleteCustomDocDir(Path,DocNo:String); //刪除自定文件DocNo |
| | | var |
| | | ini : Tinifile; |
| | |
| | | Printer object. Otherwise, if UsePrintJob is True, the Title |
| | | property of the TDibGraphicPrinter object is used to specify the |
| | | job name. } |
| | | Printer.Title := '影像列印'; |
| | | Printer.Title := _Msg('影像列印'); |
| | | end; |
| | | |
| | | IF (Page mod 2) = 1 Then |
| | |
| | | procedure PrintWithAutoPrintJob; |
| | | begin |
| | | GraphicPrinter.UsePrintJob := True; |
| | | GraphicPrinter.Title := '影像列印'; |
| | | GraphicPrinter.Title := _Msg('影像列印'); |
| | | GraphicPrinter.Print(ImageScrollBox1.Graphic); |
| | | end; |
| | | |
| | |
| | | FileList.Free; |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.FindLastestDocDirForPage(CaseID,DocNo,formid:String):String; //找出最新的DocDir 20180207 排除隱藏的資料夾 |
| | | var |
| | | i,j:integer; |
| | | DocNoList,FileList : TStringlist; |
| | | Imglist: TStringlist; |
| | | DirIsHide:Boolean; |
| | | begin |
| | | Result := ''; |
| | | DocNoList := TStringlist.Create; |
| | | FileList := TStringlist.Create; |
| | | imglist := TStringlist.Create; |
| | | try |
| | | if FileExists(ImageSavePath+CaseID+'\CaseDocNo.dat') then |
| | | DocNoList.LoadFromFile(ImageSavePath+CaseID+'\CaseDocNo.dat'); |
| | | |
| | | for i := DocNoList.Count-1 downto 0 do |
| | | begin |
| | | if Copy(DocNoList.Strings[i],1,length(DocNo)) = DocNo then |
| | | begin |
| | | //ShowMessage(ImageSavePath+CaseID+'\'+DocNoList.Strings[i]); |
| | | if not DocNoIsExistImg(ImageSavePath+CaseID+'\'+DocNoList.Strings[i]+'\') then |
| | | begin |
| | | //ShowMessage('DDDDD'); |
| | | Result := ''; |
| | | Break; |
| | | end |
| | | else |
| | | begin |
| | | Result := DocNoList.Strings[i]; |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | finally |
| | | DocNoList.Free; |
| | | FileList.Free; |
| | | imglist.Free; |
| | | end; |
| | | |
| | | end; |
| | | |
| | | |
| | | Procedure TCB_IMGPSScanX.Create_Cust_DocDir(CaseID:String); //產生外面傳入的文件代號及自定文件 |
| | | var |
| | |
| | | //Showmessage(FUrl+'service/slic/SLIC02/useOther?'+senddata); |
| | | if not upFile(HTTPSClient,FUrl,'service/imgpsc/IMGPSC02/useOther',SendData,'file',OldCasePath+'UseCase.ini',FReWrite,Memo1,False) then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!'+_Msg('錯誤代碼:')),[OldCaseID])+Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason); |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!'),[OldCaseID])+_Msg('錯誤代碼:')+Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | if memo1.Lines.Strings[0] = '1' then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!')+_Msg('錯誤原因:'),[OldCaseID])+memo1.Lines.Strings[1]); |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!'),[OldCaseID])+_Msg('錯誤原因:')+memo1.Lines.Strings[1]); |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!')+_Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入'),[OldCaseID])); |
| | | Showmessage(Format(_Msg('傳送舊件編號(%s)檔案時,網路發生錯誤!!'),[OldCaseID])+_Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入')); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | |
| | | Exit; |
| | | end; |
| | | IF memo1.Lines.Strings[0] = '1' Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[1]; |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入'); |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.GetFtpinfo(CaseID,Action:String):Boolean; |
| | | var |
| | | SendData : String; |
| | | |
| | | Procedure DecodeFtpInfo(EncryStr:String); |
| | | var |
| | | FtpStr : String; |
| | | ftpinfoList : TStringlist; |
| | | begin |
| | | if EncryStr = '' then Exit; |
| | | ftpinfoList := TStringlist.Create; |
| | | try |
| | | FtpStr := En_DecryptionStr_Base64('D',EncryStr,MpsKey); |
| | | SplitString('!@!',FtpStr,ftpinfoList); |
| | | if ftpinfoList[0] = 'ftps' then |
| | | FFtpProtocol := fpftps |
| | | else if ftpinfoList[0] = 'ftp' then |
| | | FFtpProtocol := fpftp; |
| | | FFtpIP := ftpinfoList[1]; |
| | | FFtpPort := strtoint(ftpinfoList[2]); |
| | | FFtpID := ftpinfoList[3]; |
| | | FFtpPwd := ftpinfoList[4]; |
| | | |
| | | finally |
| | | ftpinfoList.Free; |
| | | end; |
| | | end; |
| | | begin |
| | | Result := True; |
| | | SendData:='product='+FWork_no+'&case_no='+CaseID+'&department='+FUserUnit+'&action='+Action; |
| | | If not ProcessServlet_FormData(HTTPSClient,FURL+'service/imgpsc/IMGPSC02/ftps',SendData,FReWrite,Memo1,False) Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤代碼:')+inttostr(HttpError.HttpErrorCode)+','+HttpError.HttpReason; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | IF (memo1.Lines.Strings[0] = '1') Then |
| | | begin |
| | | if memo1.Lines.Strings[1]='nodata' then //nodata 為正常可繼續的判斷 |
| | | begin |
| | | TransMode := tsNone; |
| | | Result := True; |
| | | Exit; |
| | | end |
| | | else |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[1]; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | end |
| | | Else if Pos('<script type="text/javascript" src="scripts/CW00/login.js"></script>',Memo1.Lines.Text) > 0 then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+_Msg('閒置過久或被登出,請重新登入'); |
| | | Result := False; |
| | | Exit; |
| | | end |
| | | else if (memo1.Lines.Strings[0] <> '0') then//不認識的字串 |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[0]; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | TransMode := tsHttp; |
| | | FFtpExtraPath := ''; |
| | | |
| | | if memo1.Lines.Strings[0] = '0' then |
| | | begin |
| | | if memo1.Lines.Strings[2] = 'Y' then //要使用FTP |
| | | TransMode := tsFtp; |
| | | if memo1.Lines.Count > 3 then |
| | | begin |
| | | FFtpExtraPath := memo1.Lines.Strings[3]; |
| | | DecodeFtpInfo(memo1.Lines.Strings[4]); |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.SetFtpInfo; //餵入FTP資訊 |
| | | begin |
| | | IIS_Ftp.Display1 := Display1; |
| | | IIS_Ftp.FTPSClient1 := FTPSClient1; |
| | | IIS_Ftp.ElMemoryCertStorage := ElMemoryCertStorage; |
| | | IIS_Ftp.Display1 := Display1; |
| | | IIS_Ftp.Ftpip := FFtpIP; |
| | | IIS_Ftp.Ftpuserid := FFtpID; |
| | | IIS_Ftp.FtpPwd := FFtpPwd; |
| | | IIS_Ftp.FtpPath := FFtpRootPath; |
| | | IIS_Ftp.FtpPort := FFtpPort; |
| | | IIS_Ftp.FtpSSL := True; |
| | | IIS_Ftp.FtpPassive := True; |
| | | if FFtpProtocol = fpftp then |
| | | IIS_Ftp.FtpSSL := False; |
| | | IIS_Ftp.FtpEncryptDataChannel := true; |
| | | FTPSClient1.OnControlReceiveAsString := IIS_Ftp.EventHandlers.ControlReceiveAsString; |
| | | FTPSClient1.OnControlSendAsString := IIS_Ftp.EventHandlers.ControlSendAsString; |
| | | FTPSClient1.OnSSLError := IIS_Ftp.EventHandlers.SSLError; |
| | | FTPSClient1.OnCertificateValidate := IIS_Ftp.EventHandlers.CertificateValidate; |
| | | FTPSClient1.OnTextDataLine := IIS_Ftp.EventHandlers.TextDataLine; |
| | | |
| | | {Showmessage(Format('Ftpip:%s'+#13 |
| | | +'Ftpid:%s'+#13 |
| | | +'Ftppwd:%s'+#13 |
| | | +'Ftppath:%s'+#13 |
| | | +'Ftpport:%s'+#13 |
| | | ,[FFtpIP,FFtpid,FFtpPwd,Ftppath,inttostr(Ftpport)]));} |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.FtpCaseComplete(SendData:String):Boolean; |
| | | begin |
| | | Result := True; |
| | | If not ProcessServlet_FormData(HTTPSClient,FURL+'service/imgpsc/IMGPSC02/caseupload',SendData,FReWrite,Memo1,False) Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤代碼:')+inttostr(HttpError.HttpErrorCode)+','+HttpError.HttpReason; |
| | | Result := False; |
| | | Exit; |
| | | end; |
| | | IF (memo1.Lines.Strings[0] = '1') or (memo1.Lines.Strings[0] <> '0') Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[1]; |
| | | Result := False; |
| | |
| | | Function TCB_IMGPSScanX.DocNoAppear(DocNo:String):Boolean; //DocNo是否可出現 |
| | | begin |
| | | Result := True; |
| | | if (((FIs_In_Wh = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or //入庫掃描不看非入庫文件 |
| | | |
| | | {if (((FIs_In_Wh = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or //入庫掃描不看非入庫文件 |
| | | ((FIs_In_Wh = 'N') and (DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') )) {and //非入庫掃描不看入庫文件 |
| | | (Copy(DocNo,1,5)<>'ZZZZZ')} {then |
| | | {Result := False;} |
| | | //20181031 應該要換成下面的判斷比較對,FIs_In_Wh傳空的話才會出全部 |
| | | if (((FIs_In_Wh = 'Y') and ((not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach'))) or //入庫掃描不看非入庫文件 |
| | | ((FIs_In_Wh = 'N') and ((DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') ))) {and //非入庫掃描不看入庫文件 |
| | | (Copy(DocNo,1,5)<>'ZZZZZ')} then |
| | | Result := False; |
| | | |
| | | |
| | | end; |
| | | |
| | |
| | | var |
| | | i,n:Integer; |
| | | OldPath,NewPath,DocDir : String; |
| | | OldFile,NewFile : String; |
| | | OldFile,NewFile,AttFile : String; |
| | | DocNoList,FileList:TStringlist; |
| | | iFileList,iFile_DocNoList :TStringlist; |
| | | iDocDirList : TStringlist; |
| | | iAttFileList : TStringlist; |
| | | begin |
| | | DocNoList := TStringlist.Create; |
| | | FileList := TStringlist.Create; |
| | | iFileList := TStringlist.Create; |
| | | iFile_DocNoList := TStringlist.Create; |
| | | iDocDirList := TStringlist.Create; |
| | | iAttFileList := TStringlist.Create; |
| | | try |
| | | OldPath := ImageSavePath+CaseID+'\'; |
| | | NewPath := ImageSavePath+CaseID+'\Upload\'; |
| | |
| | | end; |
| | | end; |
| | | end; |
| | | OldPath := ImageSavePath+CaseID+'\'; |
| | | if FileExists(OldPath+'AttContext.dat') then |
| | | begin |
| | | iAttFileList.LoadFromFile(OldPath+'AttContext.dat'); |
| | | for n := 0 to iAttFileList.Count - 1 do |
| | | begin |
| | | AttFile := iAttFileList.Strings[n]; |
| | | CopyFile(PWideChar(OldPath+AttFile),PWideChar(NewPath+AttFile),False); |
| | | end; |
| | | iAttFileList.SaveToFile(NewPath+'AttContext.dat'); |
| | | end; |
| | | |
| | | |
| | | iFileList.SaveToFile(NewPath+'Context.dat'); |
| | | iFile_DocNoList.SaveToFile(NewPath+'Context_DocNo.dat'); |
| | |
| | | |
| | | finally |
| | | iFileList.Free; |
| | | iAttFileList.Free; |
| | | iFile_DocNoList.Free; |
| | | DocNoList.Free; |
| | | FileList.Free; |
| | |
| | | var |
| | | i,n : Integer; |
| | | DocDir:String; |
| | | OldFile,NewFile:String; |
| | | OldFile,NewFile,AttFile:String; |
| | | DocNoList,FileList : TStringlist; |
| | | iFileList,iFile_DocDirList :TStringlist; |
| | | iAttFileList :TStringlist; |
| | | AA,AA2,AA3,AA4:Boolean; |
| | | begin |
| | | |
| | |
| | | FileList := TStringlist.Create; |
| | | iFileList := TStringlist.Create; |
| | | iFile_DocDirList := TStringlist.Create; |
| | | iAttFileList := TStringlist.Create; |
| | | try |
| | | //if Not FileExists(SoDir+'Context.dat') then Exit; |
| | | //iFileList.LoadFromFile(SoDir+'Context.dat'); |
| | |
| | | CaseDocNo_CopiesList.SaveToFile(DeDir+'CaseDocNo_Copies.dat'); |
| | | end; |
| | | end;} |
| | | if FileExists(SoDir+'AttContext.dat') then |
| | | begin |
| | | iAttFileList.LoadFromFile(SoDir+'AttContext.dat'); |
| | | for i := 0 to iAttFileList.Count - 1 do |
| | | begin |
| | | AttFile := iAttFileList.Strings[i]; |
| | | CopyFile(PWideChar(SoDir+AttFile),PWideChar(DeDir+AttFile),False); |
| | | end; |
| | | iAttFileList.SaveToFile(DeDir+'AttContext.dat'); |
| | | end; |
| | | |
| | | |
| | | if FMode='ESCAN' then |
| | | begin |
| | |
| | | begin |
| | | If FindSQLData(Doc_Inf_List,'DOC_U_DESC','DOC_NO',DocNo,0,FindResult) Then |
| | | begin |
| | | //ShowMessage(FindResult.Text); |
| | | Result := GetFindResult('DOC_U_DESC'); |
| | | end; |
| | | end; |
| | |
| | | S.LoadFromFile(ImageSavePath + CaseID+'\upload\Context.dat'); |
| | | for i := 0 to S.Count - 1 do |
| | | begin |
| | | LogFile1.LogToFile(logTimeString+S.Strings[i]+' ISExistImg='+BoolToStr(ISExistImg(ImageSavePath+CaseID+'\upload\'+S.Strings[i]),true)); |
| | | LogFile1.LogToFile(logTimeString+S.Strings[i]+' reSizeExistImgList='+BoolToStr(reSizeExistImgList.IndexOf(LoadFileGetMD5(ImageSavePath+CaseID+'\upload\'+S.Strings[i]))<>-1,true)); |
| | | if FWH_category='N' then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\upload\'+S.Strings[i]) then |
| | | if (ISExistImg(ImageSavePath+CaseID+'\upload\'+S.Strings[i])) |
| | | or (reSizeExistImgList.IndexOf(LoadFileGetMD5(ImageSavePath+CaseID+'\upload\'+S.Strings[i]))<>-1) then |
| | | begin |
| | | Continue; |
| | | end; |
| | |
| | | |
| | | end; |
| | | //ShowMessage('MainFormID='+MainFormID); |
| | | LogFile1.LogToFile(logTimeString+' '+FModeName+' '+CaseID+' '+'MainFormID='+MainFormID); |
| | | if MainFormID = ''then |
| | | begin |
| | | //20131203 yuu說不檢查這個,先拿掉 20170315 楷琳說未歸類要擋 20170726 因此有檢查必要FormID 所以 可以拿掉 |
| | |
| | | //////主要非主要文件////// |
| | | DistinctDocinCase(ImageSavePath+CaseID+'\upload\'); |
| | | //ShowMessage(DocNo_VerinCase.Text); |
| | | //DocNo_VerinCase.Add('31A00101_1706A'); |
| | | LogFile1.LogToFile(logTimeString+' '+CaseID+' '+'DocNo_VerinCase.Text='+DocNo_VerinCase.Text); |
| | | if ModeNeedCheck(OMRErrInfo[1].Mode,FMode) then //是否要檢核 |
| | | begin |
| | | for i := 0 to DocNo_VerinCase.Count - 1 do |
| | |
| | | MainVersion :=Copy(DocNo_VerinCase.Strings[i],v+1,v1-v); //FormCode2Version(MainFormID); |
| | | MainFormPage := GetDataDocNoPage(MainDocNo,MainVersion); //資料庫記錄主文件頁數 |
| | | CaseFormPage := CheckCaseDocNoPage(CaseID,MainDocNo,MainVersion,MainFormPage); //案件主文件的頁數 |
| | | LogFile1.LogToFile(logTimeString+CaseID+',MainDocNo='+MainDocNo+',MainVersion='+MainVersion+',MainFormPage='+IntToStr(MainFormPage)+',CaseFormPage='+IntToStr(CaseFormPage)); |
| | | //CheckFirstDocNoPage |
| | | IF (MainFormPage > 0) and (MainFormPage <> CaseFormPage) then |
| | | begin |
| | | ErrStr:=MainDocNo+Format(OMRErrInfo[1].Info,[Inttostr(MainFormPage),Inttostr(CaseFormPage)]); //主要文件需有XX頁僅附XX頁 |
| | |
| | | end; |
| | | end; |
| | | //////主要非主要文件///// |
| | | //showmessage(MainFormID); |
| | | //showmessage(MainFormID); |
| | | MainDocNo := FormCode2DocNo(MainFormID); |
| | | MainVersion := FormCode2Version(MainFormID); |
| | | if FindSQLData(DM_FORM_INF_List,'DEPE_FORM_ID,MUTEX_FORM_ID','MAIN_FORM_ID,DOC_VERSION',MainDocNo+','+MainVersion,0,FindResult) then |
| | |
| | | end; |
| | | end; |
| | | //////互斥文件///// |
| | | end; |
| | | end; //MainFormID結束 |
| | | //end; |
| | | List.LoadFromFile(ImageSavePath + CaseID+'\upload\Context.dat'); |
| | | for i := 0 to List.Count - 1 do |
| | |
| | | end; |
| | | //if AllCheck then |
| | | //begin |
| | | //////最大頁數///// |
| | | //////最大頁數/// |
| | | LogFile1.LogToFile(logTimeString+'最大頁數A段 '+CaseID+' '+'OMRFileList.Text='+OMRFileList.Text); |
| | | DistinctFormCode(CaseID); |
| | | if ModeNeedCheck(OMRErrInfo[10].Mode,FMode) then //是否要檢核 |
| | | begin |
| | | //ShowMessage('AAA'+OMRFileList.Text); |
| | | LogFile1.LogToFile(logTimeString+'最大頁數B段 '+CaseID+' '+'OMRFileList.Text='+OMRFileList.Text); |
| | | For i := 0 to OMRFileList.Count - 1 do |
| | | begin |
| | | if FModeName=_Msg('異動件') then Continue; |
| | | |
| | | if FWH_category='N' then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\upload\'+OMRFileList.Strings[i]) then |
| | |
| | | ValueXT := TXmltool.Create; |
| | | Try |
| | | //ShowMessage('必填'+OMRFileList.Text); |
| | | LogFile1.LogToFile(logTimeString+'必填 '+CaseID+' '+'OMRFileList.Text='+OMRFileList.Text); |
| | | For i := 0 to OMRFileList.Count - 1 do |
| | | begin |
| | | // if FWH_category='N' then |
| | | // begin |
| | | // if ISExistImg(ImageSavePath+CaseID+'\upload\'+OMRFileList.Strings[i]) then |
| | | // begin |
| | | // Continue; |
| | | // end; |
| | | // end; |
| | | //ShowMessage('OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | if CheckRequiredColumnValues(FWork_NO,CaseID) then Continue; |
| | | |
| | | OMRFile := OMRFileList.Strings[i]; |
| | | OMRFormCode := FileName2FormCode(OMRFileList.Strings[i]); |
| | | OMRFormName := FormCode2FormName(CaseID,OMRFormCode); |
| | |
| | | ImageReSize_FormID(CaseID,OMRFile); |
| | | ////依十字定位點縮放/// |
| | | //Display1.Lines.Add('OMRFile='+OMRFile+',OMRFormCode='+OMRFormCode+',OMRFormName='+OMRFormName); |
| | | if not FileExists(CheckXmlPath+OMRFormCode+'.xml') then //沒有Xml就不用檢核 |
| | | LogFile1.LogToFile(logTimeString+'OMRFile='+OMRFile+',OMRFormCode='+OMRFormCode+',OMRFormName='+OMRFormName); |
| | | //ShowMessage('KKKKK'); |
| | | if not FileExists(CheckXmlPath+FWork_no+'\'+OMRFormCode+'.xml') then //沒有Xml就不用檢核 |
| | | Continue; |
| | | |
| | | |
| | | XT := TXmltool.Create(CheckXmlPath+OMRFormCode+'.xml'); |
| | | //ShowMessage('11638 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | XT := TXmltool.Create(CheckXmlPath+FWork_no+'\'+OMRFormCode+'.xml'); |
| | | RelaXT := TXmltool.Create; |
| | | //ShowMessage('ModeNeedCheck='+BoolToStr(ModeNeedCheck(OMRErrInfo[4].Mode,FMode),true)); |
| | | try |
| | |
| | | Until not XT.SubNodes['/form/settype1/'].Next ; |
| | | end; |
| | | //*******必填******** |
| | | |
| | | //ShowMessage('11692 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | //if AllCheck then |
| | | //begin |
| | | //*******有值相關文件的欄位也要有值******* |
| | |
| | | RelaFile := FormCode2FileName(RelaFormCode,ContextList); |
| | | RelaFormName := FormCode2FormName(CaseID,RelaFormCode); |
| | | Anchor1 := FormID2Anchor(RelaFormCode); |
| | | RelaXT.LoadFromFile(CheckXmlPath+RelaFormCode+'.xml'); |
| | | RelaXT.LoadFromFile(CheckXmlPath+FWork_no+'\'+RelaFormCode+'.xml'); |
| | | Display1.Lines.Add(RelaFile+','+RelaFormName); |
| | | ISB8.LoadFromFile(ImageSavePath+CaseID+'\upload\'+RelaFile,1); //20170815 |
| | | ISB8W:= ISB8.Graphic.Width; |
| | | ISB8H:= ISB8.Graphic.Height; |
| | | FindPoint(ISB8.Graphic,UpLPoint,UpRPoint,DownLPoint,ISB8W,ISB8H,ANCHOR); //20170815 抓相關然欄位所在圖檔的定位 |
| | | //ShowMessage(RelaFile); |
| | | //ShowMessage(ImageSavePath+CaseID+'\upload\'+RelaFile); |
| | | if RelaFile<>'' then |
| | | begin |
| | | ISB8.LoadFromFile(ImageSavePath+CaseID+'\upload\'+RelaFile,1); //20170815 |
| | | ISB8W:= ISB8.Graphic.Width; |
| | | ISB8H:= ISB8.Graphic.Height; |
| | | FindPoint(ISB8.Graphic,UpLPoint,UpRPoint,DownLPoint,ISB8W,ISB8H,ANCHOR); //20170815 抓相關然欄位所在圖檔的定位 |
| | | end; |
| | | |
| | | OMROK := False; |
| | | //OMROK := False; |
| | | //if RelaXT.SubNodes['/form/settype2/'].First then |
| | |
| | | Until not XT.SubNodes['/form/settype3/'].Next ; |
| | | end; |
| | | //*******有值相關文件的欄位也要有值******* |
| | | //ShowMessage('11788 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | |
| | | //*******有值相關文件的欄位不能有值******* |
| | | if ModeNeedCheck(OMRErrInfo[11].Mode,FMode) then //是否要檢核 |
| | |
| | | RelaFile := FormCode2FileName(RelaFormCode,ContextList); |
| | | RelaFormName := FormCode2FormName(CaseID,RelaFormCode); |
| | | Anchor1 := FormID2Anchor(RelaFormCode); |
| | | RelaXT.LoadFromFile(CheckXmlPath+RelaFormCode+'.xml'); |
| | | ISB8.LoadFromFile(ImageSavePath+CaseID+'\upload\'+RelaFile,1); //20170815 |
| | | ISB8W:= ISB8.Graphic.Width; |
| | | ISB8H:= ISB8.Graphic.Height; |
| | | FindPoint(ISB8.Graphic,UpLPoint,UpRPoint,DownLPoint,ISB8W,ISB8H,ANCHOR); //20170815 抓相關然欄位所在圖檔的定位 |
| | | RelaXT.LoadFromFile(CheckXmlPath+FWork_no+'\'+RelaFormCode+'.xml'); |
| | | |
| | | if RelaFile<>'' then |
| | | begin |
| | | ISB8.LoadFromFile(ImageSavePath+CaseID+'\upload\'+RelaFile,1); //20170815 |
| | | ISB8W:= ISB8.Graphic.Width; |
| | | ISB8H:= ISB8.Graphic.Height; |
| | | FindPoint(ISB8.Graphic,UpLPoint,UpRPoint,DownLPoint,ISB8W,ISB8H,ANCHOR); //20170815 抓相關然欄位所在圖檔的定位 |
| | | end; |
| | | |
| | | OMROK := False; |
| | | //OMROK := False; |
| | | //if RelaXT.SubNodes['/form/settype2/'].First then |
| | |
| | | end; |
| | | //*******有值相關文件的欄位不能有值******* |
| | | |
| | | |
| | | //ShowMessage('11889 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | |
| | | //*******有值相依文件******* |
| | | if ModeNeedCheck(OMRErrInfo[5].Mode,FMode) then //是否要檢核 |
| | |
| | | RelaXT.Free; |
| | | end; |
| | | end; |
| | | //必填迴圈結束 |
| | | Finally |
| | | ValueXT.Free; |
| | | end; |
| | |
| | | end; |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.OMRErrini2ListForLog(CaseID: String): String; |
| | | var |
| | | ini : Tinifile; |
| | | Errcount : Integer; |
| | | Del : Boolean; |
| | | i,j : Integer; |
| | | ST,CaseList:TStringList; |
| | | |
| | | begin |
| | | Result:=''; |
| | | //CaseList.dat |
| | | ST:=TStringList.Create; |
| | | CaseList:=TStringList.Create; |
| | | CaseList.LoadFromFile(ImageSavePath+'CaseList.dat'); |
| | | for I := 0 to CaseList.Count - 1 do |
| | | begin |
| | | ini := Tinifile.Create(ImageSavePath + CaseList.Strings[i]+'\upload\Checkerr.ini'); |
| | | try |
| | | Errcount := ini.ReadInteger('OMRCount','Count',0); |
| | | |
| | | for j := 1 to ErrCount do |
| | | begin |
| | | Del := ini.ReadBool(inttostr(j),'Del',False); //是否被移除了 |
| | | if Not Del then |
| | | begin |
| | | ST.Add(ini.ReadString(inttostr(j),'Reason','')) ; |
| | | end; |
| | | end; |
| | | finally |
| | | ini.Free; |
| | | end; |
| | | end; |
| | | Result:=ST.Text; |
| | | ST.Free; |
| | | CaseList.Free; |
| | | end; |
| | | |
| | | |
| | | Function TCB_IMGPSScanX.DownLanguage:Boolean; //下載多國語言檔 |
| | | begin |
| | | Result := True; // http://192.168.0.101:8080/fbnp/servlet/CWC01?act=getservertime |
| | | //dnFile(HTTPSClient,FUrl+'Language.Lng','','',LngPath+'Language.Lng',FReWrite.Text,Memo1,False,DownImgStatus) |
| | | If not dnFile_Get(HTTPSClient,FUrl+'Language.Lng','','',LngPath+'Language.Lng',FReWrite,Memo1,False,'') Then |
| | | If not dnFile_Get(HTTPSClient,FUrl+'Language.Lng','','',LngPath+'Language.Lng',FReWrite,Memo1,False,DownImgStatus) Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤代碼:')+inttostr(HttpError.HttpErrorCode)+','+HttpError.HttpReason; |
| | | Result := False; |
| | |
| | | List_FormCode,Err_FormCode: String; |
| | | iFormID : String; |
| | | begin |
| | | ShowText := '影像顯示中,請稍候'; |
| | | ShowText := _Msg('影像顯示中,請稍候'); |
| | | DataLoading(True,True); |
| | | |
| | | IF FormCode = 'ShowAll' then //顯示所有的影像 (因為附件會傳空字串,所以用ShowAll) |
| | |
| | | iGroupNo,page,Ct,int1 : Integer; |
| | | ST1:TStringList; |
| | | begin |
| | | ShowText := '影像顯示中,請稍候'; |
| | | ShowText := _Msg('影像顯示中,請稍候'); |
| | | DataLoading(True,True); |
| | | ST1:=TStringList.Create; |
| | | //Display1.Lines.Clear; |
| | |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[n],1); |
| | | |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | |
| | | end; |
| | |
| | | if ISB.ZoomPercent > 100 then |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[i],1); |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | end; |
| | | FitPreViewISB; |
| | |
| | | if ISB.ZoomPercent > 100 then |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[i],1); |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | |
| | | //NowShowFileList.Add(ContextList.Strings[i]); |
| | |
| | | Procedure TCB_IMGPSScanX.ISBMouseMove(Sender: TObject; Shift: TShiftState; |
| | | X, Y: Integer); |
| | | begin |
| | | Edit1.SetFocus; |
| | | //Edit1.SetFocus; |
| | | if Draging then |
| | | begin |
| | | if not (TShape(FindComponent('SP'+Copy(TImageScrollBox(Sender).Name,length(ISBName)+1,length(TImageScrollBox(Sender).Name)-length(ISBName)))) = nil) then |
| | |
| | | end; |
| | | if FileExists(CheckXmlPath+'OMRSet.zip') then //有更新 |
| | | begin |
| | | ExecuteUnZip(CheckXmlPath+'OMRSet.zip',CheckXmlPath,False); |
| | | ExecuteUnZip(CheckXmlPath+'OMRSet.zip',CheckXmlPath,True); |
| | | S.Clear; |
| | | S.Add(ServerDate+GetBalance2Time(Balance)); |
| | | S.SaveToFile(CheckXmlPath+'LastDateTime.dat'); |
| | |
| | | end; |
| | | if FileExists(SitePath+'KeyinSet.zip') then //有更新 |
| | | begin |
| | | ExecuteUnZip(SitePath+'KeyinSet.zip',SitePath,False); |
| | | ExecuteUnZip(SitePath+'KeyinSet.zip',SitePath,True); |
| | | S.Clear; |
| | | S.Add(ServerDate+GetBalance2Time(Balance)); |
| | | S.SaveToFile(SitePath+'LastDateTime.dat'); |
| | |
| | | end; |
| | | end; |
| | | //ShowMessage(SendData); |
| | | //ShowMessage(Memo1.Lines.Text); |
| | | |
| | | IF memo1.Lines.Strings[0] <> '0' Then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[1]; |
| | | HttpErrStr := _Msg('')+memo1.Lines.Strings[1]+'。'; |
| | | Result := -1; |
| | | Exit; |
| | | end |
| | |
| | | begin |
| | | if (memo1.Lines.Count < 2) then |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+'OCX:Index Count error'; |
| | | HttpErrStr := _Msg('')+'OCX:Index Count error'; |
| | | Result := -1; |
| | | Exit; |
| | | end |
| | |
| | | Result := 1 |
| | | Else |
| | | begin |
| | | HttpErrStr := _Msg('錯誤原因:')+'OCX:Value error'; |
| | | HttpErrStr := _Msg('')+'OCX:Value error'; |
| | | Result := -1; |
| | | Exit; |
| | | end; |
| | |
| | | PageLVclear := True; |
| | | InitialOk := False; |
| | | |
| | | FMaxUploadSize:='10'; |
| | | FJpgCompression:=50; |
| | | FFtpRootPath := ''; //影像平台沒有給FtpRoot目錄,會直接用FFtpExtraPath切換至指定目錄 |
| | | //FMode := 'DSCAN' ; |
| | | //FIs_In_Wh := 'Y'; |
| | | if FIs_In_Wh = 'Y' then |
| | |
| | | Panel6.Visible := True; |
| | | Panel21.Visible := True; |
| | | Panel23.Visible := True; |
| | | |
| | | AttFileGB.Visible := True; |
| | | Splitter2.Visible := True; |
| | | ScanDuplexCB.Visible := True; //雙面掃描 |
| | | end |
| | | Else if FMode = 'FSCAN' then |
| | |
| | | Panel6.Visible := True; |
| | | Panel21.Visible := True; |
| | | Panel23.Visible := True; |
| | | AttFileGB.Visible := True; |
| | | Splitter2.Visible := True; |
| | | end; |
| | | DisplayMode(1,1,1,Panel9); |
| | | Application.ProcessMessages; |
| | | StatusBar1.Panels[0].Text := 'Ver'+GetCurrentVersionNo; |
| | | StatusBar1.Panels[1].Text := _Msg('登入人員:')+FUserName; |
| | | StatusBar1.Panels[1].Text := 'Login User:'+FUserName; |
| | | {$IFDEF Test} |
| | | StatusBar1.Panels[0].Text := StatusBar1.Panels[0].Text+'(test)'; |
| | | {$ENDIF} |
| | | StatusBar1.Panels[0].Text := StatusBar1.Panels[0].Text; |
| | | |
| | | if FPrintyn = 'Y' then |
| | | PrtLB.Visible := True; |
| | | |
| | |
| | | InitScrollRec; |
| | | If FUrl = '' then |
| | | begin |
| | | Showmessage(_Msg('URL不能為空白,請洽詢程式人員')); |
| | | Showmessage(_Msg('URL cannot be empty,please contact system administrator')); |
| | | Exit; |
| | | end; |
| | | if FUrl[length(FUrl)]<>'/' then |
| | | FUrl := FUrl + '/'; |
| | | //20221028 把語言檔改放至 Local目錄裡,才不會有些文字來不及使用 |
| | | LngPath := GetLocalAppDir(Handle)+'MPS\CB_IMGPS\'; |
| | | Str2Dir(LngPath); |
| | | ////下載語言檔///// 20170218 先拿調以便測試 |
| | | If not DownLanguage Then |
| | | begin |
| | | Showmessage('Language File error!!'+HttpErrStr); |
| | | DataLoading(False,False); |
| | | Exit; |
| | | end; |
| | | |
| | | InitialLanguage(Self); //載入多國語言 |
| | | |
| | | |
| | | if FWork_no='' then |
| | | begin |
| | |
| | | CaseList := TStringList.Create; //記錄掃瞄案件的順序 |
| | | Context_DocnoList := TStringlist.Create; //案件裡的檔案Docno清單 |
| | | ContextList := TStringlist.Create; //案件裡的檔案清單 |
| | | AttContextList := TStringlist.Create; //案件裡的附加檔案清單 |
| | | NoSaveBarCodeList := TStringlist.Create; //不儲存的條碼清單 |
| | | FormID_List := TStringlist.Create; //FormID清單 |
| | | DocNo_List := TStringlist.Create; //DocNo清單 |
| | |
| | | LastAddFormidList := TStringList.Create; |
| | | SampleFormIDList := TStringList.Create;//20170627 加入 |
| | | ExistImgList := TStringList.Create; //20170724 新增 |
| | | reSizeExistImgList :=TStringList.Create; //20171012 新增 |
| | | //********清單區******** |
| | | |
| | | ShowText := _Msg('資料載入中,請稍候'); |
| | |
| | | if ImagePath[Length(ImagePath)] <> '\' then |
| | | ImagePath := ImagePath + '\'; |
| | | //ShowMessage('ImagePath='+ImagePath); |
| | | CheckXmlPath := ImagePath+'OMRSITE\'+FWork_No; |
| | | //CheckXmlPath := ImagePath+'OMRSITE\'+FWork_No; |
| | | CheckXmlPath := ImagePath+'OMRSITE\'; // 20200612 發現影像平台是取回所有業務的設定,所以不能有業務別目錄 |
| | | //ShowMessage('CheckXmlPath='+CheckXmlPath); |
| | | SitePath := ImagePath+'Site\'+FWork_No+'\'; |
| | | LngPath := ImagePath; |
| | | //SitePath := ImagePath+'Site\'+FWork_No+'\'; |
| | | SitePath := ImagePath+'Site\'; // 20200612 發現影像平台是取回所有業務的設定,所以不能有業務別目錄 |
| | | //LngPath := ImagePath; //改放至上面取Local目錄 |
| | | SamplePath := ImagePath+'Sample\'+FWork_No+'\'; |
| | | ImagePath := ImagePath + 'Scantemp\'; |
| | | //ShowMessage('AA ImagePath='+ImagePath); |
| | |
| | | Del_Sub_NothingPath(ImagePath); //清掉案件目錄是空的 |
| | | |
| | | |
| | | LogFile1.LogFile:=LngPath+'IMGPSCheck.log'; |
| | | |
| | | ReduceLogFile; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'OCX取表data結束'); |
| | | |
| | | ShowText := _Msg('資料載入中,請稍候'); |
| | | DataLoading(True,True); |
| | |
| | | ShowText := _Msg('資料載入中,請稍候'); |
| | | DataLoading(True,True); |
| | | |
| | | ////下載語言檔///// 20170218 先拿調以便測試 |
| | | If not DownLanguage Then |
| | | begin |
| | | Showmessage('Language File error!!'+HttpErrStr); |
| | | DataLoading(False,False); |
| | | Exit; |
| | | end; |
| | | |
| | | InitialLanguage(Self); //載入多國語言 |
| | | StatusBar1.Panels[1].Text := _Msg('登入人員:')+FUserName; |
| | | //FCaseID:='20150302180133';//測試用 |
| | | ////下載語言檔///// |
| | | //ShowMessage('OOOO'); |
| | |
| | | MkDir(ImageSavePath+FCaseID); |
| | | CreateEmptyCase(ImageSavePath,FCaseID); |
| | | MkDir(ImageSavePath+FCaseID+'\Download'); |
| | | IF (FMode = 'ESCAN') then //異動件先下載影像 |
| | | IF (FMode = 'ESCAN') or (FMode = 'DSCAN') then //異動件先下載影像 |
| | | begin |
| | | ShowText := _Msg('案件下載中,請稍候'); |
| | | DataLoading(True,True); |
| | | If not Down_Img(ImageSavePath+FCaseID+'\Download\',FCaseID) then |
| | | If not DownLoadImage(ImageSavePath+FCaseID+'\Download\',FCaseID) Then |
| | | begin |
| | | Showmessage(FCaseID+_msg('載入異動影像時,網路發生錯誤')+DownFileErrStr); |
| | | DataLoading(False,False); |
| | | Exit; |
| | | end; |
| | | |
| | | {If not Down_Img(ImageSavePath+FCaseID+'\Download\',FCaseID) then |
| | | begin |
| | | Showmessage(FCaseID+_msg('載入異動影像時,網路發生錯誤')+HttpErrStr); |
| | | DataLoading(False,False); |
| | | Exit; |
| | | end; |
| | | end;} |
| | | //Showmessage(ImageSavePath+FCaseID+'\Download\'+#10#13+ImageSavePath+FCaseID+'\'); |
| | | Download2Case(ImageSavePath+FCaseID+'\Download\',ImageSavePath+FCaseID+'\'); |
| | | //Showmessage('aaa'); |
| | |
| | | // //LoadImgFile; |
| | | // end; |
| | | Create_Cust_DocDir(FCaseID); //產生外面傳入的文件 |
| | | LastInitFormidListCreate(ImageSavePath+FCaseID+'\Download\'); |
| | | if FMode='ESCAN' then |
| | | LastInitFormidListCreate(ImageSavePath+FCaseID+'\Download\'); |
| | | end; |
| | | end; |
| | | |
| | |
| | | //ShowMessage('ImageSavePath='+ImageSavePath); |
| | | DataLoading(False,False); |
| | | |
| | | LogFile1.LogToFile(logTimeString+'OCX初始化結束'); |
| | | LogFile1.LogToFile(logTimeString+'FUrl='+FUrl+ |
| | | ',FCaseID='+FCaseID+ |
| | | ',FMode='+FMode+ |
| | | ',FModeName='+FModeName+ |
| | | ',FWork_no='+FWork_no+ |
| | | ',FUserID='+FUserID+ |
| | | ',FUserName='+FUserName+ |
| | | ',FUserUnit='+FUserUnit+ |
| | | ',FData='+FData+ |
| | | ',FVerify='+FVerify+ |
| | | ',FReWrite='+FReWrite+ |
| | | ',FLanguage='+FLanguage+ |
| | | ',FLoanDoc_Value='+FLoanDoc_Value+ |
| | | ',FLoanDoc_Enable='+FLoanDoc_Enable+ |
| | | ',FUseProxy='+FUseProxy+ |
| | | ',FC_DocNoList='+FC_DocNoList+ |
| | | ',FC_DocNameList='+FC_DocNameList+ |
| | | ',FFixFileList='+FFixFileList+ |
| | | ',FIs_In_Wh='+FIs_In_Wh+ |
| | | ',FOldCaseInfo='+FOldCaseInfo+ |
| | | ',FPrintyn='+FPrintyn+ |
| | | ',FIs_OldCase='+FIs_OldCase+ |
| | | ',FCustDocYN='+FCustDocYN); |
| | | LogFile1.LogToFile(logTimeString+'FImgDPI='+IntToStr(FImgDPI)+ |
| | | ',FScanColor='+ IntToStr(FScanColor)+ |
| | | ',FFileSizeLimit='+ IntToStr(FFileSizeLimit)+ |
| | | ',FCaseNoLength='+ IntToStr(FCaseNoLength)+ |
| | | ',FImgDelete='+FImgDelete+ |
| | | ',FIsExternal='+FIsExternal+ |
| | | ',FWH_category='+FWH_category+ |
| | | ',FCheck_main_form='+FCheck_main_form+ |
| | | ',FMaxUploadSize='+FMaxUploadSize); |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.Timer2Timer(Sender: TObject); |
| | |
| | | AreaStr : String; |
| | | S : TStringlist; |
| | | CheckStr : String; |
| | | uploadMsg:String;//20171122 新增 配合不同mode下要秀不能上傳訊息 |
| | | begin |
| | | IF not InitialOk Then |
| | | begin |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'按下上傳'); |
| | | ClearView(1); |
| | | CaseHelpBtn.Visible := False; |
| | | DisplayPath := ''; |
| | | ClearCaseIndex; |
| | | RejectCase := False; |
| | | |
| | | uploadMsg:=''; |
| | | if not CheckCaseID_OK then //檢查是否有未配號的案件 |
| | | begin |
| | | Showmessage(_Msg('尚有未配號案件,無法上傳')); |
| | | Showmessage(_Msg('尚有「無案件編號」之案件,無法上傳')); |
| | | Exit; |
| | | end; |
| | | |
| | |
| | | CreateIn_WH(CaseID); //產生入庫文件文字檔 In_Wh.dat |
| | | Case2upload(CaseID); //產生原影像結構 |
| | | TransPath := ImageSavePath+CaseID+'\Upload\'; |
| | | |
| | | {if FMode = 'ESCAN' then //20140320 yuu說拿掉此檢查 |
| | | begin |
| | | S := TStringlist.Create; |
| | |
| | | begin |
| | | /////訊問是否可上傳///// |
| | | CaseTrans := CaseAsk(CaseID); |
| | | //Showmessage('記得改回來'); |
| | | //CaseTrans := 0; |
| | | |
| | | /////訊問是否可上傳//// |
| | | end |
| | | Else ///不是新件、重掃件、異動件的不查 |
| | |
| | | end; |
| | | if CaseTrans = -1 then //失敗 |
| | | begin |
| | | Showmessage(_Msg('詢問案件可否傳送時,網路發生錯誤!!')+HttpErrStr); |
| | | Showmessage(_Msg('')+HttpErrStr+'.'); |
| | | DataLoading(False,False); |
| | | LoadImgFile; |
| | | Exit; |
| | |
| | | end; |
| | | end; |
| | | DataLoading(False,False); |
| | | TransMsg := Format(_Msg('成功件%d件'),[SuccessCount]); |
| | | TransMsg := Format(_Msg('成功件【%d】件'),[SuccessCount]); |
| | | if ReCasecount > 0 then |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('無法上傳件%d件'),[ReCasecount]); |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('無法上傳件【%d】件'),[ReCasecount]); |
| | | if CheckErrCount > 0 then |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('檢核失敗件%d件'),[CheckErrCount]); |
| | | begin |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('檢核失敗件【%d】件,請先點選「案件編號」,再點選「問號」查看錯誤原因'),[CheckErrCount]); |
| | | LogFile1.LogToFile(logTimeString+'檢核失敗原因:'+OMRErrini2ListForLog('')); |
| | | end; |
| | | |
| | | Showmessage(_Msg('傳送完成')+#13#10+TransMsg); |
| | | if (FMode = 'DSCAN') and (SuccessCount = 1) then |
| | | begin |
| | | uploadMsg:=NowCaseNo+_Msg('影像上傳完成。此案已進入下一流程'); |
| | | end; |
| | | if (FMode='ESCAN') and (FModeName=_Msg('補件掃描')) and (SuccessCount = 1) then |
| | | begin |
| | | uploadMsg:=NowCaseNo+_Msg('影像已補件完成'); |
| | | end; |
| | | //ShowMessage('uploadMsg='+uploadMsg); |
| | | if uploadMsg<>'' then |
| | | begin |
| | | ShowMessage(uploadMsg); |
| | | end |
| | | else |
| | | begin |
| | | Showmessage(_Msg('傳送完成')+#13#10+TransMsg); |
| | | end; |
| | | |
| | | LoadImgFile; |
| | | if (FMode = 'ESCAN') and (SuccessCount = 1) then |
| | |
| | | ClearCaseIndex; |
| | | PageLv.Items.Clear; //頁數清單 |
| | | //Panel18.Enabled:= False; |
| | | AttListBox.Items.Clear; |
| | | AddAttFileLB.Enabled := False; |
| | | DelAttFileLB.Enabled := False; |
| | | UseOldCaseLb.Visible := False; |
| | | PM107.Visible := False; //備註功能 |
| | | CaseHelpBtn.Visible := False; //檢核失敗原因鈕 |
| | |
| | | DisplayPath := ImageSavePath+NowCaseNo+'\'; |
| | | |
| | | if GetUseCase('F',DisplayPath,NowDocDir) <> '' then |
| | | StatusBar1.Panels[2].Text := Format('從%s引用',[GetUseCase('F',DisplayPath,NowDocDir)]); |
| | | StatusBar1.Panels[2].Text := Format(_Msg('從%s引用'),[GetUseCase('F',DisplayPath,NowDocDir)]); |
| | | if GetUseCase('T',DisplayPath,NowDocDir) <> '' then |
| | | StatusBar1.Panels[2].Text := Format('被%s引用',[GetUseCase('T',DisplayPath,NowDocDir)]); |
| | | StatusBar1.Panels[2].Text := Format(_Msg('被%s引用'),[GetUseCase('T',DisplayPath,NowDocDir)]); |
| | | if FLoanDoc_Enable = 'Y' then |
| | | begin |
| | | AddCredit1RG.Enabled := True; |
| | |
| | | DisplayPath := ImageSavePath+NowCaseNo+'\'; |
| | | |
| | | if GetUseCase('F',DisplayPath,NowDocDir) <> '' then |
| | | StatusBar1.Panels[2].Text := Format('從%s引用',[GetUseCase('F',DisplayPath,NowDocDir)]); |
| | | StatusBar1.Panels[2].Text := Format(_Msg('從%s引用'),[GetUseCase('F',DisplayPath,NowDocDir)]); |
| | | if GetUseCase('T',DisplayPath,NowDocDir) <> '' then |
| | | StatusBar1.Panels[2].Text := Format('被%s引用',[GetUseCase('T',DisplayPath,NowDocDir)]); |
| | | StatusBar1.Panels[2].Text := Format(_Msg('被%s引用'),[GetUseCase('T',DisplayPath,NowDocDir)]); |
| | | |
| | | if FLoanDoc_Enable = 'Y' then |
| | | begin |
| | |
| | | if FileExists(DisplayPath+'CustomDocNo.dat') then |
| | | Cust_DocNoList.LoadFromFile(DisplayPath+'CustomDocNo.dat'); |
| | | end; |
| | | MyTreeNode1.Expand(True); |
| | | MyTreeNode1.Expand(True); |
| | | AddAttFileLB.Enabled := True; |
| | | if FileExists(DisplayPath+'ATTContext.dat') then |
| | | begin |
| | | LoadAttFile(NowCaseno); |
| | | end; |
| | | end |
| | | Else //點在NewTreenode or MyTreenode1 上 |
| | | begin |
| | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.TreeView1MouseDown(Sender: TObject; |
| | | Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| | | begin |
| | | IF Button = TMouseButton(MbRight) Then |
| | | begin |
| | | MDown := True; |
| | | If TreeView1.GetNodeAt(X,Y) = nil then Exit; |
| | | TreeView1.Selected := TreeView1.GetNodeAt(X,Y); |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.TreeView1MouseEnter(Sender: TObject); |
| | | begin |
| | | TreeView1.SetFocus; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; |
| | | X, Y: Integer); |
| | | begin |
| | | TreeView1.SetFocus; |
| | | //TreeView1.SetFocus; |
| | | {UnRegisterHotKey(Handle, HotKeyId1); |
| | | UnRegisterHotKey(Handle, HotKeyId2); } |
| | | end; |
| | |
| | | IF Button = TMouseButton(MbRight) Then |
| | | begin |
| | | If TreeView1.GetNodeAt(X,Y) = nil then Exit; |
| | | TreeView1.Selected := TreeView1.GetNodeAt(X,Y); |
| | | TreeView1Click(self); |
| | | TreeView1.PopupMenu.Popup(Mouse.CursorPos.X ,Mouse.CursorPos.Y); |
| | | if MDown then |
| | | begin |
| | | TreeView1Click(self); |
| | | TreeView1.PopupMenu.Popup(Mouse.CursorPos.X ,Mouse.CursorPos.Y); |
| | | end; |
| | | Application.ProcessMessages; //需加這行,不然有些全域變數會沒變到 |
| | | MDown:= False; |
| | | end; |
| | | end; |
| | | |
| | |
| | | procedure TCB_IMGPSScanX.Set_filesizelimit(const Value: WideString); |
| | | begin |
| | | //ShowMessage(Value); |
| | | FFileSizeLimit:=0; |
| | | if Value ='' then |
| | | begin |
| | | FFileSizeLimit := 5*1024; |
| | |
| | | OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL, |
| | | tmApartment); |
| | | |
| | | SetLicenseKey('5B4451E676A1D2976FBB0F3BB18341336AF114C80B5ABAE7F6926B1CAF671F44' + |
| | | {SetLicenseKey('5B4451E676A1D2976FBB0F3BB18341336AF114C80B5ABAE7F6926B1CAF671F44' + |
| | | 'BD2F098CCEDA922F6389BFAE398DA6AEE67F97EEA0C17234C20D75C12173DBDA' + |
| | | '594924D56DD8E342F454389C836AD880BB4352CA3BE62C4933B1BA3828E7462C' + |
| | | '60514F2ECDAD322E6128D841F12D24DA00B623106D3F08EBCAA917D8A97CAA34' + |
| | | '3D65F2DA567316457395BF9123EE53DF235D181F191A5712DBB27735284AA92D' + |
| | | '5DFA0C8308308505F384707E900C6063F53F1BFF4C6972607955D1AE517B19D0' + |
| | | '82CDD16301885403AD229D57BAEF98C056F31430861E5F68F339D658D72E1F92' + |
| | | '63899412EC2D07891FE3AFD35F3E4A4390B2F0A8A1BF1B7D6160E5F1CC009B17'); |
| | | '63899412EC2D07891FE3AFD35F3E4A4390B2F0A8A1BF1B7D6160E5F1CC009B17'); } |
| | | SetLicenseKey('4B2CF65E8C2A86CE8A0DD0F6A7DB03BC0B0126168B48AE4C27EBD78CAE75CF0F' + |
| | | 'A612190861E0D99F6FAE3ED97AC1941B5E97843CFFCF705A3787989072D4EB2C' + |
| | | 'AE6CAB3F5B69B86616ACC8A37AD6A2AB21C7BDD5C9AE1EDF9E4193D353805C9A' + |
| | | '403631CE8A3D0803FEBB1BE4C209CE7A63B1298EF080EB34B8628CED567D2B68' + |
| | | 'E777FAC58E2E32B7411FC217A04336231D1E861A93474759DAA6EDF53F6EB632' + |
| | | 'A3055229A52F3053FB844754741409022DDE3DFB19473510F2BE63328E74BE20' + |
| | | 'A6A29AA24878F91ADA9DF8CE1F320AF4DAF58EBF95D9BE761D70EEA274E19475' + |
| | | '1C15948B184264C5C49E60493F3BCD2FFAE2CA8B021D00B96F45550C5F050D8A'); |
| | | |
| | | |
| | | SetLicenseKey('A6A94A8D91B08A9D58F300C0573EA9EF1B9DB0BF69B90E13B958DB4CB6B44F5A' + |