| | |
| | | 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; |
| | |
| | | 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+'\'; |
| | |
| | | end; |
| | | FormCode := FileName2FormCode(S.Strings[n]); |
| | | //Showmessage('1:'+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode)); |
| | | LogFile1.LogToFile(logTimeString+'caseno='+CaseID+','+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); |
| | |
| | | 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); |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | 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+' '+CaseID+' '+'MainFormID='+MainFormID); |
| | | LogFile1.LogToFile(logTimeString+' '+FModeName+' '+CaseID+' '+'MainFormID='+MainFormID); |
| | | if MainFormID = ''then |
| | | begin |
| | | //20131203 yuu說不檢查這個,先拿掉 20170315 楷琳說未歸類要擋 20170726 因此有檢查必要FormID 所以 可以拿掉 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | LogFile1.LogToFile(logTimeString+'必填 '+CaseID+' '+'OMRFileList.Text='+OMRFileList.Text); |
| | | For i := 0 to OMRFileList.Count - 1 do |
| | | begin |
| | | //ShowMessage('OMRFileList.Strings['+IntToStr(i)+']'+OMRFileList.Strings[i]); |
| | | if CheckRequiredColumnValues(FWork_NO,CaseID) then Continue; |
| | | |
| | | // if FWH_category='N' then |
| | | // begin |
| | | // if ISExistImg(ImageSavePath+CaseID+'\upload\'+OMRFileList.Strings[i]) then |
| | | // begin |
| | | // Continue; |
| | | // end; |
| | | // end; |
| | | OMRFile := OMRFileList.Strings[i]; |
| | | OMRFormCode := FileName2FormCode(OMRFileList.Strings[i]); |
| | | OMRFormName := FormCode2FormName(CaseID,OMRFormCode); |
| | |
| | | ////依十字定位點縮放/// |
| | | //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; |