|
@@ -87,6 +87,8 @@ type
|
|
|
procedure CloseAllData;
|
|
|
procedure OpenAllData;
|
|
|
|
|
|
+ procedure InnerSave;
|
|
|
+
|
|
|
function GetMainFileName: string;
|
|
|
procedure SetPhaseIndex(const Value: Integer);
|
|
|
function GetTempPath: string;
|
|
@@ -108,6 +110,7 @@ type
|
|
|
|
|
|
procedure Open(AProjRec: TsdDataRecord);
|
|
|
procedure Save;
|
|
|
+ function SaveAs(const AFileName: string): Boolean;
|
|
|
procedure SaveAndCheck;
|
|
|
//----------------------- Begin ---后台打开 ------------------------
|
|
|
{总说明:
|
|
@@ -195,6 +198,8 @@ type
|
|
|
function CheckPhaseFileComplete: Boolean;
|
|
|
function CheckLastPhaseFileExist: Boolean;
|
|
|
|
|
|
+ procedure AppendProjectLog(const ALog: string);
|
|
|
+
|
|
|
function CurUserIsOwner: Boolean;
|
|
|
function CurUserIsAuthor: Boolean;
|
|
|
function CurUserIsChecker: Boolean;
|
|
@@ -496,46 +501,9 @@ end;
|
|
|
procedure TProjectData.Save;
|
|
|
begin
|
|
|
try
|
|
|
- UpdateSysProgress(5, '正在保存数据');
|
|
|
- SaveLastestPhaseMainData;
|
|
|
- UpdateSysProgress(10, '正在保存数据');
|
|
|
- if (FPhaseData.Active) and (FPhaseIndex = ProjProperties.PhaseCount) then
|
|
|
- FPhaseData.Save;
|
|
|
- UpdateSysProgress(40, '正在保存数据');
|
|
|
- FMainListData.Save;
|
|
|
- FDealPaymentData.Save;
|
|
|
- UpdateSysProgress(50, '正在保存数据');
|
|
|
- FStaffData.Save;
|
|
|
- UpdateSysProgress(60, '正在保存数据');
|
|
|
- FBGLData.Save;
|
|
|
- UpdateSysProgress(70, '正在保存数据');
|
|
|
- FDealBillsData.Save;
|
|
|
- UpdateSysProgress(80, '正在保存数据');
|
|
|
-
|
|
|
- FProjectGLData.Save;
|
|
|
- FDetailGLData.Save;
|
|
|
- UpdateSysProgress(100, '正在保存数据');
|
|
|
-
|
|
|
- FBillsCompileData.ReLockBaseData;
|
|
|
- UpdateSysProgress(110, '正在保存数据');
|
|
|
- FBillsData.Save;
|
|
|
- UpdateSysProgress(165, '正在保存数据');
|
|
|
-
|
|
|
- FOtherMeasureOnceData.Save;
|
|
|
- FOtherMeasurePhaseData.Save;
|
|
|
- UpdateSysProgress(170, '正在保存数据');
|
|
|
-
|
|
|
- FProjProperties.AuditCompany := FStaffData.FinalStaffCompany;
|
|
|
- FProjProperties.Save;
|
|
|
- UpdateSysProgress(180, '正在保存数据');
|
|
|
- FConnection.Save;
|
|
|
- UpdateSysProgress(190, '正在保存数据');
|
|
|
-
|
|
|
+ InnerSave;
|
|
|
ZipFolder(FTempFolder, FileName);
|
|
|
SaveInfoToManager;
|
|
|
- UpdateSysProgress(200, '就绪');
|
|
|
-
|
|
|
- ProjectManager.AddSaveTenderBackup(FProjectID);
|
|
|
except
|
|
|
ErrorMessage('保存数据出错。请重试,或联系纵横客服:企业QQ:800003850 客服热线:(0756)3850888');
|
|
|
end;
|
|
@@ -1156,7 +1124,9 @@ procedure TProjectData.CopyPhaseData;
|
|
|
end;
|
|
|
|
|
|
begin
|
|
|
- Save;
|
|
|
+ AppendProjectLog('Display Reports Prepare');
|
|
|
+
|
|
|
+ InnerSave;
|
|
|
ClearReportCacheData;
|
|
|
CopyCacheReportsData;
|
|
|
if FPhaseIndex > 0 then
|
|
@@ -1167,6 +1137,8 @@ begin
|
|
|
SaveCloudInfo;
|
|
|
if _IsDebugView then
|
|
|
SaveDebugFile('Report.dat');
|
|
|
+
|
|
|
+ MeasureLog.AppendLogTo('Display Reports Prepare --> Pass');
|
|
|
end;
|
|
|
|
|
|
procedure TProjectData.ExecuteSql(const ASql: string);
|
|
@@ -2130,16 +2102,24 @@ procedure TProjectData.SaveAndCheck;
|
|
|
end;
|
|
|
|
|
|
begin
|
|
|
+ AppendProjectLog('Save Project');
|
|
|
Save;
|
|
|
if not CheckFile(FFileName) then
|
|
|
begin
|
|
|
+ AppendProjectLog('Save Project --> Error');
|
|
|
Save;
|
|
|
if not CheckFile(FFileName) then
|
|
|
begin
|
|
|
+ AppendProjectLog('Save Project --> Error-2');
|
|
|
ErrorMessage('保存数据出错。请重试,或联系纵横客服:企业QQ:800003850 客服热线:(0756)3850888');
|
|
|
Abort;
|
|
|
- end;
|
|
|
- end;
|
|
|
+ end
|
|
|
+ else
|
|
|
+ ProjectManager.AddSaveTenderBackup(FProjectID);
|
|
|
+ end
|
|
|
+ else
|
|
|
+ ProjectManager.AddSaveTenderBackup(FProjectID);
|
|
|
+ AppendProjectLog('Save Project --> End');
|
|
|
end;
|
|
|
|
|
|
function TProjectData.CheckLastPhaseFileExist: Boolean;
|
|
@@ -2150,4 +2130,69 @@ begin
|
|
|
Result := True;
|
|
|
end;
|
|
|
|
|
|
+procedure TProjectData.InnerSave;
|
|
|
+begin
|
|
|
+ try
|
|
|
+ AppendProjectLog('Save Main Data');
|
|
|
+
|
|
|
+ UpdateSysProgress(5, '正在保存数据');
|
|
|
+ SaveLastestPhaseMainData;
|
|
|
+ UpdateSysProgress(10, '正在保存数据');
|
|
|
+ if (FPhaseData.Active) and (FPhaseIndex = ProjProperties.PhaseCount) then
|
|
|
+ FPhaseData.Save;
|
|
|
+ UpdateSysProgress(40, '正在保存数据');
|
|
|
+ FMainListData.Save;
|
|
|
+ FDealPaymentData.Save;
|
|
|
+ UpdateSysProgress(50, '正在保存数据');
|
|
|
+ FStaffData.Save;
|
|
|
+ UpdateSysProgress(60, '正在保存数据');
|
|
|
+ FBGLData.Save;
|
|
|
+ UpdateSysProgress(70, '正在保存数据');
|
|
|
+ FDealBillsData.Save;
|
|
|
+ UpdateSysProgress(80, '正在保存数据');
|
|
|
+
|
|
|
+ FProjectGLData.Save;
|
|
|
+ FDetailGLData.Save;
|
|
|
+ UpdateSysProgress(100, '正在保存数据');
|
|
|
+
|
|
|
+ FBillsCompileData.ReLockBaseData;
|
|
|
+ UpdateSysProgress(110, '正在保存数据');
|
|
|
+ FBillsData.Save;
|
|
|
+ UpdateSysProgress(165, '正在保存数据');
|
|
|
+
|
|
|
+ FOtherMeasureOnceData.Save;
|
|
|
+ FOtherMeasurePhaseData.Save;
|
|
|
+ UpdateSysProgress(170, '正在保存数据');
|
|
|
+
|
|
|
+ FProjProperties.AuditCompany := FStaffData.FinalStaffCompany;
|
|
|
+ FProjProperties.Save;
|
|
|
+ UpdateSysProgress(180, '正在保存数据');
|
|
|
+
|
|
|
+ FConnection.Save;
|
|
|
+ UpdateSysProgress(200, '就绪');
|
|
|
+
|
|
|
+ AppendProjectLog('Save Main Data --> End');
|
|
|
+ except
|
|
|
+ ErrorMessage('保存数据出错。请重试,或联系纵横客服:企业QQ:800003850 客服热线:(0756)3850888');
|
|
|
+ AppendProjectLog('Save Main Data --> Error');
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+function TProjectData.SaveAs(const AFileName: string): Boolean;
|
|
|
+begin
|
|
|
+ try
|
|
|
+ InnerSave;
|
|
|
+ ZipFolder(FTempFolder, AFileName);
|
|
|
+ SaveInfoToManager;
|
|
|
+ except
|
|
|
+ Result := False;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TProjectData.AppendProjectLog(const ALog: string);
|
|
|
+begin
|
|
|
+ if SupportManager.ConfigInfo.IsLog then
|
|
|
+ MeasureLog.AppendLogTo(Format('%s: %s', [FProjectName, ALog]));
|
|
|
+end;
|
|
|
+
|
|
|
end.
|