| | |
| | | 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; |
| | | |
| | | var |
| | | Ch_WriteNote : Boolean; |
| | |
| | | N2: TMenuItem; |
| | | ISB1: TImageScrollBox; |
| | | Label3: TLabel; |
| | | LogFile1: TLogFile; |
| | | procedure ActiveFormCreate(Sender: TObject); |
| | | procedure Panel9Resize(Sender: TObject); |
| | | procedure ISB1Click(Sender: TObject); |
| | |
| | | LastAddFormidList:TstringList; |
| | | SampleFormIDList:TStringList; //20170627 已存在範本的formid |
| | | ExistImgList:TStringList; //20170724 已經存在的影像list for ESCAN //Img的完整路徑 |
| | | reSizeExistImgList:TstringList; //20171012被縮放的舊圖MD5存入 |
| | | //********清單區******** |
| | | |
| | | //********顯示區******** |
| | |
| | | NowDivPageFormID:String; |
| | | |
| | | FirstDocDir : String; |
| | | FMaxUploadSize:String;// 上傳zip大小限制 |
| | | |
| | | Draging : Boolean; |
| | | |
| | |
| | | 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 ; |
| | | protected |
| | | { Protected declarations } |
| | | procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override; |
| | |
| | | NowPage := p+1; |
| | | PageLV.ItemIndex := P; |
| | | end; |
| | | //DisplayISB.SetFocus; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.ISB1EndScroll(Sender: TObject); |
| | |
| | | p : Integer; |
| | | begin |
| | | DisplayISB := TImageScrollBox(Sender); |
| | | //DisplayISB.SetFocus; |
| | | 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; |
| | |
| | | LastAddFormidList.Free; |
| | | SampleFormIDList.Free; |
| | | ExistImgList.Free; |
| | | reSizeExistImgList.Free; |
| | | //********清單區******** |
| | | 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('文件歸類中,請稍候'); |
| | |
| | | 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 ISExistImg(ImageSavePath + NowCaseno+'\'+DocDir+'\'+ST1.Strings[0]) then |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',DocNo); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else //不分份數 |
| | | begin |
| | |
| | | //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; |
| | |
| | | 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]) + |
| | |
| | | iGraphic_sec := TTiffGraphic.Create; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0 黑白 為2 |
| | | |
| | | MpsGetBarcode(ISB.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | //有必要的話先把影像轉正 再開始切圖 |
| | | If CheckNeedCrop(iGraphic_First) Then |
| | |
| | | End; |
| | | End; |
| | | |
| | | if iGraphic.Palette.palNumEntries = 0 then //20171130 彩色 會為0 黑白 為2 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=70; |
| | | end; |
| | | |
| | | If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then |
| | | Begin |
| | | If FileExists(SavePath + SaveFilename) Then |
| | |
| | | End; |
| | | End; |
| | | // Rotate(ISB.Graphic,MpsBarcodeinf.r180[n]); //20170705 加入有條碼就轉正 |
| | | if iGraphic.Palette.palNumEntries = 0 then //20171130 彩色 會為0 黑白 為2 |
| | | begin |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=70; |
| | | end; |
| | | |
| | | If LowerCase(ExtractFileExt(SavePath + SaveFilename)) = '.tif' Then |
| | | Begin |
| | |
| | | i : Integer; |
| | | DocListForm : TDocListForm; |
| | | OldName,NewName,Ext : String; |
| | | NewFormID,NewFormName : String; |
| | | NewFormID,NewFormName,CustomDocNo : String; |
| | | begin |
| | | DocListForm := TDocListForm.Create(self); |
| | | try |
| | | InitialLanguage(PatchDlg); //載入多國語言 |
| | | 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('未輸入文件名稱'); |
| | | Exit; |
| | | end; |
| | | if FindCustomDocName(DisplayPath,NewFormID) then |
| | | begin |
| | | Showmessage(Format('文件名稱:"%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); |
| | | 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); |
| | | |
| | | 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 |
| | | begin |
| | |
| | | Showmessage(Format('文件名稱:"%s"己存在',[CustomDocName])); |
| | | Exit; |
| | | end; |
| | | |
| | | ST1:=TStringList.Create; |
| | | CustomDocNo := GetNewCustomDocNo(DisplayPath,CustomDocName); |
| | | DocDir := CustomDocNo; |
| | | SavePath := ImageSavePath+NowCaseNo+'\'+DocDir+'\'; |
| | |
| | | //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)); |
| | | |
| | | ShowMessage('FMaxUploadSize='+FMaxUploadSize); |
| | | initkscan; |
| | | showmessage('FUrl='+FUrl+#10#13+ |
| | | 'FCaseID='+FCaseID+#10#13+ |
| | |
| | | Try |
| | | Scanner.OpenSource; |
| | | Scanner.Duplex := ScanDuplex; //雙面 |
| | | |
| | | if FMode='SAMPLESCAN' then |
| | | Scanner.Duplex:=False; |
| | | |
| | | //Scanner.FEEDERENABLED := not ScanFlatCB.Checked; // 先拿掉平台 |
| | | If ScanImgSetUse Then |
| | | begin |
| | |
| | | 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)) = 'MAX_UPLOAD_SIZE' Then //取得 上傳大小的限制(MB) |
| | | begin |
| | | PARA_CONTENT := GetSQLData(WORK_INF_List,'PARA_CONTENT',i); |
| | | FMaxUploadSize := PARA_CONTENT; |
| | | end; |
| | | end; |
| | | ScanDuplex := Def_ScanDuplex; |
| | |
| | | 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; |
| | |
| | | end; |
| | | FormCode := FileName2FormCode(S.Strings[n]); |
| | | //Showmessage('1:'+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode)); |
| | | LogFile1.LogToFile(logTimeString+'CheckCaseDocNoPage caseno='+CaseID+','+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(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); |
| | |
| | | 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 |
| | |
| | | casepath:String; |
| | | filesizeInt:integer; |
| | | case_page:string; |
| | | Fname:String; |
| | | FileRec:TSearchrec; |
| | | begin |
| | | Result := True; |
| | | TransName := CaseID; |
| | |
| | | |
| | | 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); |
| | |
| | | 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; |
| | | If FileRec.Size > StrtoInt(FMaxUploadSize) * 1048576 Then // 檢查檔案大小 |
| | | Begin |
| | | ShowMessage(Format('%.3f', [FileRec.Size / 1048576]) + |
| | | ' MB,超過上傳限制大小 '+FMaxUploadSize+' MB'); |
| | | FindClose(FileRec); |
| | | Result := False; |
| | | Exit; |
| | | End; |
| | | FindClose(FileRec); |
| | | ///檢查上傳的zip大小//// |
| | | //ShowMessage('last_add_formidstr='+last_add_formidstr); |
| | | ////上傳///// |
| | | SendData:='data='+HTTPEncode(UTF8Encode(FData)) |
| | | +'&verify='+FVerify |
| | |
| | | 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; |
| | |
| | | FormID : String; |
| | | OldFile,NewFile:String; |
| | | Ext : String; |
| | | ST1:TStringList; |
| | | begin |
| | | ST1:=TStringList.Create; |
| | | OldFileList := TStringlist.Create; |
| | | NewFileList := TStringlist.Create; |
| | | try |
| | |
| | | NewDocDir := FindLastestDocDir(CaseID,NewDocNo); |
| | | if NewDocDir = '' then |
| | | NewDocDir := NewDocNo; |
| | | //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; |
| | | |
| | |
| | | |
| | | 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; |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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); |
| | |
| | | v := Pos('-',NewTreeNode.Text); |
| | | NewTreeNode.Text := Format(_Msg('%s-共%d筆共%d頁'),[Copy(NewTreeNode.Text,1,v-1),CaseCount,PageCount]); |
| | | end; |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.logTimeString: String; |
| | | begin |
| | | Result:=FormatDateTime('yyyymmdd hh:mm:ss',now) +' ' |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.FindDivFormCode(FormCode:String):Boolean; //找有沒有分案的條碼 |
| | |
| | | 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)); |
| | | 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='異動件' 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); |
| | | LogFile1.LogToFile(logTimeString+'OMRFile='+OMRFile+',OMRFormCode='+OMRFormCode+',OMRFormName='+OMRFormName); |
| | | //ShowMessage('KKKKK'); |
| | | if not FileExists(CheckXmlPath+OMRFormCode+'.xml') then //沒有Xml就不用檢核 |
| | | Continue; |
| | | |
| | | |
| | | //ShowMessage('11638 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | XT := TXmltool.Create(CheckXmlPath+OMRFormCode+'.xml'); |
| | | RelaXT := TXmltool.Create; |
| | | //ShowMessage('ModeNeedCheck='+BoolToStr(ModeNeedCheck(OMRErrInfo[4].Mode,FMode),true)); |
| | |
| | | Until not XT.SubNodes['/form/settype1/'].Next ; |
| | | end; |
| | | //*******必填******** |
| | | |
| | | //ShowMessage('11692 OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | //if AllCheck then |
| | | //begin |
| | | //*******有值相關文件的欄位也要有值******* |
| | |
| | | Anchor1 := FormID2Anchor(RelaFormCode); |
| | | RelaXT.LoadFromFile(CheckXmlPath+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 //是否要檢核 |
| | |
| | | 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 抓相關然欄位所在圖檔的定位 |
| | | |
| | | 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; |
| | |
| | | PageLVclear := True; |
| | | InitialOk := False; |
| | | |
| | | FMaxUploadSize:='10'; |
| | | //FMode := 'DSCAN' ; |
| | | //FIs_In_Wh := 'Y'; |
| | | if FIs_In_Wh = 'Y' then |
| | |
| | | LastAddFormidList := TStringList.Create; |
| | | SampleFormIDList := TStringList.Create;//20170627 加入 |
| | | ExistImgList := TStringList.Create; //20170724 新增 |
| | | reSizeExistImgList :=TStringList.Create; //20171012 新增 |
| | | //********清單區******** |
| | | |
| | | ShowText := _Msg('資料載入中,請稍候'); |
| | |
| | | Del_Sub_NothingPath(ImagePath); //清掉案件目錄是空的 |
| | | |
| | | |
| | | LogFile1.LogFile:=LngPath+'IMGPSCheck.log'; |
| | | |
| | | ReduceLogFile; |
| | | |
| | | ShowText := _Msg('資料載入中,請稍候'); |
| | | DataLoading(True,True); |
| | |
| | | AreaStr : String; |
| | | S : TStringlist; |
| | | CheckStr : String; |
| | | uploadMsg:String;//20171122 新增 配合不同mode下要秀不能上傳訊息 |
| | | begin |
| | | IF not InitialOk Then |
| | | begin |
| | |
| | | DisplayPath := ''; |
| | | ClearCaseIndex; |
| | | RejectCase := False; |
| | | |
| | | uploadMsg:=''; |
| | | if not CheckCaseID_OK then //檢查是否有未配號的案件 |
| | | begin |
| | | Showmessage(_Msg('尚有未配號案件,無法上傳')); |
| | |
| | | if CheckErrCount > 0 then |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('檢核失敗件%d件'),[CheckErrCount]); |
| | | |
| | | Showmessage(_Msg('傳送完成')+#13#10+TransMsg); |
| | | |
| | | if (FMode = 'DSCAN') and (SuccessCount = 1) then |
| | | begin |
| | | uploadMsg:=NowCaseNo+_Msg('影像上傳完成。此案已進入下一流程。'); |
| | | end; |
| | | if (FMode='ESCAN') and (FModeName='補件掃描') 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 |
| | |
| | | procedure TCB_IMGPSScanX.Set_filesizelimit(const Value: WideString); |
| | | begin |
| | | //ShowMessage(Value); |
| | | FFileSizeLimit:=0; |
| | | if Value ='' then |
| | | begin |
| | | FFileSizeLimit := 5*1024; |