doom4ster
2017-11-30 1807a861b1b5f54ff5cbe249caf24f9b68ebd18e
CB_IMGPSScanImp.pas
@@ -564,6 +564,7 @@
    NowDivPageFormID:String;
    FirstDocDir : String;
    FMaxUploadSize:String;// 上傳zip大小限制
    Draging : Boolean;
@@ -2734,6 +2735,8 @@
      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
@@ -2840,6 +2843,12 @@
              Break;
            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
@@ -4039,10 +4048,10 @@
  //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+
@@ -4143,6 +4152,10 @@
    Try
      Scanner.OpenSource;
      Scanner.Duplex := ScanDuplex; //雙面
      if FMode='SAMPLESCAN' then
        Scanner.Duplex:=False;
      //Scanner.FEEDERENABLED  := not ScanFlatCB.Checked;     // 先拿掉平台
      If ScanImgSetUse Then
      begin
@@ -5138,6 +5151,11 @@
    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;
@@ -6110,6 +6128,8 @@
  casepath:String;
  filesizeInt:integer;
  case_page:string;
  Fname:String;
  FileRec:TSearchrec;
begin
  Result := True;
  TransName := CaseID;
@@ -6173,7 +6193,7 @@
  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);
@@ -6227,6 +6247,27 @@
  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
@@ -8311,7 +8352,16 @@
      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
@@ -8928,7 +8978,7 @@
  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);
@@ -11475,7 +11525,7 @@
            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
@@ -13998,7 +14048,7 @@
  PageLVclear := True;
  InitialOk := False;
  FMaxUploadSize:='10';
  //FMode := 'DSCAN' ;
  //FIs_In_Wh := 'Y';
  if FIs_In_Wh = 'Y' then
@@ -14373,6 +14423,7 @@
  AreaStr : String;
  S : TStringlist;
  CheckStr : String;
  uploadMsg:String;//20171122 新增 配合不同mode下要秀不能上傳訊息
begin
  IF not InitialOk Then
  begin
@@ -14384,7 +14435,7 @@
  DisplayPath := '';
  ClearCaseIndex;
  RejectCase := False;
  uploadMsg:='';
  if not CheckCaseID_OK then  //檢查是否有未配號的案件
  begin
    Showmessage(_Msg('尚有未配號案件,無法上傳'));
@@ -14512,7 +14563,24 @@
  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