doom4ster
2017-03-16 f7a5517638c169c5f8d47339afbc6cfac2e08f5e
CB_IMGPSScanImp.pas
@@ -825,6 +825,7 @@
    function GetCurrentVersionNo: String;
    procedure initParameter;
    procedure LastInitFormidListCreate(path:string);
    function checkFormCodeIsCustom(path,formcode:string):boolean;
  protected
    { Protected declarations }
    procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
@@ -3648,8 +3649,8 @@
  str:='';
  for I := 1 to 11 do // 看 OMRErrInfo 的內容
  begin
  str:=str+BoolToStr(OMRErrInfo[i].Display)+','
          +BoolToStr(OMRErrInfo[i].Ignore)+','+OMRErrInfo[i].Info+','
  str:=str+BoolToStr(OMRErrInfo[i].Display,true)+','
          +BoolToStr(OMRErrInfo[i].Ignore,true)+','+OMRErrInfo[i].Info+','
          +OMRErrInfo[i].Mode+#10#13;
  end;
  ShowMessage('OMRErrInfo='+str);
@@ -5282,20 +5283,21 @@
  S : TStringlist;
  FormCode,iPage : String;
begin
  Count := 1;
  Count := 0;
  S := TStringlist.Create;
  try
    S.LoadFromFile(ImageSavePath+CaseID+'\upload\Context.dat');
    for I := 0 to pages-1 do
    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
        FormCode := FileName2FormCode(S.Strings[n]);
        //Showmessage('1:'+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode));
//Showmessage('1:'+version+','+FormCode2Version(FormCode)+','+DocNo+','+FormCode2DocNo(FormCode)+','+iPage+','+FormCode2Page(FormCode));
        if (version = FormCode2Version(FormCode)) and (DocNo = FormCode2DocNo(FormCode)) and (ipage = FormCode2Page(FormCode)) then
        begin
          //Showmessage(inttostr(Count+1));
//Showmessage(version+','+DocNo+',iPage='+iPage);
//Showmessage(inttostr(Count+1));
          Inc(Count);
          Break;   //找到了...離開
        end;
@@ -5474,6 +5476,7 @@
  must_formidStr :string;
  last_add_formidstr :string;
  casepath:String;
  filesizeInt:integer;
begin
  Result := True;
  TransName := CaseID;
@@ -5584,6 +5587,10 @@
  end;
  ///保留外部影像  end///////////////////////////////
  //file_size 計算  就先不做 20170316
  filesizeInt:=0;
  //////壓檔/////
  ZipMainFile(Path,Path,'Img.zip');
  if HaveMask then
@@ -5598,6 +5605,7 @@
  +'&doc_data='+HTTPEncode(UTF8Encode(Doc_Data))
  +'&doc_data1='+HTTPEncode(UTF8Encode(Doc_Data1))
  +'&attach='+AttachYN
  +'&file_size='+IntToStr(filesizeInt)
  +'&must_formid='+must_formidStr  //擁有的 formid
  +'&last_add_formid='+last_add_formidstr   //當次新加的 formid
  +'&in_doc1='+HTTPEncode(UTF8Encode(In_Doc1))
@@ -6442,6 +6450,27 @@
      Break;
    end;
  end;
end;
function TCB_IMGPSScanX.checkFormCodeIsCustom(path, formcode: string): boolean;
var
  i:integer;
  ini : Tmeminifile;
  str1:String;
begin
//ShowMessage(path);
  ini := Tmeminifile.Create(Path+'CustomDocNo.ini');
  str1:=ini.ReadString(Copy(formcode,1,8),'FormID','');
//ShowMessage('str1'+str1);
  if str1 = formcode then
  begin
    Result:=True;
  end
  else
  begin
    Result := False;
  end;
end;
Function TCB_IMGPSScanX.CheckCaseID_OK:Boolean;  //檢查是否有未配號的案件
@@ -10481,7 +10510,7 @@
          //20131203 yuu說不檢查這個,先拿掉   20170315 楷琳說未歸類要擋
          if FCheck_main_form='Y' then
          begin
            if (FMode <> 'SSCAN') and (Fmode <> 'ESCAN') then  //簽署章件會換主FormID,先跳過
            if (FMode <> 'SSCAN') then  //簽署章件會換主FormID,先跳過
            begin
              ErrStr:=_Msg('找不到分案文件');   //找不到主文件
              OMRErr2ini(CaseID,ErrStr,'','','','','','',False,False,True);
@@ -10586,10 +10615,12 @@
        end }
        /////未註冊文件/////
        //////停用文件//
        {Else} IF ModeNeedCheck(OMRErrInfo[9].Mode,FMode) and (not FormIDExists(FormCode,True,0)) then  //有停用的文件
        {Else} IF ModeNeedCheck(OMRErrInfo[9].Mode,FMode) and (not FormIDExists(FormCode,True,0)) and (not checkFormCodeIsCustom(ImageSavePath + CaseID+'\upload\',FormCode)) then  //有停用的文件
        begin
//ShowMessage('AAAA');
          ErrStr:=Format(OMRErrInfo[9].Info,[FormCode2FormName(CaseID,FormCode)]);   //有停用文件
          OMRErr2ini(CaseID,ErrStr,'','','','','','',False,OMRErrInfo[9].Ignore,OMRErrInfo[9].Display);
//ShowMessage('ErrStr='+ErrStr);
          if OMRErrInfo[9].Display then
            CaseOk := false;
        end;