|
@@ -806,13 +806,43 @@ var sURL, sAppFile, sJsonFile_Bills, sJsonFile_Common, sAppFile_UnLock,
|
|
|
vExportor: TTenderExport;
|
|
|
vCF: TCheckerMemoForm;
|
|
|
bNeedFreeEarlier: Boolean;
|
|
|
- iFile: Integer;
|
|
|
+
|
|
|
+ // 1 审核; 2 批复。
|
|
|
+ function SaveAndExport(AType: Integer): Boolean;
|
|
|
+
|
|
|
+ function InnerSubmit(AType: Integer): Boolean;
|
|
|
+ begin
|
|
|
+ if AType = 1 then
|
|
|
+ Result := ProjectData.SubmitProject(sAppFile)
|
|
|
+ else if AType = 2 then
|
|
|
+ Result := ProjectData.ReplyProject(sAppFile);
|
|
|
+ end;
|
|
|
+ begin
|
|
|
+ Result := False;
|
|
|
+
|
|
|
+ ProgressProRun('保存本地数据...', 0);
|
|
|
+ ProjectData.Save;
|
|
|
+ ProgressProRun('保存本地数据。OK', 10, pmtEdit);
|
|
|
+
|
|
|
+ ProgressProRun('导出并检验文件...', 0);
|
|
|
+ if not InnerSubmit(AType) then
|
|
|
+ if not InnerSubmit(AType) then
|
|
|
+ begin
|
|
|
+ bNeedFreeEarlier := True;
|
|
|
+ Application.MessageBox('Sorry!本地文件连续2次导出检验失败!如果重试后仍不能解决该问题,请联系纵横客服。', '提示', MB_OK + MB_ICONWARNING);
|
|
|
+ Exit;
|
|
|
+ end;
|
|
|
+ Result := True;
|
|
|
+ ProgressProRun('导出并检验文件。OK', 10, pmtEdit);
|
|
|
+ end;
|
|
|
begin
|
|
|
+ ProgressProCreate(100, '本地数据文件上传到云端');
|
|
|
+
|
|
|
bSubmit := False;
|
|
|
bNeedFreeEarlier := False;
|
|
|
sAppFile := PHPWeb.UserPath + 'ProjectFile.rmf';
|
|
|
// 只有编制人才真正需要该文件存在
|
|
|
- sAppFile_UnLock := PHPWeb.UserPath + 'ProjectFile_UnLock';
|
|
|
+// sAppFile_UnLock := PHPWeb.UserPath + 'ProjectFile_UnLock';
|
|
|
|
|
|
sPassedHint1 :=
|
|
|
'【审批通过】后,计量数据将自动交付给下一审批人进行审批,操作后将不可更改,是否通过审批?';
|
|
@@ -844,28 +874,7 @@ begin
|
|
|
if Application.MessageBox(PChar(CheckersHint), '询问', MB_YESNO + MB_ICONQUESTION) = ID_No then
|
|
|
Exit;
|
|
|
|
|
|
- ProgressProCreate(100, '本地数据文件上传到云端');
|
|
|
- ProjectData.Save;
|
|
|
- ProgressProRun('保存本地数据。OK');
|
|
|
-
|
|
|
- // 生成无锁文件
|
|
|
- vRec := MainForm.ProjectManagerFrame.Rec(ProjectData.ProjectID);
|
|
|
- vExportor := TTenderExport.Create(vRec, sAppFile_UnLock);
|
|
|
- try
|
|
|
- vExportor.Execute;
|
|
|
- finally
|
|
|
- vExportor.Free;
|
|
|
- end;
|
|
|
- ProgressProRun('生成无锁文件。OK');
|
|
|
- ProgressProRun('生成并检验待审核文件...', 0);
|
|
|
- if not ProjectData.SubmitProject(sAppFile) then
|
|
|
- if not ProjectData.SubmitProject(sAppFile) then
|
|
|
- begin
|
|
|
- bNeedFreeEarlier := True;
|
|
|
- Application.MessageBox('Sorry!待审核文件连续2次生成失败!如果重试后仍不能解决该问题,请联系纵横客服。', '提示', MB_OK + MB_ICONWARNING);
|
|
|
- Exit;
|
|
|
- end;
|
|
|
- ProgressProRun('生成并检验待审核文件。OK', 10, pmtEdit);
|
|
|
+ if not SaveAndExport(1) then Exit;
|
|
|
end
|
|
|
else if ProjectData.CurUserIsChecker then
|
|
|
begin
|
|
@@ -889,18 +898,7 @@ begin
|
|
|
Exit;
|
|
|
end;
|
|
|
|
|
|
- ProgressProCreate(100, '本地数据文件上传到云端');
|
|
|
- ProjectData.Save;
|
|
|
- ProgressProRun('保存本地数据。OK');
|
|
|
- ProgressProRun('生成并检验待审核文件...', 0);
|
|
|
- if not ProjectData.SubmitProject(sAppFile) then
|
|
|
- if not ProjectData.SubmitProject(sAppFile) then
|
|
|
- begin
|
|
|
- bNeedFreeEarlier := True;
|
|
|
- Application.MessageBox('Sorry!待审核文件连续2次生成失败!如果重试后仍不能解决该问题,请联系纵横客服。', '提示', MB_OK + MB_ICONWARNING);
|
|
|
- Exit;
|
|
|
- end;
|
|
|
- ProgressProRun('生成并检验待审核文件。OK', 10, pmtEdit);
|
|
|
+ if not SaveAndExport(1) then Exit;
|
|
|
end
|
|
|
else if ProjectData.CurUserIsOwner then
|
|
|
begin
|
|
@@ -924,20 +922,7 @@ begin
|
|
|
Exit;
|
|
|
end;
|
|
|
|
|
|
- ProgressProCreate(100, '本地数据文件上传到云端');
|
|
|
- ProgressProRun('保存本地数据...', 0);
|
|
|
- ProjectData.Save;
|
|
|
- ProgressProRun('保存本地数据。OK', 10, pmtEdit);
|
|
|
-
|
|
|
- ProgressProRun('生成并检验待批复文件...', 0);
|
|
|
- if not ProjectData.ReplyProject(sAppFile) then
|
|
|
- if not ProjectData.ReplyProject(sAppFile) then
|
|
|
- begin
|
|
|
- bNeedFreeEarlier := True;
|
|
|
- Application.MessageBox('Sorry!批复文件连续2次生成失败!如果重试后仍不能解决该问题,请联系纵横客服。', '提示', MB_OK + MB_ICONWARNING);
|
|
|
- Exit;
|
|
|
- end;
|
|
|
- ProgressProRun('生成并检验待批复文件。OK', 10, pmtEdit);
|
|
|
+ if not SaveAndExport(2) then Exit;
|
|
|
end;
|
|
|
finally
|
|
|
vCF.Free;
|
|
@@ -957,14 +942,10 @@ begin
|
|
|
|
|
|
|
|
|
ProgressProRun('生成并检验up数据包文件...', 0);
|
|
|
- if FileExists(sAppFile_UnLock) then // 要在压缩前判断,压缩完会删除
|
|
|
- iFile := 4
|
|
|
- else
|
|
|
- iFile := 3;
|
|
|
|
|
|
- sZipFile := PHPWeb.zip([sAppFile, sJsonFile_Bills, sJsonFile_Common, sAppFile_UnLock]);
|
|
|
+ sZipFile := PHPWeb.zip([sAppFile, sJsonFile_Bills, sJsonFile_Common]);
|
|
|
|
|
|
- if not PHPWeb.CheckZip(sZipFile, iFile) then
|
|
|
+ if not PHPWeb.CheckZip(sZipFile, 3) then
|
|
|
begin
|
|
|
Application.MessageBox('up数据包文件无法通过检验请重试!如果重试后仍不能解决该问题,请联系纵横客服。', '提示', MB_OK + MB_ICONWARNING);
|
|
|
Exit;
|