| | |
| | | function LoadFileGetMD5(const filename:string):string; //20170809 取的檔案的MD5 |
| | | function ISExistImg(const filename:string):boolean; //20170809 確認是否存在原有影像 |
| | | procedure _DelTreeForExistImg(ASourceDir:String); //2017 刪除前確認 有舊影像嗎 |
| | | function DocNoIsExistImg(DocNopath: String): boolean; //2017 刪除前確認 有舊影像嗎 |
| | | function DocNoIsExistImg(DocNopath: String): boolean; //2017 刪除前確認 有舊影像嗎 |
| | | function CheckCaseAttach_OK: Boolean; //2017 確認是否有未歸類文件 |
| | | protected |
| | | { Protected declarations } |
| | | procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override; |
| | |
| | | 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)]); |
| | |
| | | |
| | | DeleteFile(Path+FileName); |
| | | DocDir := Path2DocDir(Path,CaseID); |
| | | //ShowMessage('DocDir='+DocDir); |
| | | SetContextList('D',-1,CaseID,DocDir,FileName); |
| | | {FileList:=TStringlist.Create; |
| | | try |
| | |
| | | for n := 0 to S.Count - 1 do |
| | | begin |
| | | |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | if ISExistImg(ImageSavePath+CaseID+'\upload\'+S.Strings[n]) then |
| | | begin |
| | |
| | | //DocNo:String; |
| | | begin |
| | | //DocNo := FormCode2DocNo(FileName2FormCode(FileName)); |
| | | //ShowMessage('FileName='+FileName); |
| | | if DocDir = '' then |
| | | DocDir := AttName ; //附件 |
| | | ContextList.Clear; |
| | |
| | | begin |
| | | Result := False; |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.CheckCaseAttach_OK:Boolean; //檢查是否有未歸類的案件 |
| | | var |
| | | i,j : Integer; |
| | | begin |
| | | Result := True; |
| | | for i := 0 to NewTreeNode.Count - 1 do |
| | | begin |
| | | for j := 0 to NewTreeNode.Item[i].Count - 1 do |
| | | begin |
| | | if Pos(_msg('未歸類'),NewTreeNode.Item[i].Item[j].Text) > 0 then |
| | | begin |
| | | Result := False; |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | end; |
| | |
| | | begin |
| | | FileList.LoadFromFile(Path+CaseID+'\'+iDocDir+'\Context.dat'); |
| | | |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | ST1.Clear; |
| | | for n := 0 to FileList.Count - 1 do |
| | |
| | | FileList.LoadFromFile(ImageSavePath+Caseno+'\'+CaseDocNoList.Strings[i]+'\Context.dat'); |
| | | iDocNo := DocNoDir2DocNo(CaseDocNoList.Strings[i]); |
| | | ST1.Clear; |
| | | |
| | | if FWH_category='N' then |
| | | //ShowMessage(FileList.Text); |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | for n := 0 to FileList.Count - 1 do |
| | | begin |
| | |
| | | if FileList.Count=0 then Continue; |
| | | |
| | | |
| | | //Showmessage('aaa '+FileList.Text); |
| | | //Showmessage('aaa '+FileList.Text); |
| | | DocNoCopies := Strtoint(CaseDocNo_CopiesList.Strings[i]); |
| | | DocNoPage := FileList.Count; |
| | | iDocNo := DocNoDir2DocNo(CaseDocNoList.Strings[i]); |
| | |
| | | |
| | | if DirectoryExists(ImageSavePath+Caseno+'\'+AttName) then |
| | | begin |
| | | |
| | | FileList.Clear; |
| | | if FileExists(ImageSavePath+Caseno+'\'+AttName+'\Context.dat') then |
| | | FileList.LoadFromFile(ImageSavePath+Caseno+'\'+AttName+'\Context.dat') |
| | |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | if FModeName='件' then //20170904 先裝死 因為異動 同時存在兩種附件太難寫 |
| | | begin |
| | | if DirectoryExists(ImageSavePath+Caseno+'\Attach') then |
| | | begin |
| | | FileList.Clear; |
| | | if FileExists(ImageSavePath+Caseno+'\Attach'+'\Context.dat') then |
| | | FileList.LoadFromFile(ImageSavePath+Caseno+'\Attach'+'\Context.dat') |
| | | Else |
| | | begin |
| | | Rmdir(ImageSavePath+Caseno+'\Attach'); |
| | | Exit; |
| | | 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.ImageIndex := 2; |
| | | DocNode.SelectedIndex := 2; |
| | | for n := 0 to FileList.Count - 1 do |
| | | begin |
| | | FormID := FileName2FormCode(FileList.Strings[n]); |
| | | if not CheckFormIDExists(DocNode,FormID) 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.ImageIndex := 4; |
| | | FormNode.SelectedIndex := 4; |
| | | end; |
| | | end; |
| | | end; |
| | | end; |
| | | |
| | | Finally |
| | | FileList.Free; |
| | | CaseDocNoList.Free; |
| | |
| | | S := TStringlist.Create; |
| | | GraphicPrinter := TDibGraphicPrinter.Create; |
| | | PrtDialog := TPrintDialog.Create(self); |
| | | //PrtDialog.Copies:=99; |
| | | try |
| | | IF PrtDialog.Execute Then |
| | | begin |
| | |
| | | For i := 0 to CaseDocNoList.Count-1 do |
| | | begin |
| | | |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | if FileExists(ImageSavePath+NowCaseno+'\EditedDocDir.dat') then |
| | | begin |
| | |
| | | for n := 0 to ContextList.Count - 1 do |
| | | begin |
| | | |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[n]) then |
| | | begin |
| | |
| | | |
| | | //ShowMessage('ContextList.Count='+IntToStr(ContextList.Count)); |
| | | CreatePreViewISB(ContextList.Count); |
| | | //ShowMessage(IntToStr(ContextList.Count-Ct)); |
| | | //ShowMessage(IntToStr(ContextList.Count)); |
| | | int1:=0; |
| | | //ShowMessage(BoolToStr(DocNoIs_In_WH(Copy(iDocNo,1,8)),true)); |
| | | For i := 0 to ContextList.Count -1 do |
| | | begin |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]) then |
| | | begin |
| | | |
| | | if not DocNoIs_In_WH(Copy(iDocNo,1,8)) then |
| | | if not DocNoIs_In_WH(Copy(iDocNo,1,8)) and ( iDocNo<>'Attach') then |
| | | begin |
| | | inc(int1); |
| | | Continue; |
| | | end; |
| | | end; |
| | | end; |
| | | //ShowMessage(Path+iDocNo+'\'+ContextList.Strings[i]); |
| | | ISB := TImageScrollBox(FindComponent(ISBName+intToStr(i+1-int1))); |
| | | ISB.AntiAliased := True; |
| | | if ISB.ZoomPercent > 100 then |
| | |
| | | begin |
| | | if FileName2FormCode(ContextList.Strings[i]) = FormID then |
| | | begin |
| | | if FWH_category='N' then |
| | | if (FWH_category='N') and (FIs_In_Wh='Y') then |
| | | begin |
| | | //ShowMessage(Path+iDocNo+'\'+ContextList.Strings[i]); |
| | | //ShowMessage(BoolToStr(ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]),true)); |
| | |
| | | OldName := Filelist.Strings[i]; |
| | | //NewName := Add_Zoo(i+1,3)+Copy(OldName,4,length(OldName)-3); |
| | | NewName := Add_Zoo(i+1,3)+FileName2NoQuene_Filename(OldName); |
| | | //ShowMessage(OldName+#10#13+NewName); |
| | | ReNameFile(Path+OldName,Path+NewName); |
| | | Filelist.Strings[i] := NewName; |
| | | end; |
| | |
| | | Showmessage(_Msg('尚有未配號案件,無法上傳')); |
| | | Exit; |
| | | end; |
| | | |
| | | if not CheckCaseAttach_OK then //20170911檢查是否有未歸類的案件 |
| | | begin |
| | | Showmessage(_Msg('尚有未歸類文件,無法上傳')); |
| | | Exit; |
| | | end; |
| | | |
| | | |
| | | if NewTreeNode.Count = 0 then |
| | | begin |
| | | Showmessage(_Msg('無影像需傳送')); |