| | |
| | | ISB1: TImageScrollBox; |
| | | Label3: TLabel; |
| | | LogFile1: TLogFile; |
| | | ScanGrayCB: TCheckBox; |
| | | procedure ActiveFormCreate(Sender: TObject); |
| | | procedure Panel9Resize(Sender: TObject); |
| | | procedure ISB1Click(Sender: TObject); |
| | |
| | | procedure N1Click(Sender: TObject); |
| | | procedure TreeView1MouseEnter(Sender: TObject); |
| | | procedure ScrollBox1MouseEnter(Sender: TObject); |
| | | procedure ScanGrayCBClick(Sender: TObject); |
| | | private |
| | | { Private declarations } |
| | | HotKeyId1,HotKeyId2,HotKeyId3,HotKeyId4 :Integer; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | 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 |
| | |
| | | |
| | | //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 |
| | |
| | | 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; |
| | |
| | | end; |
| | | if CustomDocNo = '' then Exit; |
| | | DocDir := CustomDocNo; |
| | | LogFile1.LogToFile(logTimeString+'縮圖 歸類自訂文件 DocDir='+DocDir); |
| | | SavePath := ImageSavePath+NowCaseNo+'\'+DocDir+'\'; |
| | | Str2Dir(SavePath); |
| | | SetDocNoList('A',-1,NowCaseNo,DocDir,'1'); |
| | |
| | | // Exit; |
| | | // end; |
| | | // end; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'縮圖刪除 iISB.FileName='+iISB.FileName); |
| | | DeleteImageFile(ExtractFilePath(iISB.FileName),ExtractFileName(iISB.FileName),NowCaseNo); |
| | | end; |
| | | end; |
| | |
| | | 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); |
| | |
| | | Result:=False; |
| | | ST:=TStringList.Create; |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | //ShowMessage(ST.Text); |
| | | 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; |
| | |
| | | ISB := TImageScrollBox.Create(self); |
| | | try |
| | | ShowText := _Msg('檔案加入中,請稍候'); |
| | | LogFile1.LogToFile(logTimeString+'檔案加入中開始'); |
| | | DataLoading(True, True); |
| | | If TreeView1.Selected = Nil Then |
| | | Exit; |
| | |
| | | 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; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | |
| | | //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0 黑白 為2 |
| | | |
| | | MpsGetBarcode(ISB.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(ISB.Graphic, MpsBarcodeinf.r180[n]); |
| | | //MpsGetBarcode(iGraphic_First, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | //有必要的話先把影像轉正 再開始切圖 |
| | | If CheckNeedCrop(iGraphic_First) Then |
| | | Begin |
| | |
| | | (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 // 依條碼角度轉影像 |
| | | 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='補件掃描') 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 |
| | |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[n]); |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | if iGraphic.Palette.palNumEntries = 0 then //20171130 彩色 會為0 黑白 為2 |
| | | //ShowMessage(IntToStr(iGraphic.Palette.palNumEntries)); |
| | | if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 灰階256 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | |
| | | // 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 then //20171130 彩色 會為0 黑白 為2 |
| | | |
| | | if (iGraphic.Palette.palNumEntries = 0) or (iGraphic.Palette.palNumEntries = 256) then //20171130 彩色 會為0 黑白 為2 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=cooom; |
| | |
| | | begin |
| | | DocListForm := TDocListForm.Create(self); |
| | | try |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類開始'); |
| | | InitialLanguage(DocListForm); //載入多國語言 |
| | | DocListForm.CheckBox1.Visible:=True; |
| | | for i := 1 to FORM_INF_List.Count - 1 do |
| | |
| | | begin |
| | | //歸類到自訂文件 |
| | | NewFormID:=DocListForm.Edit1.Text; |
| | | |
| | | if Trim(DocListForm.Edit1.Text)='' then |
| | | begin |
| | | Showmessage('未輸入文件名稱'); |
| | |
| | | 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'); |
| | |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | //ShowMessage('NowDocDir='+NowDocDir); |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類到既有文件 NewFormID='+NewFormID); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,NewFormID); |
| | | |
| | | end; |
| | |
| | | end; |
| | | pScanInfo^.Graphic.Compression := tcJpeg; |
| | | pScanInfo^.Graphic.JpegQuality := FJpgCompression; |
| | | //ShowMessage(IntToStr(pScanInfo^.Graphic.JpegQuality)); |
| | | //if pScanInfo^.Graphic.Compression = tcJpeg then |
| | | //begin |
| | | //ShowMessage('jpg'); |
| | | //end; |
| | | |
| | | end |
| | | else |
| | | begin |
| | |
| | | //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; |
| | |
| | | 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 |
| | |
| | | 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='補件掃描') then //20180207 加入的特殊邏輯 |
| | | begin |
| | | ScanDocDir := FindLastestDocDirForPage(ScanCaseno, DocNo,FormID); |
| | | end; |
| | | |
| | | if (DocNoNeedDiv(DocNo)) then //要分份數 |
| | | begin |
| | | if TreeView1.Selected = MyTreeNode1 then //20170421 掃瞄插頁時選則在案號上才要分份數 選在FormID上就不分份數 |
| | |
| | | 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 then //2017 1220 改成只承認第一份的 |
| | | |
| | | 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)); |
| | |
| | | begin |
| | | docInt:=tempInt; |
| | | end; |
| | | |
| | | if docInt<>tempInt then |
| | | begin |
| | | Break |
| | | //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)); |
| | |
| | | //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 |
| | | 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); |
| | |
| | | |
| | | //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])); |
| | | //ShowMessage('iDocNo='+iDocNo); |
| | | DocNode := TreeView1.Items.AddChild(CaseNode,Format('%s{%s}-%d'+_msg('份'),[DocNo2DocName(Caseno,iDocNo),CaseDocNoList.Strings[i],DocNoCopies])); |
| | | |
| | | if GetUseCase('F',ImageSavePath+Caseno+'\',CaseDocNoList.Strings[i]) <> '' Then |
| | |
| | | if FScanColor = 1 then |
| | | begin |
| | | ScanColor := ifGray256 ; |
| | | ScanGrayCB.Checked:=True; |
| | | end; |
| | | |
| | | if FScanColor = 2 then |
| | |
| | | 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 |
| | |
| | | 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; |
| | |
| | | ini.Free; |
| | | 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 |
| | |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'按下上傳'); |
| | | ClearView(1); |
| | | CaseHelpBtn.Visible := False; |
| | | DisplayPath := ''; |
| | |
| | | if ReCasecount > 0 then |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('無法上傳件【%d】件'),[ReCasecount]); |
| | | if CheckErrCount > 0 then |
| | | begin |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('檢核失敗件【%d】件,請先點選「案件編號」,再點選「問號」查看錯誤原因'),[CheckErrCount]); |
| | | |
| | | LogFile1.LogToFile(logTimeString+'檢核失敗原因:'+OMRErrini2ListForLog('')); |
| | | end; |
| | | |
| | | if (FMode = 'DSCAN') and (SuccessCount = 1) then |
| | | begin |